diff --git a/public/app/features/alerting/AlertRuleList.tsx b/public/app/features/alerting/AlertRuleList.tsx index 2b35109e90b..a9cac0077a3 100644 --- a/public/app/features/alerting/AlertRuleList.tsx +++ b/public/app/features/alerting/AlertRuleList.tsx @@ -121,7 +121,7 @@ export class AlertRuleListUnconnected extends PureComponent {
{config.featureToggles.ngalert && ( - + Add NG Alert )} diff --git a/public/app/features/alerting/NextGenAlertingPage.tsx b/public/app/features/alerting/NextGenAlertingPage.tsx index 6fed4b5d484..8bc5cd61e03 100644 --- a/public/app/features/alerting/NextGenAlertingPage.tsx +++ b/public/app/features/alerting/NextGenAlertingPage.tsx @@ -98,7 +98,7 @@ class NextGenAlertingPageUnconnected extends PureComponent { }; onDiscard = () => { - locationService.replace(`${config.appSubUrl}/alerting/list`); + locationService.replace(`${config.appSubUrl}/alerting/ng/list`); }; onTest = () => { diff --git a/public/app/features/alerting/components/AlertDefinitionItem.tsx b/public/app/features/alerting/components/AlertDefinitionItem.tsx index 58a10f50a89..64407a22207 100644 --- a/public/app/features/alerting/components/AlertDefinitionItem.tsx +++ b/public/app/features/alerting/components/AlertDefinitionItem.tsx @@ -4,6 +4,7 @@ import Highlighter from 'react-highlight-words'; import { FeatureState } from '@grafana/data'; import { Card, FeatureBadge, Icon, LinkButton } from '@grafana/ui'; import { AlertDefinition } from 'app/types'; +import { config } from '@grafana/runtime'; interface Props { alertDefinition: AlertDefinition; @@ -23,7 +24,16 @@ export const AlertDefinitionItem: FC = ({ alertDefinition, search }) => { {[ - + Edit alert , ]} diff --git a/public/app/features/alerting/state/actions.ts b/public/app/features/alerting/state/actions.ts index 0832914a7e3..f5e552e7be9 100644 --- a/public/app/features/alerting/state/actions.ts +++ b/public/app/features/alerting/state/actions.ts @@ -123,7 +123,7 @@ export function createAlertDefinition(): ThunkResult { const alertDefinition = await buildAlertDefinition(getStore().alertDefinition); await getBackendSrv().post(`/api/alert-definitions`, alertDefinition); appEvents.emit(AppEvents.alertSuccess, ['Alert definition created']); - locationService.push('/alerting/list'); + locationService.push('/alerting/ng/list'); }; } diff --git a/public/app/routes/routes.tsx b/public/app/routes/routes.tsx index 9b90b29c65b..e6627fdcc44 100644 --- a/public/app/routes/routes.tsx +++ b/public/app/routes/routes.tsx @@ -347,7 +347,13 @@ export function getAppRoutes(): RouteDescriptor[] { { path: '/alerting/list', component: SafeDynamicImport( - () => import(/* webpackChunkName: "AlertRuleList" */ 'app/features/alerting/AlertRuleListIndex') + () => import(/* webpackChunkName: "AlertRuleListIndex" */ 'app/features/alerting/AlertRuleListIndex') + ), + }, + { + path: '/alerting/ng/list', + component: SafeDynamicImport( + () => import(/* webpackChunkName: "AlertRuleList" */ 'app/features/alerting/AlertRuleList') ), }, { @@ -383,20 +389,34 @@ export function getAppRoutes(): RouteDescriptor[] { component: SafeDynamicImport( () => import( - /* webpackChunkName: "NgAlertingPage"*/ 'app/features/alerting/unified/components/rule-editor/AlertRuleForm' + /* webpackChunkName: "AlertingRuleForm"*/ 'app/features/alerting/unified/components/rule-editor/AlertRuleForm' ) ), }, + { + path: '/alerting/ng/new', + pageClass: 'page-alerting', + component: SafeDynamicImport( + () => import(/* webpackChunkName: "NgAlertingPage"*/ 'app/features/alerting/NextGenAlertingPage') + ), + }, { path: '/alerting/:id/edit', pageClass: 'page-alerting', component: SafeDynamicImport( () => import( - /* webpackChunkName: "NgAlertingPage"*/ 'app/features/alerting/unified/components/rule-editor/AlertRuleForm' + /* webpackChunkName: "AlertingRuleForm"*/ 'app/features/alerting/unified/components/rule-editor/AlertRuleForm' ) ), }, + { + path: '/alerting/ng/:id/edit', + pageClass: 'page-alerting', + component: SafeDynamicImport( + () => import(/* webpackChunkName: "NgAlertingPage"*/ 'app/features/alerting/NextGenAlertingPage') + ), + }, { path: '/playlists', component: SafeDynamicImport(