From d8fe0a48b2f1205df9ee35cc2c0519c9a2aa9888 Mon Sep 17 00:00:00 2001 From: cproudlock Date: Wed, 5 Aug 2026 13:42:20 -0400 Subject: [PATCH] Stop a stray click outside a modal discarding what was typed Operators reported losing a part-filled form by clicking slightly outside it. Every data-entry modal closed on a backdrop click with no warning and no way back - the worst possible response to a misplaced click, and it happens most to someone adding their first records at a new site. Close-on-overlay is removed from 35 modals across 30 files: anything containing an input, textarea, select or v-model. They still close by Cancel or the X. Confirmation dialogs keep it, because a delete prompt holds nothing to lose and dismissing one by clicking away is the behaviour people expect. VendorsList shows the distinction - its edit form no longer closes that way, its delete confirmation still does. The shared Modal component now defaults closeOnOverlay to FALSE. Every current caller holds a form, a checkout, a stock adjustment or a map position being picked, and not one passed the prop, so all of them had the same fault. A modal that genuinely wants dismissing that way opts in explicitly. Also regroups the operator console menu, which had grown to numbers 1-9 plus three letters bolted on with no order to them. Actions are now grouped by what they touch, keyed by their first letter, and the old numbers still work so nobody who has used it for months is stopped by a rearrangement. The menu also warns when the server is not fully provisioned and names the key that fixes it, instead of reporting it as ordinary status lines that read as normal unless you already knew what to look for. That check is cached for the session because it shells out to flask twice and the answer does not change while somebody reads the screen. --- deploy/windows/installer/shopdb-admin.ps1 | 71 ++++- .../src/components/AssetRelationships.vue | 2 +- frontend/src/components/Modal.vue | 295 +++++++++--------- frontend/src/views/settings/ApiTokensList.vue | 4 +- .../src/views/settings/AssetTypesList.vue | 2 +- .../src/views/settings/BusinessUnitsList.vue | 2 +- .../src/views/settings/CustomFieldsList.vue | 2 +- .../views/settings/DashboardDefaultsList.vue | 2 +- .../src/views/settings/LocationTypesList.vue | 2 +- frontend/src/views/settings/LocationsList.vue | 2 +- .../src/views/settings/ModelTypesList.vue | 2 +- frontend/src/views/settings/ModelsList.vue | 2 +- .../views/settings/RelationshipTypesList.vue | 2 +- frontend/src/views/settings/StatusesList.vue | 2 +- .../src/views/settings/SupportTeamsList.vue | 4 +- frontend/src/views/settings/UsersList.vue | 4 +- frontend/src/views/vendors/VendorsList.vue | 2 +- .../frontend/views/AccessProtocolsList.vue | 2 +- .../frontend/views/OperatingSystemsList.vue | 2 +- .../computers/frontend/views/PCTypesList.vue | 2 +- .../frontend/views/EmployeeDirectory.vue | 4 +- .../frontend/views/ManifestEditor.vue | 4 +- .../frontend/views/MachineTypesList.vue | 2 +- .../frontend/views/MeasuringToolTypesList.vue | 2 +- .../frontend/views/NetworkTypesList.vue | 2 +- .../network/frontend/views/SubnetsList.vue | 2 +- plugins/network/frontend/views/VLANsList.vue | 2 +- .../frontend/views/NotificationTypesList.vue | 2 +- .../frontend/views/ModelSuppliesList.vue | 2 +- .../frontend/views/PrinterDriversList.vue | 2 +- .../frontend/views/PrinterTypesList.vue | 2 +- .../frontend/views/WarrantiesList.vue | 2 +- 32 files changed, 241 insertions(+), 195 deletions(-) diff --git a/deploy/windows/installer/shopdb-admin.ps1 b/deploy/windows/installer/shopdb-admin.ps1 index cf7673d..389a775 100644 --- a/deploy/windows/installer/shopdb-admin.ps1 +++ b/deploy/windows/installer/shopdb-admin.ps1 @@ -949,32 +949,73 @@ function Show-Uninstall { Say ' Take a backup first: shopdb-admin.ps1 backup' 'Yellow' } +# Cached for the session. Test-Provisioned shells out to flask twice, which is +# far too slow to repeat on every redraw of the menu - and the answer does not +# change while somebody reads the screen. Cleared after a repair so the warning +# disappears once it is actually fixed. +$script:Attention = $null + +function Show-Attention { + <# + Say what is wrong, and which key fixes it. + + A server whose seeds never ran answers 500 on most pages, and until now the + console reported all of that as ordinary status lines that read as normal + unless you knew what to look for. The one thing an operator needs is the + next action. + #> + if ($null -eq $script:Attention) { + $state = Test-Provisioned + $script:Attention = @{ + Provisioned = -not (($state.SchemaCurrent -eq $false) -or ($state.Seeded -eq $false)) + Detail = $state.Detail + } + } + if (-not $script:Attention.Provisioned) { + Write-Host '' + Say ' ! This server is not fully provisioned - most pages will fail.' 'Red' + foreach ($detail in $script:Attention.Detail) { Say (" {0}" -f $detail) 'Red' } + Say ' Press F to fix it.' 'Yellow' + } +} + function Show-Menu { $first = $true while ($true) { if ($first) { Show-Banner; $first = $false } Show-Status + Show-Attention Write-Host '' - Write-Host ' 1 Restart the application 6 Back up the database' -ForegroundColor White - Write-Host ' 2 Stop the application 7 Worker processes' -ForegroundColor White - Write-Host ' 3 Start the application 8 Open in browser' -ForegroundColor White - Write-Host ' 4 View recent logs 9 Plugins' -ForegroundColor White - Write-Host ' 5 Health check V Verify this install' -ForegroundColor White - Write-Host ' R Repair provisioning C Load equipment catalog' -ForegroundColor White - Write-Host ' 0 Exit' -ForegroundColor White + Write-Host ' APPLICATION DATA DIAGNOSE' -ForegroundColor DarkGray + Write-Host ' R Restart B Back up H Health check' -ForegroundColor White + Write-Host ' S Stop C Load catalog L Recent logs' -ForegroundColor White + Write-Host ' T Start P Plugins W Processes' -ForegroundColor White + Write-Host ' O Open in browser F Repair V Verify install' -ForegroundColor White + Write-Host '' + Write-Host ' Q Quit' -ForegroundColor White Write-Host '' $c = Read-Host ' Choose' - switch ($c) { - '1' { Restart-App } '2' { Stop-App } '3' { Start-App } - '4' { Show-Logs } '5' { Invoke-Check } '6' { Backup-Db $Path } - '7' { Show-Sessions } '8' { Open-Site } - 'v' { Invoke-Verify } 'V' { Invoke-Verify } - 'r' { Invoke-Repair } 'R' { Invoke-Repair } - 'c' { Invoke-Catalog } 'C' { Invoke-Catalog } + # The old numbers still work. Somebody who has used this for months + # should not be stopped by a menu that was rearranged under them. + switch ($c.ToUpper()) { + 'R' { Restart-App } '1' { Restart-App } + 'S' { Stop-App } '2' { Stop-App } + 'T' { Start-App } '3' { Start-App } + 'L' { Show-Logs } '4' { Show-Logs } + 'H' { Invoke-Check } '5' { Invoke-Check } + 'B' { Backup-Db $Path } '6' { Backup-Db $Path } + 'W' { Show-Sessions } '7' { Show-Sessions } + 'O' { Open-Site } '8' { Open-Site } + 'V' { Invoke-Verify } + 'F' { Invoke-Repair; $script:Attention = $null } + 'C' { Invoke-Catalog } + 'P' { Show-Plugins + $add = Read-Host ' Name of a shipped plugin to add (Enter to skip)' + if ($add) { Add-Plugin $add } } '9' { Show-Plugins $add = Read-Host ' Name of a shipped plugin to add (Enter to skip)' if ($add) { Add-Plugin $add } } - '0' { return } + 'Q' { return } '0' { return } default { Say ' not a choice' 'Yellow' } } Write-Host '' diff --git a/frontend/src/components/AssetRelationships.vue b/frontend/src/components/AssetRelationships.vue index 1f9bf14..5aaf4af 100644 --- a/frontend/src/components/AssetRelationships.vue +++ b/frontend/src/components/AssetRelationships.vue @@ -98,7 +98,7 @@ -