mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Alerting: temporarily add old ng routes (#32770)
This commit is contained in:
parent
bba4d9bd7f
commit
33a4cfde51
@ -121,7 +121,7 @@ export class AlertRuleListUnconnected extends PureComponent<Props> {
|
|||||||
</div>
|
</div>
|
||||||
<div className="page-action-bar__spacer" />
|
<div className="page-action-bar__spacer" />
|
||||||
{config.featureToggles.ngalert && (
|
{config.featureToggles.ngalert && (
|
||||||
<LinkButton variant="primary" href="alerting/new">
|
<LinkButton variant="primary" href="alerting/ng/new">
|
||||||
Add NG Alert
|
Add NG Alert
|
||||||
</LinkButton>
|
</LinkButton>
|
||||||
)}
|
)}
|
||||||
|
@ -98,7 +98,7 @@ class NextGenAlertingPageUnconnected extends PureComponent<Props> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
onDiscard = () => {
|
onDiscard = () => {
|
||||||
locationService.replace(`${config.appSubUrl}/alerting/list`);
|
locationService.replace(`${config.appSubUrl}/alerting/ng/list`);
|
||||||
};
|
};
|
||||||
|
|
||||||
onTest = () => {
|
onTest = () => {
|
||||||
|
@ -4,6 +4,7 @@ import Highlighter from 'react-highlight-words';
|
|||||||
import { FeatureState } from '@grafana/data';
|
import { FeatureState } from '@grafana/data';
|
||||||
import { Card, FeatureBadge, Icon, LinkButton } from '@grafana/ui';
|
import { Card, FeatureBadge, Icon, LinkButton } from '@grafana/ui';
|
||||||
import { AlertDefinition } from 'app/types';
|
import { AlertDefinition } from 'app/types';
|
||||||
|
import { config } from '@grafana/runtime';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
alertDefinition: AlertDefinition;
|
alertDefinition: AlertDefinition;
|
||||||
@ -23,7 +24,16 @@ export const AlertDefinitionItem: FC<Props> = ({ alertDefinition, search }) => {
|
|||||||
</Card.Meta>
|
</Card.Meta>
|
||||||
<Card.Actions>
|
<Card.Actions>
|
||||||
{[
|
{[
|
||||||
<LinkButton key="edit" variant="secondary" href={`/alerting/${alertDefinition.uid}/edit`} icon="cog">
|
<LinkButton
|
||||||
|
key="edit"
|
||||||
|
variant="secondary"
|
||||||
|
href={
|
||||||
|
config.featureToggles.ngalert
|
||||||
|
? `/alerting/ng/${alertDefinition.uid}/edit`
|
||||||
|
: `/alerting/${alertDefinition.uid}/edit`
|
||||||
|
}
|
||||||
|
icon="cog"
|
||||||
|
>
|
||||||
Edit alert
|
Edit alert
|
||||||
</LinkButton>,
|
</LinkButton>,
|
||||||
]}
|
]}
|
||||||
|
@ -123,7 +123,7 @@ export function createAlertDefinition(): ThunkResult<void> {
|
|||||||
const alertDefinition = await buildAlertDefinition(getStore().alertDefinition);
|
const alertDefinition = await buildAlertDefinition(getStore().alertDefinition);
|
||||||
await getBackendSrv().post(`/api/alert-definitions`, alertDefinition);
|
await getBackendSrv().post(`/api/alert-definitions`, alertDefinition);
|
||||||
appEvents.emit(AppEvents.alertSuccess, ['Alert definition created']);
|
appEvents.emit(AppEvents.alertSuccess, ['Alert definition created']);
|
||||||
locationService.push('/alerting/list');
|
locationService.push('/alerting/ng/list');
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -347,7 +347,13 @@ export function getAppRoutes(): RouteDescriptor[] {
|
|||||||
{
|
{
|
||||||
path: '/alerting/list',
|
path: '/alerting/list',
|
||||||
component: SafeDynamicImport(
|
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(
|
component: SafeDynamicImport(
|
||||||
() =>
|
() =>
|
||||||
import(
|
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',
|
path: '/alerting/:id/edit',
|
||||||
pageClass: 'page-alerting',
|
pageClass: 'page-alerting',
|
||||||
component: SafeDynamicImport(
|
component: SafeDynamicImport(
|
||||||
() =>
|
() =>
|
||||||
import(
|
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',
|
path: '/playlists',
|
||||||
component: SafeDynamicImport(
|
component: SafeDynamicImport(
|
||||||
|
Loading…
Reference in New Issue
Block a user