From 86a83282c120541f381f73c71a4a3a255a593688 Mon Sep 17 00:00:00 2001 From: DoraCretu594118 <103416234+doracretu3pillar@users.noreply.github.com> Date: Fri, 8 Nov 2024 15:27:48 +0200 Subject: [PATCH 1/3] Alert rule filter type changed according to Swagger --- public/app/percona/shared/core/types.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/app/percona/shared/core/types.ts b/public/app/percona/shared/core/types.ts index e9f849c306982..bbcdd29928a85 100644 --- a/public/app/percona/shared/core/types.ts +++ b/public/app/percona/shared/core/types.ts @@ -105,8 +105,8 @@ export enum AlertRuleParamType { } export enum AlertRuleFilterType { - MATCH = 'MATCH', - MISMATCH = 'MISMATCH', + MATCH = 'FILTER_TYPE_MATCH', + MISMATCH = 'FILTER_TYPE_MISMATCH', } export type AlertRulesParsedParam = TemplateParam & { value: string | boolean | number }; From b5e48eee41493ec10703f9da5b7d1c67d63c9089 Mon Sep 17 00:00:00 2001 From: DoraCretu594118 <103416234+doracretu3pillar@users.noreply.github.com> Date: Wed, 13 Nov 2024 11:39:06 +0200 Subject: [PATCH 2/3] Changed the label for filterOptions select box from New Alerting Template --- .../components/TemplateForm/TemplateFiltersField.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/public/app/percona/integrated-alerting/components/TemplateForm/TemplateFiltersField.tsx b/public/app/percona/integrated-alerting/components/TemplateForm/TemplateFiltersField.tsx index 36667e9085c64..154d76c0cc91f 100644 --- a/public/app/percona/integrated-alerting/components/TemplateForm/TemplateFiltersField.tsx +++ b/public/app/percona/integrated-alerting/components/TemplateForm/TemplateFiltersField.tsx @@ -18,9 +18,10 @@ const TemplateFiltersField: FC = () => { } = useFormContext(); const filterOptions: Array> = useMemo( () => - Object.entries(AlertRuleFilterType).map(([, value]) => ({ - label: value, - value: value, + Object.entries(AlertRuleFilterType).map(([label, value]) => ( + { + label, + value, })), [] ); From 5ae08152385dda600411b730eae5a3bcaff6c0c9 Mon Sep 17 00:00:00 2001 From: DoraCretu594118 <103416234+doracretu3pillar@users.noreply.github.com> Date: Fri, 15 Nov 2024 13:58:32 +0200 Subject: [PATCH 3/3] Fixed prettier --- .../components/TemplateForm/TemplateFiltersField.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/public/app/percona/integrated-alerting/components/TemplateForm/TemplateFiltersField.tsx b/public/app/percona/integrated-alerting/components/TemplateForm/TemplateFiltersField.tsx index 154d76c0cc91f..cb78332293d5b 100644 --- a/public/app/percona/integrated-alerting/components/TemplateForm/TemplateFiltersField.tsx +++ b/public/app/percona/integrated-alerting/components/TemplateForm/TemplateFiltersField.tsx @@ -18,10 +18,9 @@ const TemplateFiltersField: FC = () => { } = useFormContext(); const filterOptions: Array> = useMemo( () => - Object.entries(AlertRuleFilterType).map(([label, value]) => ( - { - label, - value, + Object.entries(AlertRuleFilterType).map(([label, value]) => ({ + label, + value, })), [] );