From 89f150c497ed04bdaaaa982cb0055b792e4a6b47 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Wed, 31 May 2023 21:54:46 +0530 Subject: [PATCH] fix: remove envs props from config which is no longer in use Signed-off-by: Pranav C --- packages/nocodb/src/Noco.ts | 8 +------- packages/nocodb/src/utils/nc-config/NcConfig.ts | 7 +------ 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/packages/nocodb/src/Noco.ts b/packages/nocodb/src/Noco.ts index 048901ac47..542e20166f 100644 --- a/packages/nocodb/src/Noco.ts +++ b/packages/nocodb/src/Noco.ts @@ -30,13 +30,7 @@ export default class Noco { private static logger = new Logger(Noco.name); public static get dashboardUrl(): string { - let siteUrl = `http://localhost:${process.env.PORT || 8080}`; - // if (Noco._this?.config?.envs?.[Noco._this?.env]?.publicUrl) { - // siteUrl = Noco._this?.config?.envs?.[Noco._this?.env]?.publicUrl; - // } - if (Noco._this?.config?.envs?.['_noco']?.publicUrl) { - siteUrl = Noco._this?.config?.envs?.['_noco']?.publicUrl; - } + const siteUrl = `http://localhost:${process.env.PORT || 8080}`; return `${siteUrl}${Noco._this?.config?.dashboardPath}`; } diff --git a/packages/nocodb/src/utils/nc-config/NcConfig.ts b/packages/nocodb/src/utils/nc-config/NcConfig.ts index cd8cb0e2fe..7c247685f9 100644 --- a/packages/nocodb/src/utils/nc-config/NcConfig.ts +++ b/packages/nocodb/src/utils/nc-config/NcConfig.ts @@ -40,9 +40,6 @@ export class NcConfig { publicUrl?: string; dashboardPath?: string; - // TODO what is this? - envs: any; - queriesFolder: string; env: string; workingEnv: string; @@ -81,8 +78,7 @@ export class NcConfig { ncConfig.env = '_noco'; ncConfig.workingEnv = '_noco'; - ncConfig.projectType = - ncConfig?.envs?.[ncConfig.workingEnv]?.db?.[0]?.meta?.api?.type || 'rest'; + ncConfig.projectType = 'rest'; if (ncConfig.meta?.db?.connection?.filename) { ncConfig.meta.db.connection.filename = path.join( @@ -120,7 +116,6 @@ export class NcConfig { } if (publicUrl) { - ncConfig.envs['_noco'].publicUrl = publicUrl; ncConfig.publicUrl = publicUrl; }