intial ticket fix partial delete fix

This commit is contained in:
Mark Gregory
2026-06-18 14:07:50 +01:00
parent 129eb7a8cd
commit 66b24b65d4
3 changed files with 203 additions and 28 deletions
@@ -1,4 +1,4 @@
<div class="hd-helpdesk-surface space-y-6" dusk="helpdesk-ticket-index">
<style>
.hd-helpdesk-surface .hd-btn,
.hd-btn {
@@ -136,7 +136,6 @@
}
</style>
<div class="hd-helpdesk-surface space-y-6" dusk="helpdesk-ticket-index">
<div class="overflow-hidden rounded-3xl border border-zinc-200 bg-white shadow-sm dark:border-zinc-700 dark:bg-zinc-900">
<div class="bg-gradient-to-br from-slate-950 via-slate-900 to-blue-950 px-6 py-7 text-white">
<div class="flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between">
@@ -158,6 +157,7 @@
</div>
</div>
</div>
<div class="rounded-2xl border border-zinc-200 bg-white p-4 shadow-sm dark:border-zinc-700 dark:bg-zinc-900">
<div class="grid gap-4 md:grid-cols-4">
<flux:input wire:model.live.debounce.350ms="search" icon="magnifying-glass" placeholder="Search reference, subject or body" />
@@ -237,8 +237,10 @@
@can('delete', $ticket)
<button
type="button"
wire:click="confirmDeleteTicket({{ $ticket->id }})"
class="hd-btn hd-btn-sm hd-btn-red"
wire:click="askToDeleteTicket({{ $ticket->id }})"
wire:loading.attr="disabled"
wire:target="askToDeleteTicket({{ $ticket->id }})"
class="hd-btn hd-btn-sm hd-btn-red disabled:cursor-not-allowed disabled:opacity-60"
title="Delete {{ $ticket->reference }}"
dusk="delete-ticket-{{ $ticket->id }}"
>
@@ -261,12 +263,14 @@
{{ $tickets->links() }}
</div>
</div>
@if ($confirmingTicketDeletion)
@if ($deleteModalOpen)
<div
class="fixed inset-0 z-[9998] flex items-center justify-center bg-black/70 px-4 py-6 backdrop-blur-sm"
class="fixed inset-0 z-[9998] flex items-center justify-center bg-black/75 px-4 py-6 backdrop-blur-sm"
role="dialog"
aria-modal="true"
aria-labelledby="delete-ticket-modal-title"
wire:key="ticket-delete-modal-{{ $pendingDeleteTicketId ?? 'none' }}"
dusk="delete-ticket-confirmation-modal"
>
<div class="w-full max-w-lg overflow-hidden rounded-3xl border border-red-500/30 bg-zinc-950 text-zinc-100 shadow-2xl">
@@ -282,22 +286,29 @@
</h2>
<p class="mt-1 text-sm leading-6 text-red-100/90">
This will delete <span class="font-mono font-bold">{{ $ticketDeletionReference }}</span>. This action cannot be undone.
This will delete <span class="font-mono font-bold">{{ $pendingDeleteTicketReference }}</span>. This action cannot be undone.
</p>
</div>
</div>
</div>
<div class="px-6 py-5">
<div class="space-y-3 px-6 py-5">
@if ($pendingDeleteTicketSubject)
<div class="rounded-2xl border border-zinc-800 bg-zinc-900 px-4 py-3">
<p class="text-xs font-bold uppercase tracking-[0.22em] text-zinc-500">Ticket subject</p>
<p class="mt-1 text-sm font-semibold text-zinc-100">{{ $pendingDeleteTicketSubject }}</p>
</div>
@endif
<p class="text-sm leading-6 text-zinc-300">
Confirm only if this ticket was created in error or is no longer required. Related ticket data may also be removed depending on the model relationships.
Confirm only if this ticket was created in error or is no longer required.
</p>
</div>
<div class="flex flex-col-reverse gap-3 border-t border-zinc-800 bg-zinc-900/80 px-6 py-4 sm:flex-row sm:justify-end">
<button
type="button"
wire:click="cancelDeleteTicket"
wire:click="cancelTicketDelete"
class="hd-btn hd-btn-sm hd-btn-blue"
dusk="cancel-delete-ticket"
>
@@ -307,15 +318,15 @@
<button
type="button"
wire:click="deleteConfirmedTicket"
wire:click="confirmTicketDelete"
wire:loading.attr="disabled"
wire:target="deleteConfirmedTicket"
wire:target="confirmTicketDelete"
class="hd-btn hd-btn-sm hd-btn-red disabled:cursor-not-allowed disabled:opacity-60"
dusk="confirm-delete-ticket"
>
<i class="fa-solid fa-trash" aria-hidden="true"></i>
<span wire:loading.remove wire:target="deleteConfirmedTicket">Delete ticket</span>
<span wire:loading wire:target="deleteConfirmedTicket">Deleting...</span>
<span wire:loading.remove wire:target="confirmTicketDelete">Delete ticket</span>
<span wire:loading wire:target="confirmTicketDelete">Deleting...</span>
</button>
</div>
</div>