mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-22 04:10:01 +00:00
fix(editor): Hide What's New notification in executions demo view (#17742)
This commit is contained in:
@@ -7,6 +7,12 @@ import type { Version, WhatsNewArticle, WhatsNewSection } from '@n8n/rest-api-cl
|
|||||||
import { useRootStore } from '@n8n/stores/useRootStore';
|
import { useRootStore } from '@n8n/stores/useRootStore';
|
||||||
import { useSettingsStore } from './settings.store';
|
import { useSettingsStore } from './settings.store';
|
||||||
import { useToast } from '@/composables/useToast';
|
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', () => {
|
vi.mock('@/composables/useToast', () => {
|
||||||
const showToast = vi.fn();
|
const showToast = vi.fn();
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import {
|
|||||||
LOCAL_STORAGE_DISMISSED_WHATS_NEW_CALLOUT,
|
LOCAL_STORAGE_DISMISSED_WHATS_NEW_CALLOUT,
|
||||||
LOCAL_STORAGE_READ_WHATS_NEW_ARTICLES,
|
LOCAL_STORAGE_READ_WHATS_NEW_ARTICLES,
|
||||||
VERSIONS_MODAL_KEY,
|
VERSIONS_MODAL_KEY,
|
||||||
|
VIEWS,
|
||||||
WHATS_NEW_MODAL_KEY,
|
WHATS_NEW_MODAL_KEY,
|
||||||
} from '@/constants';
|
} from '@/constants';
|
||||||
import { STORES } from '@n8n/stores';
|
import { STORES } from '@n8n/stores';
|
||||||
@@ -19,6 +20,7 @@ import { useUsersStore } from './users.store';
|
|||||||
import { useStorage } from '@/composables/useStorage';
|
import { useStorage } from '@/composables/useStorage';
|
||||||
import { jsonParse } from 'n8n-workflow';
|
import { jsonParse } from 'n8n-workflow';
|
||||||
import { useTelemetry } from '@/composables/useTelemetry';
|
import { useTelemetry } from '@/composables/useTelemetry';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
|
|
||||||
type SetVersionParams = { versions: Version[]; currentVersion: string };
|
type SetVersionParams = { versions: Version[]; currentVersion: string };
|
||||||
|
|
||||||
@@ -54,6 +56,7 @@ export const useVersionsStore = defineStore(STORES.VERSIONS, () => {
|
|||||||
const uiStore = useUIStore();
|
const uiStore = useUIStore();
|
||||||
const settingsStore = useSettingsStore();
|
const settingsStore = useSettingsStore();
|
||||||
const usersStore = useUsersStore();
|
const usersStore = useUsersStore();
|
||||||
|
const route = useRoute();
|
||||||
const readWhatsNewArticlesStorage = useStorage(LOCAL_STORAGE_READ_WHATS_NEW_ARTICLES);
|
const readWhatsNewArticlesStorage = useStorage(LOCAL_STORAGE_READ_WHATS_NEW_ARTICLES);
|
||||||
const lastDismissedWhatsNewCalloutStorage = useStorage(LOCAL_STORAGE_DISMISSED_WHATS_NEW_CALLOUT);
|
const lastDismissedWhatsNewCalloutStorage = useStorage(LOCAL_STORAGE_DISMISSED_WHATS_NEW_CALLOUT);
|
||||||
|
|
||||||
@@ -171,6 +174,11 @@ export const useVersionsStore = defineStore(STORES.VERSIONS, () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const shouldShowWhatsNewCallout = (): boolean => {
|
const shouldShowWhatsNewCallout = (): boolean => {
|
||||||
|
// Never show if embedded, e.g. in executions iframe
|
||||||
|
if (route.name === VIEWS.DEMO) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
const createdAt = usersStore.currentUser?.createdAt;
|
const createdAt = usersStore.currentUser?.createdAt;
|
||||||
let hasNewArticle = false;
|
let hasNewArticle = false;
|
||||||
if (createdAt) {
|
if (createdAt) {
|
||||||
|
|||||||
Reference in New Issue
Block a user