From cebb1f65669638a6716dbbd2eb9873ae8dbfe108 Mon Sep 17 00:00:00 2001 From: Charlie Kolb Date: Mon, 28 Jul 2025 15:12:48 +0200 Subject: [PATCH] fix(editor): Hide `What's New` notification in executions demo view (#17742) --- .../frontend/editor-ui/src/stores/versions.store.test.ts | 6 ++++++ packages/frontend/editor-ui/src/stores/versions.store.ts | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/packages/frontend/editor-ui/src/stores/versions.store.test.ts b/packages/frontend/editor-ui/src/stores/versions.store.test.ts index dd9e1cd554..8af1509e91 100644 --- a/packages/frontend/editor-ui/src/stores/versions.store.test.ts +++ b/packages/frontend/editor-ui/src/stores/versions.store.test.ts @@ -7,6 +7,12 @@ import type { Version, WhatsNewArticle, WhatsNewSection } from '@n8n/rest-api-cl import { useRootStore } from '@n8n/stores/useRootStore'; import { useSettingsStore } from './settings.store'; import { useToast } from '@/composables/useToast'; +import { reactive } from 'vue'; +import { VIEWS } from '@/constants'; + +vi.mock('vue-router', () => ({ + useRoute: () => reactive({ name: VIEWS.HOMEPAGE }), +})); vi.mock('@/composables/useToast', () => { const showToast = vi.fn(); diff --git a/packages/frontend/editor-ui/src/stores/versions.store.ts b/packages/frontend/editor-ui/src/stores/versions.store.ts index e5a84a287f..5348255aec 100644 --- a/packages/frontend/editor-ui/src/stores/versions.store.ts +++ b/packages/frontend/editor-ui/src/stores/versions.store.ts @@ -4,6 +4,7 @@ import { LOCAL_STORAGE_DISMISSED_WHATS_NEW_CALLOUT, LOCAL_STORAGE_READ_WHATS_NEW_ARTICLES, VERSIONS_MODAL_KEY, + VIEWS, WHATS_NEW_MODAL_KEY, } from '@/constants'; import { STORES } from '@n8n/stores'; @@ -19,6 +20,7 @@ import { useUsersStore } from './users.store'; import { useStorage } from '@/composables/useStorage'; import { jsonParse } from 'n8n-workflow'; import { useTelemetry } from '@/composables/useTelemetry'; +import { useRoute } from 'vue-router'; type SetVersionParams = { versions: Version[]; currentVersion: string }; @@ -54,6 +56,7 @@ export const useVersionsStore = defineStore(STORES.VERSIONS, () => { const uiStore = useUIStore(); const settingsStore = useSettingsStore(); const usersStore = useUsersStore(); + const route = useRoute(); const readWhatsNewArticlesStorage = useStorage(LOCAL_STORAGE_READ_WHATS_NEW_ARTICLES); const lastDismissedWhatsNewCalloutStorage = useStorage(LOCAL_STORAGE_DISMISSED_WHATS_NEW_CALLOUT); @@ -171,6 +174,11 @@ export const useVersionsStore = defineStore(STORES.VERSIONS, () => { }; const shouldShowWhatsNewCallout = (): boolean => { + // Never show if embedded, e.g. in executions iframe + if (route.name === VIEWS.DEMO) { + return false; + } + const createdAt = usersStore.currentUser?.createdAt; let hasNewArticle = false; if (createdAt) {