Skip to content

Commit

Permalink
[RHOAIENG-8124]: show pipeline group label on hover at low scale
Browse files Browse the repository at this point in the history
fix(pipelineDefaultTaskGroup): format

fix(pipelineDefaultTaskGroup): remove unused declarations
  • Loading branch information
Gkrumbach07 authored and jenny-s51 committed Jun 21, 2024
1 parent 8808e8d commit 31ed32e
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 50 deletions.
49 changes: 21 additions & 28 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"@patternfly/react-styles": "^5.2.1",
"@patternfly/react-table": "^5.2.1",
"@patternfly/react-tokens": "^5.2.1",
"@patternfly/react-topology": "^5.4.0-prerelease.6",
"@patternfly/react-topology": "^5.4.0-prerelease.9",
"@patternfly/react-virtualized-extension": "^5.0.0",
"@types/classnames": "^2.3.1",
"axios": "^1.6.4",
Expand Down
37 changes: 16 additions & 21 deletions frontend/src/concepts/topology/PipelineDefaultTaskGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ import {
Node,
GraphElement,
RunStatus,
DEFAULT_LAYER,
Layer,
ScaleDetailsLevel,
TOP_LAYER,
NodeModel,
useHover,
PipelineNodeModel,
Expand Down Expand Up @@ -65,7 +62,7 @@ const DefaultTaskGroupInner: React.FunctionComponent<PipelinesDefaultGroupInnerP
hideDetailsAtMedium
showStatusState
scaleNode={hover && detailsLevel !== ScaleDetailsLevel.high}
showLabel={detailsLevel === ScaleDetailsLevel.high}
showLabelOnHover
status={element.getData()?.runStatus}
hiddenDetailsShownStatuses={[
RunStatus.Succeeded,
Expand All @@ -79,23 +76,21 @@ const DefaultTaskGroupInner: React.FunctionComponent<PipelinesDefaultGroupInnerP
);

return (
<Layer id={detailsLevel !== ScaleDetailsLevel.high && hover ? TOP_LAYER : DEFAULT_LAYER}>
<g ref={hoverRef}>
{element.isCollapsed() ? (
<Popover
triggerRef={popoverRef}
triggerAction="hover"
aria-label="Hoverable popover"
headerContent={element.getLabel()}
bodyContent={getPopoverTasksList(element.getAllNodeChildren())}
>
<g ref={popoverRef}>{groupNode}</g>
</Popover>
) : (
groupNode
)}
</g>
</Layer>
<g ref={hoverRef}>
{element.isCollapsed() ? (
<Popover
triggerRef={popoverRef}
triggerAction="hover"
aria-label="Hoverable popover"
headerContent={element.getLabel()}
bodyContent={getPopoverTasksList(element.getAllNodeChildren())}
>
<g ref={popoverRef}>{groupNode}</g>
</Popover>
) : (
groupNode
)}
</g>
);
},
);
Expand Down

0 comments on commit 31ed32e

Please sign in to comment.