mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Alerting: Remove checkForPathSeparator validation in alert rule name (#59014)
Remove checkForPathSeparator validation in alert rule name
This commit is contained in:
parent
b0fc736e7a
commit
ee9057a5fa
@ -27,7 +27,6 @@ import { NotificationsStep } from './NotificationsStep';
|
|||||||
import { RuleEditorSection } from './RuleEditorSection';
|
import { RuleEditorSection } from './RuleEditorSection';
|
||||||
import { RuleInspector } from './RuleInspector';
|
import { RuleInspector } from './RuleInspector';
|
||||||
import { QueryAndExpressionsStep } from './query-and-alert-condition/QueryAndExpressionsStep';
|
import { QueryAndExpressionsStep } from './query-and-alert-condition/QueryAndExpressionsStep';
|
||||||
import { checkForPathSeparator } from './util';
|
|
||||||
|
|
||||||
const recordingRuleNameValidationPattern = {
|
const recordingRuleNameValidationPattern = {
|
||||||
message:
|
message:
|
||||||
@ -58,16 +57,6 @@ const AlertRuleNameInput = () => {
|
|||||||
{...register('name', {
|
{...register('name', {
|
||||||
required: { value: true, message: 'Must enter an alert name' },
|
required: { value: true, message: 'Must enter an alert name' },
|
||||||
pattern: ruleFormType === RuleFormType.cloudRecording ? recordingRuleNameValidationPattern : undefined,
|
pattern: ruleFormType === RuleFormType.cloudRecording ? recordingRuleNameValidationPattern : undefined,
|
||||||
validate: {
|
|
||||||
pathSeparator: (value: string) => {
|
|
||||||
// we use the alert rule name as the "groupname" for Grafana managed alerts, so we can't allow path separators
|
|
||||||
if (ruleFormType === RuleFormType.grafana) {
|
|
||||||
return checkForPathSeparator(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})}
|
})}
|
||||||
placeholder="Give your alert rule a name."
|
placeholder="Give your alert rule a name."
|
||||||
/>
|
/>
|
||||||
|
Loading…
Reference in New Issue
Block a user