diff --git a/public/app/containers/AlertRuleList/AlertRuleList.tsx b/public/app/containers/AlertRuleList/AlertRuleList.tsx index 39fb0c73749..625d7118879 100644 --- a/public/app/containers/AlertRuleList/AlertRuleList.tsx +++ b/public/app/containers/AlertRuleList/AlertRuleList.tsx @@ -52,7 +52,7 @@ export class AlertRuleList extends React.Component { render() { const { nav, alertList } = this.props; - let regex = new RegExp(this.state.search, 'ig'); + let regex = new RegExp(this.state.search, 'i'); return (
diff --git a/public/app/stores/AlertListStore/AlertListStore.ts b/public/app/stores/AlertListStore/AlertListStore.ts index 10bf9be7fa9..00d24d2643d 100644 --- a/public/app/stores/AlertListStore/AlertListStore.ts +++ b/public/app/stores/AlertListStore/AlertListStore.ts @@ -10,6 +10,13 @@ export const AlertListStore = types rules: types.array(AlertRule), stateFilter: types.optional(types.string, 'all'), }) + .views(self => ({ + searchFilter(regex) { + return self.rules.filter(alert => { + return regex.test(alert.name) || regex.test(alert.stateText); + }); + }, + })) .actions(self => ({ loadRules: flow(function* load(filters) { const backendSrv = getEnv(self).backendSrv; @@ -31,11 +38,4 @@ export const AlertListStore = types self.rules.push(AlertRule.create(rule)); } }), - })) - .views(self => ({ - searchFilter(regex) { - return self.rules.filter(alert => { - return regex.test(alert.name) || regex.test(alert.stateText); - }); - }, }));