From f8e5359777e0f0f2ddc8b555d2b94fceb55e5545 Mon Sep 17 00:00:00 2001 From: Mark Gregory Date: Mon, 22 Jun 2026 08:01:33 +0100 Subject: [PATCH] fully working tests now with coverage for warehouse --- .../views/livewire/ticket-show.blade.php | 589 ++++++++++-------- 1 file changed, 343 insertions(+), 246 deletions(-) diff --git a/Modules/Helpdesk/Resources/views/livewire/ticket-show.blade.php b/Modules/Helpdesk/Resources/views/livewire/ticket-show.blade.php index 6e990248..de92d0cc 100644 --- a/Modules/Helpdesk/Resources/views/livewire/ticket-show.blade.php +++ b/Modules/Helpdesk/Resources/views/livewire/ticket-show.blade.php @@ -1,32 +1,42 @@ @php + use Illuminate\Support\Str; + $currentUser = auth()->user(); $currentCompany = $currentUser?->company; $canSeeInternalNotes = (bool) ($currentCompany?->is_system_company ?? false) - || \Illuminate\Support\Str::lower((string) ($currentCompany?->slug ?? '')) === 'mpba-limited' - || \Illuminate\Support\Str::contains(\Illuminate\Support\Str::lower((string) ($currentCompany?->name ?? '')), 'mpba'); + || Str::lower((string) ($currentCompany?->slug ?? '')) === 'mpba-limited' + || Str::contains(Str::lower((string) ($currentCompany?->name ?? '')), 'mpba'); $visibleCommentCount = $ticket->comments->count(); @endphp -
-
-
-
-
+
+
+
+
+
{{ $ticket->reference }} {{ $ticket->status->name }} {{ $ticket->priority->name }}
-

{{ $ticket->subject }}

-

Raised by {{ $ticket->owner?->name ?? 'Unknown user' }} · Assigned to {{ $ticket->agent?->name ?? 'Unassigned' }}

+ +

{{ $ticket->subject }}

+ +

+ Raised by {{ $ticket->owner?->name ?? 'Unknown user' }} · Assigned to {{ $ticket->agent?->name ?? 'Unassigned' }} +

+
- - Back + + + Back + @can('update', $ticket) - - Edit + + + Edit @endcan
@@ -34,100 +44,113 @@
-
-
-
-
-
-
- - +
+
+
+
+
+
+ + -
-

Ticket document

-

Request details

-

Original request content recorded against this helpdesk ticket.

+ +
+

Ticket document

+

Request details

+

Original request content recorded against this helpdesk ticket.

- + {{ $ticket->reference }}
-
-
-
+
+
+
{!! $ticket->body !!}
-
- -
- - +
+ +
+ + -
-

Attachments

-

Supporting files

-

Pin screenshots, logs and supporting documents directly to this ticket.

+ +
+

Attachments

+

Supporting files

- - + + {{ $ticket->attachments->count() }} file{{ $ticket->attachments->count() === 1 ? '' : 's' }}
-
+
@can('update', $ticket) -
+ @csrf -
+ +
-

Add files

-

No files selected

+

Add files

+

No files selected

-
-
+ @error('attachments') -

{{ $message }}

+

{{ $message }}

@enderror + @error('attachments.*') -

{{ $message }}

+

{{ $message }}

@enderror @endcan @if ($ticket->attachments->isEmpty()) -
No supporting files have been attached yet.
+
+ No supporting files have been attached yet. +
@else -
-
-
- -
- - +
+
+ +
+ + -
-

Conversation

-

Document responses

-

Lotus Notes-style document responses and replies.

+ +
+

Conversation

+

Document responses

- + + {{ $visibleCommentCount }} item{{ $visibleCommentCount === 1 ? '' : 's' }}
-
-
+
+
- + +
- - @@ -174,132 +200,137 @@ @if ($ticket->comments->isNotEmpty()) @include('helpdesk::partials.comment-thread', ['comments' => $ticket->comments, 'level' => 0, 'ticket' => $ticket, 'canSeeInternalNotes' => $canSeeInternalNotes]) @else -
No responses yet.
+
+ No responses yet. +
@endif
-
+ @csrf -
-
- - + +
+
+ + -
-

Response document

-

Add reply

-

Create a response, internal MPBA note or threaded document reply.

+ +
+

Response document

+

Add reply

+

Create a response, internal MPBA note or threaded document reply.

-
- @if (session('ticket-comment-added')) -
- {{ session('ticket-comment-added') }} -
- @endif - @if ($errors->any()) -
- {{ $errors->first() }} -
- @endif - - @php - $cannedResponseBodies = $cannedResponses->mapWithKeys(function ($response) use ($ticket, $currentUser) { - $body = (string) $response->body; - - $body = strtr($body, [ - '{{ ticket.reference }}' => e((string) ($ticket->reference ?? '')), - '{{ ticket.subject }}' => e((string) ($ticket->subject ?? '')), - '{{ ticket.status }}' => e((string) ($ticket->status?->name ?? '')), - '{{ ticket.priority }}' => e((string) ($ticket->priority?->name ?? '')), - '{{ ticket.category }}' => e((string) ($ticket->category?->name ?? '')), - '{{ ticket.project }}' => e((string) ($ticket->project?->title ?? '')), - '{{ ticket.team }}' => e((string) ($ticket->team?->name ?? '')), - '{{ requester.name }}' => e((string) ($ticket->owner?->name ?? $ticket->user?->name ?? '')), - '{{ agent.name }}' => e((string) ($ticket->agent?->name ?? $currentUser?->name ?? '')), - '{{ actor.name }}' => e((string) ($currentUser?->name ?? '')), - '{{ ticket.url }}' => e(route('helpdesk.tickets.show', ['ticket' => $ticket->getKey()])), - ]); - - $body = html_entity_decode($body, ENT_QUOTES | ENT_HTML5, 'UTF-8'); - $body = preg_replace('/<\s*(script|style)[^>]*>.*?<\s*\/\s*\1\s*>/is', '', $body) ?: ''; - $body = preg_replace('/\s+on[a-z]+\s*=\s*("[^"]*"|\'[^\']*\'|[^\s>]+)/i', '', $body) ?: ''; - $body = preg_replace('/javascript\s*:/i', '', $body) ?: ''; - $body = strip_tags($body, '