Skip to content

Commit abb8225

Browse files
authored
fix(editor): Issue with context menu disabling most options when importing template (#15185)
1 parent d870c68 commit abb8225

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

packages/frontend/editor-ui/src/composables/useCanvasOperations.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3002,7 +3002,7 @@ describe('useCanvasOperations', () => {
30023002
disabled: false,
30033003
});
30043004
expect(workflowsStore.setNodePristine).toHaveBeenCalledWith(nodeB.name, true);
3005-
expect(workflowsStore.getNewWorkflowData).toHaveBeenCalledWith(
3005+
expect(workflowsStore.getNewWorkflowDataAndMakeShareable).toHaveBeenCalledWith(
30063006
templateName,
30073007
projectsStore.currentProjectId,
30083008
);

packages/frontend/editor-ui/src/composables/useCanvasOperations.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2003,7 +2003,7 @@ export function useCanvasOperations({ router }: { router: ReturnType<typeof useR
20032003
workflowsStore.setConnections(workflow.connections);
20042004
}
20052005
await addNodes(convertedNodes ?? []);
2006-
await workflowsStore.getNewWorkflowData(name, projectsStore.currentProjectId);
2006+
await workflowsStore.getNewWorkflowDataAndMakeShareable(name, projectsStore.currentProjectId);
20072007
workflowsStore.addToWorkflowMetadata({ templateId: `${id}` });
20082008
}
20092009

packages/frontend/editor-ui/src/stores/workflows.store.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,16 @@ export const useWorkflowsStore = defineStore(STORES.WORKFLOWS, () => {
632632
return workflowData;
633633
}
634634

635+
async function getNewWorkflowDataAndMakeShareable(
636+
name?: string,
637+
projectId?: string,
638+
parentFolderId?: string,
639+
): Promise<INewWorkflowData> {
640+
const workflowData = await getNewWorkflowData(name, projectId, parentFolderId);
641+
makeNewWorkflowShareable();
642+
return workflowData;
643+
}
644+
635645
function makeNewWorkflowShareable() {
636646
const { currentProject, personalProject } = useProjectsStore();
637647
const homeProject = currentProject ?? personalProject ?? {};
@@ -1963,6 +1973,7 @@ export const useWorkflowsStore = defineStore(STORES.WORKFLOWS, () => {
19631973
markExecutionAsStopped,
19641974
findNodeByPartialId,
19651975
getPartialIdForNode,
1976+
getNewWorkflowDataAndMakeShareable,
19661977
totalWorkflowCount,
19671978
};
19681979
});

packages/frontend/editor-ui/src/views/NodeView.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,12 +380,11 @@ async function initializeWorkspaceForNewWorkflow() {
380380
381381
const parentFolderId = route.query.parentFolderId as string | undefined;
382382
383-
await workflowsStore.getNewWorkflowData(
383+
await workflowsStore.getNewWorkflowDataAndMakeShareable(
384384
undefined,
385385
projectsStore.currentProjectId,
386386
parentFolderId,
387387
);
388-
workflowsStore.makeNewWorkflowShareable();
389388
390389
if (projectsStore.currentProjectId) {
391390
await fetchAndSetProject(projectsStore.currentProjectId);

0 commit comments

Comments
 (0)