Skip to content

Commit c558b41

Browse files
ivicackresimir-coko
authored andcommitted
1674 - client - Remove unnecessary setComponentActions call
1 parent c21fb36 commit c558b41

File tree

2 files changed

+1
-16
lines changed

2 files changed

+1
-16
lines changed

client/src/pages/platform/workflow-editor/components/WorkflowNodeDetailsPanel.tsx

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ const WorkflowNodeDetailsPanel = ({
9696
const {currentComponent, currentNode, setCurrentComponent, setCurrentNode, workflowNodeDetailsPanelOpen} =
9797
useWorkflowNodeDetailsPanelStore();
9898

99-
const {componentActions, setComponentActions, setDataPills, workflow} = useWorkflowDataStore();
99+
const {componentActions, setDataPills, workflow} = useWorkflowDataStore();
100100

101101
const {data: currentComponentDefinition} = useGetComponentDefinitionQuery(
102102
{
@@ -293,19 +293,6 @@ const WorkflowNodeDetailsPanel = ({
293293
}),
294294
type: `${componentName}/v${currentComponentDefinition.version}/${newOperationName}`,
295295
});
296-
297-
const formattedComponentActions = componentActions.map((componentAction) => {
298-
if (componentAction.workflowNodeName === currentNode?.name) {
299-
return {
300-
...componentAction,
301-
operationName: newOperationName,
302-
};
303-
} else {
304-
return componentAction;
305-
}
306-
});
307-
308-
setComponentActions(formattedComponentActions);
309296
},
310297
queryClient,
311298
updateWorkflowMutation,

client/src/pages/platform/workflow-editor/stores/useWorkflowDataStore.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ export type WorkflowTaskDataType = {
2121

2222
interface WorkflowDataStateI {
2323
componentActions: Array<ComponentOperationType>;
24-
setComponentActions: (componentActions: Array<ComponentOperationType>) => void;
2524

2625
componentDefinitions: Array<ComponentDefinitionBasic>;
2726
setComponentDefinitions: (componentDefinitions: Array<ComponentDefinitionBasic>) => void;
@@ -53,7 +52,6 @@ const useWorkflowDataStore = create<WorkflowDataStateI>()(
5352
devtools(
5453
(set, get) => ({
5554
componentActions: [],
56-
setComponentActions: (componentActions) => set((state) => ({...state, componentActions})),
5755

5856
componentDefinitions: [],
5957
setComponentDefinitions: (componentDefinitions) => set((state) => ({...state, componentDefinitions})),

0 commit comments

Comments
 (0)