mirror of
https://github.com/grafana/grafana.git
synced 2025-02-11 16:15:42 -06:00
* Expose option to disable help menu * Expose option to disable profile menu * Add Profile FeatureTogglePage * Update public/app/features/profile/FeatureTogglePage.tsx Uptake PR wording suggestion. Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com> * Fix front end lint issue * Fix back end lint issue Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
40 lines
1.2 KiB
TypeScript
40 lines
1.2 KiB
TypeScript
import { SafeDynamicImport } from 'app/core/components/DynamicImports/SafeDynamicImport';
|
|
import { config } from 'app/core/config';
|
|
import { RouteDescriptor } from 'app/core/navigation/types';
|
|
import { uniq } from 'lodash';
|
|
|
|
const profileRoutes: RouteDescriptor[] = [
|
|
{
|
|
path: '/profile',
|
|
component: SafeDynamicImport(
|
|
() => import(/* webpackChunkName: "UserProfileEditPage" */ 'app/features/profile/UserProfileEditPage')
|
|
),
|
|
},
|
|
{
|
|
path: '/profile/password',
|
|
component: SafeDynamicImport(
|
|
() => import(/* webPackChunkName: "ChangePasswordPage" */ 'app/features/profile/ChangePasswordPage')
|
|
),
|
|
},
|
|
{
|
|
path: '/profile/select-org',
|
|
component: SafeDynamicImport(
|
|
() => import(/* webpackChunkName: "SelectOrgPage" */ 'app/features/org/SelectOrgPage')
|
|
),
|
|
},
|
|
];
|
|
|
|
export function getProfileRoutes(cfg = config): RouteDescriptor[] {
|
|
if (cfg.profileEnabled) {
|
|
return profileRoutes;
|
|
}
|
|
|
|
const uniquePaths = uniq(profileRoutes.map((route) => route.path));
|
|
return uniquePaths.map((path) => ({
|
|
path,
|
|
component: SafeDynamicImport(
|
|
() => import(/* webpackChunkName: "Profile feature toggle page"*/ 'app/features/profile/FeatureTogglePage')
|
|
),
|
|
}));
|
|
}
|