Skip to content

Commit

Permalink
fix: unable to view all the workflow versions
Browse files Browse the repository at this point in the history
Signed-off-by: Carina Ursu <[email protected]>
  • Loading branch information
ursucarina committed May 2, 2022
1 parent 2ccabe3 commit 73eb0aa
Showing 1 changed file with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ export const buildReactFlowDataProps = (props: BuildDataProps) => {
currentNestedView,
} = props;

const taskType = node.value?.template ? node.value.template.type : null;
const displayName = node.name;
const { value: nodeValue, name: displayName, scopedId, type: nodeType } = node || {};
const taskType = nodeValue?.template?.type ?? null;

const mapNodeExecutionStatus = () => {
if (nodeExecutionsById) {
if (nodeExecutionsById[node.scopedId]) {
return nodeExecutionsById[node.scopedId].closure.phase as NodeExecutionPhase;
if (nodeExecutionsById?.[scopedId]) {
return nodeExecutionsById[scopedId].closure.phase as NodeExecutionPhase;
} else {
return NodeExecutionPhase.SKIPPED;
}
Expand All @@ -78,33 +78,33 @@ export const buildReactFlowDataProps = (props: BuildDataProps) => {
const nodeExecutionStatus = mapNodeExecutionStatus();

const cacheStatus: CatalogCacheStatus =
nodeExecutionsById[node.scopedId]?.closure.taskNodeMetadata?.cacheStatus ??
nodeExecutionsById?.[scopedId]?.closure?.taskNodeMetadata?.cacheStatus ??
CatalogCacheStatus.CACHE_DISABLED;

const dataProps = {
nodeExecutionStatus,
text: displayName,
handles: [],
nodeType: node.type,
scopedId: node.scopedId,
nodeType,
scopedId,
taskType,
cacheStatus,
onNodeSelectionChanged: () => {
if (onNodeSelectionChanged) {
onNodeSelectionChanged([node.scopedId]);
onNodeSelectionChanged([scopedId]);
}
},
onAddNestedView: () => {
onAddNestedView({
parent: rootParentNode.scopedId,
view: node.scopedId,
parent: rootParentNode?.scopedId,
view: scopedId,
});
},
onRemoveNestedView,
};

for (const rootParentId in currentNestedView) {
if (node.scopedId === rootParentId) {
if (scopedId === rootParentId) {
dataProps['currentNestedView'] = currentNestedView[rootParentId];
}
}
Expand Down

0 comments on commit 73eb0aa

Please sign in to comment.