fix(editor): Hide What's New notification in executions demo view (#17742)

This commit is contained in:
Charlie Kolb
2025-07-28 15:12:48 +02:00
committed by GitHub
parent 53d272c251
commit cebb1f6566
2 changed files with 14 additions and 0 deletions

View File

@@ -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();

View File

@@ -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) {