Alerting: Remove checkForPathSeparator validation in alert rule name (#59014)

Remove checkForPathSeparator validation in alert rule name
This commit is contained in:
Sonia Aguilar 2022-11-21 11:15:00 +01:00 committed by GitHub
parent b0fc736e7a
commit ee9057a5fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,7 +27,6 @@ import { NotificationsStep } from './NotificationsStep';
import { RuleEditorSection } from './RuleEditorSection';
import { RuleInspector } from './RuleInspector';
import { QueryAndExpressionsStep } from './query-and-alert-condition/QueryAndExpressionsStep';
import { checkForPathSeparator } from './util';
const recordingRuleNameValidationPattern = {
message:
@ -58,16 +57,6 @@ const AlertRuleNameInput = () => {
{...register('name', {
required: { value: true, message: 'Must enter an alert name' },
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."
/>