mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
feat(editor): Force final canvas v2 migration and remove switcher from UI (#12717)
Some checks are pending
Test Master / install-and-build (push) Waiting to run
Test Master / Unit tests (18.x) (push) Blocked by required conditions
Test Master / Unit tests (20.x) (push) Blocked by required conditions
Test Master / Unit tests (22.4) (push) Blocked by required conditions
Test Master / Lint (push) Blocked by required conditions
Test Master / Notify Slack on failure (push) Blocked by required conditions
Benchmark Docker Image CI / build (push) Waiting to run
Some checks are pending
Test Master / install-and-build (push) Waiting to run
Test Master / Unit tests (18.x) (push) Blocked by required conditions
Test Master / Unit tests (20.x) (push) Blocked by required conditions
Test Master / Unit tests (22.4) (push) Blocked by required conditions
Test Master / Lint (push) Blocked by required conditions
Test Master / Notify Slack on failure (push) Blocked by required conditions
Benchmark Docker Image CI / build (push) Waiting to run
This commit is contained in:
parent
d25817c5cc
commit
29335b9b6a
|
@ -77,7 +77,7 @@ Cypress.Commands.add('signin', ({ email, password }) => {
|
|||
|
||||
// @TODO Remove this once the switcher is removed
|
||||
cy.window().then((win) => {
|
||||
win.localStorage.setItem('NodeView.migrated', 'true');
|
||||
win.localStorage.setItem('NodeView.migrated.release', 'true');
|
||||
win.localStorage.setItem('NodeView.switcher.discovered.beta', 'true');
|
||||
|
||||
const nodeViewVersion = Cypress.env('NODE_VIEW_VERSION');
|
||||
|
|
|
@ -3,7 +3,6 @@ import {
|
|||
DUPLICATE_MODAL_KEY,
|
||||
EnterpriseEditionFeature,
|
||||
MAX_WORKFLOW_NAME_LENGTH,
|
||||
MODAL_CLOSE,
|
||||
MODAL_CONFIRM,
|
||||
PLACEHOLDER_EMPTY_WORKFLOW_ID,
|
||||
SOURCE_CONTROL_PUSH_MODAL_KEY,
|
||||
|
@ -55,7 +54,6 @@ import { useI18n } from '@/composables/useI18n';
|
|||
import { useTelemetry } from '@/composables/useTelemetry';
|
||||
import type { BaseTextKey } from '@/plugins/i18n';
|
||||
import { useNpsSurveyStore } from '@/stores/npsSurvey.store';
|
||||
import { useNodeViewVersionSwitcher } from '@/composables/useNodeViewVersionSwitcher';
|
||||
import { usePageRedirectionHelper } from '@/composables/usePageRedirectionHelper';
|
||||
|
||||
const props = defineProps<{
|
||||
|
@ -102,16 +100,6 @@ const importFileRef = ref<HTMLInputElement | undefined>();
|
|||
const tagsEventBus = createEventBus();
|
||||
const sourceControlModalEventBus = createEventBus();
|
||||
|
||||
const {
|
||||
isNewUser,
|
||||
nodeViewVersion,
|
||||
nodeViewSwitcherDiscovered,
|
||||
isNodeViewDiscoveryTooltipVisible,
|
||||
switchNodeViewVersion,
|
||||
setNodeViewSwitcherDropdownOpened,
|
||||
setNodeViewSwitcherDiscovered,
|
||||
} = useNodeViewVersionSwitcher();
|
||||
|
||||
const hasChanged = (prev: string[], curr: string[]) => {
|
||||
if (prev.length !== curr.length) {
|
||||
return true;
|
||||
|
@ -191,33 +179,6 @@ const workflowMenuItems = computed<ActionDropdownItem[]>(() => {
|
|||
disabled: !onWorkflowPage.value || isNewWorkflow.value,
|
||||
});
|
||||
|
||||
if (settingsStore.isCanvasV2Enabled) {
|
||||
actions.push({
|
||||
id: WORKFLOW_MENU_ACTIONS.SWITCH_NODE_VIEW_VERSION,
|
||||
...(nodeViewVersion.value === '2'
|
||||
? nodeViewSwitcherDiscovered.value || isNewUser.value
|
||||
? {}
|
||||
: {
|
||||
badge: locale.baseText('menuActions.badge.new'),
|
||||
}
|
||||
: nodeViewSwitcherDiscovered.value
|
||||
? {
|
||||
badge: locale.baseText('menuActions.badge.beta'),
|
||||
badgeProps: {
|
||||
theme: 'tertiary',
|
||||
},
|
||||
}
|
||||
: {
|
||||
badge: locale.baseText('menuActions.badge.new'),
|
||||
}),
|
||||
label:
|
||||
nodeViewVersion.value === '2'
|
||||
? locale.baseText('menuActions.switchToOldNodeViewVersion')
|
||||
: locale.baseText('menuActions.switchToNewNodeViewVersion'),
|
||||
disabled: !onWorkflowPage.value,
|
||||
});
|
||||
}
|
||||
|
||||
if ((workflowPermissions.value.delete && !props.readOnly) || isNewWorkflow.value) {
|
||||
actions.push({
|
||||
id: WORKFLOW_MENU_ACTIONS.DELETE,
|
||||
|
@ -417,10 +378,6 @@ async function handleFileImport(): Promise<void> {
|
|||
}
|
||||
}
|
||||
|
||||
function onWorkflowMenuOpen(visible: boolean) {
|
||||
setNodeViewSwitcherDropdownOpened(visible);
|
||||
}
|
||||
|
||||
async function onWorkflowMenuSelect(action: WORKFLOW_MENU_ACTIONS): Promise<void> {
|
||||
switch (action) {
|
||||
case WORKFLOW_MENU_ACTIONS.DUPLICATE: {
|
||||
|
@ -520,36 +477,6 @@ async function onWorkflowMenuSelect(action: WORKFLOW_MENU_ACTIONS): Promise<void
|
|||
uiStore.openModal(WORKFLOW_SETTINGS_MODAL_KEY);
|
||||
break;
|
||||
}
|
||||
case WORKFLOW_MENU_ACTIONS.SWITCH_NODE_VIEW_VERSION: {
|
||||
setNodeViewSwitcherDiscovered();
|
||||
|
||||
if (uiStore.stateIsDirty) {
|
||||
const confirmModal = await message.confirm(
|
||||
locale.baseText('generic.unsavedWork.confirmMessage.message'),
|
||||
{
|
||||
title: locale.baseText('generic.unsavedWork.confirmMessage.headline'),
|
||||
type: 'warning',
|
||||
confirmButtonText: locale.baseText(
|
||||
'generic.unsavedWork.confirmMessage.confirmButtonText',
|
||||
),
|
||||
cancelButtonText: locale.baseText(
|
||||
'generic.unsavedWork.confirmMessage.cancelButtonText',
|
||||
),
|
||||
showClose: true,
|
||||
},
|
||||
);
|
||||
|
||||
if (confirmModal === MODAL_CONFIRM) {
|
||||
await onSaveButtonClick();
|
||||
} else if (confirmModal === MODAL_CLOSE) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
switchNodeViewVersion();
|
||||
|
||||
break;
|
||||
}
|
||||
case WORKFLOW_MENU_ACTIONS.DELETE: {
|
||||
const deleteConfirmed = await message.confirm(
|
||||
locale.baseText('mainSidebar.confirmMessage.workflowDelete.message', {
|
||||
|
@ -758,28 +685,11 @@ function showCreateWorkflowSuccessToast(id?: string) {
|
|||
data-test-id="workflow-import-input"
|
||||
@change="handleFileImport()"
|
||||
/>
|
||||
<N8nTooltip :visible="isNodeViewDiscoveryTooltipVisible">
|
||||
<N8nActionDropdown
|
||||
:items="workflowMenuItems"
|
||||
data-test-id="workflow-menu"
|
||||
@select="onWorkflowMenuSelect"
|
||||
@visible-change="onWorkflowMenuOpen"
|
||||
/>
|
||||
<template #content>
|
||||
<div class="mb-4xs">
|
||||
<N8nBadge>{{ i18n.baseText('menuActions.badge.beta') }}</N8nBadge>
|
||||
</div>
|
||||
<p>{{ i18n.baseText('menuActions.nodeViewDiscovery.tooltip') }}</p>
|
||||
<N8nText color="text-light" size="small">
|
||||
{{ i18n.baseText('menuActions.nodeViewDiscovery.tooltip.switchBack') }}
|
||||
</N8nText>
|
||||
<N8nIcon
|
||||
:class="$style.closeNodeViewDiscovery"
|
||||
icon="times-circle"
|
||||
@click="setNodeViewSwitcherDiscovered"
|
||||
/>
|
||||
</template>
|
||||
</N8nTooltip>
|
||||
<N8nActionDropdown
|
||||
:items="workflowMenuItems"
|
||||
data-test-id="workflow-menu"
|
||||
@select="onWorkflowMenuSelect"
|
||||
/>
|
||||
</div>
|
||||
</PushConnectionTracker>
|
||||
</div>
|
||||
|
|
|
@ -15,7 +15,7 @@ export function useNodeViewVersionSwitcher() {
|
|||
|
||||
const defaultVersion = settingsStore.isCanvasV2Enabled ? '2' : '1';
|
||||
const nodeViewVersion = useLocalStorage('NodeView.version', defaultVersion);
|
||||
const nodeViewVersionMigrated = useLocalStorage('NodeView.migrated', false);
|
||||
const nodeViewVersionMigrated = useLocalStorage('NodeView.migrated.release', false);
|
||||
|
||||
function setNodeViewSwitcherDropdownOpened(visible: boolean) {
|
||||
if (!visible) {
|
||||
|
|
|
@ -939,13 +939,6 @@
|
|||
"menuActions.importFromUrl": "Import from URL...",
|
||||
"menuActions.importFromFile": "Import from File...",
|
||||
"menuActions.delete": "Delete",
|
||||
"menuActions.switchToNewNodeViewVersion": "Switch to new canvas",
|
||||
"menuActions.switchToOldNodeViewVersion": "Switch to old canvas",
|
||||
"menuActions.badge.new": "NEW",
|
||||
"menuActions.badge.alpha": "ALPHA",
|
||||
"menuActions.badge.beta": "BETA",
|
||||
"menuActions.nodeViewDiscovery.tooltip": "You're currently using our new, more performant canvas.",
|
||||
"menuActions.nodeViewDiscovery.tooltip.switchBack": "You can switch back to the old version using this menu.",
|
||||
"multipleParameter.addItem": "Add item",
|
||||
"multipleParameter.currentlyNoItemsExist": "Currently no items exist",
|
||||
"multipleParameter.deleteItem": "Delete item",
|
||||
|
|
Loading…
Reference in a new issue