From 268510bbf2322c545f76322027464898c065f23d Mon Sep 17 00:00:00 2001 From: deyvisonwanderley Date: Sun, 30 Nov 2025 15:55:48 -0300 Subject: [PATCH] feat: update Cibersecurity SGSE title and description for clarity, and enhance Central de Chamados page by implementing filter application logic and reactivity for improved user experience --- .../src/routes/(dashboard)/ti/+page.svelte | 2 +- .../ti/central-chamados/+page.svelte | 68 +++++++++++++++---- .../(dashboard)/ti/cibersecurity/+page.svelte | 4 +- 3 files changed, 58 insertions(+), 16 deletions(-) diff --git a/apps/web/src/routes/(dashboard)/ti/+page.svelte b/apps/web/src/routes/(dashboard)/ti/+page.svelte index 1a5f058..ff1113a 100644 --- a/apps/web/src/routes/(dashboard)/ti/+page.svelte +++ b/apps/web/src/routes/(dashboard)/ti/+page.svelte @@ -234,7 +234,7 @@ icon: 'control' }, { - title: 'Cibersecurity SGSE - Sistema de Gerenciamento de Secretaria', + title: 'Cibersecurity SGSE - Central de Segurança Cibernética', description: 'Central desegurança cibernética com detecção de DDoS, SQLi, APT, bloqueios automatizados, relatórios refinados e alertas sonoros/visuais.', ctaLabel: 'Abrir Central', diff --git a/apps/web/src/routes/(dashboard)/ti/central-chamados/+page.svelte b/apps/web/src/routes/(dashboard)/ti/central-chamados/+page.svelte index d5811ac..491ed3a 100644 --- a/apps/web/src/routes/(dashboard)/ti/central-chamados/+page.svelte +++ b/apps/web/src/routes/(dashboard)/ti/central-chamados/+page.svelte @@ -119,24 +119,54 @@ let carregamentoToken = 0; - // Carregar chamados quando filtros mudarem + // Função para aplicar filtros + function aplicarFiltros() { + if (abaAtiva !== 'chamados') return; + + const filtros = { + status: filtroStatus === "todos" ? undefined : filtroStatus, + responsavelId: filtroResponsavel === "todos" || !filtroResponsavel ? undefined : filtroResponsavel, + setor: filtroSetor === "todos" ? undefined : filtroSetor, + }; + if (import.meta.env.DEV) { + console.log("🚀 [aplicarFiltros] Carregando chamados com filtros:", filtros); + console.log("🚀 [aplicarFiltros] Valores dos filtros:", { + filtroStatus, + filtroResponsavel, + filtroSetor + }); + } + carregarChamados(filtros); + } + + // Carregar chamados quando filtros ou aba mudarem $effect(() => { + // Só carregar se estiver na aba de chamados + if (abaAtiva !== 'chamados') return; + + // Acessar os valores dos filtros para criar dependências reativas + const status = filtroStatus; + const responsavel = filtroResponsavel; + const setor = filtroSetor; + // Pequeno delay para garantir que autenticação está configurada const timeoutId = setTimeout(() => { - const filtros = { - status: filtroStatus === "todos" ? undefined : filtroStatus, - responsavelId: filtroResponsavel === "todos" ? undefined : filtroResponsavel, - setor: filtroSetor === "todos" ? undefined : filtroSetor, - }; - if (import.meta.env.DEV) { - console.log("🚀 [effect] Carregando chamados com filtros:", filtros); - } - carregarChamados(filtros); + aplicarFiltros(); }, 200); return () => clearTimeout(timeoutId); }); + // Carregar chamados quando mudar para a aba de chamados + $effect(() => { + if (abaAtiva === 'chamados') { + const timeoutId = setTimeout(() => { + aplicarFiltros(); + }, 300); + return () => clearTimeout(timeoutId); + } + }); + async function carregarChamados(filtros: { status?: Ticket["status"]; responsavelId?: Id<"usuarios">; @@ -796,7 +826,11 @@

- aplicarFiltros()} + > @@ -805,13 +839,21 @@ - aplicarFiltros()} + > {#each usuariosTI as usuario (usuario._id)} {/each} - aplicarFiltros()} + > diff --git a/apps/web/src/routes/(dashboard)/ti/cibersecurity/+page.svelte b/apps/web/src/routes/(dashboard)/ti/cibersecurity/+page.svelte index 1a88d00..645fc91 100644 --- a/apps/web/src/routes/(dashboard)/ti/cibersecurity/+page.svelte +++ b/apps/web/src/routes/(dashboard)/ti/cibersecurity/+page.svelte @@ -4,14 +4,14 @@ - Cibersecurity SGSE - Sistema de Gerenciamento de Secretaria • Wizcard TI + Cibersecurity SGSE - Central de Segurança Cibernética

- Cibersecurity • SGSE - Sistema de Gerenciamento de Secretaria + Cibersecurity • SGSE - Central de Segurança Cibernética

Segurança Avançada