diff --git a/client/src/pages/automation/project-instances/ProjectInstanceWorkflowList.tsx b/client/src/pages/automation/project-instances/ProjectInstanceWorkflowList.tsx
index aa4d1d682f..5944636980 100644
--- a/client/src/pages/automation/project-instances/ProjectInstanceWorkflowList.tsx
+++ b/client/src/pages/automation/project-instances/ProjectInstanceWorkflowList.tsx
@@ -53,30 +53,35 @@ const ProjectInstanceWorkflowList = ({
{workflows?.map((workflow) => {
- const names = workflow.tasks?.map(
+ const definitionNames = workflow.tasks?.map(
(task) => task.type.split('/')[0]
);
- names?.forEach((name) => {
- if (!workflowComponentDefinitions[name]) {
- workflowComponentDefinitions[name] =
+ definitionNames?.forEach((definitionName) => {
+ if (!workflowComponentDefinitions[definitionName]) {
+ workflowComponentDefinitions[definitionName] =
componentDefinitions?.find(
(componentDefinition) =>
- componentDefinition.name === name
+ componentDefinition.name ===
+ definitionName
);
}
- if (!workflowTaskDispatcherDefinitions[name]) {
- workflowTaskDispatcherDefinitions[name] =
+ if (
+ !workflowTaskDispatcherDefinitions[definitionName]
+ ) {
+ workflowTaskDispatcherDefinitions[definitionName] =
taskDispatcherDefinitions?.find(
(taskDispatcherDefinition) =>
- taskDispatcherDefinition.name === name
+ taskDispatcherDefinition.name ===
+ definitionName
);
}
});
- const filteredNames = names?.filter(
- (item, index) => names?.indexOf(item) === index
+ const filteredDefinitionNames = definitionNames?.filter(
+ (item, index) =>
+ definitionNames?.indexOf(item) === index
);
return (
@@ -95,48 +100,50 @@ const ProjectInstanceWorkflowList = ({
- {filteredNames?.map((name) => {
- const componentDefinition =
- workflowComponentDefinitions[
- name
- ];
- const taskDispatcherDefinition =
- workflowTaskDispatcherDefinitions[
- name
- ];
-
- return (
-
-
-
-
- {
+ const componentDefinition =
+ workflowComponentDefinitions[
+ name
+ ];
+ const taskDispatcherDefinition =
+ workflowTaskDispatcherDefinitions[
+ name
+ ];
+
+ return (
+
+
+
+
+
+
+
+
+ {
+ componentDefinition?.title
}
- src={
- componentDefinition?.icon
- ? componentDefinition?.icon
- : taskDispatcherDefinition?.icon ??
- ''
- }
- />
-
-
-
- {
- componentDefinition?.title
- }
-
-
-
-
- );
- })}
+
+
+
+
+ );
+ }
+ )}
diff --git a/client/src/pages/automation/projects/ProjectWorkflowList.tsx b/client/src/pages/automation/projects/ProjectWorkflowList.tsx
index ec0f78b8d7..f44c646565 100644
--- a/client/src/pages/automation/projects/ProjectWorkflowList.tsx
+++ b/client/src/pages/automation/projects/ProjectWorkflowList.tsx
@@ -39,30 +39,35 @@ const ProjectWorkflowList = ({project}: {project: ProjectModel}) => {
{workflows?.map((workflow) => {
- const names = workflow.tasks?.map(
+ const definitionNames = workflow.tasks?.map(
(task) => task.type.split('/')[0]
);
- names?.map((name) => {
- if (!workflowComponentDefinitions[name]) {
- workflowComponentDefinitions[name] =
+ definitionNames?.map((definitionName) => {
+ if (!workflowComponentDefinitions[definitionName]) {
+ workflowComponentDefinitions[definitionName] =
componentDefinitions?.find(
(componentDefinition) =>
- componentDefinition.name === name
+ componentDefinition.name ===
+ definitionName
);
}
- if (!workflowTaskDispatcherDefinitions[name]) {
- workflowTaskDispatcherDefinitions[name] =
+ if (
+ !workflowTaskDispatcherDefinitions[definitionName]
+ ) {
+ workflowTaskDispatcherDefinitions[definitionName] =
taskDispatcherDefinitions?.find(
(taskDispatcherDefinition) =>
- taskDispatcherDefinition.name === name
+ taskDispatcherDefinition.name ===
+ definitionName
);
}
});
- const filteredNames = names?.filter(
- (item, index) => names?.indexOf(item) === index
+ const filteredDefinitionNames = definitionNames?.filter(
+ (item, index) =>
+ definitionNames?.indexOf(item) === index
);
return (
@@ -80,46 +85,50 @@ const ProjectWorkflowList = ({project}: {project: ProjectModel}) => {
- {filteredNames?.map((name) => {
- const componentDefinition =
- workflowComponentDefinitions[
- name
- ];
- const taskDispatcherDefinition =
- workflowTaskDispatcherDefinitions[
- name
- ];
-
- return (
-
-
-
-
- {
+ const componentDefinition =
+ workflowComponentDefinitions[
+ name
+ ];
+ const taskDispatcherDefinition =
+ workflowTaskDispatcherDefinitions[
+ name
+ ];
+
+ return (
+
+
+
+
+
+
+
+
+ {
+ componentDefinition?.title
}
- />
-
-
-
- {
- componentDefinition?.title
- }
-
-
-
-
- );
- })}
+
+
+
+
+ );
+ }
+ )}