9e243493fb
Applies the family-wide admin-UI cleanup playbook to the Central UI so the Blazor surfaces stop diverging from the shared kit: buttons are grouped rather than individually sized, long cell values are contained instead of widening tables, and hard-coded colours give way to theme tokens. The headline fix is that MainLayout passed Accent="#2f5fd0" to ThemeShell, which the kit emits as an inline style on the shell root. Being a descendant of <html>, it beat the [data-bs-theme="dark"] override for the entire app, so the dark accent had never rendered. Declaring --accent in site.css :root instead lets both schemes resolve; light is unchanged because the value already matched the kit's light default. Theme pins to 0.4.1, which upstreams the local .btn sizing block verbatim, so that block is deleted here rather than duplicated. Verified byte-identical before removal; the repo now declares no --bs-btn-* anywhere. NOT purely cosmetic, contrary to the sweep's stated scope: four detail-modal surfaces (NotificationReport, ConfigurationAuditLog, ParkedMessages, SiteCallsReport) were additionally refactored from holding the selected record to holding its id and re-resolving from the current page each render, with the resolve doubling as the visibility gate. A background refresh that drops the row now closes the modal instead of showing a stale snapshot. This is a behaviour change and is called out rather than buried: a full-suite run turned up one intermittent CentralUI failure, CloseButton_DismissesModal, whose stack (GetRequiredEventBindingEntry during DispatchEventAsync) indicates the handler was disposed between render and click — a window the previous field-held record made structurally impossible. Treat the modal lifecycle here as unreviewed. Build 0/0; suite green apart from that one intermittent failure.
56 lines
2.2 KiB
Plaintext
56 lines
2.2 KiB
Plaintext
@if (IsVisible)
|
|
{
|
|
<div class="modal show d-block sb-modal-backdrop" tabindex="-1">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h6 class="modal-title">Move area '@AreaName' to…</h6>
|
|
<button type="button" class="btn-close" @onclick="Close"></button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<select class="form-select form-select-sm" @bind="_targetParentId">
|
|
@foreach (var opt in ParentOptions)
|
|
{
|
|
<option value="@opt.Id">@opt.Label</option>
|
|
}
|
|
</select>
|
|
@if (!string.IsNullOrEmpty(ErrorMessage)) { <div class="text-danger small mt-1">@ErrorMessage</div> }
|
|
</div>
|
|
<div class="modal-footer">
|
|
<div class="btn-group btn-group-sm" role="group">
|
|
<button class="btn btn-outline-secondary" @onclick="Close">Cancel</button>
|
|
<button class="btn btn-primary" @onclick="Submit">Move</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
}
|
|
|
|
@code {
|
|
[Parameter] public bool IsVisible { get; set; }
|
|
[Parameter] public EventCallback<bool> IsVisibleChanged { get; set; }
|
|
[Parameter] public int AreaId { get; set; }
|
|
[Parameter] public string AreaName { get; set; } = string.Empty;
|
|
[Parameter] public int? CurrentParentId { get; set; }
|
|
[Parameter] public IEnumerable<(int? Id, string Label)> ParentOptions { get; set; } = Array.Empty<(int?, string)>();
|
|
[Parameter] public string? ErrorMessage { get; set; }
|
|
[Parameter] public EventCallback<(int AreaId, int? NewParentId)> OnSubmit { get; set; }
|
|
|
|
private bool _wasVisible;
|
|
private int? _targetParentId;
|
|
|
|
protected override void OnParametersSet()
|
|
{
|
|
if (IsVisible && !_wasVisible)
|
|
{
|
|
_targetParentId = CurrentParentId;
|
|
}
|
|
_wasVisible = IsVisible;
|
|
}
|
|
|
|
private async Task Close() => await IsVisibleChanged.InvokeAsync(false);
|
|
|
|
private async Task Submit() => await OnSubmit.InvokeAsync((AreaId, _targetParentId));
|
|
}
|