From d02630949b68cf287cb22757b75b7392362ba8f9 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Sun, 17 Apr 2022 20:31:15 +0800 Subject: [PATCH 01/11] fix: unsafe repository issue in actions/checkout Signed-off-by: Wing-Kam Wong --- .github/workflows/sync-to-develop.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/sync-to-develop.yml b/.github/workflows/sync-to-develop.yml index 17571b175c..e3c327f3ae 100644 --- a/.github/workflows/sync-to-develop.yml +++ b/.github/workflows/sync-to-develop.yml @@ -9,6 +9,11 @@ jobs: sync-to-develop: runs-on: ubuntu-latest steps: + # See https://github.com/actions/checkout/issues/766 + - name: Workaround for unsafe repository issue + run: | + git config --global --add safe.directory ${GITHUB_WORKSPACE} + - name: Checkout uses: actions/checkout@v1 From ae3f260519e9b508af387c3fa0d4aac44fee4d22 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Sun, 17 Apr 2022 20:36:19 +0800 Subject: [PATCH 02/11] fix: remove extra space Signed-off-by: Wing-Kam Wong --- README.md | 2 +- packages/noco-docs/content/en/getting-started/installation.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2757641f23..fd4af9aa40 100644 --- a/README.md +++ b/README.md @@ -93,7 +93,7 @@ npm start ```bash # for SQLite docker run -d --name nocodb \ --v "$(pwd)"/nocodb:/usr/app/data/ \ +-v "$(pwd)"/nocodb:/usr/app/data/ \ -p 8080:8080 \ nocodb/nocodb:latest diff --git a/packages/noco-docs/content/en/getting-started/installation.md b/packages/noco-docs/content/en/getting-started/installation.md index f62db95801..8fd20b70da 100644 --- a/packages/noco-docs/content/en/getting-started/installation.md +++ b/packages/noco-docs/content/en/getting-started/installation.md @@ -66,7 +66,7 @@ If you are a Docker user, you may try this way! ```bash docker run -d --name nocodb \ - -v "$(pwd)"/nocodb:/usr/app/data/ \ + -v "$(pwd)"/nocodb:/usr/app/data/ \ -p 8080:8080 \ nocodb/nocodb:latest ``` From 300d7a314a0eae1af01c0e0fe5eff95cac4cb600 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Sun, 17 Apr 2022 21:29:18 +0800 Subject: [PATCH 03/11] docs: fix delete function name Signed-off-by: Wing-Kam Wong --- packages/noco-docs/content/en/developer-resources/rest-apis.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/noco-docs/content/en/developer-resources/rest-apis.md b/packages/noco-docs/content/en/developer-resources/rest-apis.md index cb4b517364..7998fd33ae 100644 --- a/packages/noco-docs/content/en/developer-resources/rest-apis.md +++ b/packages/noco-docs/content/en/developer-resources/rest-apis.md @@ -50,7 +50,7 @@ Here's the overview of all APIs. For the details, please check out TODO: description", "author": "“pranavxc” ", "homepage": "https://gitlab.com/xgenecloud-ts/xgenecloud-ts#readme", diff --git a/packages/nocodb-sdk/package-lock.json b/packages/nocodb-sdk/package-lock.json index 1a1d81b135..bb76580586 100644 --- a/packages/nocodb-sdk/package-lock.json +++ b/packages/nocodb-sdk/package-lock.json @@ -1,6 +1,6 @@ { "name": "nocodb-sdk", - "version": "0.90.1", + "version": "0.90.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/nocodb-sdk/package.json b/packages/nocodb-sdk/package.json index 293a63ee22..1f085b0e37 100644 --- a/packages/nocodb-sdk/package.json +++ b/packages/nocodb-sdk/package.json @@ -1,6 +1,6 @@ { "name": "nocodb-sdk", - "version": "0.90.1", + "version": "0.90.2", "description": "NocoDB SDK", "main": "build/main/index.js", "typings": "build/main/index.d.ts", diff --git a/packages/nocodb/package-lock.json b/packages/nocodb/package-lock.json index 7249127e81..583d4b2d16 100644 --- a/packages/nocodb/package-lock.json +++ b/packages/nocodb/package-lock.json @@ -1,6 +1,6 @@ { "name": "nocodb", - "version": "0.90.1", + "version": "0.90.2", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -12483,9 +12483,9 @@ } }, "nc-lib-gui": { - "version": "0.90.1", - "resolved": "https://registry.npmjs.org/nc-lib-gui/-/nc-lib-gui-0.90.1.tgz", - "integrity": "sha512-4S/hOUUwrpIBfjEgiONEjAdanejv6yFdIq77RZjvuhuGuySccHMdvOZ7KOWkxsdiDXCzc0W0YCCyn6WICKUrVA==", + "version": "0.90.2", + "resolved": "https://registry.npmjs.org/nc-lib-gui/-/nc-lib-gui-0.90.2.tgz", + "integrity": "sha512-+ftnlNyc6I/QU8DxAITSBNSoK7cHZAL4JjLIk7xqFSP4M7v3shCTDO4zkxOxVRih5z915dj1iR/Vw7A5qWz58A==", "requires": { "axios": "^0.19.2", "body-parser": "^1.19.0", @@ -12592,9 +12592,9 @@ "dev": true }, "nocodb-sdk": { - "version": "0.90.1", - "resolved": "https://registry.npmjs.org/nocodb-sdk/-/nocodb-sdk-0.90.1.tgz", - "integrity": "sha512-hjweeyVQHD4EGcF8BwF7yrONrWJzN065d09KvK5HWiEjupdzkGwBpz3blK2YqDQQNdLwjwzMBVjS0BnxBYdq3A==", + "version": "0.90.2", + "resolved": "https://registry.npmjs.org/nocodb-sdk/-/nocodb-sdk-0.90.2.tgz", + "integrity": "sha512-myA+9Vluo4iULAd8hT0xO0I7n5kKIPhL+6p2LNBiE9FL9g1xRIMt5stDpuhP79qTiSMiXvdOV2Wyb1Zqz/7Qiw==", "requires": { "axios": "^0.21.1", "jsep": "^0.4.0" diff --git a/packages/nocodb/package.json b/packages/nocodb/package.json index b4540a6d3a..907f02ea68 100644 --- a/packages/nocodb/package.json +++ b/packages/nocodb/package.json @@ -1,6 +1,6 @@ { "name": "nocodb", - "version": "0.90.1", + "version": "0.90.2", "description": "NocoDB", "main": "dist/bundle.js", "repository": "https://github.com/nocodb/nocodb", @@ -151,10 +151,10 @@ "nanoid": "^3.1.20", "nc-common": "0.0.6", "nc-help": "^0.2.44", - "nc-lib-gui": "0.90.1", + "nc-lib-gui": "0.90.2", "nc-plugin": "^0.1.1", "ncp": "^2.0.0", - "nocodb-sdk": "0.90.1", + "nocodb-sdk": "0.90.2", "nodemailer": "^6.4.10", "ora": "^4.0.4", "os-locale": "^5.0.0", From ab3a4c53166dca8ccf27e696863ae342df2b2ee4 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Mon, 18 Apr 2022 12:23:17 +0800 Subject: [PATCH 07/11] fix: import csv issue Signed-off-by: Wing-Kam Wong --- .../project/spreadsheet/components/moreActions.vue | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/nc-gui/components/project/spreadsheet/components/moreActions.vue b/packages/nc-gui/components/project/spreadsheet/components/moreActions.vue index 630f94eb7c..b8be60b14e 100644 --- a/packages/nc-gui/components/project/spreadsheet/components/moreActions.vue +++ b/packages/nc-gui/components/project/spreadsheet/components/moreActions.vue @@ -286,10 +286,6 @@ export default { }, async importData(columnMappings) { try { - const api = this.$ncApis.get({ - table: this.meta.table_name - }) - const data = this.parsedCsv.data for (let i = 0, progress = 0; i < data.length; i += 500) { const batchData = data.slice(i, i + 500).map(row => columnMappings.reduce((res, col) => { @@ -312,7 +308,12 @@ export default { } return res }, {})) - await api.insertBulk(batchData) + await this.$api.dbTableRow.bulkCreate( + 'noco', + this.projectName, + this.meta.title, + batchData + ) progress += batchData.length this.$store.commit('loader/MutMessage', `Importing data : ${progress}/${data.length}`) this.$store.commit('loader/MutProgress', Math.round((100 * progress / data.length))) From 94cd1198bd8d4862fa76681eeeee8f1f95cccab8 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Mon, 18 Apr 2022 13:24:41 +0800 Subject: [PATCH 08/11] fix: NC_DISABLE_TELE typo Signed-off-by: Wing-Kam Wong --- packages/nocodb/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nocodb/package.json b/packages/nocodb/package.json index 907f02ea68..59e6aebe34 100644 --- a/packages/nocodb/package.json +++ b/packages/nocodb/package.json @@ -67,7 +67,7 @@ "help:c": "ts-node ./help/a", "watch:build": "nodemon -e ts,js -w ./src -x npm run build", "watch:serve": "nodemon -e ts -w ./build -x npm run debug-local ", - "watch:run": "cross-env NC_DISABLE_TELE1=true EE=true nodemon -e ts,js -w ./src -x \"ts-node src/example/docker --log-error --project tsconfig.json\"", + "watch:run": "cross-env NC_DISABLE_TELE=true EE=true nodemon -e ts,js -w ./src -x \"ts-node src/example/docker --log-error --project tsconfig.json\"", "watch:run:cypress": "cross-env EE=true nodemon -e ts,js -w ./src -x \"ts-node src/example/docker --log-error --project tsconfig.json\"", "watch:run:mysql": "cross-env NC_DISABLE_TELE=true EE=true nodemon -e ts,js -w ./src -x \"ts-node src/example/dockerRunMysql --log-error --project tsconfig.json\"", "run": "ts-node src/example/docker", From 970d2730d48984be62ae04d804d73fb6cac0693c Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Mon, 18 Apr 2022 10:55:39 +0530 Subject: [PATCH 09/11] chore: typo correction for better error update Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> --- packages/nocodb/src/lib/noco/meta/helpers/catchError.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/nocodb/src/lib/noco/meta/helpers/catchError.ts b/packages/nocodb/src/lib/noco/meta/helpers/catchError.ts index ee75573a03..f83c8fc94b 100644 --- a/packages/nocodb/src/lib/noco/meta/helpers/catchError.ts +++ b/packages/nocodb/src/lib/noco/meta/helpers/catchError.ts @@ -8,7 +8,7 @@ export default function( // todo: error log console.log(requestHandler.name ? `${requestHandler.name} ::` : '', e); - if (e instanceof BasRequest) { + if (e instanceof BadRequest) { return res.status(400).json({ msg: e.message }); } else if (e instanceof Unauthorized) { return res.status(401).json({ msg: e.message }); @@ -26,7 +26,7 @@ export default function( }; } -class BasRequest extends Error {} +class BadRequest extends Error {} class Unauthorized extends Error {} class Forbidden extends Error {} class NotFound extends Error {} @@ -38,7 +38,7 @@ export class NcError { throw new NotFound(message); } static badRequest(message) { - throw new BasRequest(message); + throw new BadRequest(message); } static unauthorized(message) { throw new Unauthorized(message); From 3e046ac1e2405315c8287793231aa26c8a3a3f8a Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Mon, 18 Apr 2022 18:00:56 +0800 Subject: [PATCH 10/11] fix: checkbox always false issue Signed-off-by: Wing-Kam Wong --- .../components/project/appStore/inputs/checkboxField.vue | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/nc-gui/components/project/appStore/inputs/checkboxField.vue b/packages/nc-gui/components/project/appStore/inputs/checkboxField.vue index d8c05e90fb..5d46f03fd8 100644 --- a/packages/nc-gui/components/project/appStore/inputs/checkboxField.vue +++ b/packages/nc-gui/components/project/appStore/inputs/checkboxField.vue @@ -29,9 +29,6 @@ export default { return $listeners } }, - created() { - this.localState = false - }, } From b9250af0587dd3c71f7cf8359330b6b702cfeffa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D5=A1=C9=A8=D5=BC=C9=A2=D3=84=D5=A1=D6=85=D5=BC=C9=A2?= Date: Mon, 18 Apr 2022 19:07:09 +0800 Subject: [PATCH 11/11] fix: add alter column dt scripts (#1740) * fix: add alter column dt scripts Signed-off-by: Wing-Kam Wong * refactor: move migration to v2 migrations, modify `dtxp` column, and ignore migration for sqlite Signed-off-by: Pranav C Co-authored-by: Pranav C --- packages/nocodb/package.json | 2 +- .../lib/noco/common/XcMigrationSourcev2.ts | 7 ++- .../{migrations => migrationsv2}/nc_011.ts | 0 .../nc_012_alter_column_data_types.ts | 48 +++++++++++++++++++ 4 files changed, 54 insertions(+), 3 deletions(-) rename packages/nocodb/src/lib/noco/{migrations => migrationsv2}/nc_011.ts (100%) create mode 100644 packages/nocodb/src/lib/noco/migrationsv2/nc_012_alter_column_data_types.ts diff --git a/packages/nocodb/package.json b/packages/nocodb/package.json index 59e6aebe34..907f02ea68 100644 --- a/packages/nocodb/package.json +++ b/packages/nocodb/package.json @@ -67,7 +67,7 @@ "help:c": "ts-node ./help/a", "watch:build": "nodemon -e ts,js -w ./src -x npm run build", "watch:serve": "nodemon -e ts -w ./build -x npm run debug-local ", - "watch:run": "cross-env NC_DISABLE_TELE=true EE=true nodemon -e ts,js -w ./src -x \"ts-node src/example/docker --log-error --project tsconfig.json\"", + "watch:run": "cross-env NC_DISABLE_TELE1=true EE=true nodemon -e ts,js -w ./src -x \"ts-node src/example/docker --log-error --project tsconfig.json\"", "watch:run:cypress": "cross-env EE=true nodemon -e ts,js -w ./src -x \"ts-node src/example/docker --log-error --project tsconfig.json\"", "watch:run:mysql": "cross-env NC_DISABLE_TELE=true EE=true nodemon -e ts,js -w ./src -x \"ts-node src/example/dockerRunMysql --log-error --project tsconfig.json\"", "run": "ts-node src/example/docker", diff --git a/packages/nocodb/src/lib/noco/common/XcMigrationSourcev2.ts b/packages/nocodb/src/lib/noco/common/XcMigrationSourcev2.ts index ba703baab0..25df4729f9 100644 --- a/packages/nocodb/src/lib/noco/common/XcMigrationSourcev2.ts +++ b/packages/nocodb/src/lib/noco/common/XcMigrationSourcev2.ts @@ -1,4 +1,5 @@ -import * as nc_011 from '../migrations/nc_011'; +import * as nc_011 from '../migrationsv2/nc_011'; +import * as nc_012_alter_column_data_types from '../migrationsv2/nc_012_alter_column_data_types'; // Create a custom migration source class export default class XcMigrationSourcev2 { @@ -7,7 +8,7 @@ export default class XcMigrationSourcev2 { // arguments to getMigrationName and getMigration public getMigrations(): Promise { // In this example we are just returning migration names - return Promise.resolve(['nc_011']); + return Promise.resolve(['nc_011', 'nc_012_alter_column_data_types']); } public getMigrationName(migration): string { @@ -18,6 +19,8 @@ export default class XcMigrationSourcev2 { switch (migration) { case 'nc_011': return nc_011; + case 'nc_012_alter_column_data_types': + return nc_012_alter_column_data_types; } } } diff --git a/packages/nocodb/src/lib/noco/migrations/nc_011.ts b/packages/nocodb/src/lib/noco/migrationsv2/nc_011.ts similarity index 100% rename from packages/nocodb/src/lib/noco/migrations/nc_011.ts rename to packages/nocodb/src/lib/noco/migrationsv2/nc_011.ts diff --git a/packages/nocodb/src/lib/noco/migrationsv2/nc_012_alter_column_data_types.ts b/packages/nocodb/src/lib/noco/migrationsv2/nc_012_alter_column_data_types.ts new file mode 100644 index 0000000000..6f643cba0f --- /dev/null +++ b/packages/nocodb/src/lib/noco/migrationsv2/nc_012_alter_column_data_types.ts @@ -0,0 +1,48 @@ +import Knex from 'knex'; +import { MetaTable } from '../../utils/globals'; + +const up = async (knex: Knex) => { + if (knex.client.config.client !== 'sqlite3') { + await knex.schema.alterTable(MetaTable.COLUMNS, table => { + table.text('cdf').alter(); + table.text('dtxp').alter(); + table.text('cc').alter(); + table.text('ct').alter(); + }); + } +}; + +const down = async knex => { + await knex.schema.alterTable(MetaTable.COLUMNS, table => { + if (knex.client.config.client !== 'sqlite3') { + table.string('cdf').alter(); + table.string('dtxp').alter(); + table.string('cc').alter(); + table.string('ct').alter(); + } + }); +}; + +export { up, down }; + +/** + * @copyright Copyright (c) 2022, Xgene Cloud Ltd + * + * @author Wing-Kam Wong + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */