2022-04-22 21:33:13 +08:00
|
|
|
import { uniq } from 'lodash';
|
|
|
|
|
import React from 'react';
|
2024-01-05 07:01:57 +08:00
|
|
|
import { Redirect, RouteComponentProps } from 'react-router-dom';
|
2022-04-22 21:33:13 +08:00
|
|
|
|
2021-10-25 20:40:45 +08:00
|
|
|
import { SafeDynamicImport } from 'app/core/components/DynamicImports/SafeDynamicImport';
|
2023-04-14 16:43:11 +08:00
|
|
|
import { NavLandingPage } from 'app/core/components/NavLandingPage/NavLandingPage';
|
2021-10-25 20:40:45 +08:00
|
|
|
import { config } from 'app/core/config';
|
|
|
|
|
import { RouteDescriptor } from 'app/core/navigation/types';
|
2022-03-22 07:54:37 +08:00
|
|
|
import { AccessControlAction } from 'app/types';
|
2022-04-22 21:33:13 +08:00
|
|
|
|
2022-04-07 00:24:33 +08:00
|
|
|
import { evaluateAccess } from './unified/utils/access-control';
|
2021-10-25 20:40:45 +08:00
|
|
|
|
2022-12-20 23:21:56 +08:00
|
|
|
const commonRoutes: RouteDescriptor[] = [];
|
|
|
|
|
|
|
|
|
|
const legacyRoutes: RouteDescriptor[] = [
|
|
|
|
|
...commonRoutes,
|
2021-10-25 20:40:45 +08:00
|
|
|
{
|
2024-01-05 07:01:57 +08:00
|
|
|
path: '/alerting-legacy',
|
2023-04-14 16:43:11 +08:00
|
|
|
component: () => <NavLandingPage navId="alerting-legacy" />,
|
2021-10-25 20:40:45 +08:00
|
|
|
},
|
|
|
|
|
{
|
2024-01-05 07:01:57 +08:00
|
|
|
path: '/alerting-legacy/list',
|
2021-10-25 20:40:45 +08:00
|
|
|
component: SafeDynamicImport(
|
2024-01-05 07:01:57 +08:00
|
|
|
() => import(/* webpackChunkName: "AlertRuleListLegacyIndex" */ 'app/features/alerting/AlertRuleList')
|
2021-10-25 20:40:45 +08:00
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
{
|
2024-01-05 07:01:57 +08:00
|
|
|
path: '/alerting-legacy/ng/list',
|
2021-10-25 20:40:45 +08:00
|
|
|
component: SafeDynamicImport(
|
2024-01-05 07:01:57 +08:00
|
|
|
() => import(/* webpackChunkName: "AlertRuleListLegacy" */ 'app/features/alerting/AlertRuleList')
|
2021-10-25 20:40:45 +08:00
|
|
|
),
|
|
|
|
|
},
|
2022-02-02 17:57:43 +08:00
|
|
|
{
|
2024-01-05 07:01:57 +08:00
|
|
|
path: '/alerting-legacy/notifications',
|
2022-02-02 17:57:43 +08:00
|
|
|
roles: config.unifiedAlertingEnabled ? () => ['Editor', 'Admin'] : undefined,
|
|
|
|
|
component: SafeDynamicImport(
|
2024-01-05 07:01:57 +08:00
|
|
|
() => import(/* webpackChunkName: "NotificationsListLegacyPage" */ 'app/features/alerting/NotificationsListPage')
|
2022-02-02 17:57:43 +08:00
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
{
|
2024-01-05 07:01:57 +08:00
|
|
|
path: '/alerting-legacy/notifications/templates/new',
|
2022-02-02 17:57:43 +08:00
|
|
|
roles: () => ['Editor', 'Admin'],
|
|
|
|
|
component: SafeDynamicImport(
|
2024-01-05 07:01:57 +08:00
|
|
|
() => import(/* webpackChunkName: "NotificationsListLegacyPage" */ 'app/features/alerting/NotificationsListPage')
|
2022-02-02 17:57:43 +08:00
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
{
|
2024-01-05 07:01:57 +08:00
|
|
|
path: '/alerting-legacy/notifications/templates/:id/edit',
|
2022-02-02 17:57:43 +08:00
|
|
|
roles: () => ['Editor', 'Admin'],
|
|
|
|
|
component: SafeDynamicImport(
|
2024-01-05 07:01:57 +08:00
|
|
|
() => import(/* webpackChunkName: "NotificationsListLegacyPage" */ 'app/features/alerting/NotificationsListPage')
|
2022-02-02 17:57:43 +08:00
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
{
|
2024-01-05 07:01:57 +08:00
|
|
|
path: '/alerting-legacy/notifications/receivers/new',
|
2022-02-02 17:57:43 +08:00
|
|
|
roles: () => ['Editor', 'Admin'],
|
|
|
|
|
component: SafeDynamicImport(
|
2024-01-05 07:01:57 +08:00
|
|
|
() => import(/* webpackChunkName: "NotificationsListLegacyPage" */ 'app/features/alerting/NotificationsListPage')
|
2022-02-02 17:57:43 +08:00
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
{
|
2024-01-05 07:01:57 +08:00
|
|
|
path: '/alerting-legacy/notifications/receivers/:id/edit',
|
2022-02-02 17:57:43 +08:00
|
|
|
roles: () => ['Editor', 'Admin'],
|
|
|
|
|
component: SafeDynamicImport(
|
2024-01-05 07:01:57 +08:00
|
|
|
() => import(/* webpackChunkName: "NotificationsListLegacyPage" */ 'app/features/alerting/NotificationsListPage')
|
2022-02-02 17:57:43 +08:00
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
{
|
2024-01-05 07:01:57 +08:00
|
|
|
path: '/alerting-legacy/notifications/global-config',
|
2022-02-02 17:57:43 +08:00
|
|
|
roles: () => ['Admin', 'Editor'],
|
|
|
|
|
component: SafeDynamicImport(
|
2024-01-05 07:01:57 +08:00
|
|
|
() => import(/* webpackChunkName: "NotificationsListLegacyPage" */ 'app/features/alerting/NotificationsListPage')
|
2022-02-02 17:57:43 +08:00
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
{
|
2024-01-05 07:01:57 +08:00
|
|
|
path: '/alerting-legacy/notification/new',
|
2022-02-02 17:57:43 +08:00
|
|
|
component: SafeDynamicImport(
|
2024-01-05 07:01:57 +08:00
|
|
|
() =>
|
|
|
|
|
import(
|
|
|
|
|
/* webpackChunkName: "NewNotificationChannelLegacy" */ 'app/features/alerting/NewNotificationChannelPage'
|
|
|
|
|
)
|
2022-02-02 17:57:43 +08:00
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
{
|
2024-01-05 07:01:57 +08:00
|
|
|
path: '/alerting-legacy/notification/:id/edit',
|
2022-02-02 17:57:43 +08:00
|
|
|
component: SafeDynamicImport(
|
2024-01-05 07:01:57 +08:00
|
|
|
() =>
|
|
|
|
|
import(
|
|
|
|
|
/* webpackChunkName: "EditNotificationChannelLegacy"*/ 'app/features/alerting/EditNotificationChannelPage'
|
|
|
|
|
)
|
2022-02-02 17:57:43 +08:00
|
|
|
),
|
|
|
|
|
},
|
2024-01-06 07:19:12 +08:00
|
|
|
{
|
|
|
|
|
path: '/alerting-legacy/upgrade',
|
|
|
|
|
roles: () => ['Admin'],
|
|
|
|
|
component: SafeDynamicImport(
|
|
|
|
|
() => import(/* webpackChunkName: "AlertingUpgrade" */ 'app/features/alerting/Upgrade')
|
|
|
|
|
),
|
|
|
|
|
},
|
2022-02-02 17:57:43 +08:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
const unifiedRoutes: RouteDescriptor[] = [
|
|
|
|
|
...commonRoutes,
|
2023-04-14 16:43:11 +08:00
|
|
|
{
|
|
|
|
|
path: '/alerting',
|
|
|
|
|
component: SafeDynamicImport(
|
2023-09-01 04:01:47 +08:00
|
|
|
() => import(/* webpackChunkName: "AlertingHome" */ 'app/features/alerting/unified/home/Home')
|
2023-04-14 16:43:11 +08:00
|
|
|
),
|
|
|
|
|
},
|
2023-09-19 20:17:56 +08:00
|
|
|
{
|
|
|
|
|
path: '/alerting/home',
|
|
|
|
|
exact: false,
|
|
|
|
|
component: SafeDynamicImport(
|
|
|
|
|
() => import(/* webpackChunkName: "AlertingHome" */ 'app/features/alerting/unified/home/Home')
|
|
|
|
|
),
|
|
|
|
|
},
|
2022-02-02 17:57:43 +08:00
|
|
|
{
|
|
|
|
|
path: '/alerting/list',
|
2023-09-06 23:57:22 +08:00
|
|
|
roles: evaluateAccess([AccessControlAction.AlertingRuleRead, AccessControlAction.AlertingRuleExternalRead]),
|
2022-02-02 17:57:43 +08:00
|
|
|
component: SafeDynamicImport(
|
|
|
|
|
() => import(/* webpackChunkName: "AlertRuleListIndex" */ 'app/features/alerting/unified/RuleList')
|
|
|
|
|
),
|
|
|
|
|
},
|
2021-10-25 20:40:45 +08:00
|
|
|
{
|
|
|
|
|
path: '/alerting/routes',
|
2023-09-06 23:57:22 +08:00
|
|
|
roles: evaluateAccess([
|
|
|
|
|
AccessControlAction.AlertingNotificationsRead,
|
|
|
|
|
AccessControlAction.AlertingNotificationsExternalRead,
|
|
|
|
|
]),
|
2021-10-25 20:40:45 +08:00
|
|
|
component: SafeDynamicImport(
|
2023-03-02 20:49:38 +08:00
|
|
|
() => import(/* webpackChunkName: "AlertAmRoutes" */ 'app/features/alerting/unified/NotificationPolicies')
|
2021-10-25 20:40:45 +08:00
|
|
|
),
|
|
|
|
|
},
|
2022-01-06 02:16:43 +08:00
|
|
|
{
|
|
|
|
|
path: '/alerting/routes/mute-timing/new',
|
2023-09-06 23:57:22 +08:00
|
|
|
roles: evaluateAccess([
|
|
|
|
|
AccessControlAction.AlertingNotificationsWrite,
|
|
|
|
|
AccessControlAction.AlertingNotificationsExternalWrite,
|
|
|
|
|
]),
|
2022-01-06 02:16:43 +08:00
|
|
|
component: SafeDynamicImport(
|
|
|
|
|
() => import(/* webpackChunkName: "MuteTimings" */ 'app/features/alerting/unified/MuteTimings')
|
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/alerting/routes/mute-timing/edit',
|
2023-09-06 23:57:22 +08:00
|
|
|
roles: evaluateAccess([
|
|
|
|
|
AccessControlAction.AlertingNotificationsWrite,
|
|
|
|
|
AccessControlAction.AlertingNotificationsExternalWrite,
|
|
|
|
|
]),
|
2022-01-06 02:16:43 +08:00
|
|
|
component: SafeDynamicImport(
|
|
|
|
|
() => import(/* webpackChunkName: "MuteTimings" */ 'app/features/alerting/unified/MuteTimings')
|
|
|
|
|
),
|
|
|
|
|
},
|
2021-10-25 20:40:45 +08:00
|
|
|
{
|
|
|
|
|
path: '/alerting/silences',
|
2023-09-06 23:57:22 +08:00
|
|
|
roles: evaluateAccess([
|
|
|
|
|
AccessControlAction.AlertingInstanceRead,
|
|
|
|
|
AccessControlAction.AlertingInstancesExternalRead,
|
|
|
|
|
]),
|
2021-10-25 20:40:45 +08:00
|
|
|
component: SafeDynamicImport(
|
|
|
|
|
() => import(/* webpackChunkName: "AlertSilences" */ 'app/features/alerting/unified/Silences')
|
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/alerting/silence/new',
|
2023-09-06 23:57:22 +08:00
|
|
|
roles: evaluateAccess([
|
|
|
|
|
AccessControlAction.AlertingInstanceCreate,
|
|
|
|
|
AccessControlAction.AlertingInstancesExternalWrite,
|
|
|
|
|
]),
|
2021-10-25 20:40:45 +08:00
|
|
|
component: SafeDynamicImport(
|
|
|
|
|
() => import(/* webpackChunkName: "AlertSilences" */ 'app/features/alerting/unified/Silences')
|
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/alerting/silence/:id/edit',
|
2023-09-06 23:57:22 +08:00
|
|
|
roles: evaluateAccess([
|
|
|
|
|
AccessControlAction.AlertingInstanceUpdate,
|
|
|
|
|
AccessControlAction.AlertingInstancesExternalWrite,
|
|
|
|
|
]),
|
2021-10-25 20:40:45 +08:00
|
|
|
component: SafeDynamicImport(
|
|
|
|
|
() => import(/* webpackChunkName: "AlertSilences" */ 'app/features/alerting/unified/Silences')
|
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/alerting/notifications',
|
2023-09-06 23:57:22 +08:00
|
|
|
roles: evaluateAccess([
|
|
|
|
|
AccessControlAction.AlertingNotificationsRead,
|
|
|
|
|
AccessControlAction.AlertingNotificationsExternalRead,
|
|
|
|
|
]),
|
2021-10-25 20:40:45 +08:00
|
|
|
component: SafeDynamicImport(
|
2022-02-02 17:57:43 +08:00
|
|
|
() => import(/* webpackChunkName: "NotificationsListPage" */ 'app/features/alerting/unified/Receivers')
|
2021-10-25 20:40:45 +08:00
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
{
|
2022-09-06 22:25:07 +08:00
|
|
|
path: '/alerting/notifications/:type/new',
|
2023-09-06 23:57:22 +08:00
|
|
|
roles: evaluateAccess([
|
|
|
|
|
AccessControlAction.AlertingNotificationsWrite,
|
|
|
|
|
AccessControlAction.AlertingNotificationsExternalWrite,
|
|
|
|
|
]),
|
2021-10-25 20:40:45 +08:00
|
|
|
component: SafeDynamicImport(
|
2022-02-02 17:57:43 +08:00
|
|
|
() => import(/* webpackChunkName: "NotificationsListPage" */ 'app/features/alerting/unified/Receivers')
|
2021-10-25 20:40:45 +08:00
|
|
|
),
|
|
|
|
|
},
|
2023-10-25 21:57:53 +08:00
|
|
|
{
|
|
|
|
|
path: '/alerting/notifications/receivers/:id/edit',
|
|
|
|
|
roles: evaluateAccess([
|
|
|
|
|
AccessControlAction.AlertingNotificationsWrite,
|
|
|
|
|
AccessControlAction.AlertingNotificationsExternalWrite,
|
|
|
|
|
AccessControlAction.AlertingNotificationsRead,
|
|
|
|
|
AccessControlAction.AlertingNotificationsExternalRead,
|
|
|
|
|
]),
|
|
|
|
|
component: SafeDynamicImport(
|
|
|
|
|
() => import(/* webpackChunkName: "NotificationsListPage" */ 'app/features/alerting/unified/Receivers')
|
|
|
|
|
),
|
|
|
|
|
},
|
2021-10-25 20:40:45 +08:00
|
|
|
{
|
2022-09-06 22:25:07 +08:00
|
|
|
path: '/alerting/notifications/:type/:id/edit',
|
2023-09-06 23:57:22 +08:00
|
|
|
roles: evaluateAccess([
|
|
|
|
|
AccessControlAction.AlertingNotificationsWrite,
|
|
|
|
|
AccessControlAction.AlertingNotificationsExternalWrite,
|
|
|
|
|
]),
|
2021-10-25 20:40:45 +08:00
|
|
|
component: SafeDynamicImport(
|
2022-02-02 17:57:43 +08:00
|
|
|
() => import(/* webpackChunkName: "NotificationsListPage" */ 'app/features/alerting/unified/Receivers')
|
2021-10-25 20:40:45 +08:00
|
|
|
),
|
|
|
|
|
},
|
2023-02-01 21:14:10 +08:00
|
|
|
{
|
|
|
|
|
path: '/alerting/notifications/:type/:id/duplicate',
|
2023-09-06 23:57:22 +08:00
|
|
|
roles: evaluateAccess([
|
|
|
|
|
AccessControlAction.AlertingNotificationsWrite,
|
|
|
|
|
AccessControlAction.AlertingNotificationsExternalWrite,
|
|
|
|
|
]),
|
2023-02-01 21:14:10 +08:00
|
|
|
component: SafeDynamicImport(
|
|
|
|
|
() => import(/* webpackChunkName: "NotificationsListPage" */ 'app/features/alerting/unified/Receivers')
|
|
|
|
|
),
|
|
|
|
|
},
|
2021-10-25 20:40:45 +08:00
|
|
|
{
|
2022-09-06 22:25:07 +08:00
|
|
|
path: '/alerting/notifications/:type',
|
2023-09-06 23:57:22 +08:00
|
|
|
roles: evaluateAccess([
|
|
|
|
|
AccessControlAction.AlertingNotificationsWrite,
|
|
|
|
|
AccessControlAction.AlertingNotificationsExternalWrite,
|
|
|
|
|
]),
|
2021-10-25 20:40:45 +08:00
|
|
|
component: SafeDynamicImport(
|
2022-02-02 17:57:43 +08:00
|
|
|
() => import(/* webpackChunkName: "NotificationsListPage" */ 'app/features/alerting/unified/Receivers')
|
2021-10-25 20:40:45 +08:00
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/alerting/groups/',
|
2023-09-06 23:57:22 +08:00
|
|
|
roles: evaluateAccess([
|
|
|
|
|
AccessControlAction.AlertingInstanceRead,
|
|
|
|
|
AccessControlAction.AlertingInstancesExternalRead,
|
|
|
|
|
]),
|
2021-10-25 20:40:45 +08:00
|
|
|
component: SafeDynamicImport(
|
|
|
|
|
() => import(/* webpackChunkName: "AlertGroups" */ 'app/features/alerting/unified/AlertGroups')
|
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
{
|
2023-05-31 21:56:54 +08:00
|
|
|
path: '/alerting/new/:type?',
|
2021-10-25 20:40:45 +08:00
|
|
|
pageClass: 'page-alerting',
|
2023-09-06 23:57:22 +08:00
|
|
|
roles: evaluateAccess([AccessControlAction.AlertingRuleCreate, AccessControlAction.AlertingRuleExternalWrite]),
|
2021-10-25 20:40:45 +08:00
|
|
|
component: SafeDynamicImport(
|
|
|
|
|
() => import(/* webpackChunkName: "AlertingRuleForm"*/ 'app/features/alerting/unified/RuleEditor')
|
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/alerting/:id/edit',
|
|
|
|
|
pageClass: 'page-alerting',
|
2023-09-06 23:57:22 +08:00
|
|
|
roles: evaluateAccess([AccessControlAction.AlertingRuleUpdate, AccessControlAction.AlertingRuleExternalWrite]),
|
2021-10-25 20:40:45 +08:00
|
|
|
component: SafeDynamicImport(
|
|
|
|
|
() => import(/* webpackChunkName: "AlertingRuleForm"*/ 'app/features/alerting/unified/RuleEditor')
|
|
|
|
|
),
|
|
|
|
|
},
|
2023-09-28 22:07:45 +08:00
|
|
|
{
|
|
|
|
|
path: '/alerting/:id/modify-export',
|
|
|
|
|
pageClass: 'page-alerting',
|
2023-10-13 01:17:32 +08:00
|
|
|
roles: evaluateAccess([AccessControlAction.AlertingRuleRead]),
|
|
|
|
|
component: SafeDynamicImport(
|
|
|
|
|
() =>
|
|
|
|
|
import(
|
|
|
|
|
/* webpackChunkName: "AlertingRuleForm"*/ 'app/features/alerting/unified/components/export/GrafanaModifyExport'
|
2023-09-28 22:07:45 +08:00
|
|
|
)
|
2023-10-13 01:17:32 +08:00
|
|
|
),
|
2023-09-28 22:07:45 +08:00
|
|
|
},
|
2021-10-25 20:40:45 +08:00
|
|
|
{
|
|
|
|
|
path: '/alerting/:sourceName/:id/view',
|
|
|
|
|
pageClass: 'page-alerting',
|
2023-09-06 23:57:22 +08:00
|
|
|
roles: evaluateAccess([AccessControlAction.AlertingRuleRead, AccessControlAction.AlertingRuleExternalRead]),
|
2021-10-25 20:40:45 +08:00
|
|
|
component: SafeDynamicImport(
|
|
|
|
|
() => import(/* webpackChunkName: "AlertingRule"*/ 'app/features/alerting/unified/RuleViewer')
|
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/alerting/:sourceName/:name/find',
|
|
|
|
|
pageClass: 'page-alerting',
|
2023-09-06 23:57:22 +08:00
|
|
|
roles: evaluateAccess([AccessControlAction.AlertingRuleRead, AccessControlAction.AlertingRuleExternalRead]),
|
2021-10-25 20:40:45 +08:00
|
|
|
component: SafeDynamicImport(
|
|
|
|
|
() => import(/* webpackChunkName: "AlertingRedirectToRule"*/ 'app/features/alerting/unified/RedirectToRuleViewer')
|
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/alerting/admin',
|
|
|
|
|
roles: () => ['Admin'],
|
|
|
|
|
component: SafeDynamicImport(
|
|
|
|
|
() => import(/* webpackChunkName: "AlertingAdmin" */ 'app/features/alerting/unified/Admin')
|
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
export function getAlertingRoutes(cfg = config): RouteDescriptor[] {
|
2022-02-02 17:57:43 +08:00
|
|
|
if (cfg.unifiedAlertingEnabled) {
|
|
|
|
|
return unifiedRoutes;
|
|
|
|
|
} else if (cfg.alertingEnabled) {
|
2024-01-06 07:19:12 +08:00
|
|
|
if (config.featureToggles.alertingPreviewUpgrade) {
|
|
|
|
|
// If preview is enabled, return both legacy and unified routes.
|
|
|
|
|
return [...legacyRoutes, ...unifiedRoutes];
|
|
|
|
|
}
|
2024-01-05 07:01:57 +08:00
|
|
|
// Redirect old overlapping legacy routes to new separate ones to minimize unintended 404s.
|
|
|
|
|
const redirects = [
|
|
|
|
|
{
|
|
|
|
|
path: '/alerting',
|
|
|
|
|
component: () => <Redirect to={'/alerting-legacy'} />,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/alerting/list',
|
|
|
|
|
component: () => <Redirect to={'/alerting-legacy/list'} />,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/alerting/notifications',
|
|
|
|
|
component: () => <Redirect to={'/alerting-legacy/notifications'} />,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/alerting/notification/new',
|
|
|
|
|
component: () => <Redirect to={'/alerting-legacy/notification/new'} />,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/alerting/notification/:id/edit',
|
|
|
|
|
component: (props: RouteComponentProps<{ id: string }>) => (
|
|
|
|
|
<Redirect to={'/alerting-legacy/notification/:id/edit'.replace(':id', props.match.params.id)} />
|
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
return [...legacyRoutes, ...redirects];
|
2021-10-25 20:40:45 +08:00
|
|
|
}
|
|
|
|
|
|
2024-01-06 07:19:12 +08:00
|
|
|
// Disable all alerting routes.
|
2022-02-02 17:57:43 +08:00
|
|
|
const uniquePaths = uniq([...legacyRoutes, ...unifiedRoutes].map((route) => route.path));
|
|
|
|
|
return uniquePaths.map((path) => ({
|
|
|
|
|
path,
|
2021-10-25 20:40:45 +08:00
|
|
|
component: SafeDynamicImport(
|
2022-05-16 21:26:14 +08:00
|
|
|
() => import(/* webpackChunkName: "AlertingFeatureTogglePage"*/ 'app/features/alerting/FeatureTogglePage')
|
2021-10-25 20:40:45 +08:00
|
|
|
),
|
|
|
|
|
}));
|
|
|
|
|
}
|