Compare commits

...

2 Commits

6 changed files with 16 additions and 5 deletions

View File

@ -26,6 +26,8 @@ public function save(ClientService $clientService)
$data = $this->form->all();
$data['name'] = $data['client_name'];
dd($data);
if ($this->form->profile_image_path) {
$path = $this->form->profile_image_path->store('client_logos', 'public');
$data['profile_image_path'] = $path;
@ -37,6 +39,8 @@ public function save(ClientService $clientService)
$this->dispatch('client-added');
$this->dispatch('notify', message: $client->name . ' adicionado com sucesso!');
$this->form->reset();
} catch (\Exception $e) {
$this->dispatch('notify', message: 'Ocorreu um erro inesperado ao salvar. ' . $e->getMessage(), type: 'error');
}

View File

@ -54,6 +54,7 @@ public function edit(ClientService $clientService)
$this->dispatch('client-updated');
$this->dispatch('notify', message: $this->clientForm->client_name . ' atualizado com sucesso!');
$this->clientForm->reset();
} catch (Exception $e) {
$this->dispatch('notify', message: 'Falha na edição: ' . $e->getMessage(), type: 'error');
}

View File

@ -43,6 +43,7 @@ public function editUser(UserService $userService)
$this->dispatch('user-updated');
$this->dispatch('notify', message: $this->userForm->name . ' atualizado com sucesso!');
$this->userForm->reset();
} catch (\Exception $e) {
$this->dispatch('notify', message: 'Falha na edição: ' . $e->getMessage(), type: 'error');
// $this->addError('general', $e->getMessage());

View File

@ -4,7 +4,8 @@
<div x-on:click.outside="showUsers = false" x-show="showUsers" x-transition:enter="transition-enter"
x-transition:enter-start="transition-enter-start" x-transition:enter-end="transition-enter-end"
x-transition:leave="transition-leave" x-transition:leave-start="transition-leave-start"
x-transition:leave-end="transition-leave-end" class="modal-container w-full max-w-2xl">
x-transition:leave-end="transition-leave-end" x-on:keydown.escape.window="showUsers = false"
class="modal-container w-full max-w-2xl">
<h3 class="modal-title">Usuários Cadastrados no Nexus</h3>
<div class="user-list-content">

View File

@ -6,7 +6,8 @@
<div x-on:click.outside="showModal = false" x-show="showModal" x-transition:enter="transition-enter"
x-transition:enter-start="transition-enter-start" x-transition:enter-end="transition-enter-end"
x-transition:leave="transition-leave" x-transition:leave-start="transition-leave-start"
x-transition:leave-end="transition-leave-end" class="modal-container">
x-transition:leave-end="transition-leave-end" x-on:keydown.escape.window="showModal = false"
class="modal-container">
<h3 class="modal-title">Novo Usuário Nexus</h3>
@ -65,7 +66,8 @@
<div x-show="open" x-transition style="display: none;" class="select-options">
<div x-on:click="selected = 'user'; open = false" class="select-option"
:class="{ 'selected-option': selected == 'user' }">
<span class="option-label" :class="{ 'font-semibold': selected == 'user' }">Usuário</span>
<span class="option-label"
:class="{ 'font-semibold': selected == 'user' }">Usuário</span>
<span x-show="selected == 'user'"
class="absolute inset-y-0 left-0 flex items-center pl-3 text-blue-600">
<svg class="h-5 w-5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"
@ -79,7 +81,8 @@ class="absolute inset-y-0 left-0 flex items-center pl-3 text-blue-600">
<div x-on:click="selected = 'admin'; open = false" class="select-option"
:class="{ 'selected-option': selected == 'admin' }">
<span class="option-label" :class="{ 'font-semibold': selected == 'admin' }">Admin</span>
<span class="option-label"
:class="{ 'font-semibold': selected == 'admin' }">Admin</span>
<span x-show="selected == 'admin'"
class="absolute inset-y-0 left-0 flex items-center pl-3 text-blue-600">
<svg class="h-5 w-5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"

View File

@ -7,7 +7,8 @@
<div x-on:click.outside="showModalUpdate = false" x-show="showModalUpdate" x-transition:enter="transition-enter"
x-transition:enter-start="transition-enter-start" x-transition:enter-end="transition-enter-end"
x-transition:leave="transition-leave" x-transition:leave-start="transition-leave-start"
x-transition:leave-end="transition-leave-end" class="modal-container">
x-transition:leave-end="transition-leave-end" x-on:keydown.escape.window="showModalUpdate = false"
class="modal-container">
<h3 class="modal-title">Novo Usuário Nexus</h3>