mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +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,
|
||||
});
|
||||
|
||||
versionStore.setVersionNotificationSettings({
|
||||
versionStore.initialize({
|
||||
enabled: true,
|
||||
endpoint: '',
|
||||
infoUrl:
|
||||
|
||||
@@ -66,6 +66,8 @@ export async function initializeCore() {
|
||||
banners,
|
||||
});
|
||||
|
||||
versionsStore.initialize(settingsStore.settings.versionNotifications);
|
||||
|
||||
void useExternalHooks().run('app.mount');
|
||||
|
||||
if (!settingsStore.isPreviewMode) {
|
||||
|
||||
@@ -46,7 +46,7 @@ vi.mock('@n8n/stores/useRootStore', () => ({
|
||||
|
||||
vi.mock('@/stores/versions.store', () => ({
|
||||
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 { defineStore } from 'pinia';
|
||||
import { useRootStore } from '@n8n/stores/useRootStore';
|
||||
import { useVersionsStore } from './versions.store';
|
||||
import { makeRestApiRequest } from '@n8n/rest-api-client';
|
||||
import { useToast } from '@/composables/useToast';
|
||||
import { useI18n } from '@n8n/i18n';
|
||||
@@ -255,7 +254,6 @@ export const useSettingsStore = defineStore(STORES.SETTINGS, () => {
|
||||
rootStore.setN8nMetadata(fetchedSettings.n8nMetadata || {});
|
||||
rootStore.setDefaultLocale(fetchedSettings.defaultLocale);
|
||||
rootStore.setBinaryDataMode(fetchedSettings.binaryDataMode);
|
||||
useVersionsStore().setVersionNotificationSettings(fetchedSettings.versionNotifications);
|
||||
|
||||
if (fetchedSettings.telemetry.enabled) {
|
||||
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);
|
||||
};
|
||||
|
||||
const setVersionNotificationSettings = (settings: IVersionNotificationSettings) => {
|
||||
const initialize = (settings: IVersionNotificationSettings) => {
|
||||
versionNotificationSettings.value = settings;
|
||||
};
|
||||
|
||||
@@ -107,7 +107,7 @@ export const useVersionsStore = defineStore(STORES.VERSIONS, () => {
|
||||
infoUrl,
|
||||
fetchVersions,
|
||||
setVersions,
|
||||
setVersionNotificationSettings,
|
||||
initialize,
|
||||
checkForNewVersions,
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user