mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Move repeated Paused message into component
This commit is contained in:
parent
31fb80b29a
commit
30699dabec
@ -0,0 +1,13 @@
|
||||
import React from 'react';
|
||||
|
||||
import { Alert } from '@grafana/ui';
|
||||
|
||||
const InfoPausedRule = () => {
|
||||
return (
|
||||
<Alert severity="info" title="Alert evaluation currently paused">
|
||||
Notifications for this rule will not fire and no alert instances will be created until the rule is un-paused.
|
||||
</Alert>
|
||||
);
|
||||
};
|
||||
|
||||
export default InfoPausedRule;
|
@ -5,12 +5,13 @@ import { Link, useParams } from 'react-router-dom';
|
||||
|
||||
import { GrafanaTheme2 } from '@grafana/data';
|
||||
import { config } from '@grafana/runtime';
|
||||
import { Alert, Button, ConfirmModal, CustomScrollbar, HorizontalGroup, Spinner, Stack, useStyles2 } from '@grafana/ui';
|
||||
import { Button, ConfirmModal, CustomScrollbar, HorizontalGroup, Spinner, Stack, useStyles2 } from '@grafana/ui';
|
||||
import { AppChromeUpdate } from 'app/core/components/AppChrome/AppChromeUpdate';
|
||||
import { useAppNotification } from 'app/core/copy/appNotification';
|
||||
import { contextSrv } from 'app/core/core';
|
||||
import { useCleanup } from 'app/core/hooks/useCleanup';
|
||||
import { useQueryParams } from 'app/core/hooks/useQueryParams';
|
||||
import InfoPausedRule from 'app/features/alerting/unified/components/InfoPausedRule';
|
||||
import { isGrafanaRulerRule, isGrafanaRulerRulePaused } from 'app/features/alerting/unified/utils/rules';
|
||||
import { useDispatch } from 'app/types';
|
||||
import { RuleWithLocation } from 'app/types/unified-alerting';
|
||||
@ -237,12 +238,7 @@ export const AlertRuleForm = ({ existing, prefill }: Props) => {
|
||||
<AppChromeUpdate actions={actionButtons} />
|
||||
<form onSubmit={(e) => e.preventDefault()} className={styles.form}>
|
||||
<div className={styles.contentOuter}>
|
||||
{isPaused && (
|
||||
<Alert severity="info" title="Alert evaluation currently paused">
|
||||
Notifications for this rule will not fire and no alert instances will be created until the rule is
|
||||
un-paused.
|
||||
</Alert>
|
||||
)}
|
||||
{isPaused && <InfoPausedRule />}
|
||||
<CustomScrollbar autoHeightMin="100%" hideHorizontalTrack={true}>
|
||||
<Stack direction="column" gap={3}>
|
||||
{/* Step 1 */}
|
||||
|
@ -6,6 +6,7 @@ import { NavModelItem, UrlQueryValue } from '@grafana/data';
|
||||
import { Alert, LinkButton, Stack, TabContent, Text, TextLink, useStyles2 } from '@grafana/ui';
|
||||
import { PageInfoItem } from 'app/core/components/Page/types';
|
||||
import { useQueryParams } from 'app/core/hooks/useQueryParams';
|
||||
import InfoPausedRule from 'app/features/alerting/unified/components/InfoPausedRule';
|
||||
import { CombinedRule, RuleHealth, RuleIdentifier } from 'app/types/unified-alerting';
|
||||
import { PromAlertingRuleState, PromRuleType } from 'app/types/unified-alerting-dto';
|
||||
|
||||
@ -88,12 +89,7 @@ const RuleViewer = () => {
|
||||
info={createMetadata(rule)}
|
||||
subTitle={
|
||||
<Stack direction="column">
|
||||
{isPaused && (
|
||||
<Alert severity="info" title="Alert evaluation currently paused">
|
||||
Notifications for this rule will not fire and no alert instances will be created until the rule is
|
||||
un-paused.
|
||||
</Alert>
|
||||
)}
|
||||
{isPaused && <InfoPausedRule />}
|
||||
{summary}
|
||||
{/* alerts and notifications and stuff */}
|
||||
{isFederatedRule && <FederatedRuleWarning />}
|
||||
|
Loading…
Reference in New Issue
Block a user