Require package reinstall after industry change and wipe old queues.
Deploy Ladill Queue / deploy (push) Successful in 1m5s

Changing industry now flags a pending reinstall with an app banner; reinstall clears queues, tickets, and service points before applying the new template.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-07-17 20:10:25 +00:00
co-authored by Cursor
parent f1edf8a19e
commit a2d5a8affd
5 changed files with 276 additions and 29 deletions
+22 -6
View File
@@ -153,18 +153,34 @@
</form>
{{-- Separate form: nested forms break Save settings in browsers --}}
@if ($canManage && $activePackage)
@if ($canManage && ($selectedPackage ?? $activePackage))
@php $templatePackage = $selectedPackage ?? $activePackage; @endphp
<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.">
@if ($needsPackageReinstall ?? false)
<div class="mb-4 rounded-xl border border-amber-300 bg-amber-50 px-4 py-3 text-sm text-amber-950 dark:border-amber-700 dark:bg-amber-950/40 dark:text-amber-100">
<p class="font-semibold">Industry package reinstall required</p>
<p class="mt-1">
You selected <span class="font-medium">{{ $templatePackage->label() }}</span>, but the installed template still matches
<span class="font-medium">{{ $activePackage?->label() ?? 'the previous industry' }}</span>.
Reinstall to clear old queues and apply the new service points.
</p>
</div>
@endif
<x-settings.card
title="Industry template"
description="Reinstall replaces departments, stages, service points, and workflow from the selected industry package. Existing queues, tickets, and related data are cleared."
>
<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' }}).
{{ $templatePackage->label() }} uses
<span class="font-medium text-slate-900">{{ count($templatePackage->stages()) }}</span> workflow stages and
industry-specific terminology ({{ $templatePackage->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>
<button type="submit" class="{{ ($needsPackageReinstall ?? false) ? 'btn-primary' : 'btn-secondary' }} shrink-0 text-sm">
{{ ($needsPackageReinstall ?? false) ? 'Reinstall package now' : 'Reinstall package' }}
</button>
</form>
</div>
</x-settings.card>