fix(centralui): Esc-to-close and aria attributes on ExecutionDetailModal
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System.Globalization;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.AspNetCore.Components.Web;
|
||||
using ScadaLink.CentralUI.Services;
|
||||
using ScadaLink.Commons.Entities.Audit;
|
||||
using ScadaLink.Commons.Types.Audit;
|
||||
@@ -112,6 +113,10 @@ public partial class ExecutionDetailModal
|
||||
|
||||
try
|
||||
{
|
||||
// No CancellationToken is passed deliberately: this is a bounded,
|
||||
// small (~100-row) query for one execution, so the IDisposable/CTS
|
||||
// machinery is not worth it for a modal. The closed → open guard in
|
||||
// OnParametersSetAsync cleanly re-loads on the next open if needed.
|
||||
_rows = await AuditLogQueryService.QueryAsync(
|
||||
new AuditLogQueryFilter(ExecutionId: ExecutionId.Value),
|
||||
new AuditLogPaging(PageSize: RowPageSize));
|
||||
@@ -150,6 +155,19 @@ public partial class ExecutionDetailModal
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Closes the modal when Escape is pressed, matching the header X, backdrop
|
||||
/// click, and footer Close affordances. The root <c>.modal</c> div carries
|
||||
/// <c>tabindex="-1"</c> so it can receive the keydown.
|
||||
/// </summary>
|
||||
private async Task HandleKeyDown(KeyboardEventArgs e)
|
||||
{
|
||||
if (e.Key == "Escape")
|
||||
{
|
||||
await HandleClose();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>First 8 hex digits of the execution id, mirroring the UI's short-id convention.</summary>
|
||||
private string ShortExecutionId()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user