From e8d5715e04fcfcc7012425e5b40507da1681cd35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?= Date: Mon, 25 Mar 2019 21:24:55 -0700 Subject: [PATCH 1/4] fix(ui): use flex for ordering filter elements --- .../Labels/FilterInputLabel/index.css | 2 +- .../Labels/FilterInputLabel/index.js | 48 +++++++++---------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/ui/src/Components/Labels/FilterInputLabel/index.css b/ui/src/Components/Labels/FilterInputLabel/index.css index 3de3f2cad..97fcc246d 100644 --- a/ui/src/Components/Labels/FilterInputLabel/index.css +++ b/ui/src/Components/Labels/FilterInputLabel/index.css @@ -22,5 +22,5 @@ .badge.components-filteredinputlabel > .close { /* make close button bigger, to match font size of the badge */ - font-size: 1rem; + font-size: 100%; } diff --git a/ui/src/Components/Labels/FilterInputLabel/index.js b/ui/src/Components/Labels/FilterInputLabel/index.js index 9f225b40d..db41f6050 100644 --- a/ui/src/Components/Labels/FilterInputLabel/index.js +++ b/ui/src/Components/Labels/FilterInputLabel/index.js @@ -56,32 +56,18 @@ const FilterInputLabel = observer( f => f.hits !== alertStore.info.totalAlerts ).length > 0; + const rootClasses = filter.applied + ? cs.className + : [ + "badge-secondary components-filteredinputlabel", + ...cs.baseClassNames + ].join(" "); + return ( - {filter.isValid ? ( filter.applied ? ( showCounter ? ( @@ -99,9 +85,9 @@ const FilterInputLabel = observer( )} - + + ); } From 7bd9cc641a061fadbe149107784a42b504d2982a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?= Date: Tue, 26 Mar 2019 21:32:48 -0700 Subject: [PATCH 2/4] fix(ui): cleanup filter input css classes --- ui/src/Components/Labels/FilterInputLabel/index.css | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ui/src/Components/Labels/FilterInputLabel/index.css b/ui/src/Components/Labels/FilterInputLabel/index.css index 97fcc246d..eb22f0467 100644 --- a/ui/src/Components/Labels/FilterInputLabel/index.css +++ b/ui/src/Components/Labels/FilterInputLabel/index.css @@ -11,9 +11,12 @@ margin-bottom: 1px; } -.badge.components-filteredinputlabel > .badge { +.badge.components-filteredinputlabel > .badge, +.badge.components-filteredinputlabel > svg { /* match outer badge font size */ font-size: 90%; + line-height: 100%; + padding-bottom: 0.1em; /* we have badge inside a badge, make the inner one a little brighter in case both use same color classes */ From d4032ea816e7e057a71ae748a7eb934ccecf7104 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?= Date: Tue, 26 Mar 2019 22:03:21 -0700 Subject: [PATCH 3/4] fix(ui): only set custom colors on filters that are applied --- ui/src/Components/Labels/FilterInputLabel/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/src/Components/Labels/FilterInputLabel/index.js b/ui/src/Components/Labels/FilterInputLabel/index.js index db41f6050..ab1f05a5a 100644 --- a/ui/src/Components/Labels/FilterInputLabel/index.js +++ b/ui/src/Components/Labels/FilterInputLabel/index.js @@ -66,7 +66,7 @@ const FilterInputLabel = observer( return ( {filter.isValid ? ( filter.applied ? ( @@ -98,7 +98,7 @@ const FilterInputLabel = observer(