feat: Add temporary env variable N8N_FOLDERS_ENABLED (no-changelog) (#13374)

This commit is contained in:
Ricardo Espinoza 2025-02-19 19:34:29 -05:00 committed by GitHub
parent 1e5feb195d
commit aae55fe7ac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 26 additions and 0 deletions

View file

@ -156,6 +156,9 @@ export interface FrontendSettings {
mfa: {
enabled: boolean;
};
folders: {
enabled: boolean;
};
banners: {
dismissed: string[];
};

View file

@ -370,4 +370,13 @@ export const schema = {
env: 'N8N_PROXY_HOPS',
doc: 'Number of reverse-proxies n8n is running behind',
},
folders: {
enabled: {
format: Boolean,
default: false,
env: 'N8N_FOLDERS_ENABLED',
doc: 'Temporary env variable to enable folders feature',
},
},
};

View file

@ -233,6 +233,9 @@ export class FrontendService {
},
easyAIWorkflowOnboarded: false,
partialExecution: this.globalConfig.partialExecutions,
folders: {
enabled: false,
},
};
}
@ -360,6 +363,8 @@ export class FrontendService {
this.settings.enterprise.projects.team.limit = this.license.getTeamProjectLimit();
this.settings.folders.enabled = config.get('folders.enabled');
return this.settings;
}

View file

@ -140,4 +140,7 @@ export const defaultSettings: FrontendSettings = {
version: 1,
enforce: false,
},
folders: {
enabled: false,
},
};

View file

@ -43,6 +43,8 @@ export const useSettingsStore = defineStore(STORES.SETTINGS, () => {
const ldap = ref({ loginLabel: '', loginEnabled: false });
const saml = ref({ loginLabel: '', loginEnabled: false });
const mfa = ref({ enabled: false });
const folders = ref({ enabled: false });
const saveDataErrorExecution = ref<WorkflowSettings.SaveDataExecution>('all');
const saveDataSuccessExecution = ref<WorkflowSettings.SaveDataExecution>('all');
const saveManualExecutions = ref(false);
@ -141,6 +143,8 @@ export const useSettingsStore = defineStore(STORES.SETTINGS, () => {
const isMfaFeatureEnabled = computed(() => mfa.value.enabled);
const isFoldersFeatureEnabled = computed(() => folders.value.enabled);
const areTagsEnabled = computed(() =>
settings.value.workflowTagsDisabled !== undefined ? !settings.value.workflowTagsDisabled : true,
);
@ -203,6 +207,7 @@ export const useSettingsStore = defineStore(STORES.SETTINGS, () => {
}
mfa.value.enabled = settings.value.mfa?.enabled;
folders.value.enabled = settings.value.folders?.enabled;
if (settings.value.enterprise?.showNonProdBanner) {
useUIStore().pushBannerToStack('NON_PRODUCTION_LICENSE');
@ -411,6 +416,7 @@ export const useSettingsStore = defineStore(STORES.SETTINGS, () => {
logLevel,
isTelemetryEnabled,
isMfaFeatureEnabled,
isFoldersFeatureEnabled,
isAiAssistantEnabled,
areTagsEnabled,
isHiringBannerEnabled,