diff --git a/packages/nc-gui/composables/useGridViewColumnWidth.ts b/packages/nc-gui/composables/useGridViewColumnWidth.ts index 4e7786c250..66b180c3ae 100644 --- a/packages/nc-gui/composables/useGridViewColumnWidth.ts +++ b/packages/nc-gui/composables/useGridViewColumnWidth.ts @@ -13,7 +13,7 @@ import { watch, } from '#imports' -export function useGridViewColumnWidth(view: Ref) { +export function useGridViewColumnWidth(view: Ref<(ViewType & { columns?: GridColumnType[] }) | undefined>) { const { css, load: loadCss, unload: unloadCss } = useStyleTag('') const { isUIAllowed } = useUIPermission() @@ -52,7 +52,9 @@ export function useGridViewColumnWidth(view: Ref) { const loadGridViewColumns = async () => { if (!view.value?.id && !isPublic.value) return - const colsData: GridColumnType[] = (isPublic.value ? columns.value : await $api.dbView.gridColumnsList(view.value!.id!)) ?? [] + const colsData: GridColumnType[] = + (isPublic.value ? view.value?.columns : await $api.dbView.gridColumnsList(view.value!.id!)) ?? [] + gridViewCols.value = colsData.reduce>( (o, col) => ({ ...o, diff --git a/packages/nc-gui/package-lock.json b/packages/nc-gui/package-lock.json index ba86a9b893..57c16ce20f 100644 --- a/packages/nc-gui/package-lock.json +++ b/packages/nc-gui/package-lock.json @@ -30,7 +30,7 @@ "leaflet.markercluster": "^1.5.3", "locale-codes": "^1.3.1", "monaco-editor": "^0.33.0", - "nocodb-sdk": "0.108.0", + "nocodb-sdk": "file:../nocodb-sdk", "papaparse": "^5.3.2", "pinia": "^2.0.33", "qrcode": "^1.5.1", @@ -111,7 +111,6 @@ }, "../nocodb-sdk": { "version": "0.108.0", - "extraneous": true, "license": "AGPL-3.0-or-later", "dependencies": { "axios": "^0.21.1", @@ -8776,6 +8775,7 @@ "version": "1.15.1", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.1.tgz", "integrity": "sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==", + "devOptional": true, "funding": [ { "type": "individual", @@ -12294,21 +12294,8 @@ } }, "node_modules/nocodb-sdk": { - "version": "0.108.0", - "resolved": "https://registry.npmjs.org/nocodb-sdk/-/nocodb-sdk-0.108.0.tgz", - "integrity": "sha512-AKv6aIy0ZWdvU6ZeniaiCYeeQB2EPjCfKOtSGLZtt1b8fqqoLBSER7l/IrzfR0qUH/4GsO2mb0hUuGiBqYdSfQ==", - "dependencies": { - "axios": "^0.21.1", - "jsep": "^1.3.6" - } - }, - "node_modules/nocodb-sdk/node_modules/axios": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", - "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", - "dependencies": { - "follow-redirects": "^1.14.0" - } + "resolved": "../nocodb-sdk", + "link": true }, "node_modules/node-abi": { "version": "3.23.0", @@ -24810,7 +24797,8 @@ "follow-redirects": { "version": "1.15.1", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.1.tgz", - "integrity": "sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==" + "integrity": "sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==", + "devOptional": true }, "form-data": { "version": "4.0.0", @@ -27360,22 +27348,22 @@ } }, "nocodb-sdk": { - "version": "0.108.0", - "resolved": "https://registry.npmjs.org/nocodb-sdk/-/nocodb-sdk-0.108.0.tgz", - "integrity": "sha512-AKv6aIy0ZWdvU6ZeniaiCYeeQB2EPjCfKOtSGLZtt1b8fqqoLBSER7l/IrzfR0qUH/4GsO2mb0hUuGiBqYdSfQ==", + "version": "file:../nocodb-sdk", "requires": { + "@typescript-eslint/eslint-plugin": "^4.0.1", + "@typescript-eslint/parser": "^4.0.1", "axios": "^0.21.1", - "jsep": "^1.3.6" - }, - "dependencies": { - "axios": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", - "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", - "requires": { - "follow-redirects": "^1.14.0" - } - } + "cspell": "^4.1.0", + "eslint": "^7.8.0", + "eslint-config-prettier": "^6.11.0", + "eslint-plugin-eslint-comments": "^3.2.0", + "eslint-plugin-functional": "^3.0.2", + "eslint-plugin-import": "^2.22.0", + "eslint-plugin-prettier": "^4.0.0", + "jsep": "^1.3.6", + "npm-run-all": "^4.1.5", + "prettier": "^2.1.1", + "typescript": "^4.0.2" } }, "node-abi": { diff --git a/packages/nc-gui/package.json b/packages/nc-gui/package.json index f306b59104..847017b499 100644 --- a/packages/nc-gui/package.json +++ b/packages/nc-gui/package.json @@ -54,7 +54,7 @@ "leaflet.markercluster": "^1.5.3", "locale-codes": "^1.3.1", "monaco-editor": "^0.33.0", - "nocodb-sdk": "0.108.0", + "nocodb-sdk": "file:../nocodb-sdk", "papaparse": "^5.3.2", "pinia": "^2.0.33", "qrcode": "^1.5.1", diff --git a/packages/nocodb-sdk/package-lock.json b/packages/nocodb-sdk/package-lock.json index e130eba8d1..bc444e9392 100644 --- a/packages/nocodb-sdk/package-lock.json +++ b/packages/nocodb-sdk/package-lock.json @@ -1,12 +1,12 @@ { "name": "nocodb-sdk", - "version": "0.108.0-beta.0", + "version": "0.108.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "nocodb-sdk", - "version": "0.108.0-beta.0", + "version": "0.108.0", "license": "AGPL-3.0-or-later", "dependencies": { "axios": "^0.21.1", diff --git a/packages/nocodb/package-lock.json b/packages/nocodb/package-lock.json index b505de42f8..e7b388a078 100644 --- a/packages/nocodb/package-lock.json +++ b/packages/nocodb/package-lock.json @@ -83,7 +83,7 @@ "nc-lib-gui": "0.108.0", "nc-plugin": "^0.1.3", "ncp": "^2.0.0", - "nocodb-sdk": "0.108.0", + "nocodb-sdk": "file:../nocodb-sdk", "nodemailer": "^6.4.10", "object-hash": "^3.0.0", "os-locale": "^6.0.2", @@ -191,7 +191,6 @@ }, "../nocodb-sdk": { "version": "0.108.0", - "extraneous": true, "license": "AGPL-3.0-or-later", "dependencies": { "axios": "^0.21.1", @@ -13207,13 +13206,8 @@ } }, "node_modules/nocodb-sdk": { - "version": "0.108.0", - "resolved": "https://registry.npmjs.org/nocodb-sdk/-/nocodb-sdk-0.108.0.tgz", - "integrity": "sha512-AKv6aIy0ZWdvU6ZeniaiCYeeQB2EPjCfKOtSGLZtt1b8fqqoLBSER7l/IrzfR0qUH/4GsO2mb0hUuGiBqYdSfQ==", - "dependencies": { - "axios": "^0.21.1", - "jsep": "^1.3.6" - } + "resolved": "../nocodb-sdk", + "link": true }, "node_modules/node-abort-controller": { "version": "3.1.1", @@ -28485,12 +28479,22 @@ "integrity": "sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==" }, "nocodb-sdk": { - "version": "0.108.0", - "resolved": "https://registry.npmjs.org/nocodb-sdk/-/nocodb-sdk-0.108.0.tgz", - "integrity": "sha512-AKv6aIy0ZWdvU6ZeniaiCYeeQB2EPjCfKOtSGLZtt1b8fqqoLBSER7l/IrzfR0qUH/4GsO2mb0hUuGiBqYdSfQ==", + "version": "file:../nocodb-sdk", "requires": { + "@typescript-eslint/eslint-plugin": "^4.0.1", + "@typescript-eslint/parser": "^4.0.1", "axios": "^0.21.1", - "jsep": "^1.3.6" + "cspell": "^4.1.0", + "eslint": "^7.8.0", + "eslint-config-prettier": "^6.11.0", + "eslint-plugin-eslint-comments": "^3.2.0", + "eslint-plugin-functional": "^3.0.2", + "eslint-plugin-import": "^2.22.0", + "eslint-plugin-prettier": "^4.0.0", + "jsep": "^1.3.6", + "npm-run-all": "^4.1.5", + "prettier": "^2.1.1", + "typescript": "^4.0.2" } }, "node-abort-controller": { diff --git a/packages/nocodb/package.json b/packages/nocodb/package.json index 8d004cd612..989c911c05 100644 --- a/packages/nocodb/package.json +++ b/packages/nocodb/package.json @@ -116,7 +116,7 @@ "nc-lib-gui": "0.108.0", "nc-plugin": "^0.1.3", "ncp": "^2.0.0", - "nocodb-sdk": "0.108.0", + "nocodb-sdk": "file:../nocodb-sdk", "nodemailer": "^6.4.10", "object-hash": "^3.0.0", "os-locale": "^6.0.2", @@ -203,4 +203,4 @@ "coverageDirectory": "../coverage", "testEnvironment": "node" } -} \ No newline at end of file +} 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; }