From e59d96735af36c95b8a0a0a34f2bbeb8ab517a86 Mon Sep 17 00:00:00 2001 From: deyvisonwanderley Date: Mon, 3 Nov 2025 23:04:31 -0300 Subject: [PATCH] refactor: enhance notification management UI and improve data handling - Refactored the notification management component to improve data extraction from queries, ensuring robust handling of loading states and errors. - Introduced a modal for creating new templates, including validation and user authentication checks. - Enhanced the notification sending logic to support bulk sending and provide detailed feedback on the sending process. - Improved UI elements for better user experience, including loading indicators and dynamic user selection options. --- .../(dashboard)/ti/notificacoes/+page.svelte | 666 +++++++++++++++--- 1 file changed, 569 insertions(+), 97 deletions(-) diff --git a/apps/web/src/routes/(dashboard)/ti/notificacoes/+page.svelte b/apps/web/src/routes/(dashboard)/ti/notificacoes/+page.svelte index 6133381..55b7128 100644 --- a/apps/web/src/routes/(dashboard)/ti/notificacoes/+page.svelte +++ b/apps/web/src/routes/(dashboard)/ti/notificacoes/+page.svelte @@ -1,25 +1,193 @@ @@ -156,19 +439,46 @@
- - + Enviar para todos ({usuarios.length} usuários) + +
+ + {#if enviarParaTodos} + + {/if} @@ -242,12 +552,16 @@ @@ -282,17 +596,28 @@
@@ -303,7 +628,11 @@

Templates Disponíveis

-
- {#if !templates?.data} -
+ {#if carregandoTemplates} +
+

Carregando templates...

- {:else if templates.data.length === 0} -
- Nenhum template disponível -
- {:else} + {:else if templates.length > 0} +
- {#each templates.data as template} + {#each templates as template}
@@ -359,6 +686,30 @@
{/each}
+ {:else} + +
+ + + +

Nenhum template disponível

+

Clique no botão abaixo para criar os templates padrão do sistema.

+ +
{/if}
@@ -373,3 +724,124 @@
+ +{#if modalNovoTemplateAberto} + +{/if} +