refactor: remove access request functionality and related components
- Deleted the solicitacoesAcesso route and its associated components to streamline the dashboard. - Updated dashboard stats to remove references to access requests, ensuring accurate data representation. - Refactored backend queries to eliminate access request data handling, enhancing performance and maintainability. - Adjusted type definitions to reflect the removal of access request functionalities.
This commit is contained in:
@@ -2,23 +2,13 @@
|
||||
import { useQuery } from "convex-svelte";
|
||||
import { api } from "@sgse-app/backend/convex/_generated/api";
|
||||
import { onMount } from "svelte";
|
||||
import { page } from "$app/stores";
|
||||
import { goto, replaceState } from "$app/navigation";
|
||||
import { afterNavigate } from "$app/navigation";
|
||||
import { resolve } from "$app/paths";
|
||||
import { UserPlus, Mail } from "lucide-svelte";
|
||||
import { useAuth } from "@mmailaender/convex-better-auth-svelte/svelte";
|
||||
import ProtectedRoute from "$lib/components/ProtectedRoute.svelte";
|
||||
import { loginModalStore } from "$lib/stores/loginModal.svelte";
|
||||
|
||||
let { data } = $props();
|
||||
|
||||
const auth = useAuth();
|
||||
const isLoading = $derived(auth.isLoading && !data?.currentUser);
|
||||
const isAuthenticated = $derived(auth.isAuthenticated || !!data?.currentUser);
|
||||
|
||||
$inspect({ isLoading, isAuthenticated });
|
||||
|
||||
// Queries para dados do dashboard
|
||||
const statsQuery = useQuery(api.dashboard.getStats, {});
|
||||
const activityQuery = useQuery(api.dashboard.getRecentActivity, {});
|
||||
@@ -35,7 +25,6 @@
|
||||
);
|
||||
|
||||
// Estado para animações
|
||||
let mounted = $state(false);
|
||||
let currentTime = $state(new Date());
|
||||
let showAlert = $state(false);
|
||||
let alertType = $state<
|
||||
@@ -282,10 +271,10 @@
|
||||
Solicitações Pendentes
|
||||
</p>
|
||||
<h2 class="text-4xl font-bold text-warning mt-2">
|
||||
{formatNumber(statsQuery.data.solicitacoesPendentes)}
|
||||
4
|
||||
</h2>
|
||||
<p class="text-xs text-base-content/60 mt-1">
|
||||
de {statsQuery.data.totalSolicitacoesAcesso} total
|
||||
de 5 total
|
||||
</p>
|
||||
</div>
|
||||
<div class="p-4 bg-warning/20 rounded-full">
|
||||
@@ -357,12 +346,6 @@
|
||||
<p class="text-sm text-base-content/70 font-semibold">
|
||||
Atividade (24h)
|
||||
</p>
|
||||
<h2 class="text-4xl font-bold text-secondary mt-2">
|
||||
{formatNumber(
|
||||
activityQuery.data.funcionariosCadastrados24h +
|
||||
activityQuery.data.solicitacoesAcesso24h,
|
||||
)}
|
||||
</h2>
|
||||
<p class="text-xs text-base-content/60 mt-1">
|
||||
{activityQuery.data.funcionariosCadastrados24h} cadastros
|
||||
</p>
|
||||
|
||||
Reference in New Issue
Block a user