Fix Issue ticket queue dropdown HTML breakage.
Deploy Ladill Queue / deploy (push) Successful in 2m0s
Deploy Ladill Queue / deploy (push) Successful in 2m0s
@json inside onchange terminated the attribute and broke the select; use a data-create-url attribute instead. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -5,6 +5,14 @@
|
||||
@endphp
|
||||
<div class="mx-auto max-w-lg">
|
||||
<h1 class="text-2xl font-semibold">Issue ticket</h1>
|
||||
|
||||
@if ($queues->isEmpty())
|
||||
<div class="mt-6 rounded-2xl border border-amber-200 bg-amber-50 p-6 text-sm text-amber-900 dark:border-amber-800 dark:bg-amber-950/40 dark:text-amber-100">
|
||||
<p class="font-medium">No active queues yet.</p>
|
||||
<p class="mt-1">Create a queue first, then come back to issue tickets.</p>
|
||||
<a href="{{ route('qms.service-queues.index') }}" class="mt-4 inline-flex text-sm font-medium text-indigo-600 hover:text-indigo-800">Go to queues →</a>
|
||||
</div>
|
||||
@else
|
||||
<form method="POST" action="{{ route('qms.tickets.store') }}" class="mt-6 space-y-4 rounded-2xl border bg-white p-6 dark:border-slate-700 dark:bg-slate-900">
|
||||
@csrf
|
||||
<div>
|
||||
@@ -13,7 +21,8 @@
|
||||
name="service_queue_id"
|
||||
required
|
||||
class="mt-1 w-full rounded-lg border-slate-300 text-sm"
|
||||
onchange="window.location = @json(route('qms.tickets.create')).concat('?queue=', encodeURIComponent(this.value))"
|
||||
data-create-url="{{ route('qms.tickets.create') }}"
|
||||
onchange="window.location = this.dataset.createUrl + '?queue=' + encodeURIComponent(this.value)"
|
||||
>
|
||||
@foreach ($queues as $queue)
|
||||
<option value="{{ $queue->id }}" @selected($selectedQueueId === (int) $queue->id)>
|
||||
@@ -64,5 +73,6 @@
|
||||
</div>
|
||||
<button type="submit" class="btn-primary w-full">Issue ticket</button>
|
||||
</form>
|
||||
@endif
|
||||
</div>
|
||||
</x-app-layout>
|
||||
|
||||
@@ -125,8 +125,10 @@ class ServicePointRoutingTest extends TestCase
|
||||
->get(route('qms.tickets.create', ['queue' => $queue->id]))
|
||||
->assertOk()
|
||||
->assertSee('Service point')
|
||||
->assertSee('data-create-url', false)
|
||||
->assertDontSee('needsPoint')
|
||||
->assertDontSee('onQueueChange');
|
||||
->assertDontSee('onQueueChange')
|
||||
->assertDontSee('@json');
|
||||
}
|
||||
|
||||
public function test_web_issue_without_service_point_returns_validation_error_not_500(): void
|
||||
|
||||
Reference in New Issue
Block a user