From: bryanmontalvan <68972382+bryanmontalvan@users.noreply.github.com> Date: Mon, 27 Jun 2022 19:43:58 +0000 (-0400) Subject: mgr/dashboard: Simplified silence-form matchers list X-Git-Tag: v17.2.6~28^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=cef6e5b834bbe896a2e3deefb689b9d515916399;p=ceph.git mgr/dashboard: Simplified silence-form matchers list This commit removes unmeaning icons on the matchers-list component, and now only displays the information/content needed when viewing and editing matchers. Fixes: https://tracker.ceph.com/issues/42306 Signed-off-by: Bryan Montalvan (cherry picked from commit fcb47be5eedb5d7d1dd8504a76124093dbd5b702) --- diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-form/silence-form.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-form/silence-form.component.html index 02f04a06a4bc..0cfbf0823509 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-form/silence-form.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-form/silence-form.component.html @@ -5,8 +5,10 @@
- + ~ + =
@@ -18,18 +20,6 @@ disabled readonly>
- - -
-
- -
-
-
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-form/silence-form.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-form/silence-form.component.spec.ts index 481413e4a63e..b4d8a86526dc 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-form/silence-form.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-form/silence-form.component.spec.ts @@ -402,13 +402,7 @@ describe('SilenceFormComponent', () => { it('should show added matcher', () => { addMatcher('job', 'someJob', true); fixtureH.expectIdElementsVisible( - [ - 'matcher-name-0', - 'matcher-value-0', - 'matcher-isRegex-0', - 'matcher-edit-0', - 'matcher-delete-0' - ], + ['matcher-name-0', 'matcher-value-0', 'matcher-edit-0', 'matcher-delete-0'], true ); expectMatch(null); @@ -421,12 +415,10 @@ describe('SilenceFormComponent', () => { [ 'matcher-name-0', 'matcher-value-0', - 'matcher-isRegex-0', 'matcher-edit-0', 'matcher-delete-0', 'matcher-name-1', 'matcher-value-1', - 'matcher-isRegex-1', 'matcher-edit-1', 'matcher-delete-1' ], @@ -441,8 +433,6 @@ describe('SilenceFormComponent', () => { fixture.detectChanges(); fixtureH.expectFormFieldToBe('#matcher-name-0', 'alertname'); fixtureH.expectFormFieldToBe('#matcher-value-0', 'alert.*'); - fixtureH.expectFormFieldToBe('#matcher-isRegex-0', 'true'); - fixtureH.expectFormFieldToBe('#matcher-isRegex-1', 'false'); expectMatch(null); }); @@ -465,7 +455,6 @@ describe('SilenceFormComponent', () => { fixtureH.expectFormFieldToBe('#matcher-name-0', 'alertname'); fixtureH.expectFormFieldToBe('#matcher-value-0', 'alert0'); - fixtureH.expectFormFieldToBe('#matcher-isRegex-0', 'false'); expectMatch('Matches 1 rule with 1 active alert.'); }); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-form/silence-form.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-form/silence-form.component.ts index 027485301e42..958039a31dc7 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-form/silence-form.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-form/silence-form.component.ts @@ -52,18 +52,15 @@ export class SilenceFormComponent { matcherConfig = [ { tooltip: $localize`Attribute name`, - icon: this.icons.paragraph, attribute: 'name' }, - { - tooltip: $localize`Value`, - icon: this.icons.terminal, - attribute: 'value' - }, { tooltip: $localize`Regular expression`, - icon: this.icons.magic, attribute: 'isRegex' + }, + { + tooltip: $localize`Value`, + attribute: 'value' } ];