-
- {renderExecutionsTimeline}
-
+ ;
diff --git a/packages/zapp/console/src/components/Executions/ExecutionDetails/test/Timeline.test.tsx b/packages/zapp/console/src/components/Executions/ExecutionDetails/test/Timeline.test.tsx
index d1e68dba2..f99d01f8d 100644
--- a/packages/zapp/console/src/components/Executions/ExecutionDetails/test/Timeline.test.tsx
+++ b/packages/zapp/console/src/components/Executions/ExecutionDetails/test/Timeline.test.tsx
@@ -1,5 +1,6 @@
import ThemeProvider from '@material-ui/styles/ThemeProvider';
import { render, waitFor } from '@testing-library/react';
+import { NodeExecutionsByIdContext } from 'components/Executions/contexts';
import { muiTheme } from 'components/Theme/muiTheme';
import { oneFailedTaskWorkflow } from 'mocks/data/fixtures/oneFailedTaskWorkflow';
import { insertFixture } from 'mocks/data/insertFixture';
@@ -16,6 +17,10 @@ jest.mock('../ExecutionWorkflowGraph.tsx', () => ({
ExecutionWorkflowGraph: () => null,
}));
+jest.mock('../Timeline/ExecutionTimeline.tsx', () => ({
+ ExecutionTimeline: () => null,
+}));
+
jest.mock('chart.js', () => ({
Chart: { register: () => null },
Tooltip: { positioners: { cursor: () => null } },
@@ -59,7 +64,9 @@ describe('ExecutionDetails > Timeline', () => {
render(
-
+
+
+
,
);
diff --git a/packages/zapp/console/src/components/Executions/Tables/nodeExecutionColumns.tsx b/packages/zapp/console/src/components/Executions/Tables/nodeExecutionColumns.tsx
index b2338437f..f674002b9 100644
--- a/packages/zapp/console/src/components/Executions/Tables/nodeExecutionColumns.tsx
+++ b/packages/zapp/console/src/components/Executions/Tables/nodeExecutionColumns.tsx
@@ -3,8 +3,7 @@ import { formatDateLocalTimezone, formatDateUTC, millisecondsToHMS } from 'commo
import { timestampToDate } from 'common/utils';
import { useCommonStyles } from 'components/common/styles';
import { isEqual } from 'lodash';
-import { CatalogCacheStatus, NodeExecutionPhase } from 'models/Execution/enums';
-import { TaskNodeMetadata } from 'models/Execution/types';
+import { NodeExecutionPhase } from 'models/Execution/enums';
import * as React from 'react';
import { useNodeExecutionContext } from '../contextProvider/NodeExecutionDetails';
import { ExecutionStatusBadge } from '../ExecutionStatusBadge';
@@ -107,15 +106,6 @@ const DisplayType: React.FC
= ({ execution }) =>
return {type};
};
-const hiddenCacheStatuses = [CatalogCacheStatus.CACHE_MISS, CatalogCacheStatus.CACHE_DISABLED];
-function hasCacheStatus(taskNodeMetadata?: TaskNodeMetadata): taskNodeMetadata is TaskNodeMetadata {
- if (!taskNodeMetadata) {
- return false;
- }
- const { cacheStatus } = taskNodeMetadata;
- return !hiddenCacheStatuses.includes(cacheStatus);
-}
-
export function generateColumns(
styles: ReturnType,
): NodeExecutionColumnDefinition[] {
diff --git a/packages/zapp/console/src/components/Executions/contexts.ts b/packages/zapp/console/src/components/Executions/contexts.ts
index 691d464ee..faeb47b6d 100644
--- a/packages/zapp/console/src/components/Executions/contexts.ts
+++ b/packages/zapp/console/src/components/Executions/contexts.ts
@@ -9,6 +9,7 @@ export interface ExecutionContextData {
export const ExecutionContext = React.createContext(
{} as ExecutionContextData,
);
-export const NodeExecutionsContext = React.createContext>({});
+
+export const NodeExecutionsByIdContext = React.createContext>({});
export const NodeExecutionsRequestConfigContext = React.createContext({});
diff --git a/packages/zapp/console/src/components/Executions/nodeExecutionQueries.ts b/packages/zapp/console/src/components/Executions/nodeExecutionQueries.ts
index f31766060..556832414 100644
--- a/packages/zapp/console/src/components/Executions/nodeExecutionQueries.ts
+++ b/packages/zapp/console/src/components/Executions/nodeExecutionQueries.ts
@@ -280,86 +280,6 @@ function fetchChildNodeExecutionGroups(
return fetchGroupsForTaskExecutionNode(queryClient, nodeExecution, config);
}
-/**
- * Query returns all children for a list of `nodeExecutions`
- * Will recursively gather all children for anyone that isParent()
- */
-async function fetchAllChildNodeExecutions(
- queryClient: QueryClient,
- nodeExecutions: NodeExecution[],
- config: RequestConfig,
-): Promise> {
- const executionGroups: Array = await Promise.all(
- nodeExecutions.map((exe) => fetchChildNodeExecutionGroups(queryClient, exe, config)),
- );
-
- /** Recursive check for nested/dynamic nodes */
- const childrenFromChildrenNodes: NodeExecution[] = [];
- executionGroups.map((group) =>
- group.map((attempt) => {
- attempt.nodeExecutions.map((execution) => {
- if (isParentNode(execution)) {
- childrenFromChildrenNodes.push(execution);
- }
- });
- }),
- );
-
- /** Request and concact data from children */
- if (childrenFromChildrenNodes.length > 0) {
- const childGroups = await fetchAllChildNodeExecutions(
- queryClient,
- childrenFromChildrenNodes,
- config,
- );
- for (const group in childGroups) {
- executionGroups.push(childGroups[group]);
- }
- }
- return executionGroups;
-}
-
-/**
- *
- * @param nodeExecutions list of parent node executionId's
- * @param config
- * @returns
- */
-export function useAllChildNodeExecutionGroupsQuery(
- nodeExecutions: NodeExecution[],
- config: RequestConfig,
-): QueryObserverResult, Error> {
- const queryClient = useQueryClient();
- const shouldEnableFn = (groups) => {
- if (groups.length > 0) {
- return groups.some((group) => {
- // non-empty groups are wrapped in array
- const unwrappedGroup = Array.isArray(group) ? group[0] : group;
- if (unwrappedGroup?.nodeExecutions?.length > 0) {
- /* Return true is any executions are not yet terminal (ie, they can change) */
- return unwrappedGroup.nodeExecutions.some((ne) => {
- return !nodeExecutionIsTerminal(ne);
- });
- } else {
- return false;
- }
- });
- } else {
- return false;
- }
- };
-
- const key = `${nodeExecutions?.[0]?.scopedId}-${nodeExecutions?.[0]?.closure?.phase}`;
-
- return useConditionalQuery>(
- {
- queryKey: [QueryType.NodeExecutionChildList, key, config],
- queryFn: () => fetchAllChildNodeExecutions(queryClient, nodeExecutions, config),
- },
- shouldEnableFn,
- );
-}
-
/** Fetches and groups `NodeExecution`s which are direct children of the given
* `NodeExecution`.
*/
@@ -438,15 +358,29 @@ export function useAllTreeNodeExecutionGroupsQuery(
): QueryObserverResult {
const queryClient = useQueryClient();
const shouldEnableFn = (groups) => {
- if (nodeExecutions.some((ne) => !nodeExecutionIsTerminal(ne))) {
- return true;
+ if (groups.length > 0) {
+ return groups.some((group) => {
+ // non-empty groups are wrapped in array
+ const unwrappedGroup = Array.isArray(group) ? group[0] : group;
+ if (unwrappedGroup?.nodeExecutions?.length > 0) {
+ /* Return true is any executions are not yet terminal (ie, they can change) */
+ return unwrappedGroup.nodeExecutions.some((ne) => {
+ return !nodeExecutionIsTerminal(ne);
+ });
+ } else {
+ return false;
+ }
+ });
+ } else {
+ return false;
}
- return groups.some((group) => !nodeExecutionIsTerminal(group));
};
+ const key = `${nodeExecutions?.[0]?.scopedId}-${nodeExecutions?.[0]?.closure?.phase}`;
+
return useConditionalQuery(
{
- queryKey: [QueryType.NodeExecutionTreeList, nodeExecutions[0]?.id, config],
+ queryKey: [QueryType.NodeExecutionTreeList, key, config],
queryFn: () => fetchAllTreeNodeExecutions(queryClient, nodeExecutions, config),
refetchInterval: executionRefreshIntervalMs,
},
diff --git a/packages/zapp/console/src/components/Launch/LaunchForm/MapInput.tsx b/packages/zapp/console/src/components/Launch/LaunchForm/MapInput.tsx
index 2458aa45e..8c83285b3 100644
--- a/packages/zapp/console/src/components/Launch/LaunchForm/MapInput.tsx
+++ b/packages/zapp/console/src/components/Launch/LaunchForm/MapInput.tsx
@@ -155,16 +155,16 @@ export const MapInput = (props: InputProps) => {
setData((data) => [...data, getNewMapItem(data.length)]);
};
- const updateUpperStream = () => {
+ const updateUpperStream = (newData: MapInputItem[]) => {
let newError = false;
- data.forEach((item) => {
+ newData.forEach((item) => {
if (item.id === null || !item.key?.length || !item.value?.length) newError = true;
else {
if (data.findIndex(({ key, id }) => id !== item.id && key === item.key) >= 0)
newError = true;
}
});
- const newPairs = data
+ const newPairs = newData
.filter((item) => {
// we filter out delted values and items with errors or empty keys/values
return item.id !== null && !!item.key && !!item.value;
@@ -182,32 +182,29 @@ export const MapInput = (props: InputProps) => {
const onSetKey = (id: number | null, key: string) => {
if (id === null) return;
- setData((data) => {
- data[id].key = key;
- return [...data];
- });
- updateUpperStream();
+ const newData = [...data];
+ newData[id].key = key;
+ setData([...newData]);
+ updateUpperStream([...newData]);
};
const onSetValue = (id: number | null, value: string) => {
if (id === null) return;
- setData((data) => {
- data[id].value = value;
- return [...data];
- });
- updateUpperStream();
+ const newData = [...data];
+ newData[id].value = value;
+ setData([...newData]);
+ updateUpperStream([...newData]);
};
const onDeleteItem = (id: number | null) => {
if (id === null) return;
- setData((data) => {
- const dataIndex = data.findIndex((item) => item.id === id);
- if (dataIndex >= 0 && dataIndex < data.length) {
- return [...data.splice(0, dataIndex), ...data.splice(dataIndex + 1)];
- }
- return [...data];
- });
- updateUpperStream();
+ const newData = [...data];
+ const dataIndex = newData.findIndex((item) => item.id === id);
+ if (dataIndex >= 0 && dataIndex < newData.length) {
+ newData[dataIndex].id = null;
+ }
+ setData([...newData]);
+ updateUpperStream([...newData]);
};
const isValid = (id: number | null, value: string) => {
diff --git a/packages/zapp/console/src/components/LaunchPlan/SearchableLaunchPlanNameList.tsx b/packages/zapp/console/src/components/LaunchPlan/SearchableLaunchPlanNameList.tsx
index e8b7137a5..b5e985e40 100644
--- a/packages/zapp/console/src/components/LaunchPlan/SearchableLaunchPlanNameList.tsx
+++ b/packages/zapp/console/src/components/LaunchPlan/SearchableLaunchPlanNameList.tsx
@@ -4,10 +4,11 @@ import { useNamedEntityListStyles } from 'components/common/SearchableNamedEntit
import { useCommonStyles } from 'components/common/styles';
import { separatorColor, primaryTextColor, launchPlanLabelColor } from 'components/Theme/constants';
import * as React from 'react';
+import { useState, useEffect } from 'react';
import { Link } from 'react-router-dom';
import { Routes } from 'routes/routes';
import { debounce } from 'lodash';
-import { Typography, FormGroup } from '@material-ui/core';
+import { FormGroup } from '@material-ui/core';
import { ResourceType } from 'models/Common/types';
import { MuiLaunchPlanIcon } from '@flyteconsole/ui-atoms';
import { LaunchPlanListStructureItem } from './types';
@@ -120,18 +121,22 @@ export const SearchableLaunchPlanNameList: React.FC {
const styles = useStyles();
- const [search, setSearch] = React.useState('');
+ const [search, setSearch] = useState('');
const { results, setSearchString } = useSearchableListState({
items: launchPlans,
propertyGetter: ({ id }) => id.name,
});
+ useEffect(() => {
+ const debouncedSearch = debounce(() => setSearchString(search), 1000);
+ debouncedSearch();
+ }, [search]);
+
const onSearchChange = (event: React.ChangeEvent) => {
const searchString = event.target.value;
setSearch(searchString);
- const debouncedSearch = debounce(() => setSearchString(searchString), 1000);
- debouncedSearch();
};
+
const onClear = () => setSearch('');
return (
diff --git a/packages/zapp/console/src/components/Literals/__stories__/helpers/typeGenerators.ts b/packages/zapp/console/src/components/Literals/__stories__/helpers/typeGenerators.ts
index edf237870..4974f3ab1 100644
--- a/packages/zapp/console/src/components/Literals/__stories__/helpers/typeGenerators.ts
+++ b/packages/zapp/console/src/components/Literals/__stories__/helpers/typeGenerators.ts
@@ -1,8 +1,5 @@
import { Core } from 'flyteidl';
-import {
- blobScalars,
- schemaScalars,
-} from '../scalarValues';
+import { blobScalars, schemaScalars } from '../scalarValues';
// SIMPLE
type GeneratedSimpleType = {
diff --git a/packages/zapp/console/src/components/Literals/test/helpers/mock_simpleTypes.ts b/packages/zapp/console/src/components/Literals/test/helpers/mock_simpleTypes.ts
index 0bd9d543f..16e7e8f80 100644
--- a/packages/zapp/console/src/components/Literals/test/helpers/mock_simpleTypes.ts
+++ b/packages/zapp/console/src/components/Literals/test/helpers/mock_simpleTypes.ts
@@ -1,17 +1,17 @@
import { Core } from 'flyteidl';
export function extractSimpleTypes() {
- const simpleTypes= Object.keys(Core.SimpleType).map((key) => ({
- [key]: {
- type: 'simple',
- simple: Core.SimpleType[key],
- },
- })).reduce((acc, v) => ({...acc, ...v}), {});
+ const simpleTypes = Object.keys(Core.SimpleType)
+ .map((key) => ({
+ [key]: {
+ type: 'simple',
+ simple: Core.SimpleType[key],
+ },
+ }))
+ .reduce((acc, v) => ({ ...acc, ...v }), {});
return simpleTypes;
}
const simple: Core.SimpleType[] = extractSimpleTypes() as any;
-export {
- simple
-};
+export { simple };
diff --git a/packages/zapp/console/src/components/Workflow/SearchableWorkflowNameList.tsx b/packages/zapp/console/src/components/Workflow/SearchableWorkflowNameList.tsx
index 5d4da6a19..2d4514a99 100644
--- a/packages/zapp/console/src/components/Workflow/SearchableWorkflowNameList.tsx
+++ b/packages/zapp/console/src/components/Workflow/SearchableWorkflowNameList.tsx
@@ -5,6 +5,7 @@ import { useNamedEntityListStyles } from 'components/common/SearchableNamedEntit
import { useCommonStyles } from 'components/common/styles';
import { separatorColor, primaryTextColor, workflowLabelColor } from 'components/Theme/constants';
import * as React from 'react';
+import { useEffect, useState } from 'react';
import { Link } from 'react-router-dom';
import { Routes } from 'routes/routes';
import { Shimmer } from 'components/common/Shimmer';
@@ -23,7 +24,6 @@ import ArchiveOutlined from '@material-ui/icons/ArchiveOutlined';
import { useMutation } from 'react-query';
import { NamedEntityState } from 'models/enums';
import { updateWorkflowState } from 'models/Workflow/api';
-import { useState } from 'react';
import { useSnackbar } from 'notistack';
import { padExecutionPaths, padExecutions } from 'common/utils';
import { WorkflowListStructureItem } from './types';
@@ -322,18 +322,22 @@ export const SearchableWorkflowNameList: React.FC {
const styles = useStyles();
- const [search, setSearch] = React.useState('');
+ const [search, setSearch] = useState('');
const { results, setSearchString } = useSearchableListState({
items: workflows,
propertyGetter: ({ id }) => id.name,
});
+ useEffect(() => {
+ const debouncedSearch = debounce(() => setSearchString(search), 1000);
+ debouncedSearch();
+ }, [search]);
+
const onSearchChange = (event: React.ChangeEvent) => {
const searchString = event.target.value;
setSearch(searchString);
- const debouncedSearch = debounce(() => setSearchString(searchString), 1000);
- debouncedSearch();
};
+
const onClear = () => setSearch('');
return (
diff --git a/packages/zapp/console/src/components/WorkflowGraph/WorkflowGraph.tsx b/packages/zapp/console/src/components/WorkflowGraph/WorkflowGraph.tsx
index ff0035bb4..fad6e0902 100644
--- a/packages/zapp/console/src/components/WorkflowGraph/WorkflowGraph.tsx
+++ b/packages/zapp/console/src/components/WorkflowGraph/WorkflowGraph.tsx
@@ -11,6 +11,9 @@ import { makeNodeExecutionDynamicWorkflowQuery } from 'components/Workflow/workf
import { createDebugLogger } from 'common/log';
import { CompiledNode } from 'models/Node/types';
import { TaskExecutionPhase } from 'models/Execution/enums';
+import { NodeExecutionsByIdContext } from 'components/Executions/contexts';
+import { useContext } from 'react';
+import { checkForDynamicExecutions } from 'components/common/utils';
import { transformerWorkflowToDag } from './transformerWorkflowToDag';
export interface WorkflowGraphProps {
@@ -19,7 +22,6 @@ export interface WorkflowGraphProps {
selectedPhase?: TaskExecutionPhase;
isDetailsTabClosed: boolean;
workflow: Workflow;
- nodeExecutionsById?: any;
}
interface PrepareDAGResult {
@@ -63,42 +65,12 @@ export const WorkflowGraph: React.FC = (props) => {
onPhaseSelectionChanged,
selectedPhase,
isDetailsTabClosed,
- nodeExecutionsById,
workflow,
} = props;
+ const nodeExecutionsById = useContext(NodeExecutionsByIdContext);
const { dag, staticExecutionIdsMap, error } = workflowToDag(workflow);
- /**
- * Note:
- * Dynamic nodes are deteremined at runtime and thus do not come
- * down as part of the workflow closure. We can detect and place
- * dynamic nodes by finding orphan execution id's and then mapping
- * those executions into the dag by using the executions 'uniqueParentId'
- * to render that node as a subworkflow
- */
- const checkForDynamicExeuctions = (allExecutions, staticExecutions) => {
- const parentsToFetch = {};
- for (const executionId in allExecutions) {
- if (!staticExecutions[executionId]) {
- const dynamicExecution = allExecutions[executionId];
- const dynamicExecutionId = dynamicExecution.metadata.specNodeId || dynamicExecution.id;
- const uniqueParentId = dynamicExecution.fromUniqueParentId;
- if (uniqueParentId) {
- if (parentsToFetch[uniqueParentId]) {
- parentsToFetch[uniqueParentId].push(dynamicExecutionId);
- } else {
- parentsToFetch[uniqueParentId] = [dynamicExecutionId];
- }
- }
- }
- }
- const result = {};
- for (const parentId in parentsToFetch) {
- result[parentId] = allExecutions[parentId];
- }
- return result;
- };
- const dynamicParents = checkForDynamicExeuctions(nodeExecutionsById, staticExecutionIdsMap);
+ const dynamicParents = checkForDynamicExecutions(nodeExecutionsById, staticExecutionIdsMap);
const dynamicWorkflowQuery = useQuery(makeNodeExecutionDynamicWorkflowQuery(dynamicParents));
const renderReactFlowGraph = (dynamicWorkflows) => {
debug('DynamicWorkflows:', dynamicWorkflows);
@@ -118,7 +90,6 @@ export const WorkflowGraph: React.FC = (props) => {
return (
({
ReactFlowWrapper: jest.fn(({ children }) => (
@@ -27,7 +26,6 @@ describe('WorkflowGraph', () => {
onNodeSelectionChanged={jest.fn}
onPhaseSelectionChanged={jest.fn}
workflow={workflow}
- nodeExecutionsById={nodeExecutionsById}
isDetailsTabClosed={true}
/>
,
diff --git a/packages/zapp/console/src/components/WorkflowGraph/utils.ts b/packages/zapp/console/src/components/WorkflowGraph/utils.ts
index 2930f6062..d8e104652 100644
--- a/packages/zapp/console/src/components/WorkflowGraph/utils.ts
+++ b/packages/zapp/console/src/components/WorkflowGraph/utils.ts
@@ -27,22 +27,6 @@ export function isExpanded(node: any) {
return !!node.expanded;
}
-/**
- * Utility funciton assumes (loose) parity between [a]->[b] if matching
- * keys have matching values.
- * @param a object
- * @param b object
- * @returns boolean
- */
-export const checkIfObjectsAreSame = (a, b) => {
- for (const k in a) {
- if (a[k] != b[k]) {
- return false;
- }
- }
- return true;
-};
-
/**
* Returns a display name from either workflows or nodes
* @param context input can be either CompiledWorkflow or CompiledNode
@@ -110,11 +94,12 @@ export const getNodeTypeFromCompiledNode = (node: CompiledNode): dTypes => {
};
export const getSubWorkflowFromId = (id, workflow) => {
+ const _ = require('lodash');
const { subWorkflows } = workflow;
/* Find current matching entitity from subWorkflows */
for (const k in subWorkflows) {
const subWorkflowId = subWorkflows[k].template.id;
- if (checkIfObjectsAreSame(subWorkflowId, id)) {
+ if (_.isEqual(subWorkflowId, id)) {
return subWorkflows[k];
}
}
@@ -122,11 +107,12 @@ export const getSubWorkflowFromId = (id, workflow) => {
};
export const getTaskTypeFromCompiledNode = (taskNode: TaskNode, tasks: CompiledTask[]) => {
+ const _ = require('lodash');
for (let i = 0; i < tasks.length; i++) {
const compiledTask: CompiledTask = tasks[i];
const taskTemplate: TaskTemplate = compiledTask.template;
const templateId: Identifier = taskTemplate.id;
- if (checkIfObjectsAreSame(templateId, taskNode.referenceId)) {
+ if (_.isEqual(templateId, taskNode.referenceId)) {
return compiledTask;
}
}
diff --git a/packages/zapp/console/src/components/common/FilterableNamedEntityList.tsx b/packages/zapp/console/src/components/common/FilterableNamedEntityList.tsx
index 74afadbb9..fe713433f 100644
--- a/packages/zapp/console/src/components/common/FilterableNamedEntityList.tsx
+++ b/packages/zapp/console/src/components/common/FilterableNamedEntityList.tsx
@@ -2,6 +2,7 @@ import { Checkbox, debounce, FormControlLabel, FormGroup } from '@material-ui/co
import { makeStyles, Theme } from '@material-ui/core/styles';
import { NamedEntity } from 'models/Common/types';
import * as React from 'react';
+import { useEffect, useState } from 'react';
import { NoResults } from './NoResults';
import { SearchableInput, SearchResult } from './SearchableList';
import { useCommonStyles } from './styles';
@@ -60,18 +61,21 @@ export const FilterableNamedEntityList: React.FC
archiveCheckboxLabel,
}) => {
const styles = useStyles();
- const [search, setSearch] = React.useState('');
+ const [search, setSearch] = useState('');
const { results, setSearchString } = useSearchableListState({
items: names,
propertyGetter: ({ id }) => id.name,
});
+ useEffect(() => {
+ const debouncedSearch = debounce(() => setSearchString(search), 1000);
+ debouncedSearch();
+ }, [search]);
+
const onSearchChange = (event: React.ChangeEvent) => {
const searchString = event.target.value;
setSearch(searchString);
- const debouncedSearch = debounce(() => setSearchString(searchString), 1000);
- debouncedSearch();
};
const onClear = () => setSearch('');
diff --git a/packages/zapp/console/src/components/common/utils.ts b/packages/zapp/console/src/components/common/utils.ts
index c6c521874..4612bddbe 100644
--- a/packages/zapp/console/src/components/common/utils.ts
+++ b/packages/zapp/console/src/components/common/utils.ts
@@ -16,3 +16,34 @@ export function measureText(fontDefinition: string, text: string) {
context.font = fontDefinition;
return context.measureText(text);
}
+
+/**
+ * Note:
+ * Dynamic nodes are deteremined at runtime and thus do not come
+ * down as part of the workflow closure. We can detect and place
+ * dynamic nodes by finding orphan execution id's and then mapping
+ * those executions into the dag by using the executions 'uniqueParentId'
+ * to render that node as a subworkflow
+ */
+export const checkForDynamicExecutions = (allExecutions, staticExecutions) => {
+ const parentsToFetch = {};
+ for (const executionId in allExecutions) {
+ if (!staticExecutions[executionId]) {
+ const dynamicExecution = allExecutions[executionId];
+ const dynamicExecutionId = dynamicExecution.metadata.specNodeId || dynamicExecution.id;
+ const uniqueParentId = dynamicExecution.fromUniqueParentId;
+ if (uniqueParentId) {
+ if (parentsToFetch[uniqueParentId]) {
+ parentsToFetch[uniqueParentId].push(dynamicExecutionId);
+ } else {
+ parentsToFetch[uniqueParentId] = [dynamicExecutionId];
+ }
+ }
+ }
+ }
+ const result = {};
+ for (const parentId in parentsToFetch) {
+ result[parentId] = allExecutions[parentId];
+ }
+ return result;
+};
diff --git a/packages/zapp/console/src/components/flytegraph/ReactFlow/ReactFlowGraphComponent.tsx b/packages/zapp/console/src/components/flytegraph/ReactFlow/ReactFlowGraphComponent.tsx
index 2fb41b801..b84d2f8bc 100644
--- a/packages/zapp/console/src/components/flytegraph/ReactFlow/ReactFlowGraphComponent.tsx
+++ b/packages/zapp/console/src/components/flytegraph/ReactFlow/ReactFlowGraphComponent.tsx
@@ -1,6 +1,7 @@
import * as React from 'react';
-import { useState, useEffect } from 'react';
+import { useState, useEffect, useContext } from 'react';
import { ConvertFlyteDagToReactFlows } from 'components/flytegraph/ReactFlow/transformDAGToReactFlowV2';
+import { NodeExecutionsByIdContext } from 'components/Executions/contexts';
import { RFWrapperProps, RFGraphTypes, ConvertDagProps } from './types';
import { getRFBackground } from './utils';
import { ReactFlowWrapper } from './ReactFlowWrapper';
@@ -50,9 +51,9 @@ const ReactFlowGraphComponent = (props) => {
onPhaseSelectionChanged,
selectedPhase,
isDetailsTabClosed,
- nodeExecutionsById,
dynamicWorkflows,
} = props;
+ const nodeExecutionsById = useContext(NodeExecutionsByIdContext);
const [state, setState] = useState({
data,
dynamicWorkflows,
diff --git a/packages/zapp/console/src/components/flytegraph/ReactFlow/ReactFlowWrapper.tsx b/packages/zapp/console/src/components/flytegraph/ReactFlow/ReactFlowWrapper.tsx
index d7c8bd13a..b2a806eff 100644
--- a/packages/zapp/console/src/components/flytegraph/ReactFlow/ReactFlowWrapper.tsx
+++ b/packages/zapp/console/src/components/flytegraph/ReactFlow/ReactFlowWrapper.tsx
@@ -41,7 +41,7 @@ export const ReactFlowWrapper: React.FC = ({
edges: rfGraphJson.edges,
version: version,
reactFlowInstance: null,
- needFitView: false
+ needFitView: false,
});
useEffect(() => {
@@ -49,7 +49,7 @@ export const ReactFlowWrapper: React.FC = ({
...state,
shouldUpdate: true,
nodes: rfGraphJson.nodes,
- edges: rfGraphJson.edges.map(edge => ({ ...edge, zIndex: 0 })),
+ edges: rfGraphJson.edges.map((edge) => ({ ...edge, zIndex: 0 })),
}));
}, [rfGraphJson]);
@@ -96,8 +96,8 @@ export const ReactFlowWrapper: React.FC = ({
};
const onNodeClick = () => {
- setState((state) => ({ ...state, needFitView: false }))
- }
+ setState((state) => ({ ...state, needFitView: false }));
+ };
return (
=2.2.7 <3":
+through@2, "through@>=2.2.7 <3", through@^2.3.6:
version "2.3.8"
resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5"
integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=
@@ -18589,6 +18826,13 @@ tiny-warning@^1.0.0, tiny-warning@^1.0.2, tiny-warning@^1.0.3:
resolved "https://registry.yarnpkg.com/tiny-warning/-/tiny-warning-1.0.3.tgz#94a30db453df4c643d0fd566060d60a875d84754"
integrity sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==
+tmp@^0.0.33:
+ version "0.0.33"
+ resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9"
+ integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==
+ dependencies:
+ os-tmpdir "~1.0.2"
+
tmpl@1.0.x:
version "1.0.5"
resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.5.tgz#8683e0b902bb9c20c4f726e3c0b69f36518c07cc"
@@ -18788,6 +19032,11 @@ tslib@^2.0.0, tslib@^2.0.1, tslib@^2.0.3, tslib@^2.3.0:
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01"
integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==
+tslib@^2.1.0:
+ version "2.4.0"
+ resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3"
+ integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==
+
tsutils@^3.21.0:
version "3.21.0"
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623"
@@ -19496,7 +19745,7 @@ wbuf@^1.1.0, wbuf@^1.7.3:
dependencies:
minimalistic-assert "^1.0.0"
-wcwidth@^1.0.0:
+wcwidth@^1.0.0, wcwidth@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8"
integrity sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=