From 6b08fc88cc75ebbb38dcfafc827beb661ea74fae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?= Date: Sat, 6 Oct 2018 19:23:57 +0100 Subject: [PATCH] refactor(ui): drop alert count from silence preview This will be confusing since we deduplicate receivers, drop the count and more info --- .../__snapshots__/index.test.js.snap | 16 ++++++---------- .../SilenceModal/SilencePreview/index.js | 13 +++++++------ 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/ui/src/Components/SilenceModal/SilencePreview/__snapshots__/index.test.js.snap b/ui/src/Components/SilenceModal/SilencePreview/__snapshots__/index.test.js.snap index a70beda82..b325ca1d5 100644 --- a/ui/src/Components/SilenceModal/SilencePreview/__snapshots__/index.test.js.snap +++ b/ui/src/Components/SilenceModal/SilencePreview/__snapshots__/index.test.js.snap @@ -2,17 +2,13 @@ exports[` matches snapshot 1`] = ` " -
+

- This silence will match - - 3 - - alerts + Unique alert label sets (without receiver) matching this silence.

-
    -
  • +
      +
    • alertname: foo @@ -23,7 +19,7 @@ exports[` matches snapshot 1`] = ` instance: foo1
    • -
    • +
    • alertname: bar @@ -34,7 +30,7 @@ exports[` matches snapshot 1`] = ` instance: bar1
    • -
    • +
    • alertname: bar diff --git a/ui/src/Components/SilenceModal/SilencePreview/index.js b/ui/src/Components/SilenceModal/SilencePreview/index.js index ee83b4107..6f3144736 100644 --- a/ui/src/Components/SilenceModal/SilencePreview/index.js +++ b/ui/src/Components/SilenceModal/SilencePreview/index.js @@ -29,9 +29,9 @@ FetchError.propTypes = { }; const Preview = ({ alertStore, labelsList }) => ( -
        +
          {labelsList.map(labels => ( -
        • +
        • {Object.entries(labels).map(([name, value]) => ( -
          +
          {this.matchedAlerts.error !== null ? ( ) : (

          - This silence will match{" "} - {this.matchedAlerts.alertLabels.length} alert - {this.matchedAlerts.alertLabels.length > 1 ? "s" : ""} + Unique alert label sets (without receiver) matching this + silence.