From 6335e0938d469ec2c891e0da4ea2b9918d132bee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Tue, 25 Apr 2023 16:18:46 +0000 Subject: [PATCH] fix(editor): Make the frontend work again when `NODE_FUNCTION_ALLOW_EXTERNAL` is set (no-changelog) (#6058) --- packages/cli/src/config/index.ts | 1 + packages/editor-ui/src/stores/settings.ts | 7 ++----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/cli/src/config/index.ts b/packages/cli/src/config/index.ts index 4b87524611..6f20ba3fb9 100644 --- a/packages/cli/src/config/index.ts +++ b/packages/cli/src/config/index.ts @@ -16,6 +16,7 @@ if (inE2ETests) { N8N_PUBLIC_API_DISABLED: 'true', EXTERNAL_FRONTEND_HOOKS_URLS: '', N8N_PERSONALIZATION_ENABLED: 'false', + NODE_FUNCTION_ALLOW_EXTERNAL: 'node-fetch', }; } else if (inTest) { process.env.N8N_PUBLIC_API_DISABLED = 'true'; diff --git a/packages/editor-ui/src/stores/settings.ts b/packages/editor-ui/src/stores/settings.ts index 12e7edcc90..65fb38b137 100644 --- a/packages/editor-ui/src/stores/settings.ts +++ b/packages/editor-ui/src/stores/settings.ts @@ -235,11 +235,8 @@ export const useSettingsStore = defineStore(STORES.SETTINGS, { setPromptsData(promptsData: IN8nPrompts): void { Vue.set(this, 'promptsData', promptsData); }, - setAllowedModules(allowedModules: { builtIn?: string; external?: string }): void { - this.settings.allowedModules = { - ...(allowedModules.builtIn && { builtIn: allowedModules.builtIn.split(',') }), - ...(allowedModules.external && { external: allowedModules.external.split(',') }), - }; + setAllowedModules(allowedModules: { builtIn?: string[]; external?: string[] }): void { + this.settings.allowedModules = allowedModules; }, async fetchPromptsData(): Promise { if (!this.isTelemetryEnabled) {