mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
refactor(editor): Detangle versions store from settings store (no-changelog) (#16508)
This commit is contained in:
@@ -51,7 +51,7 @@ describe('usePageRedirectionHelper', () => {
|
|||||||
writable: true,
|
writable: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
versionStore.setVersionNotificationSettings({
|
versionStore.initialize({
|
||||||
enabled: true,
|
enabled: true,
|
||||||
endpoint: '',
|
endpoint: '',
|
||||||
infoUrl:
|
infoUrl:
|
||||||
|
|||||||
@@ -66,6 +66,8 @@ export async function initializeCore() {
|
|||||||
banners,
|
banners,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
versionsStore.initialize(settingsStore.settings.versionNotifications);
|
||||||
|
|
||||||
void useExternalHooks().run('app.mount');
|
void useExternalHooks().run('app.mount');
|
||||||
|
|
||||||
if (!settingsStore.isPreviewMode) {
|
if (!settingsStore.isPreviewMode) {
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ vi.mock('@n8n/stores/useRootStore', () => ({
|
|||||||
|
|
||||||
vi.mock('@/stores/versions.store', () => ({
|
vi.mock('@/stores/versions.store', () => ({
|
||||||
useVersionsStore: vi.fn(() => ({
|
useVersionsStore: vi.fn(() => ({
|
||||||
setVersionNotificationSettings: vi.fn(),
|
initialize: vi.fn(),
|
||||||
})),
|
})),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ import { UserManagementAuthenticationMethod } from '@/Interface';
|
|||||||
import type { IDataObject, WorkflowSettings } from 'n8n-workflow';
|
import type { IDataObject, WorkflowSettings } from 'n8n-workflow';
|
||||||
import { defineStore } from 'pinia';
|
import { defineStore } from 'pinia';
|
||||||
import { useRootStore } from '@n8n/stores/useRootStore';
|
import { useRootStore } from '@n8n/stores/useRootStore';
|
||||||
import { useVersionsStore } from './versions.store';
|
|
||||||
import { makeRestApiRequest } from '@n8n/rest-api-client';
|
import { makeRestApiRequest } from '@n8n/rest-api-client';
|
||||||
import { useToast } from '@/composables/useToast';
|
import { useToast } from '@/composables/useToast';
|
||||||
import { useI18n } from '@n8n/i18n';
|
import { useI18n } from '@n8n/i18n';
|
||||||
@@ -255,7 +254,6 @@ export const useSettingsStore = defineStore(STORES.SETTINGS, () => {
|
|||||||
rootStore.setN8nMetadata(fetchedSettings.n8nMetadata || {});
|
rootStore.setN8nMetadata(fetchedSettings.n8nMetadata || {});
|
||||||
rootStore.setDefaultLocale(fetchedSettings.defaultLocale);
|
rootStore.setDefaultLocale(fetchedSettings.defaultLocale);
|
||||||
rootStore.setBinaryDataMode(fetchedSettings.binaryDataMode);
|
rootStore.setBinaryDataMode(fetchedSettings.binaryDataMode);
|
||||||
useVersionsStore().setVersionNotificationSettings(fetchedSettings.versionNotifications);
|
|
||||||
|
|
||||||
if (fetchedSettings.telemetry.enabled) {
|
if (fetchedSettings.telemetry.enabled) {
|
||||||
void eventsApi.sessionStarted(rootStore.restApiContext);
|
void eventsApi.sessionStarted(rootStore.restApiContext);
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ export const useVersionsStore = defineStore(STORES.VERSIONS, () => {
|
|||||||
currentVersion.value = params.versions.find((v) => v.name === params.currentVersion);
|
currentVersion.value = params.versions.find((v) => v.name === params.currentVersion);
|
||||||
};
|
};
|
||||||
|
|
||||||
const setVersionNotificationSettings = (settings: IVersionNotificationSettings) => {
|
const initialize = (settings: IVersionNotificationSettings) => {
|
||||||
versionNotificationSettings.value = settings;
|
versionNotificationSettings.value = settings;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -107,7 +107,7 @@ export const useVersionsStore = defineStore(STORES.VERSIONS, () => {
|
|||||||
infoUrl,
|
infoUrl,
|
||||||
fetchVersions,
|
fetchVersions,
|
||||||
setVersions,
|
setVersions,
|
||||||
setVersionNotificationSettings,
|
initialize,
|
||||||
checkForNewVersions,
|
checkForNewVersions,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user