feature - 7 - Hide users selection if no users exist
This commit is contained in:
parent
ecfadbc2ad
commit
dc00300f44
2 changed files with 50 additions and 37 deletions
|
|
@ -83,6 +83,7 @@ class="w-full p-2 border rounded bg-gray-600 border-secondary text-gray-100 focu
|
|||
@error('name') <span class="text-danger text-xs">{{ $message }}</span> @enderror
|
||||
</div>
|
||||
|
||||
@if($users->count() > 0)
|
||||
<div class="mb-6">
|
||||
<label class="block text-sm font-medium mb-2">Assign to Users</label>
|
||||
<div class="space-y-2 max-h-40 overflow-y-auto border border-secondary rounded p-3 bg-gray-700">
|
||||
|
|
@ -103,6 +104,11 @@ class="rounded border-secondary bg-gray-600 text-primary focus:ring-accent-blue
|
|||
</div>
|
||||
@error('selectedUsers') <span class="text-danger text-xs">{{ $message }}</span> @enderror
|
||||
</div>
|
||||
@else
|
||||
<div class="mb-6">
|
||||
<p class="text-gray-400 text-sm italic">No users available to assign. <a href="{{ route('users.index') }}" class="text-accent-blue hover:underline">Add users</a> to assign them to dishes.</p>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="flex justify-end space-x-3">
|
||||
<button type="button"
|
||||
|
|
@ -135,6 +141,7 @@ class="w-full p-2 border rounded bg-gray-600 border-secondary text-gray-100 focu
|
|||
@error('name') <span class="text-danger text-xs">{{ $message }}</span> @enderror
|
||||
</div>
|
||||
|
||||
@if($users->count() > 0)
|
||||
<div class="mb-6">
|
||||
<label class="block text-sm font-medium mb-2">Assign to Users</label>
|
||||
<div class="space-y-2 max-h-40 overflow-y-auto border border-secondary rounded p-3 bg-gray-700">
|
||||
|
|
@ -155,6 +162,11 @@ class="rounded border-secondary bg-gray-600 text-primary focus:ring-accent-blue
|
|||
</div>
|
||||
@error('selectedUsers') <span class="text-danger text-xs">{{ $message }}</span> @enderror
|
||||
</div>
|
||||
@else
|
||||
<div class="mb-6">
|
||||
<p class="text-gray-400 text-sm italic">No users available to assign. <a href="{{ route('users.index') }}" class="text-accent-blue hover:underline">Add users</a> to assign them to dishes.</p>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="flex justify-end space-x-3">
|
||||
<button type="button"
|
||||
|
|
|
|||
|
|
@ -50,7 +50,8 @@ public function testCanOpenCreateDishModal(): void
|
|||
->pause(1000)
|
||||
->assertSee('Add New Dish')
|
||||
->assertSee('Dish Name')
|
||||
->assertSee('Assign to Users')
|
||||
->assertSee('No users available to assign')
|
||||
->assertSee('Add users')
|
||||
->assertSee('Create Dish')
|
||||
->assertSee('Cancel');
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue