refactor(editor): Enable collaboration features only in NodeView v2 (no-changelog) (#10756)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-09-11 14:22:55 +02:00
committed by GitHub
parent ee5fbc543c
commit a1e011dd2a
17 changed files with 221 additions and 226 deletions

View File

@@ -8,7 +8,6 @@ import { getNodeViewTab } from '@/utils/canvasUtils';
import { MAIN_HEADER_TABS, PLACEHOLDER_EMPTY_WORKFLOW_ID, VIEWS } from '@/constants';
import { useWorkflowsStore } from '@/stores/workflows.store';
import { useWorkflowHelpers } from '@/composables/useWorkflowHelpers';
import { useCanvasOperations } from '@/composables/useCanvasOperations';
import { useSourceControlStore } from '@/stores/sourceControl.store';
import { useSettingsStore } from '@/stores/settings.store';
@@ -20,8 +19,6 @@ const router = useRouter();
const route = useRoute();
const workflowHelpers = useWorkflowHelpers({ router });
const { resetWorkspace } = useCanvasOperations({ router });
const nodeViewVersion = useLocalStorage(
'NodeView.version',
settingsStore.deploymentType === 'n8n-internal' ? '2' : '1',
@@ -56,9 +53,6 @@ onBeforeRouteLeave(async (to, from, next) => {
await workflowHelpers.promptSaveUnsavedWorkflowChanges(next, {
async confirm() {
// Make sure workflow id is empty when leaving the editor
workflowsStore.setWorkflowId(PLACEHOLDER_EMPTY_WORKFLOW_ID);
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.
@@ -72,11 +66,10 @@ onBeforeRouteLeave(async (to, from, next) => {
return false;
}
return true;
},
async cancel() {
// Make sure workflow id is empty when leaving the editor
workflowsStore.setWorkflowId(PLACEHOLDER_EMPTY_WORKFLOW_ID);
resetWorkspace();
return true;
},
});
});