Skip to content
Open
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
28 changes: 24 additions & 4 deletions dashboard/src/styles/detailPage.scss
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ pre.code-block .json-string {
flex-direction: column;
gap: 12px;
min-width: 280px;
flex: 0 0 auto;
flex: 1 1 0;
}

@media (max-width: 599px) {
Expand All @@ -216,6 +216,9 @@ pre.code-block .json-string {
background-color: #ffffff;
box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
min-height: 80px;
display: flex;
flex-direction: column;
overflow: hidden;
}

.relationship-card__header {
Expand Down Expand Up @@ -296,6 +299,7 @@ pre.code-block .json-string {
.relationship-card__content {
display: flex;
flex-direction: column;
min-width: 0;
}

.relationship-card__search {
Expand Down Expand Up @@ -330,15 +334,18 @@ pre.code-block .json-string {

.relationship-card__item {
font-size: 0.875rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
line-height: 1.5;
}

.relationship-card__link {
color: #2563eb;
text-decoration: none;
display: inline-block;
max-width: 100%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
vertical-align: middle;
}

.relationship-card__link:hover {
Expand All @@ -356,6 +363,12 @@ pre.code-block .json-string {

.relationship-card__text {
color: #334155;
display: inline-block;
max-width: 100%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
vertical-align: middle;
}

.relationship-card__empty {
Expand Down Expand Up @@ -572,3 +585,10 @@ pre.code-block .json-string {
cursor: pointer !important;
margin-left: 6px !important;
}

.relationship-node-link {
display: block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@ import { CloseIcon, LightTooltip } from "@components/muiComponents";
import { useAppSelector } from "@hooks/reducerHook";
import { Link as MUILink } from "@mui/material";

interface CustomLinkProps {
href: string;
status: string;
entityColor: string;
guid: string;
name: string;
typeName: string;
params: URLSearchParams | string;
}

const CustomLink = ({
href,
status,
Expand All @@ -56,20 +66,24 @@ const CustomLink = ({
name,
typeName,
params
}: any): any => {
}: CustomLinkProps): JSX.Element => {
const displayLabel = `${name} (${typeName})`;
return (
<li className={status}>
<MUILink
component={RouterLink}
to={{
pathname: href,
search: params.toString() ? params.toString() : ""
}}
style={{ color: entityColor }}
replace={true}
>
{name} ({typeName})
</MUILink>
<LightTooltip title={displayLabel}>
<MUILink
component={RouterLink}
to={{
pathname: href,
search: params.toString() ? params.toString() : ""
}}
className={`relationship-node-link ${entityColor === "#1976d2" ? "text-blue" : "text-red"}`}
replace={true}
underline="hover"
>
{displayLabel}
</MUILink>
</LightTooltip>
</li>
);
};
Expand Down Expand Up @@ -146,9 +160,9 @@ const RelationshipLineage = ({
selectedNodeColor = "#4a90e2";

var svg = d3
.select(svgElement)
.attr("viewBox", `${-padding} ${-padding} ${width + padding * 2} ${height + padding * 2}`)
.attr("enable-background", `new ${-padding} ${-padding} ${width + padding * 2} ${height + padding * 2}`),
.select(svgElement)
.attr("viewBox", `${-padding} ${-padding} ${width + padding * 2} ${height + padding * 2}`)
.attr("enable-background", `new ${-padding} ${-padding} ${width + padding * 2} ${height + padding * 2}`),
node,
path;

Expand Down Expand Up @@ -527,15 +541,18 @@ const RelationshipLineage = ({
? "deleted-relation"
: "";
}
const displayLabel = `${name} (${options.typeName})`;
return (
<li className={status}>
<MUILink
component={RouterLink}
to={`/detailPage/${options.guid}?tabActive=relationship`}
style={{ color: entityColor }}
>
{name} ({options.typeName})
</MUILink>
<LightTooltip title={displayLabel}>
<MUILink
component={RouterLink}
to={`/detailPage/${options.guid}?tabActive=relationship`}
className={`relationship-node-link ${entityColor === "#1976d2" ? "text-blue" : "text-red"}`}
>
{displayLabel}
</MUILink>
</LightTooltip>
</li>
);
};
Expand Down Expand Up @@ -617,7 +634,7 @@ const RelationshipLineage = ({
listString.push(<Fragment key={itemKey}>{getElement(data)}</Fragment>);
}
return (
<Stack sx={{ background: "white" }} minHeight={"150px"} maxWidth="520px">
<Stack sx={{ background: "white" }} minHeight={"150px"} maxWidth="350px">
{/* {listString?.length > 1 && ( */}
<Paper
variant="outlined"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1217,6 +1217,41 @@ describe('RelationshipLineage', () => {
});
});

describe('Tooltip Rendering', () => {
it('should render LightTooltip for relationship nodes in drawer', async () => {
render(
<TestWrapper>
<RelationshipLineage entity={mockEntityWithRelationships} />
</TestWrapper>
);

const mockNode = {
name: 'Process',
value: [
{
guid: 'proc-1',
typeName: 'Process',
displayText: 'Test Tooltip Name',
entityStatus: 'ACTIVE',
relationshipStatus: 'ACTIVE'
}
]
};

act(() => {
if (mockEnterSelection.clickHandler) {
mockEnterSelection.clickHandler(mockNode);
}
});

await waitFor(() => {
const tooltips = screen.getAllByTestId('light-tooltip');
const targetTooltip = tooltips.find(t => t.getAttribute('title') === 'Test Tooltip Name (Process)');
expect(targetTooltip).toBeInTheDocument();
}, { timeout: 3000 });
});
});

describe('Edge Cases', () => {
it('should handle entity without relationshipAttributes', () => {
const entityWithoutAttributes = {
Expand Down
7 changes: 7 additions & 0 deletions dashboardv2/public/css/scss/graph.scss
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@
margin-bottom: 5px;
text-align: left;

&.entity-list-item {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 100%;
}

&.deleted-relation {
.deleteBtn {
padding: 2px 8px !important;
Expand Down
26 changes: 23 additions & 3 deletions dashboardv2/public/css/scss/relationship.scss
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
flex-direction: column;
gap: 12px;
min-width: 280px;
flex: 0 0 auto;
flex: 1 1 0;
}

@media (max-width: 599px) {
Expand Down Expand Up @@ -220,6 +220,7 @@
flex-direction: column;
padding: 12px;
min-height: 0;
min-width: 0;
overflow: hidden;

.relationship-card-search {
Expand All @@ -241,6 +242,7 @@
overflow-y: auto;
overflow-x: hidden;
min-height: 0;
min-width: 0;
position: relative;

&::-webkit-scrollbar {
Expand All @@ -267,10 +269,14 @@
padding: 0;
margin: 0;
text-align: left;
width: 100%;
overflow: hidden;

.relationship-card-item {
padding: 8px 0;
border-bottom: 1px solid #f0f0f0;
width: 100%;
overflow: hidden;

&:last-child {
border-bottom: none;
Expand All @@ -290,7 +296,12 @@
font-size: 13px;
font-family: inherit;
line-height: 1.5;
word-break: break-word;
display: inline-block;
max-width: 100%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
vertical-align: middle;

&:hover {
text-decoration: underline;
Expand Down Expand Up @@ -547,4 +558,13 @@
50% {
background-position: -200% 0;
}
}
}
.entity-type-name {
&.active {
color: #1976d2;
}
&.deleted {
color: #BB5838;
}
}
.entity-type-name { &.active { color: #1976d2; } &.deleted { color: #BB5838; } }
4 changes: 3 additions & 1 deletion dashboardv2/public/css/scss/theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ header.atlas-header {
overflow: auto;
padding-top: 15px !important;
padding-bottom: 10px !important;
box-sizing: border-box;

&>div {
height: 100%;
Expand Down Expand Up @@ -536,7 +537,8 @@ hr[size="10"] {
}

.tooltip-inner {
max-width: none;
max-width: 300px;
word-break: break-all;
color: #2c2c2c;
background-color: #f9f9f9;
box-shadow: 0px 0px 3px 0px #8080806b;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -489,8 +489,8 @@ define([
var nameValue = item && item.attributes && item.attributes.name ? item.attributes.name : "";
var searchText = _.escape((displayText + " " + qualifiedName + " " + nameValue).toLowerCase());
return "<li class='relationship-card-item' data-search='" + searchText + "'>" +
(href ? "<a class='relationship-card-link" + deletedClass + "' href='" + href + "'>" + _.escape(displayLabel) + "</a>" :
"<span class='relationship-card-link" + deletedClass + "'>" + _.escape(displayLabel) + "</span>") +
(href ? "<a class='relationship-card-link" + deletedClass + "' href='" + href + "' title='" + _.escape(displayLabel) + "'>" + _.escape(displayLabel) + "</a>" :
"<span class='relationship-card-link" + deletedClass + "' title='" + _.escape(displayLabel) + "'>" + _.escape(displayLabel) + "</span>") +
"</li>";
}).join("");

Expand Down Expand Up @@ -693,6 +693,12 @@ define([
if (this.$el && this.$el.length) {
this.$el.html(html);
this.bindCardEvents();
if ($.fn.tooltip) {
this.$el.find('[title]').tooltip({
placement: 'bottom',
container: 'body'
});
}
} else {
console.warn("[RelationshipCardsLayoutView] $el not available, cannot render cards");
}
Expand Down
Loading
Loading