Skip to content

Commit

Permalink
Merge pull request #2897 from dpanshug/cache-node
Browse files Browse the repository at this point in the history
Changing cache node color to green
  • Loading branch information
openshift-merge-bot[bot] authored Jun 12, 2024
2 parents ba94286 + 93adbd1 commit e1210fb
Showing 1 changed file with 16 additions and 1 deletion.
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 e1210fb

Please sign in to comment.