diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts index bc5a18a34f6a53..c414c9fea9775e 100644 --- a/cypress/support/commands.ts +++ b/cypress/support/commands.ts @@ -75,8 +75,13 @@ Cypress.Commands.add('signin', ({ email, password }) => { .then((response) => { Cypress.env('currentUserId', response.body.data.id); + // @TODO Remove this once the switcher is removed cy.window().then((win) => { - win.localStorage.setItem('NodeView.switcher.discovered', 'true'); // @TODO Remove this once the switcher is removed + win.localStorage.setItem('NodeView.migrated', 'true'); + win.localStorage.setItem('NodeView.switcher.discovered.beta', 'true'); + + const nodeViewVersion = Cypress.env('NODE_VIEW_VERSION'); + win.localStorage.setItem('NodeView.version', nodeViewVersion ?? '1'); }); }); }); diff --git a/cypress/support/e2e.ts b/cypress/support/e2e.ts index 4261cb4b630074..0fe782499d1d7a 100644 --- a/cypress/support/e2e.ts +++ b/cypress/support/e2e.ts @@ -20,11 +20,6 @@ beforeEach(() => { win.localStorage.setItem('N8N_THEME', 'light'); win.localStorage.setItem('N8N_AUTOCOMPLETE_ONBOARDED', 'true'); win.localStorage.setItem('N8N_MAPPING_ONBOARDED', 'true'); - - const nodeViewVersion = Cypress.env('NODE_VIEW_VERSION'); - if (nodeViewVersion) { - win.localStorage.setItem('NodeView.version', nodeViewVersion); - } }); cy.intercept('GET', '/rest/settings', (req) => { diff --git a/packages/editor-ui/src/components/MainHeader/WorkflowDetails.vue b/packages/editor-ui/src/components/MainHeader/WorkflowDetails.vue index 089f6fee919b93..6c053057de32aa 100644 --- a/packages/editor-ui/src/components/MainHeader/WorkflowDetails.vue +++ b/packages/editor-ui/src/components/MainHeader/WorkflowDetails.vue @@ -103,6 +103,7 @@ const tagsEventBus = createEventBus(); const sourceControlModalEventBus = createEventBus(); const { + isNewUser, nodeViewVersion, nodeViewSwitcherDiscovered, isNodeViewDiscoveryTooltipVisible, @@ -193,10 +194,14 @@ const workflowMenuItems = computed(() => { 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.alpha'), + badge: locale.baseText('menuActions.badge.beta'), badgeProps: { theme: 'tertiary', }, @@ -756,9 +761,12 @@ function showCreateWorkflowSuccessToast(id?: string) { />