Skip to content

Commit

Permalink
Fleet UI: Fix policy truncation and add tooltip (#24659)
Browse files Browse the repository at this point in the history
  • Loading branch information
RachelElysia authored Dec 12, 2024
1 parent 4dd152c commit 95ae7c3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
1 change: 1 addition & 0 deletions changes/24334-policy-truncation
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fix policy truncation UI bug
1 change: 0 additions & 1 deletion frontend/components/buttons/Button/_styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ $base-class: "button";
border: 0;
position: relative;
cursor: pointer;
min-width: max-content;

&:focus {
outline: none;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import Button from "components/buttons/Button";
import HeaderCell from "components/TableContainer/DataTable/HeaderCell";
import ViewAllHostsLink from "components/ViewAllHostsLink";
import { IndicatorStatus } from "components/StatusIndicatorWithIcon/StatusIndicatorWithIcon";
import TooltipTruncatedText from "components/TooltipTruncatedText";

interface IHeaderProps {
column: {
Expand Down Expand Up @@ -82,7 +83,7 @@ const generatePolicyTableHeaders = (
onClick={onClickPolicyName}
variant="text-icon"
>
<span className={`policy-info-text`}>{name}</span>
<TooltipTruncatedText value={name} />
</Button>
);
},
Expand Down
10 changes: 4 additions & 6 deletions frontend/pages/hosts/details/cards/Policies/_styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
tr {
.name__cell {
max-width: 0; // sets ellipsis

.truncated-tooltip {
font-weight: $regular;
}
}

.policy-link {
Expand All @@ -39,12 +43,6 @@
width: 100%; // sets ellipsis
justify-content: left;

.policy-info-text {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}

&::after {
content: url("../assets/images/icon-arrow-right-vibrant-blue-10x18@2x.png");
transform: scale(0.5);
Expand Down

0 comments on commit 95ae7c3

Please sign in to comment.