ui-nyla/src/config/keepAliveRoutes.tsx
ValueOn AG ff68307a39
Some checks failed
Deploy Nyla Frontend to Integration / deploy (push) Failing after 55s
fixes private model and udb scoping sources
2026-06-03 09:35:59 +02:00

51 lines
1.9 KiB
TypeScript

import type { KeepAliveEntry } from '../types/keepAlive.types';
import { AdminDatabaseHealthPage } from '../pages/admin/AdminDatabaseHealthPage';
import { AdminLanguagesPage } from '../pages/admin/AdminLanguagesPage';
import { CommcoachSessionView } from '../pages/views/commcoach';
import { GraphicalEditorPage } from '../pages/views/graphicalEditor/GraphicalEditorPage';
import { WorkspacePage } from '../pages/views/workspace/WorkspacePage';
export const KEEP_ALIVE_ROUTES: KeepAliveEntry[] = [
{
id: 'workspace-dashboard',
pathRegex: /\/mandates\/[^/]+\/workspace\/[^/]+\/dashboard/,
scopeRegex: /\/mandates\/([^/]+)\/workspace\/([^/]+)/,
requireMandateForMount: false,
render: ({ mandateId, instanceId, scopeKey }) => (
<WorkspacePage key={scopeKey} persistentInstanceId={instanceId} persistentMandateId={mandateId} />
),
},
{
id: 'commcoach-session',
pathRegex: /\/mandates\/[^/]+\/commcoach\/[^/]+\/session/,
scopeRegex: /\/mandates\/([^/]+)\/commcoach\/([^/]+)\/session/,
shellOverflowHidden: false,
render: ({ scopeKey }) => <CommcoachSessionView key={scopeKey} />,
},
{
id: 'graphical-editor',
pathRegex: /\/mandates\/[^/]+\/graphicalEditor\/[^/]+\/editor/,
scopeRegex: /\/mandates\/([^/]+)\/graphicalEditor\/([^/]+)\/editor/,
render: ({ mandateId, instanceId, scopeKey }) => (
<GraphicalEditorPage
key={scopeKey}
persistentInstanceId={instanceId}
persistentMandateId={mandateId}
/>
),
},
{
id: 'admin-languages',
pathRegex: /\/admin\/languages(?:$|\/)/,
render: () => <AdminLanguagesPage />,
},
{
id: 'admin-database-health',
pathRegex: /\/admin\/database-health(?:$|\/)/,
render: () => <AdminDatabaseHealthPage />,
},
];
export function hideFeatureOutlet(pathname: string): boolean {
return KEEP_ALIVE_ROUTES.some((e) => e.pathRegex.test(pathname));
}