feat(import): client_editor puede importar BPMN; orgId asignado automáticamente

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-07-07 22:18:16 -03:00
parent 70d35dad8b
commit bff71f0f29

View File

@@ -43,10 +43,9 @@ export function ImportPage() {
const [isProcessing, setIsProcessing] = useState(false) const [isProcessing, setIsProcessing] = useState(false)
const [loadingSampleId, setLoadingSampleId] = useState<string | null>(null) const [loadingSampleId, setLoadingSampleId] = useState<string | null>(null)
// Solo platform_admin y member pueden importar BPMN
useEffect(() => { useEffect(() => {
if (!user) return if (!user) return
const allowed = ['platform_admin', 'member'] const allowed = ['platform_admin', 'member', 'client_editor']
if (!allowed.includes(user.platformRole)) { if (!allowed.includes(user.platformRole)) {
void navigate({ to: '/' }) void navigate({ to: '/' })
} }
@@ -91,7 +90,7 @@ export function ImportPage() {
tags: [], tags: [],
ownerId: user!.id, ownerId: user!.id,
updatedBy: user!.id, updatedBy: user!.id,
orgId: null, orgId: user!.orgId ?? null,
areaId: null, areaId: null,
} }
@@ -201,8 +200,7 @@ export function ImportPage() {
} }
} }
const isClientRole = user?.platformRole === 'client_editor' || user?.platformRole === 'client_viewer' if (user?.platformRole === 'client_viewer') return null
if (isClientRole) return null
return ( return (
<div className="min-h-screen bg-gradient-to-br from-slate-50 to-slate-100 flex flex-col"> <div className="min-h-screen bg-gradient-to-br from-slate-50 to-slate-100 flex flex-col">
@@ -212,7 +210,7 @@ export function ImportPage() {
<div className="text-center mb-10"> <div className="text-center mb-10">
<div className="inline-flex items-center gap-2 text-primary text-sm font-medium mb-4 bg-primary/10 px-3 py-1 rounded-full"> <div className="inline-flex items-center gap-2 text-primary text-sm font-medium mb-4 bg-primary/10 px-3 py-1 rounded-full">
<FlaskConical className="h-3.5 w-3.5" /> <FlaskConical className="h-3.5 w-3.5" />
Process Cost Platform · MVP Fase 0 InQ ROI
</div> </div>
<h1 className="text-4xl font-bold text-slate-900 mb-3"> <h1 className="text-4xl font-bold text-slate-900 mb-3">
Cuantificá el costo operativo<br />de tus procesos Cuantificá el costo operativo<br />de tus procesos
@@ -276,8 +274,8 @@ export function ImportPage() {
</CardContent> </CardContent>
</Card> </Card>
{/* Procesos de ejemplo — visibles directamente */} {/* Procesos de ejemplo — solo para InQuality */}
<div className="mt-8 w-full max-w-lg"> {user?.platformRole !== 'client_editor' && <div className="mt-8 w-full max-w-lg">
<p className="text-xs text-slate-400 uppercase tracking-wide font-medium text-center mb-3"> <p className="text-xs text-slate-400 uppercase tracking-wide font-medium text-center mb-3">
O cargá un proceso de ejemplo con un click O cargá un proceso de ejemplo con un click
</p> </p>
@@ -311,11 +309,7 @@ export function ImportPage() {
) )
})} })}
</div> </div>
</div> </div>}
<p className="mt-8 text-xs text-slate-300">
100% en tu navegador · Sin backend · Sin registro · Datos guardados localmente
</p>
<AppFooter /> <AppFooter />
</div> </div>