From 83287ef150b71bc4383235d0aa520aab13a3fc0b Mon Sep 17 00:00:00 2001 From: Pranav C Date: Tue, 20 Feb 2024 09:02:40 +0000 Subject: [PATCH 1/6] fix: encode url params --- packages/nocodb/src/utils/nc-config/helpers.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/nocodb/src/utils/nc-config/helpers.ts b/packages/nocodb/src/utils/nc-config/helpers.ts index a8bf1c84cf..7ae244b0a2 100644 --- a/packages/nocodb/src/utils/nc-config/helpers.ts +++ b/packages/nocodb/src/utils/nc-config/helpers.ts @@ -109,14 +109,16 @@ export function jdbcToXcUrl(url: string): string { const extraParams = []; for (const [key, value] of Object.entries(extra)) { - extraParams.push(`${key}=${value}`); + extraParams.push(`${key}=${encodeURIComponent(value + '')}`); } const res = `${driverClientMapping[driver] || driver}://${host}${ port ? `:${port}` : '' - }?${user ? `u=${user}&` : ''}${password ? `p=${password}&` : ''}${ - database ? `d=${database}&` : '' - }${extraParams.join('&')}`; + }?${user ? `u=${encodeURIComponent(user)}&` : ''}${ + password ? `p=${encodeURIComponent(password)}&` : '' + }${database ? `d=${encodeURIComponent(database)}&` : ''}${extraParams.join( + '&', + )}`; return res; } From 841a450a2d9c2528ba6f33f046f6b8af38daf902 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Tue, 20 Feb 2024 09:02:41 +0000 Subject: [PATCH 2/6] chore: run license check even before initializing meta --- packages/nocodb/src/modules/global/global.module.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nocodb/src/modules/global/global.module.ts b/packages/nocodb/src/modules/global/global.module.ts index 0d58a77729..1f4abce3d9 100644 --- a/packages/nocodb/src/modules/global/global.module.ts +++ b/packages/nocodb/src/modules/global/global.module.ts @@ -1,7 +1,7 @@ import { forwardRef, Global, Module } from '@nestjs/common'; import { ExtractJwt } from 'passport-jwt'; -import { InitMetaServiceProvider } from './init-meta-service.provider'; import type { Provider } from '@nestjs/common'; +import { InitMetaServiceProvider } from '~/modules/global/init-meta-service.provider'; import { EventEmitterModule } from '~/modules/event-emitter/event-emitter.module'; import { SocketGateway } from '~/gateways/socket.gateway'; import { GlobalGuard } from '~/guards/global/global.guard'; From 2afa7a8a8698591675a93c9c1436fde5add6b698 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Tue, 20 Feb 2024 09:02:41 +0000 Subject: [PATCH 3/6] fix: use relative path until alias issue resolves --- .../nocodb/src/modules/global/init-meta-service.provider.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nocodb/src/modules/global/init-meta-service.provider.ts b/packages/nocodb/src/modules/global/init-meta-service.provider.ts index 7d873f0540..a19238e8c9 100644 --- a/packages/nocodb/src/modules/global/init-meta-service.provider.ts +++ b/packages/nocodb/src/modules/global/init-meta-service.provider.ts @@ -1,5 +1,5 @@ import { T } from 'nc-help'; -import type { Provider } from '@nestjs/common'; +import type { FactoryProvider } from '@nestjs/common'; import type { IEventEmitter } from '~/modules/event-emitter/event-emitter.interface'; import { populatePluginsForCloud } from '~/utils/cloud/populateCloudPlugins'; import { MetaService } from '~/meta/meta.service'; @@ -12,7 +12,7 @@ import initAdminFromEnv from '~/helpers/initAdminFromEnv'; import { User } from '~/models'; import { NcConfig, prepareEnv } from '~/utils/nc-config'; -export const InitMetaServiceProvider: Provider = { +export const InitMetaServiceProvider: FactoryProvider = { // initialize app, // 1. init cache // 2. init db connection and create if not exist From f290597266cb6a3674a67803b32439b641b42029 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Tue, 20 Feb 2024 09:02:42 +0000 Subject: [PATCH 4/6] feat: set baseUrl of app --- packages/nc-gui/composables/useGlobal/actions.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/nc-gui/composables/useGlobal/actions.ts b/packages/nc-gui/composables/useGlobal/actions.ts index 78e6b522fa..46e07d7591 100644 --- a/packages/nc-gui/composables/useGlobal/actions.ts +++ b/packages/nc-gui/composables/useGlobal/actions.ts @@ -142,6 +142,11 @@ export function useGlobalActions(state: State): Actions { } const getBaseUrl = (workspaceId: string) => { + // if baseUrl is set in appInfo, use it (which is part of license data in on-prem version and included in appInfo API) + if (state.appInfo.value.baseUrl) { + return state.appInfo.value.baseUrl + } + if (state.appInfo.value.baseHostName && location.hostname !== `${workspaceId}.${state.appInfo.value.baseHostName}`) { return `https://${workspaceId}.${state.appInfo.value.baseHostName}` } From f919dd9744e7ab7ee824cd7a599c41632d973e69 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Tue, 20 Feb 2024 09:02:47 +0000 Subject: [PATCH 5/6] feat: EE trial implementation --- packages/nc-gui/assets/nc-icons/phone-call.svg | 3 +++ packages/nc-gui/components/dashboard/Sidebar.vue | 3 ++- .../nc-gui/components/dashboard/Sidebar/BeforeUserInfo.vue | 3 +++ packages/nc-gui/components/dashboard/Sidebar/UserInfo.vue | 2 +- packages/nc-gui/utils/iconUtils.ts | 3 ++- 5 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 packages/nc-gui/assets/nc-icons/phone-call.svg create mode 100644 packages/nc-gui/components/dashboard/Sidebar/BeforeUserInfo.vue diff --git a/packages/nc-gui/assets/nc-icons/phone-call.svg b/packages/nc-gui/assets/nc-icons/phone-call.svg new file mode 100644 index 0000000000..29d7722a4f --- /dev/null +++ b/packages/nc-gui/assets/nc-icons/phone-call.svg @@ -0,0 +1,3 @@ + + + diff --git a/packages/nc-gui/components/dashboard/Sidebar.vue b/packages/nc-gui/components/dashboard/Sidebar.vue index 2b2c9a6551..30b2d08508 100644 --- a/packages/nc-gui/components/dashboard/Sidebar.vue +++ b/packages/nc-gui/components/dashboard/Sidebar.vue @@ -56,7 +56,8 @@ onUnmounted(() => { > -
+
+
diff --git a/packages/nc-gui/components/dashboard/Sidebar/BeforeUserInfo.vue b/packages/nc-gui/components/dashboard/Sidebar/BeforeUserInfo.vue new file mode 100644 index 0000000000..b95f1483e9 --- /dev/null +++ b/packages/nc-gui/components/dashboard/Sidebar/BeforeUserInfo.vue @@ -0,0 +1,3 @@ + diff --git a/packages/nc-gui/components/dashboard/Sidebar/UserInfo.vue b/packages/nc-gui/components/dashboard/Sidebar/UserInfo.vue index 5c41031a43..7207a9724c 100644 --- a/packages/nc-gui/components/dashboard/Sidebar/UserInfo.vue +++ b/packages/nc-gui/components/dashboard/Sidebar/UserInfo.vue @@ -78,7 +78,7 @@ onMounted(() => {