fix(centralui): re-apply Audit Log query-string filters on same-page drill-in
The drilldown drawer's 'View this/parent execution' actions call
NavigationManager.NavigateTo('/audit/log?executionId=...') while the
user is already on the routed AuditLogPage. Blazor treats this as a
same-component navigation, so OnInitialized does not re-run and
ApplyQueryStringFilters() (which was wired only to OnInitialized) never
re-parsed the new query string: _currentFilter stayed stale and the
results grid never reloaded to the drill-in target.
AuditLogPage now subscribes to NavigationManager.LocationChanged,
re-applies the query-string filters on every location change (closing
the drawer and calling StateHasChanged), and unsubscribes via
IDisposable. The 'View parent execution' drill-in now genuinely lands
on /audit/log?executionId={parentId} with the grid reloaded.
Also corrects the Playwright test wait: a same-page query-string Blazor
navigation pushes history.pushState over the SignalR circuit rather
than triggering a document load, so WaitForLoadState(NetworkIdle)
returned before the URL settled. Switched to WaitForURLAsync, the
correct primitive for SPA/pushState navigations.
This commit is contained in:
@@ -415,7 +415,12 @@ public class AuditLogPageTests
|
||||
var viewParent = page.Locator("[data-test='view-parent-execution']");
|
||||
await Assertions.Expect(viewParent).ToBeVisibleAsync();
|
||||
await viewParent.ClickAsync();
|
||||
await page.WaitForLoadStateAsync(LoadState.NetworkIdle);
|
||||
// The drawer's NavigateTo is a same-page (query-string-only) Blazor
|
||||
// navigation: it pushes history.pushState over the SignalR circuit
|
||||
// rather than triggering a document load, so WaitForLoadState would
|
||||
// return before the URL settles. WaitForURLAsync is the correct wait
|
||||
// primitive for SPA/pushState navigations.
|
||||
await page.WaitForURLAsync($"**/audit/log?executionId={parentExecutionId}");
|
||||
|
||||
// The drill-in lands on ?executionId={parentExecutionId} and auto-loads
|
||||
// the spawner's own row.
|
||||
|
||||
Reference in New Issue
Block a user