This commit is contained in:
Mark Gregory
2026-06-15 17:55:36 +01:00
parent 578a977c59
commit 0a9746fa77
25 changed files with 844 additions and 106 deletions
@@ -53,6 +53,7 @@
'checklists' => ['label' => 'Checks', 'count' => $checklistTemplates->count()],
'tags' => ['label' => 'Tags', 'count' => $tags->count()],
'products' => ['label' => 'Products', 'count' => $products->count()],
'defaults' => ['label' => 'Defaults', 'count' => 1],
] as $key => $item)
<button type="button" wire:click="$set('section', '{{ $key }}')" class="rounded-2xl border px-4 py-3 text-left shadow-sm transition {{ $section === $key ? 'border-blue-500 bg-blue-50 text-blue-900 dark:border-blue-400 dark:bg-blue-950 dark:text-blue-100' : 'border-zinc-200 bg-white text-zinc-700 hover:bg-zinc-50 dark:border-zinc-700 dark:bg-zinc-900 dark:text-zinc-200 dark:hover:bg-zinc-800' }}">
<div class="text-xs font-semibold uppercase tracking-wide opacity-70">{{ $item['label'] }}</div>
@@ -61,6 +62,33 @@
@endforeach
</div>
@if ($section === 'defaults')
<x-helpdesk::settings-section title="Ticket defaults" description="Choose the company default used when a new Helpdesk ticket is created. Lookup defaults are configured on the Statuses, Priorities, Categories, Teams and Projects sections.">
<x-slot:form>
<form wire:submit="saveDefaultHelpdeskCompany" class="grid gap-4 md:grid-cols-3">
<flux:select wire:model="default_helpdesk_company_id" label="Default company">
<option value="">No default company</option>
@foreach ($companies as $company)
<option value="{{ $company->id }}">
{{ $company->name }}{{ ($company->is_default_helpdesk_company ?? false) ? ' — Default' : '' }}
</option>
@endforeach
</flux:select>
<div class="md:col-span-3 flex gap-2">
<flux:button type="submit" variant="primary">Save default company</flux:button>
</div>
</form>
</x-slot:form>
<div class="rounded-2xl border border-zinc-200 bg-zinc-50 p-4 text-sm text-zinc-700 dark:border-zinc-700 dark:bg-zinc-950 dark:text-zinc-200">
<p class="font-semibold">Lookup defaults</p>
<p class="mt-1">Set the default Status, Priority, Category, Team and Project from their own settings sections. Only one default per company/global scope is kept for each lookup type.</p>
</div>
</x-helpdesk::settings-section>
@endif
@if ($section === 'statuses')
<x-helpdesk::settings-section title="Statuses" description="Control workflow stages and mark which statuses close tickets.">
<x-slot:form>
@@ -70,6 +98,10 @@
<flux:input wire:model="statusForm.color" label="Badge colour" />
<flux:input wire:model="statusForm.sort_order" label="Sort" type="number" min="0" />
<label class="flex items-end gap-2 pb-2 text-sm text-zinc-700 dark:text-zinc-200"><input type="checkbox" wire:model="statusForm.is_closed" class="rounded border-zinc-300"> Closed status</label>
<label class="md:col-span-5 flex items-center gap-2 text-sm font-semibold text-zinc-700 dark:text-zinc-200">
<input type="checkbox" wire:model="statusForm.is_default" class="rounded border-zinc-300 bg-zinc-950 text-blue-600 focus:ring-blue-500">
Default status for new tickets
</label>
<div class="md:col-span-5 flex gap-2"><flux:button type="submit" variant="primary">Save status</flux:button><flux:button type="button" wire:click="resetStatusForm" variant="ghost">Reset</flux:button></div>
</form>
</x-slot:form>
@@ -85,6 +117,10 @@
<flux:input wire:model="priorityForm.slug" label="Slug" placeholder="auto-generated" />
<flux:input wire:model="priorityForm.color" label="Badge colour" />
<flux:input wire:model="priorityForm.sort_order" label="Sort" type="number" min="0" />
<label class="flex items-end gap-2 pb-2 text-sm font-semibold text-zinc-700 dark:text-zinc-200">
<input type="checkbox" wire:model="priorityForm.is_default" class="rounded border-zinc-300 bg-zinc-950 text-blue-600 focus:ring-blue-500">
Default for new tickets
</label>
<div class="md:col-span-4 flex gap-2"><flux:button type="submit" variant="primary">Save priority</flux:button><flux:button type="button" wire:click="resetPriorityForm" variant="ghost">Reset</flux:button></div>
</form>
</x-slot:form>
@@ -101,6 +137,10 @@
<flux:input wire:model="categoryForm.slug" label="Slug" placeholder="auto-generated" />
<flux:input wire:model="categoryForm.color" label="Badge colour" />
<div class="md:col-span-4"><flux:textarea wire:model="categoryForm.description" label="Description" rows="3" /></div>
<label class="md:col-span-4 flex items-center gap-2 text-sm font-semibold text-zinc-700 dark:text-zinc-200">
<input type="checkbox" wire:model="categoryForm.is_default" class="rounded border-zinc-300 bg-zinc-950 text-blue-600 focus:ring-blue-500">
Default category for new tickets
</label>
<div class="md:col-span-4 flex gap-2"><flux:button type="submit" variant="primary">Save category</flux:button><flux:button type="button" wire:click="resetCategoryForm" variant="ghost">Reset</flux:button></div>
</form>
</x-slot:form>
@@ -117,6 +157,10 @@
<flux:input wire:model="teamForm.slug" label="Slug" placeholder="auto-generated" />
<flux:input wire:model="teamForm.color" label="Badge colour" />
<div class="md:col-span-4"><flux:textarea wire:model="teamForm.description" label="Description" rows="3" /></div>
<label class="md:col-span-4 flex items-center gap-2 text-sm font-semibold text-zinc-700 dark:text-zinc-200">
<input type="checkbox" wire:model="teamForm.is_default" class="rounded border-zinc-300 bg-zinc-950 text-blue-600 focus:ring-blue-500">
Default team for new tickets
</label>
<div class="md:col-span-4 flex gap-2"><flux:button type="submit" variant="primary">Save team</flux:button><flux:button type="button" wire:click="resetTeamForm" variant="ghost">Reset</flux:button></div>
</form>
</x-slot:form>
@@ -134,6 +178,10 @@
<flux:input wire:model="projectForm.slug" label="Slug" placeholder="auto-generated" />
<flux:input wire:model="projectForm.color" label="Badge colour" />
<div class="md:col-span-5"><flux:textarea wire:model="projectForm.description" label="Description" rows="3" /></div>
<label class="md:col-span-5 flex items-center gap-2 text-sm font-semibold text-zinc-700 dark:text-zinc-200">
<input type="checkbox" wire:model="projectForm.is_default" class="rounded border-zinc-300 bg-zinc-950 text-blue-600 focus:ring-blue-500">
Default project for new tickets
</label>
<div class="md:col-span-5 flex gap-2"><flux:button type="submit" variant="primary">Save project</flux:button><flux:button type="button" wire:click="resetProjectForm" variant="ghost">Reset</flux:button></div>
</form>
</x-slot:form>