Files
isaaccladandCursor a2d5a8affd
Deploy Ladill Queue / deploy (push) Successful in 1m5s
Require package reinstall after industry change and wipe old queues.
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>
2026-07-17 20:10:25 +00:00

67 lines
3.1 KiB
PHP

@if (session('success'))
<div x-data="{ show: true }" x-show="show" x-init="setTimeout(() => show = false, 4000)" x-transition class="mb-4">
<div class="rounded-lg bg-green-50 border border-green-200 p-4">
<p class="text-sm text-green-800">{{ session('success') }}</p>
</div>
</div>
@endif
@if (session('error'))
<div x-data="{ show: true }" x-show="show" x-init="setTimeout(() => show = false, 6000)" x-transition class="mb-4">
<div class="rounded-lg bg-red-50 border border-red-200 p-4">
<p class="text-sm text-red-800">{{ session('error') }}</p>
</div>
</div>
@endif
@if (session('warning'))
<div x-data="{ show: true }" x-show="show" x-init="setTimeout(() => show = false, 5000)" x-transition class="mb-4">
<div class="rounded-lg bg-yellow-50 border border-yellow-200 p-4">
<p class="text-sm text-yellow-800">{{ session('warning') }}</p>
</div>
</div>
@endif
@auth
@php
$industryBannerOrg = app(\App\Services\Qms\OrganizationResolver::class)->resolveForUser(auth()->user());
$industryNeedsReinstall = $industryBannerOrg
&& \App\Services\Qms\Industry\IndustryPackageInstaller::needsReinstall($industryBannerOrg);
$industryCanManage = $industryNeedsReinstall
&& app(\App\Services\Qms\QmsPermissions::class)->can(
app(\App\Services\Qms\OrganizationResolver::class)->memberFor(auth()->user(), $industryBannerOrg),
'settings.manage'
);
$industrySelectedLabel = $industryNeedsReinstall
? (app(\App\Services\Qms\Industry\IndustryPackageRegistry::class)
->get((string) data_get($industryBannerOrg->settings, 'industry'))
?->label() ?? data_get($industryBannerOrg->settings, 'industry'))
: null;
@endphp
@if ($industryCanManage && ! request()->routeIs('qms.settings.*'))
<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">
<div class="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
<div>
<p class="font-semibold">Reinstall industry package required</p>
<p class="mt-1">
Industry is set to <span class="font-medium">{{ $industrySelectedLabel }}</span>, but the installed queues still match the previous template.
Reinstall to clear old queues and apply the new package.
</p>
</div>
<a href="{{ route('qms.settings.edit') }}" class="btn-primary shrink-0 text-sm">Open settings</a>
</div>
</div>
@endif
@endauth
@if ($errors->any())
<div class="mb-4 rounded-lg bg-red-50 border border-red-200 p-4">
<p class="text-sm font-medium text-red-800">Please fix the following:</p>
<ul class="mt-1 list-disc pl-5 text-sm text-red-700">
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif