Skip to content

Commit 4dc0e59

Browse files
committed
Fix tooltip
1 parent 27b6382 commit 4dc0e59

File tree

4 files changed

+16
-8
lines changed

4 files changed

+16
-8
lines changed

src/main/frontend/common/components/tooltip.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ declare global {
99
/**
1010
* Provides a bridge between React and the Jenkins' tooltip component
1111
*/
12-
export default function Tooltip({ text, children, properties = {} }: TooltipProps) {
12+
export default function Tooltip({
13+
text,
14+
children,
15+
properties = {},
16+
}: TooltipProps) {
1317
const ref = useRef<HTMLDivElement>(null);
1418

1519
useEffect(() => {
@@ -28,7 +32,7 @@ export default function Tooltip({ text, children, properties = {} }: TooltipProp
2832
}
2933

3034
interface TooltipProps {
31-
text: string;
35+
text?: string;
3236
children: React.ReactNode;
3337
properties?: React.HTMLProps<HTMLDivElement>;
3438
}

src/main/frontend/multi-pipeline-graph-view/multi-pipeline-graph/main/single-run.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55

66
// This is hacky - the pipeline graph is too tall and isn't centered
77
.PWGx-PipelineGraph-container {
8-
height: 28px;
8+
height: 36px;
99

1010
& > div {
11-
margin-top: -40px;
11+
margin-top: -36px;
1212
}
1313
}
1414

src/main/frontend/pipeline-graph-view/pipeline-graph/main/PipelineGraph.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ export function PipelineGraph(props: Props) {
141141
</svg>
142142

143143
{nodes.map((node) => (
144-
<Node key={node.id} node={node} />
144+
<Node key={node.id} node={node} collapsed={collapsed} />
145145
))}
146146

147147
{bigLabels.map((label) => (

src/main/frontend/pipeline-graph-view/pipeline-graph/main/support/nodes.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@ type SVGChildren = Array<any>; // Fixme: Maybe refine this? Not sure what should
1616

1717
interface NodeProps {
1818
node: NodeInfo;
19+
collapsed?: boolean;
1920
}
21+
2022
/**
2123
* Generate the SVG elements to represent a node.
2224
*/
23-
export function Node({ node }: NodeProps) {
25+
export function Node({ node, collapsed }: NodeProps) {
2426
const key = node.key;
2527
const groupChildren: SVGChildren = [];
2628

@@ -72,8 +74,9 @@ export function Node({ node }: NodeProps) {
7274

7375
return (
7476
<Tooltip
75-
text={`${node.stage.name}: ${node.stage.state}`}
76-
properties={groupProps}>
77+
text={collapsed ? node.stage.name : undefined}
78+
properties={groupProps}
79+
>
7780
{groupChildren}
7881
{clickable && (
7982
<a href={document.head.dataset.rooturl + url}>
@@ -89,6 +92,7 @@ interface SelectionHighlightProps {
8992
nodeColumns: Array<NodeColumn>;
9093
isStageSelected: (stage: StageInfo) => boolean;
9194
}
95+
9296
/**
9397
* Generates SVG for visual highlight to show which node is selected.
9498
*/

0 commit comments

Comments
 (0)