mirror of
https://github.com/fleetdm/fleet
synced 2026-05-05 22:39:17 +00:00
Fix long label trunctaion on the host details page (#33451)
## For #27876  - [x] Changes file added for user-visible changes in `changes/` - [x] QA'd all new/changed functionality manually --------- Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
This commit is contained in:
parent
54226dad63
commit
05f586a86a
3 changed files with 20 additions and 3 deletions
1
changes/27876-host-details-labels
Normal file
1
changes/27876-host-details-labels
Normal file
|
|
@ -0,0 +1 @@
|
|||
- Elegantly handle host details page label pills for labels with very long names
|
||||
|
|
@ -7,6 +7,7 @@ import classnames from "classnames";
|
|||
import Card from "components/Card";
|
||||
import CardHeader from "components/CardHeader";
|
||||
import { LABEL_DISPLAY_MAP } from "utilities/constants";
|
||||
import TooltipTruncatedText from "components/TooltipTruncatedText";
|
||||
|
||||
const baseClass = "labels-card";
|
||||
|
||||
|
|
@ -31,9 +32,15 @@ const Labels = ({
|
|||
variant="pill"
|
||||
className="list__button"
|
||||
>
|
||||
{label.label_type === "builtin" && label.name in LABEL_DISPLAY_MAP
|
||||
? LABEL_DISPLAY_MAP[label.name as keyof typeof LABEL_DISPLAY_MAP]
|
||||
: label.name}
|
||||
<TooltipTruncatedText
|
||||
value={
|
||||
label.label_type === "builtin" && label.name in LABEL_DISPLAY_MAP
|
||||
? LABEL_DISPLAY_MAP[
|
||||
label.name as keyof typeof LABEL_DISPLAY_MAP
|
||||
]
|
||||
: label.name
|
||||
}
|
||||
/>
|
||||
</Button>
|
||||
</li>
|
||||
);
|
||||
|
|
|
|||
9
frontend/pages/hosts/details/cards/Labels/_styles.scss
Normal file
9
frontend/pages/hosts/details/cards/Labels/_styles.scss
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
.labels-card {
|
||||
.button,
|
||||
.children-wrapper {
|
||||
max-width: 100%;
|
||||
.__react_component_tooltip {
|
||||
font-weight: $regular;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue