Skip to content

Commit

Permalink
Dashboard shows cached pipeline steps in gray (no info about what it …
Browse files Browse the repository at this point in the history
…means)
  • Loading branch information
dpanshug committed Jun 12, 2024
1 parent 7725a1f commit 68f4f14
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ describe('pipeline topology parseUtils', () => {
{ state: RuntimeStateKF.SKIPPED, status: RunStatus.Skipped },
{ state: RuntimeStateKF.SUCCEEDED, status: RunStatus.Succeeded },
{ state: ExecutionStateKF.CANCELED, status: RunStatus.Cancelled },
{ state: ExecutionStateKF.CACHED, status: RunStatus.Skipped },
{ state: ExecutionStateKF.CACHED, status: RunStatus.Succeeded },
{ state: ExecutionStateKF.COMPLETE, status: RunStatus.Succeeded },
{ state: ExecutionStateKF.FAILED, status: RunStatus.Failed },
{ state: ExecutionStateKF.RUNNING, status: RunStatus.Running },
Expand Down
17 changes: 16 additions & 1 deletion frontend/src/concepts/topology/customNodes/StandardTaskNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ import {
WithContextMenuProps,
WithSelectionProps,
} from '@patternfly/react-topology';
import { AngleDoubleRightIcon } from '@patternfly/react-icons';
import { PipelineNodeModelExpanded } from '~/concepts/topology/types';
import { ExecutionStateKF } from '~/concepts/pipelines/kfTypes';

type StandardTaskNodeProps = {
element: GraphElement<PipelineNodeModelExpanded>;
Expand All @@ -29,6 +31,14 @@ const StandardTaskNode: React.FunctionComponent<StandardTaskNodeProps> = ({
const [hover, hoverRef] = useHover();
const detailsLevel = element.getGraph().getDetailsLevel();

// Set the cached node status to Succeeded
const getNodeStatus = () => {
if (data?.pipelineTask.status?.state === ExecutionStateKF.CACHED) {
return RunStatus.Succeeded;
}
return data?.runStatus;
};

const whenDecorator = data?.pipelineTask.whenStatus ? (
<WhenDecorator
element={element}
Expand All @@ -44,7 +54,12 @@ const StandardTaskNode: React.FunctionComponent<StandardTaskNodeProps> = ({
onSelect={onSelect}
selected={selected}
scaleNode={hover && detailsLevel !== ScaleDetailsLevel.high}
status={data?.runStatus}
status={getNodeStatus()}
customStatusIcon={
data?.pipelineTask.status?.state === ExecutionStateKF.CACHED ? (
<AngleDoubleRightIcon />
) : undefined
}
hideDetailsAtMedium
hiddenDetailsShownStatuses={[
RunStatus.Succeeded,
Expand Down

0 comments on commit 68f4f14

Please sign in to comment.