Skip to content

Commit 9f2bdc7

Browse files
LEGLINK-840: Enhance Quick Launch and Scenario Page with Search, Grouping, and Filtering (#1792)
* Added initial client-side search capability for the Scenarios page with some JavaScript to dynamically filter the scenario table * Began adding search functionality * Added a couple more small improvements to Views/ Scenarios/Index.cshtml * Added some search, grouping, and filtering nnhancements to Quick Launch * Fixed an issue with the quick lauch search so that its now properly visible * I added alphebetical and recently modified sorting to the new searches I added for the scenario page and the quick launch * Added last used and created time stamps for sorting the searches of scenarios * Removed the reset Created Date or Last Used when editing * removed the unsupported createdAt and last used search sort options * Updated the shared scenario-save handling to retrieve persisted Quick Launch metadata after each save. Both the hidden option and visible dropdown item are now refreshed with the saved name, description, report method, measures, scenario type, and UpdatedAt value before re-sorting and reapplying the active search/filter state. * Fix broken javascript relating to refreshing the Quick Launch Runs dropdown when a new scenario is added. --------- Co-authored-by: nmLantana <nick.montalto@lantanagroup.com>
1 parent 33a5644 commit 9f2bdc7

4 files changed

Lines changed: 662 additions & 137 deletions

File tree

DotNet/Automation.UI/Controllers/RunsController.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,14 +152,22 @@ public async Task<IActionResult> Start(StartScenarioRequest request, Cancellatio
152152
{
153153
if (request.Scenario == AutomationScenarioKind.Custom && request.ScenarioId is Guid scenarioId)
154154
{
155-
var scenario = await scenarioStore.GetByIdAsync(scenarioId, cancellationToken);
155+
var scenario = await scenarioStore.GetByIdAsync(
156+
scenarioId,
157+
cancellationToken);
158+
156159
if (scenario == null)
157160
{
158-
TempData["RunStartError"] = "Unable to start test: selected scenario was not found.";
161+
TempData["RunStartError"] =
162+
"Unable to start test: selected scenario was not found.";
163+
159164
return RedirectToAction(nameof(Index));
160165
}
161166

167+
// Build the run request from the complete persisted scenario rather than
168+
// relying on the default hidden values submitted by the Quick Launch form.
162169
await runManager.StartAsync(StartScenarioRequest.FromScenario(scenario), cancellationToken);
170+
163171
return RedirectToAction(nameof(Index));
164172
}
165173

DotNet/Automation.UI/Controllers/ScenariosController.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ public async Task<IActionResult> SaveInline([FromBody] TestScenarioDefinition mo
8484
model.NhsnOrganizationId = string.IsNullOrWhiteSpace(model.NhsnOrganizationId)
8585
? GenerateRandomNhsnOrganizationId()
8686
: model.NhsnOrganizationId.Trim();
87+
8788
model.UpdatedAt = DateTimeOffset.UtcNow;
8889

8990
await scenarioStore.UpsertAsync(model, ct);
@@ -532,6 +533,30 @@ public async Task<IActionResult> ClassifyImported([FromBody] ClassifyImportedReq
532533
});
533534
}
534535

536+
[HttpGet]
537+
public async Task<IActionResult> GetQuickLaunchMetadata(
538+
Guid id,
539+
CancellationToken ct)
540+
{
541+
var scenario = await scenarioStore.GetByIdAsync(id, ct);
542+
543+
if (scenario == null)
544+
return NotFound();
545+
546+
return Json(new
547+
{
548+
id = scenario.Id,
549+
name = scenario.Name,
550+
description = scenario.Description ?? string.Empty,
551+
method = scenario.ReportMethod.ToString(),
552+
type = scenario.IsSystemScenario ? "System" : "Custom",
553+
measures = scenario.SelectedMeasures
554+
.Select(ProfiledMeasureCatalog.GetDisplayName)
555+
.ToList(),
556+
updatedAt = scenario.UpdatedAt.ToUnixTimeMilliseconds()
557+
});
558+
}
559+
535560
public sealed class ClassifyImportedRequest
536561
{
537562
public ImportedPatientSource Source { get; set; } = ImportedPatientSource.ExistingId;

0 commit comments

Comments
 (0)