From f3572dba611e852bc61c7fc683186e626ebd4d40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?= Date: Sat, 26 Oct 2019 17:46:02 +0100 Subject: [PATCH] fix(ui): tweak silence display --- .../__snapshots__/index.test.js.snap | 68 ++++++--- .../ManagedSilence/SilenceComment.js | 21 ++- .../__snapshots__/SilenceComment.test.js.snap | 104 ++++++++++--- .../__snapshots__/index.test.js.snap | 142 +++++++++++------- ui/src/Components/ManagedSilence/index.js | 11 +- 5 files changed, 234 insertions(+), 112 deletions(-) diff --git a/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupFooter/__snapshots__/index.test.js.snap b/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupFooter/__snapshots__/index.test.js.snap index 4e1fbe5fc..0d6ef4eb1 100644 --- a/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupFooter/__snapshots__/index.test.js.snap +++ b/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupFooter/__snapshots__/index.test.js.snap @@ -287,34 +287,54 @@ exports[` mathes snapshot when silence is rendered 1`] = ` link
-
+
- - - - - Mocked Silence - - - … - - - - - me@example.com - - - Expired - - - +
+
+ + + + +
+
+ + + + + Mocked Silence + + + … + + + + + me@example.com + + + Expired + + + +
+
diff --git a/ui/src/Components/ManagedSilence/SilenceComment.js b/ui/src/Components/ManagedSilence/SilenceComment.js index fb3ca1f6c..a171c3b7e 100644 --- a/ui/src/Components/ManagedSilence/SilenceComment.js +++ b/ui/src/Components/ManagedSilence/SilenceComment.js @@ -5,14 +5,29 @@ import Truncate from "react-truncate"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faExternalLinkAlt } from "@fortawesome/free-solid-svg-icons/faExternalLinkAlt"; +import { faBellSlash } from "@fortawesome/free-solid-svg-icons/faBellSlash"; import { APISilence } from "Models/API"; +import { SilenceProgress } from "./SilenceProgress"; const SilenceComment = ({ silence, collapsed, afterUpdate }) => { const comment = ( - - {silence.comment} - +
+
+ +
+
+ + {silence.comment} + + + + {silence.createdBy} + + {collapsed ? : null} + +
+
); if (silence.jiraURL) { return ( diff --git a/ui/src/Components/ManagedSilence/__snapshots__/SilenceComment.test.js.snap b/ui/src/Components/ManagedSilence/__snapshots__/SilenceComment.test.js.snap index 16ef62d63..754ad97fc 100644 --- a/ui/src/Components/ManagedSilence/__snapshots__/SilenceComment.test.js.snap +++ b/ui/src/Components/ManagedSilence/__snapshots__/SilenceComment.test.js.snap @@ -2,34 +2,90 @@ exports[` Matches snapshot when collapsed 1`] = ` " - - - - - Mocked Silence - - - … - - +
+
+ + + + +
+
+ + + + + Mocked Silence + + + … + + + + + me@example.com + + + Expired + + + +
+
" `; exports[` Matches snapshot when expanded 1`] = ` " - - - - - Mocked Silence - - - … - - +
+
+ + + + +
+
+ + + + + Mocked Silence + + + … + + + + + me@example.com + + +
+
" `; diff --git a/ui/src/Components/ManagedSilence/__snapshots__/index.test.js.snap b/ui/src/Components/ManagedSilence/__snapshots__/index.test.js.snap index 916890ea0..ae8eda9f4 100644 --- a/ui/src/Components/ManagedSilence/__snapshots__/index.test.js.snap +++ b/ui/src/Components/ManagedSilence/__snapshots__/index.test.js.snap @@ -2,44 +2,64 @@ exports[` matches snapshot when collapsed 1`] = ` " -
+
- - - - - Mocked Silence - - - … - - - - - me@example.com - - - Expires - -
-
+
+ + -
-
- - + + +
+
+ + + + + Mocked Silence + + + … + + + + + me@example.com + + + Expires + +
+
+
+
+
+
+
+
@@ -66,28 +86,48 @@ exports[` matches snapshot when collapsed 1`] = ` exports[` matches snapshot with expaned details 1`] = ` " -
+
- - - - - Mocked Silence - - - … - - - - - me@example.com - - +
+
+ + + + +
+
+ + + + + Mocked Silence + + + … + + + + + me@example.com + + +
+
diff --git a/ui/src/Components/ManagedSilence/index.js b/ui/src/Components/ManagedSilence/index.js index 6560988db..4b1fbfcac 100644 --- a/ui/src/Components/ManagedSilence/index.js +++ b/ui/src/Components/ManagedSilence/index.js @@ -14,7 +14,6 @@ import { SilenceFormStore, SilenceTabNames } from "Stores/SilenceFormStore"; import { MountFade } from "Components/Animations/MountFade"; import { SilenceComment } from "./SilenceComment"; import { SilenceDetails } from "./SilenceDetails"; -import { SilenceProgress } from "./SilenceProgress"; import "./index.scss"; @@ -66,7 +65,7 @@ const ManagedSilence = observer( return ( -
+
@@ -75,14 +74,6 @@ const ManagedSilence = observer( silence={silence} collapsed={this.collapse.value} /> - - - {silence.createdBy} - - {this.collapse.value ? ( - - ) : null} -