Fix Queue settings save broken by nested industry reinstall form.
Deploy Ladill Queue / deploy (push) Successful in 2m5s

Browsers abort the outer Save settings form when a Reinstall package form is nested inside it. Move reinstall outside the main form and harden update validation so package failures cannot block saving.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-07-17 18:09:34 +00:00
co-authored by Cursor
parent a4d8775a82
commit 9a11098674
3 changed files with 91 additions and 26 deletions
+30 -16
View File
@@ -24,6 +24,17 @@
<form method="POST" action="{{ route('qms.settings.update') }}" enctype="multipart/form-data" class="space-y-6">
@csrf @method('PUT')
@if ($errors->any())
<div class="rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-800">
<p class="font-medium">Could not save settings:</p>
<ul class="mt-1 list-disc pl-5">
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
<x-settings.card title="Organization" description="Name, timezone, appointment mode, and notification preferences.">
<div class="space-y-4">
<div>
@@ -121,22 +132,6 @@
</x-settings.card>
@endif
@if ($canManage && $activePackage)
<x-settings.card title="Industry template" description="Re-sync departments, stages, service points, workflow, and announcement copy from the selected industry package. Existing tickets are kept.">
<div class="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
<p class="text-sm text-slate-600">
{{ $activePackage->label() }} uses
<span class="font-medium text-slate-900">{{ count($activePackage->stages()) }}</span> workflow stages and
industry-specific terminology ({{ $activePackage->terminology()['ticket'] ?? 'Ticket' }}).
</p>
<form method="POST" action="{{ route('qms.settings.package.reinstall') }}">
@csrf
<button type="submit" class="btn-secondary shrink-0 text-sm">Reinstall package</button>
</form>
</div>
</x-settings.card>
@endif
<x-settings.card title="Integrations" description="Allow Ladill Care and Frontdesk to manage queues in-app via the Queue API. Both apps must also enable integration in their settings.">
<div class="space-y-2">
<label class="flex items-center gap-2 text-sm">
@@ -156,5 +151,24 @@
</div>
@endif
</form>
{{-- Separate form: nested forms break Save settings in browsers --}}
@if ($canManage && $activePackage)
<div class="mt-6">
<x-settings.card title="Industry template" description="Re-sync departments, stages, service points, workflow, and announcement copy from the selected industry package. Existing tickets are kept.">
<div class="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
<p class="text-sm text-slate-600">
{{ $activePackage->label() }} uses
<span class="font-medium text-slate-900">{{ count($activePackage->stages()) }}</span> workflow stages and
industry-specific terminology ({{ $activePackage->terminology()['ticket'] ?? 'Ticket' }}).
</p>
<form method="POST" action="{{ route('qms.settings.package.reinstall') }}">
@csrf
<button type="submit" class="btn-secondary shrink-0 text-sm">Reinstall package</button>
</form>
</div>
</x-settings.card>
</div>
@endif
</x-settings.page>
</x-app-layout>