From 31ca77558e8661fa63fa51f2eda7310efce1f3a4 Mon Sep 17 00:00:00 2001 From: 4Ventures <4ventures@MacBook-Air-de-4Ventures.local> Date: Tue, 22 Sep 2026 15:41:52 +0200 Subject: [PATCH] fix: keep Activos as file library only Agent documents (calendar/copy/audit) belong in Calendario/ops, not the asset upload surface. Co-authored-by: Cursor --- src/app/dashboard/activos/page.tsx | 70 +----------------------------- 1 file changed, 2 insertions(+), 68 deletions(-) diff --git a/src/app/dashboard/activos/page.tsx b/src/app/dashboard/activos/page.tsx index 7900f66..e2f3e55 100644 --- a/src/app/dashboard/activos/page.tsx +++ b/src/app/dashboard/activos/page.tsx @@ -1,23 +1,11 @@ import React from 'react'; -import { CheckCircle2 } from 'lucide-react'; import { createClient } from '@/lib/supabase/server'; import { redirect } from 'next/navigation'; -import { resolveActiveTenant, restGet } from '@/lib/tenant-context'; -import { isAgencyRole, userRole } from '@/lib/agency'; +import { resolveActiveTenant } from '@/lib/tenant-context'; import AssetsLibrary from '@/components/AssetsLibrary'; export const dynamic = 'force-dynamic'; -type Doc = { - id: string; - type?: string; - title?: string; - content?: string; - version?: number; - created_at?: string; - status?: string; -}; - export default async function ActivosPage() { const supabase = await createClient(); const { @@ -26,24 +14,6 @@ export default async function ActivosPage() { if (!user) redirect('/login'); const ctx = await resolveActiveTenant(user); - const agency = isAgencyRole(userRole(user)); - let documents: Doc[] = []; - - if (!ctx.portfolioWide && agency && ctx.viaView && ctx.tenantId) { - const tid = encodeURIComponent(ctx.tenantId); - const r = await restGet( - `/rest/v1/documents?tenant_id=eq.${tid}&status=eq.approved&select=id,type,title,content,version,created_at,status&order=created_at.desc` - ); - documents = r.data || []; - } else if (!ctx.portfolioWide) { - const { data, error } = await supabase - .from('documents') - .select('id,type,title,content,version,created_at,status') - .eq('status', 'approved') - .order('created_at', { ascending: false }); - if (error) console.error('documents', error.message); - else documents = data ?? []; - } if (ctx.portfolioWide) { return ( @@ -64,41 +34,5 @@ export default async function ActivosPage() { ); } - return ( -
- - - {documents.length > 0 && ( -
-
-

- Entregables de agentes -

-

- Textos/briefs aprobados en documents (Slack / ops). -

-
-
- {documents.map((doc) => ( -
-
- - {doc.type} - - - Aprobado - -
-

{doc.title}

-

{doc.content}

-
- ))} -
-
- )} -
- ); + return ; }