Skip to main content

Portal Routing

An essential component inn the component in the project portal is its routing system. the base route displays a "view page" this is the landing page if th project portal and for now the project "view" / " workSurface" is the default. and we are currently only allowing the user to utilize this. the view decided what context type that is available and when a context is selected ans sins the current view is project the user will be navigated to /project/:contextId

as for now the routes are static but this is intended to be dynamic in the future. if a new view is added the corresponding routes wil be added. but then the views landing page wil be dynamic loaded as well.

const routes: RouteObject[] = [
{
path: '/',
element: <PortalFrame />,
errorElement: <PortalMessagePage title="Fail to setup portal" type="Error" />,
children: [
{
path: '/',
element: <ViewPage />,
errorElement: <PortalMessagePage title="Fail to load view page" type={'Error'} />,
},
{
path: '/project',
element: <ViewPage />,
errorElement: <PortalMessagePage title="Fail to load view page" type={'Error'} />,
},
{
path: '/project/:contextId',
element: <ProjectPage />,
errorElement: <PortalMessagePage title="Fail to load context page" type={'Error'} />,
},
{
path: '/apps/:appKey',
element: <AppPage />,
children: [
{
path: ':contextId/*',
element: <AppPage />,
errorElement: <PortalMessagePage title="Fail to load application" type={'Error'} />,
},
],
errorElement: <PortalMessagePage title="Fail to load application" type={'Error'} />,
},
{
path: `/*`,
element: <Navigate replace to={'/'} />,
errorElement: <PortalMessagePage title="Fail to load application" type={'Error'} />,
},
],
},
];