mirror of
https://github.com/grafana/grafana.git
synced 2025-02-20 11:48:34 -06:00
* Replace feature toggle with configuration setting * Fix permission alert * Update documentation * Add back feature toggle * revert unwanted commited changes * fix tests * run prettier * Update SharePublicDashboard.test.tsx * fix linter and frontend tests * Update api.go * Apply docs edit from code review Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com> * Update index.md * Update docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com> * Update docs/sources/setup-grafana/configure-grafana/_index.md Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com> * add isPublicDashboardsEnabled + test * fix test * update ff description in registry * move isPublicDashboardsEnabled * revert getConfig() update --------- Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com> Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
37 lines
1.1 KiB
TypeScript
37 lines
1.1 KiB
TypeScript
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.publicDashboardsEnabled || !config.featureToggles.publicDashboards) {
|
|
return [];
|
|
}
|
|
|
|
return [
|
|
{
|
|
path: '/dashboard/public',
|
|
pageClass: 'page-dashboard',
|
|
routeName: DashboardRoutes.Public,
|
|
component: SafeDynamicImport(
|
|
() =>
|
|
import(
|
|
/* webpackChunkName: "ListPublicDashboardPage" */ '../../features/manage-dashboards/PublicDashboardListPage'
|
|
)
|
|
),
|
|
},
|
|
{
|
|
path: '/public-dashboards/:accessToken',
|
|
pageClass: 'page-dashboard',
|
|
routeName: DashboardRoutes.Public,
|
|
chromeless: true,
|
|
component: SafeDynamicImport(
|
|
() =>
|
|
import(
|
|
/* webpackChunkName: "PublicDashboardPage" */ '../../features/dashboard/containers/PublicDashboardPage'
|
|
)
|
|
),
|
|
},
|
|
];
|
|
};
|