diff --git a/ui/src/Components/Grid/AlertGrid/AlertGroup/Alert/AlertMenu.js b/ui/src/Components/Grid/AlertGrid/AlertGroup/Alert/AlertMenu.js index aaff3bad1..f4d5ec76a 100644 --- a/ui/src/Components/Grid/AlertGrid/AlertGroup/Alert/AlertMenu.js +++ b/ui/src/Components/Grid/AlertGrid/AlertGroup/Alert/AlertMenu.js @@ -128,7 +128,7 @@ const AlertMenu = observer( {({ ref }) => ( matches snapshot when inhibited 1`] = `
  • matches snapshot when inhibited 1`] = `
    matches snapshot when inhibited 1`] = `
    - matches snapshot when inhibited 1`] = `
    - + matches snapshot when inhibited 1`] = `
    - + job: @@ -119,12 +119,12 @@ exports[` matches snapshot when inhibited 1`] = `
    - + cluster: @@ -136,7 +136,7 @@ exports[` matches snapshot when inhibited 1`] = ` matches snapshot with showAlertmanagers=false showReceiver=fa
  • matches snapshot with showAlertmanagers=false showReceiver=fa
    matches snapshot with showAlertmanagers=false showReceiver=fa
    - matches snapshot with showAlertmanagers=false showReceiver=fa
    - + job: @@ -254,12 +254,12 @@ exports[` matches snapshot with showAlertmanagers=false showReceiver=fa
    - + cluster: @@ -271,7 +271,7 @@ exports[` matches snapshot with showAlertmanagers=false showReceiver=fa am.inhibitedBy.length) .reduce((sum, x) => sum + x) > 0 ? ( - + diff --git a/ui/src/Components/Grid/AlertGrid/AlertGroup/Annotation/__snapshots__/index.test.js.snap b/ui/src/Components/Grid/AlertGrid/AlertGroup/Annotation/__snapshots__/index.test.js.snap index 8890c9586..4337bd638 100644 --- a/ui/src/Components/Grid/AlertGrid/AlertGroup/Annotation/__snapshots__/index.test.js.snap +++ b/ui/src/Components/Grid/AlertGrid/AlertGroup/Annotation/__snapshots__/index.test.js.snap @@ -5,7 +5,7 @@ exports[` matches snapshot 1`] = ` matches snapshot when visible=false 1`] = ` "
    matches snapshot when visible=true 1`] = ` "
    { href={value} target="_blank" rel="noopener noreferrer" - className="components-label-with-hover text-nowrap text-truncate badge mr-1 components-grid-annotation-link" + className="components-label components-label-with-hover badge mr-1 components-grid-annotation-link" > {name} 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 abb327e54..2c3349bf1 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 @@ -5,7 +5,7 @@ exports[` matches snapshot 1`] = `
    - + label1: @@ -74,12 +74,12 @@ exports[` matches snapshot 1`] = `
    - + label2: @@ -89,12 +89,12 @@ exports[` matches snapshot 1`] = `
    - + @alertmanager: @@ -104,12 +104,12 @@ exports[` matches snapshot 1`] = `
    - + @receiver: @@ -121,7 +121,7 @@ exports[` matches snapshot 1`] = ` mathes snapshot when silence is rendered 1`] = `
    - + label1: @@ -217,12 +217,12 @@ exports[` mathes snapshot when silence is rendered 1`] = `
    - + label2: @@ -232,12 +232,12 @@ exports[` mathes snapshot when silence is rendered 1`] = `
    - + @alertmanager: @@ -247,12 +247,12 @@ exports[` mathes snapshot when silence is rendered 1`] = `
    - + @receiver: @@ -264,7 +264,7 @@ exports[` mathes snapshot when silence is rendered 1`] = ` mathes snapshot when silence is rendered 1`] = `
    mathes snapshot when silence is rendered 1`] = ` me@example.com - + Expired
    matches snapshot when data is present in alertStore 1`] = ` me@example.com - + Expires
    matches snapshot with expaned details 1`] = `
    - + matches snapshot with expaned details 1`] = ` 5 hours ago - + matches snapshot with expaned details 1`] = ` in 5 hours - + matches snapshot with expaned details 1`] = ` Edit - + matches snapshot with expaned details 1`] = `
    - + matches snapshot with expaned details 1`] = ` Matchers: - + alertname=MockAlert - + instance=~foo[0-9]+
    diff --git a/ui/src/Components/Grid/AlertGrid/AlertGroup/Silence/index.js b/ui/src/Components/Grid/AlertGrid/AlertGroup/Silence/index.js index 76ed0f478..9b67c9cd7 100644 --- a/ui/src/Components/Grid/AlertGrid/AlertGroup/Silence/index.js +++ b/ui/src/Components/Grid/AlertGrid/AlertGroup/Silence/index.js @@ -64,7 +64,7 @@ const SilenceExpiryBadgeWithProgress = ({ silence, progress }) => { // if silence is expired we can skip progress value calculation if (moment(silence.endsAt) < moment()) { return ( - + Expired {silence.endsAt} ); @@ -80,7 +80,7 @@ const SilenceExpiryBadgeWithProgress = ({ silence, progress }) => { } return ( - + Expires {silence.endsAt}
    - + Started {silence.startsAt} - + {expiresLabel} {silence.endsAt} @@ -150,15 +148,12 @@ const SilenceDetails = ({ />
    - + Matchers: {silence.matchers.map(matcher => ( - + {matcher.name} {matcher.isRegex ? QueryOperators.Regex : QueryOperators.Equal} {matcher.value} diff --git a/ui/src/Components/LabelSetList/__snapshots__/index.test.js.snap b/ui/src/Components/LabelSetList/__snapshots__/index.test.js.snap index bce2c5f61..9304cfe5c 100644 --- a/ui/src/Components/LabelSetList/__snapshots__/index.test.js.snap +++ b/ui/src/Components/LabelSetList/__snapshots__/index.test.js.snap @@ -9,7 +9,7 @@ exports[` matches snapshot with populated list 1`] = `
    • - + foo: @@ -19,7 +19,7 @@ exports[` matches snapshot with populated list 1`] = `
    • - + job: @@ -29,7 +29,7 @@ exports[` matches snapshot with populated list 1`] = `
    • - + instance: @@ -39,7 +39,7 @@ exports[` matches snapshot with populated list 1`] = `
    • - + cluster: diff --git a/ui/src/Components/Labels/BaseLabel/index.js b/ui/src/Components/Labels/BaseLabel/index.js index 7b6f024a4..a7e184388 100644 --- a/ui/src/Components/Labels/BaseLabel/index.js +++ b/ui/src/Components/Labels/BaseLabel/index.js @@ -30,13 +30,7 @@ class BaseLabel extends Component { const data = { style: {}, className: "", - baseClassNames: [ - "components-label", - elementType, - "text-nowrap", - "text-truncate", - "mw-100" - ], + baseClassNames: ["components-label", elementType], colorClassNames: [] }; diff --git a/ui/src/Components/Labels/BaseLabel/index.scss b/ui/src/Components/Labels/BaseLabel/index.scss index 996c6cd2c..2a087be75 100644 --- a/ui/src/Components/Labels/BaseLabel/index.scss +++ b/ui/src/Components/Labels/BaseLabel/index.scss @@ -8,6 +8,21 @@ .components-label { margin-right: 0.25rem; + + overflow: hidden; + max-width: 100%; + text-overflow: ellipsis; + white-space: nowrap; + /* https://stackoverflow.com/a/20566810 */ + vertical-align: bottom !important; + + margin-top: 2px; + margin-bottom: 2px; +} + +span.badge.components-label:not(.badge-pill) { + /* badge class uses em and we modify font sizes a bit, so switch to rem */ + padding: 0.25rem 0.4rem; } .components-label-bright { diff --git a/ui/src/Components/Labels/FilterInputLabel/index.js b/ui/src/Components/Labels/FilterInputLabel/index.js index b0df1c167..d282d9f9e 100644 --- a/ui/src/Components/Labels/FilterInputLabel/index.js +++ b/ui/src/Components/Labels/FilterInputLabel/index.js @@ -88,7 +88,7 @@ const FilterInputLabel = observer( )} span { + display: inline-block; + overflow: hidden; + text-overflow: ellipsis; + vertical-align: bottom; + max-width: 100%; + } } .components-filteredinputlabel > .badge, diff --git a/ui/src/Components/Labels/FilteringLabel/__snapshots__/index.test.js.snap b/ui/src/Components/Labels/FilteringLabel/__snapshots__/index.test.js.snap index 4e122333f..411ee21af 100644 --- a/ui/src/Components/Labels/FilteringLabel/__snapshots__/index.test.js.snap +++ b/ui/src/Components/Labels/FilteringLabel/__snapshots__/index.test.js.snap @@ -3,12 +3,12 @@ exports[` matches snapshot 1`] = ` "
      - + foo: diff --git a/ui/src/Components/Labels/HistoryLabel/index.css b/ui/src/Components/Labels/HistoryLabel/index.css index 0e258c6bb..c1c720ec2 100644 --- a/ui/src/Components/Labels/HistoryLabel/index.css +++ b/ui/src/Components/Labels/HistoryLabel/index.css @@ -1,4 +1,3 @@ -.badge.components-label-history { - /* fix align after text-truncate */ - vertical-align: middle; +.components-label.components-label-history { + font-size: 80%; } diff --git a/ui/src/Components/Labels/StaticLabel/__snapshots__/index.test.js.snap b/ui/src/Components/Labels/StaticLabel/__snapshots__/index.test.js.snap index fa79adad8..b9be407da 100644 --- a/ui/src/Components/Labels/StaticLabel/__snapshots__/index.test.js.snap +++ b/ui/src/Components/Labels/StaticLabel/__snapshots__/index.test.js.snap @@ -2,7 +2,7 @@ exports[` matches snapshot 1`] = ` " - + foo: diff --git a/ui/src/Components/NavBar/FilterInput/index.css b/ui/src/Components/NavBar/FilterInput/index.css index f2960e29c..5900cb574 100644 --- a/ui/src/Components/NavBar/FilterInput/index.css +++ b/ui/src/Components/NavBar/FilterInput/index.css @@ -1,9 +1,10 @@ .form-control.components-filterinput { cursor: text; height: auto; + min-height: 2.6rem; - padding-top: 0.125rem; - padding-bottom: 0.125rem; + padding-top: 2px; + padding-bottom: 2px; padding-left: 0.25rem; padding-right: 0.25rem; } @@ -17,6 +18,8 @@ input.components-filterinput-wrapper { vertical-align: middle; } -.autosuggest { +.components-filterinput-wrapper { min-height: 2rem; + margin-top: 2px; + margin-bottom: 2px; } diff --git a/ui/src/Components/SilenceModal/SilenceMatch/__snapshots__/LabelValueInput.test.js.snap b/ui/src/Components/SilenceModal/SilenceMatch/__snapshots__/LabelValueInput.test.js.snap index 550c753e5..73d0f4bb0 100644 --- a/ui/src/Components/SilenceModal/SilenceMatch/__snapshots__/LabelValueInput.test.js.snap +++ b/ui/src/Components/SilenceModal/SilenceMatch/__snapshots__/LabelValueInput.test.js.snap @@ -7,7 +7,7 @@ exports[` matches snapshot 1`] = `
      matches snapshot with empty matcher 1`] = ` "
      matches snapshot 1`] = `
      • - + alertname: @@ -18,7 +18,7 @@ exports[` matches snapshot 1`] = ` foo - + job: @@ -26,7 +26,7 @@ exports[` matches snapshot 1`] = ` foo - + instance: @@ -36,7 +36,7 @@ exports[` matches snapshot 1`] = `
      • - + alertname: @@ -44,7 +44,7 @@ exports[` matches snapshot 1`] = ` bar - + job: @@ -52,7 +52,7 @@ exports[` matches snapshot 1`] = ` bar - + instance: @@ -62,7 +62,7 @@ exports[` matches snapshot 1`] = `
      • - + alertname: @@ -70,7 +70,7 @@ exports[` matches snapshot 1`] = ` bar - + job: @@ -78,7 +78,7 @@ exports[` matches snapshot 1`] = ` bar - + instance: diff --git a/ui/src/Components/TooltipWrapper/index.js b/ui/src/Components/TooltipWrapper/index.js index 590143a4c..5f735f209 100644 --- a/ui/src/Components/TooltipWrapper/index.js +++ b/ui/src/Components/TooltipWrapper/index.js @@ -6,7 +6,13 @@ import { Tooltip } from "react-tippy"; import "react-tippy/dist/tippy.css"; const TooltipWrapper = ({ children, ...props }) => ( - + {children} );