feat(editor): Add workflow action to switch between new and old canvas (no-changelog) (#9969)

This commit is contained in:
Alex Grozav
2024-07-09 15:58:36 +03:00
committed by GitHub
parent b5b96eb43e
commit 4e2f0adb2a
7 changed files with 79 additions and 54 deletions

View File

@@ -153,7 +153,7 @@ const hideNodeIssues = ref(false);
const workflowId = computed<string>(() => route.params.name as string);
const workflow = computed(() => workflowsStore.workflowsById[workflowId.value]);
const isNewWorkflowRoute = computed(() => route.name === VIEWS.NEW_WORKFLOW_V2);
const isNewWorkflowRoute = computed(() => route.name === VIEWS.NEW_WORKFLOW);
const isDemoRoute = computed(() => route.name === VIEWS.DEMO);
const isReadOnlyRoute = computed(() => route?.meta?.readOnlyCanvas === true);
const isReadOnlyEnvironment = computed(() => {
@@ -265,7 +265,7 @@ async function initializeView() {
toast.showError(error, i18n.baseText('openWorkflow.workflowNotFoundError'));
void router.push({
name: VIEWS.NEW_WORKFLOW_V2,
name: VIEWS.NEW_WORKFLOW,
});
}
}
@@ -844,11 +844,11 @@ onBeforeRouteLeave(async (to, from, next) => {
}
uiStore.stateIsDirty = false;
if (from.name === VIEWS.NEW_WORKFLOW_V2) {
if (from.name === VIEWS.NEW_WORKFLOW) {
// Replace the current route with the new workflow route
// before navigating to the new route when saving new workflow.
await router.replace({
name: VIEWS.WORKFLOW_V2,
name: VIEWS.WORKFLOW,
params: { name: workflowId.value },
});