mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
refactor(core): Centralize module management (#16464)
Co-authored-by: Danny Martini <danny@n8n.io>
This commit is contained in:
@@ -148,5 +148,5 @@ export const defaultSettings: FrontendSettings = {
|
||||
evaluation: {
|
||||
quota: 0,
|
||||
},
|
||||
loadedModules: [],
|
||||
activeModules: [],
|
||||
};
|
||||
|
||||
@@ -112,7 +112,7 @@ const mainMenuItems = computed(() => [
|
||||
position: 'bottom',
|
||||
route: { to: { name: VIEWS.INSIGHTS } },
|
||||
available:
|
||||
settingsStore.settings.loadedModules.includes('insights') &&
|
||||
settingsStore.settings.activeModules.includes('insights') &&
|
||||
hasPermission(['rbac'], { rbac: { scope: 'insights:list' } }),
|
||||
},
|
||||
{
|
||||
|
||||
@@ -19,7 +19,7 @@ export const useInsightsStore = defineStore('insights', () => {
|
||||
);
|
||||
|
||||
const isInsightsEnabled = computed(() =>
|
||||
settingsStore.settings.loadedModules.includes('insights'),
|
||||
settingsStore.settings.activeModules.includes('insights'),
|
||||
);
|
||||
|
||||
const isDashboardEnabled = computed(
|
||||
|
||||
@@ -185,7 +185,7 @@ export const useSettingsStore = defineStore(STORES.SETTINGS, () => {
|
||||
|
||||
const isDevRelease = computed(() => settings.value.releaseChannel === 'dev');
|
||||
|
||||
const loadedModules = computed(() => settings.value.loadedModules);
|
||||
const activeModules = computed(() => settings.value.activeModules);
|
||||
|
||||
const setSettings = (newSettings: FrontendSettings) => {
|
||||
settings.value = newSettings;
|
||||
@@ -426,7 +426,7 @@ export const useSettingsStore = defineStore(STORES.SETTINGS, () => {
|
||||
getSettings,
|
||||
setSettings,
|
||||
initialize,
|
||||
loadedModules,
|
||||
activeModules,
|
||||
getModuleSettings,
|
||||
moduleSettings,
|
||||
};
|
||||
|
||||
@@ -46,7 +46,7 @@ let telemetry: ReturnType<typeof useTelemetry>;
|
||||
describe('SigninView', () => {
|
||||
const signInWithValidUser = async () => {
|
||||
settingsStore.isCloudDeployment = false;
|
||||
settingsStore.loadedModules = [];
|
||||
settingsStore.activeModules = [];
|
||||
usersStore.loginWithCreds.mockResolvedValueOnce();
|
||||
|
||||
const { getByRole, queryByTestId, container } = renderComponent();
|
||||
|
||||
@@ -145,7 +145,7 @@ const login = async (form: LoginRequestDto) => {
|
||||
}
|
||||
await settingsStore.getSettings();
|
||||
|
||||
if (settingsStore.loadedModules.length > 0) {
|
||||
if (settingsStore.activeModules.length > 0) {
|
||||
await settingsStore.getModuleSettings();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user