2022-06-02 15:57:55 -05:00
|
|
|
import { SafeDynamicImport } from '../../core/components/DynamicImports/SafeDynamicImport';
|
|
|
|
import { config } from '../../core/config';
|
|
|
|
import { RouteDescriptor } from '../../core/navigation/types';
|
|
|
|
import { DashboardRoutes } from '../../types';
|
|
|
|
|
|
|
|
export const getPublicDashboardRoutes = (): RouteDescriptor[] => {
|
|
|
|
if (config.featureToggles.publicDashboards) {
|
|
|
|
return [
|
2022-10-13 00:36:05 -05:00
|
|
|
{
|
|
|
|
path: '/dashboard/public',
|
|
|
|
pageClass: 'page-dashboard',
|
|
|
|
routeName: DashboardRoutes.Public,
|
|
|
|
component: SafeDynamicImport(
|
|
|
|
() =>
|
|
|
|
import(
|
|
|
|
/* webpackChunkName: "ListPublicDashboardPage" */ '../../features/manage-dashboards/PublicDashboardListPage'
|
|
|
|
)
|
|
|
|
),
|
|
|
|
},
|
2022-06-02 15:57:55 -05:00
|
|
|
{
|
2022-06-22 16:58:52 -05:00
|
|
|
path: '/public-dashboards/:accessToken',
|
2022-06-02 15:57:55 -05:00
|
|
|
pageClass: 'page-dashboard',
|
|
|
|
routeName: DashboardRoutes.Public,
|
2023-01-10 11:50:37 -06:00
|
|
|
chromeless: true,
|
2022-06-02 15:57:55 -05:00
|
|
|
component: SafeDynamicImport(
|
|
|
|
() =>
|
|
|
|
import(
|
|
|
|
/* webpackChunkName: "PublicDashboardPage" */ '../../features/dashboard/containers/PublicDashboardPage'
|
|
|
|
)
|
|
|
|
),
|
|
|
|
},
|
|
|
|
];
|
|
|
|
}
|
2023-07-06 09:43:20 -05:00
|
|
|
return [];
|
|
|
|
};
|
|
|
|
|
|
|
|
export const getEmbeddedDashboardRoutes = (): RouteDescriptor[] => {
|
|
|
|
if (config.featureToggles.dashboardEmbed) {
|
|
|
|
return [
|
|
|
|
{
|
|
|
|
path: '/d-embed',
|
|
|
|
pageClass: 'dashboard-embed',
|
|
|
|
routeName: DashboardRoutes.Embedded,
|
|
|
|
component: SafeDynamicImport(
|
|
|
|
() =>
|
|
|
|
import(
|
|
|
|
/* webpackChunkName: "EmbeddedDashboardPage" */ '../../features/dashboard/containers/EmbeddedDashboardPage'
|
|
|
|
)
|
|
|
|
),
|
|
|
|
},
|
|
|
|
];
|
|
|
|
}
|
2022-06-02 15:57:55 -05:00
|
|
|
|
|
|
|
return [];
|
|
|
|
};
|