Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Tooltip UI and truncate long file names in table in Local UI #320

Merged
merged 2 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pebblo/app/pebblo-ui/src/components/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ export function Tooltip(props) {
return /*html*/ `
<div class="tooltip">
<div class="tooltip-content">${children}</div>
<span class="tooltip-wrapper-${variant}"><span class="tooltip-title-${variant}">${title}</span></span></div>
<span class="tooltip-wrapper tooltip-wrapper-${variant}"><span class="tooltip-title-${variant}">${title}</span></span></div>
`;
}
8 changes: 5 additions & 3 deletions pebblo/app/pebblo-ui/src/constants/constant.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ export const FILES_WITH_FINDINGS_TABLE = [
</div>
`,
align: "start",
isTooltip: true,
tooltipTitle: (item) => item.fileName,
},
{
label: "Size",
Expand Down Expand Up @@ -165,9 +167,9 @@ export const FILES_WITH_FINDINGS_TABLE = [
fileName: item?.fileName,
id: item.id,
dialogTitle: `<div class="flex gap-4 items-center">
<div>Identities (${item?.authorizedIdentities?.length})</div>
<div class="font-12 surface-10-opacity-50">Document: ${item?.fileName}</div>
</div>`,
<div>Identities (${item?.authorizedIdentities?.length})</div>
<div class="font-12 surface-10-opacity-50 overflow-ellipsis w-400px overflow-hidden" title="${item.fileName}">Document: ${item?.fileName}</div>
</div>`,
}),
align: "start",
},
Expand Down
41 changes: 30 additions & 11 deletions pebblo/app/pebblo-ui/static/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ svg.icon-success {
.w-full {
width: 100%;
}
.w-half {
width: 50%;
}
.w-50 {
width: 200px;
}
Expand All @@ -116,6 +119,9 @@ svg.icon-success {
.w-10 {
width: 100px;
}
.w-400px {
width: 400px;
}
.w-auto {
width: auto;
}
Expand Down Expand Up @@ -262,6 +268,9 @@ svg.icon-success {
max-width: 0;
text-overflow: ellipsis;
}
.overflow-ellipsis {
text-overflow: ellipsis;
}

/* <----------- FLEX SHRINK -----------> */
.shrink-0 {
Expand Down Expand Up @@ -916,7 +925,7 @@ tbody {
td {
border-bottom: 0.5px solid rgba(25, 28, 46, 0.2);
position: relative;
z-index: 0;
/*z-index: 0;*/
}
td > #link {
text-decoration: none;
Expand Down Expand Up @@ -1098,6 +1107,13 @@ dialog::backdrop {

/* TOOLTIP */

.tooltip-wrapper {
word-break: break-all;
white-space: normal;
width: 90%;
z-index: 1;
}

.tooltip-content {
min-width: 100%;
width: 100%;
Expand All @@ -1110,14 +1126,18 @@ dialog::backdrop {
.tooltip-wrapper-bottom,
.tooltip-wrapper-left {
position: absolute;
visibility: hidden;
display: none;
}
.tooltip:hover .tooltip-wrapper-top {
visibility: visible;
top: -30px;
display: block;
top: 20px;
left: 0;
}

.tooltip:hover .tooltip-wrapper-bottom {
display: block;
}

.tooltip-title-top {
display: block;
position: relative;
Expand All @@ -1132,21 +1152,19 @@ dialog::backdrop {
.tooltip-title-top:after {
content: "";
position: absolute;
top: 100%;
top: -10px;
left: 50%;
margin-left: -5px;
border-width: 5px;
border-style: solid;
border-color: black transparent transparent transparent;
transform: rotate(180deg);
}

.tooltip:hover .tooltip-wrapper-bottom {
visibility: visible;
top: 0;
left: 0;
display: block;
height: fit-content;
width: 100%;
margin: auto;
width: fit-content;
bottom: 0;
}

Expand Down Expand Up @@ -1189,7 +1207,7 @@ dialog::backdrop {
z-index: 1;
top: 150%;
margin-left: -24px;
visibility: hidden;
display: none;
}

.copy-text-tooltip::after {
Expand Down Expand Up @@ -1234,6 +1252,7 @@ dialog::backdrop {
display: flex;
flex-direction: column;
gap: 4px;
position: relative;
}

.tooltip-heading {
Expand Down