mirror of
https://github.com/grafana/grafana.git
synced 2025-02-15 01:53:33 -06:00
* Add and configure eslint-plugin-import * Fix the lint:ts npm command * Autofix + prettier all the files * Manually fix remaining files * Move jquery code in jest-setup to external file to safely reorder imports * Resolve issue caused by circular dependencies within Prometheus * Update .betterer.results * Fix missing // @ts-ignore * ignore iconBundle.ts * Fix missing // @ts-ignore
41 lines
1.2 KiB
TypeScript
41 lines
1.2 KiB
TypeScript
import { uniq } from 'lodash';
|
|
|
|
import { SafeDynamicImport } from 'app/core/components/DynamicImports/SafeDynamicImport';
|
|
import { config } from 'app/core/config';
|
|
import { RouteDescriptor } from 'app/core/navigation/types';
|
|
|
|
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')
|
|
),
|
|
}));
|
|
}
|