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 [loadingSampleId, setLoadingSampleId] = useState<string | null>(null)
// Solo platform_admin y member pueden importar BPMN
useEffect(() => {
if (!user) return
const allowed = ['platform_admin', 'member']
const allowed = ['platform_admin', 'member', 'client_editor']
if (!allowed.includes(user.platformRole)) {
void navigate({ to: '/' })
}
@@ -91,7 +90,7 @@ export function ImportPage() {
tags: [],
ownerId: user!.id,
updatedBy: user!.id,
orgId: null,
orgId: user!.orgId ?? null,
areaId: null,
}
@@ -201,8 +200,7 @@ export function ImportPage() {
}
}
const isClientRole = user?.platformRole === 'client_editor' || user?.platformRole === 'client_viewer'
if (isClientRole) return null
if (user?.platformRole === 'client_viewer') return null
return (
<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="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" />
Process Cost Platform · MVP Fase 0
InQ ROI
</div>
<h1 className="text-4xl font-bold text-slate-900 mb-3">
Cuantificá el costo operativo<br />de tus procesos
@@ -276,8 +274,8 @@ export function ImportPage() {
</CardContent>
</Card>
{/* Procesos de ejemplo — visibles directamente */}
<div className="mt-8 w-full max-w-lg">
{/* Procesos de ejemplo — solo para InQuality */}
{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">
O cargá un proceso de ejemplo con un click
</p>
@@ -311,11 +309,7 @@ export function ImportPage() {
)
})}
</div>
</div>
<p className="mt-8 text-xs text-slate-300">
100% en tu navegador · Sin backend · Sin registro · Datos guardados localmente
</p>
</div>}
<AppFooter />
</div>