From a85f3810aa072aae80b4b12139f525640b8e6c38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?= Date: Tue, 16 Oct 2018 18:43:16 +0100 Subject: [PATCH] fix(ui): move ul to a dedicated div to prevent bottom border The way list-group-flush is styled any extra element on the ul level seems to be causing top/bottom borders to show up, move it under a dedicated div to prevent that from happening, with list-group-flush we want borders only between label set elements --- .../__snapshots__/index.test.js.snap | 78 +++++----- ui/src/Components/LabelSetList/index.js | 46 +++--- .../__snapshots__/index.test.js.snap | 144 +++++++++--------- 3 files changed, 137 insertions(+), 131 deletions(-) diff --git a/ui/src/Components/LabelSetList/__snapshots__/index.test.js.snap b/ui/src/Components/LabelSetList/__snapshots__/index.test.js.snap index ecb061e13..7f0088f71 100644 --- a/ui/src/Components/LabelSetList/__snapshots__/index.test.js.snap +++ b/ui/src/Components/LabelSetList/__snapshots__/index.test.js.snap @@ -6,48 +6,50 @@ exports[` matches snapshot with populated list 1`] = `

Affected alerts

- + " `; diff --git a/ui/src/Components/LabelSetList/index.js b/ui/src/Components/LabelSetList/index.js index 2dd272d3b..efb69ed22 100644 --- a/ui/src/Components/LabelSetList/index.js +++ b/ui/src/Components/LabelSetList/index.js @@ -61,28 +61,30 @@ const LabelSetList = observer( return labelsList.length > 0 ? (

Affected alerts

-
    - {labelsList - .slice( - (this.pagination.activePage - 1) * this.maxPerPage, - this.pagination.activePage * this.maxPerPage - ) - .map(labels => ( -
  • - {Object.entries(labels).map(([name, value]) => ( - - ))} -
  • - ))} -
+
+
    + {labelsList + .slice( + (this.pagination.activePage - 1) * this.maxPerPage, + this.pagination.activePage * this.maxPerPage + ) + .map(labels => ( +
  • + {Object.entries(labels).map(([name, value]) => ( + + ))} +
  • + ))} +
+
{labelsList.length > this.maxPerPage ? (
matches snapshot 1`] = `

Affected alerts

-
    -
  • - - - alertname: +
    +
      +
    • + + + alertname: + + + foo + - - foo + + + job: + + + foo + - - - - job: + + + instance: + + + foo1 + - - foo +
    • +
    • + + + alertname: + + + bar + - - - - instance: + + + job: + + + bar + - - foo1 + + + instance: + + + bar1 + - -
    • -
    • - - - alertname: +
    • +
    • + + + alertname: + + + bar + - - bar + + + job: + + + bar + - - - - job: + + + instance: + + + bar2 + - - bar - - - - - instance: - - - bar1 - - -
    • -
    • - - - alertname: - - - bar - - - - - job: - - - bar - - - - - instance: - - - bar2 - - -
    • -
    +
  • +
+
"