Browse Source

Merge pull request #1746 from nocodb/develop

0.90.3 Pre-release
pull/1749/head 0.90.3
աɨռɢӄաօռɢ 3 years ago committed by GitHub
parent
commit
7374f7583f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      packages/nc-gui/components/project/appStore/inputs/checkboxField.vue
  2. 11
      packages/nc-gui/components/project/spreadsheet/components/moreActions.vue
  3. 6
      packages/nc-gui/package-lock.json
  4. 2
      packages/nc-gui/package.json
  5. 2
      packages/nc-lib-gui/package.json
  6. 2
      packages/nocodb-sdk/package-lock.json
  7. 2
      packages/nocodb-sdk/package.json
  8. 14
      packages/nocodb/package-lock.json
  9. 6
      packages/nocodb/package.json
  10. 7
      packages/nocodb/src/lib/noco/common/XcMigrationSourcev2.ts
  11. 6
      packages/nocodb/src/lib/noco/meta/helpers/catchError.ts
  12. 0
      packages/nocodb/src/lib/noco/migrationsv2/nc_011.ts
  13. 48
      packages/nocodb/src/lib/noco/migrationsv2/nc_012_alter_column_data_types.ts

3
packages/nc-gui/components/project/appStore/inputs/checkboxField.vue

@ -29,9 +29,6 @@ export default {
return $listeners return $listeners
} }
}, },
created() {
this.localState = false
},
} }
</script> </script>

11
packages/nc-gui/components/project/spreadsheet/components/moreActions.vue

@ -286,10 +286,6 @@ export default {
}, },
async importData(columnMappings) { async importData(columnMappings) {
try { try {
const api = this.$ncApis.get({
table: this.meta.table_name
})
const data = this.parsedCsv.data const data = this.parsedCsv.data
for (let i = 0, progress = 0; i < data.length; i += 500) { for (let i = 0, progress = 0; i < data.length; i += 500) {
const batchData = data.slice(i, i + 500).map(row => columnMappings.reduce((res, col) => { const batchData = data.slice(i, i + 500).map(row => columnMappings.reduce((res, col) => {
@ -312,7 +308,12 @@ export default {
} }
return res return res
}, {})) }, {}))
await api.insertBulk(batchData) await this.$api.dbTableRow.bulkCreate(
'noco',
this.projectName,
this.meta.title,
batchData
)
progress += batchData.length progress += batchData.length
this.$store.commit('loader/MutMessage', `Importing data : ${progress}/${data.length}`) this.$store.commit('loader/MutMessage', `Importing data : ${progress}/${data.length}`)
this.$store.commit('loader/MutProgress', Math.round((100 * progress / data.length))) this.$store.commit('loader/MutProgress', Math.round((100 * progress / data.length)))

6
packages/nc-gui/package-lock.json generated

@ -7876,9 +7876,9 @@
} }
}, },
"nocodb-sdk": { "nocodb-sdk": {
"version": "0.90.1", "version": "0.90.2",
"resolved": "https://registry.npmjs.org/nocodb-sdk/-/nocodb-sdk-0.90.1.tgz", "resolved": "https://registry.npmjs.org/nocodb-sdk/-/nocodb-sdk-0.90.2.tgz",
"integrity": "sha512-hjweeyVQHD4EGcF8BwF7yrONrWJzN065d09KvK5HWiEjupdzkGwBpz3blK2YqDQQNdLwjwzMBVjS0BnxBYdq3A==", "integrity": "sha512-myA+9Vluo4iULAd8hT0xO0I7n5kKIPhL+6p2LNBiE9FL9g1xRIMt5stDpuhP79qTiSMiXvdOV2Wyb1Zqz/7Qiw==",
"requires": { "requires": {
"axios": "^0.21.1", "axios": "^0.21.1",
"jsep": "^0.4.0" "jsep": "^0.4.0"

2
packages/nc-gui/package.json

@ -29,7 +29,7 @@
"monaco-editor": "^0.19.3", "monaco-editor": "^0.19.3",
"monaco-themes": "^0.2.5", "monaco-themes": "^0.2.5",
"nano-assign": "^1.0.1", "nano-assign": "^1.0.1",
"nocodb-sdk": "0.90.1", "nocodb-sdk": "0.90.2",
"nuxt": "^2.14.0", "nuxt": "^2.14.0",
"odometer": "^0.4.8", "odometer": "^0.4.8",
"papaparse": "^5.3.1", "papaparse": "^5.3.1",

2
packages/nc-lib-gui/package.json

@ -1,6 +1,6 @@
{ {
"name": "nc-lib-gui", "name": "nc-lib-gui",
"version": "0.90.1", "version": "0.90.2",
"description": "> TODO: description", "description": "> TODO: description",
"author": "“pranavxc” <pranavxc@gmail.com>", "author": "“pranavxc” <pranavxc@gmail.com>",
"homepage": "https://gitlab.com/xgenecloud-ts/xgenecloud-ts#readme", "homepage": "https://gitlab.com/xgenecloud-ts/xgenecloud-ts#readme",

2
packages/nocodb-sdk/package-lock.json generated

@ -1,6 +1,6 @@
{ {
"name": "nocodb-sdk", "name": "nocodb-sdk",
"version": "0.90.1", "version": "0.90.2",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

2
packages/nocodb-sdk/package.json

@ -1,6 +1,6 @@
{ {
"name": "nocodb-sdk", "name": "nocodb-sdk",
"version": "0.90.1", "version": "0.90.2",
"description": "NocoDB SDK", "description": "NocoDB SDK",
"main": "build/main/index.js", "main": "build/main/index.js",
"typings": "build/main/index.d.ts", "typings": "build/main/index.d.ts",

14
packages/nocodb/package-lock.json generated

@ -1,6 +1,6 @@
{ {
"name": "nocodb", "name": "nocodb",
"version": "0.90.1", "version": "0.90.2",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
@ -12483,9 +12483,9 @@
} }
}, },
"nc-lib-gui": { "nc-lib-gui": {
"version": "0.90.1", "version": "0.90.2",
"resolved": "https://registry.npmjs.org/nc-lib-gui/-/nc-lib-gui-0.90.1.tgz", "resolved": "https://registry.npmjs.org/nc-lib-gui/-/nc-lib-gui-0.90.2.tgz",
"integrity": "sha512-4S/hOUUwrpIBfjEgiONEjAdanejv6yFdIq77RZjvuhuGuySccHMdvOZ7KOWkxsdiDXCzc0W0YCCyn6WICKUrVA==", "integrity": "sha512-+ftnlNyc6I/QU8DxAITSBNSoK7cHZAL4JjLIk7xqFSP4M7v3shCTDO4zkxOxVRih5z915dj1iR/Vw7A5qWz58A==",
"requires": { "requires": {
"axios": "^0.19.2", "axios": "^0.19.2",
"body-parser": "^1.19.0", "body-parser": "^1.19.0",
@ -12592,9 +12592,9 @@
"dev": true "dev": true
}, },
"nocodb-sdk": { "nocodb-sdk": {
"version": "0.90.1", "version": "0.90.2",
"resolved": "https://registry.npmjs.org/nocodb-sdk/-/nocodb-sdk-0.90.1.tgz", "resolved": "https://registry.npmjs.org/nocodb-sdk/-/nocodb-sdk-0.90.2.tgz",
"integrity": "sha512-hjweeyVQHD4EGcF8BwF7yrONrWJzN065d09KvK5HWiEjupdzkGwBpz3blK2YqDQQNdLwjwzMBVjS0BnxBYdq3A==", "integrity": "sha512-myA+9Vluo4iULAd8hT0xO0I7n5kKIPhL+6p2LNBiE9FL9g1xRIMt5stDpuhP79qTiSMiXvdOV2Wyb1Zqz/7Qiw==",
"requires": { "requires": {
"axios": "^0.21.1", "axios": "^0.21.1",
"jsep": "^0.4.0" "jsep": "^0.4.0"

6
packages/nocodb/package.json

@ -1,6 +1,6 @@
{ {
"name": "nocodb", "name": "nocodb",
"version": "0.90.1", "version": "0.90.2",
"description": "NocoDB", "description": "NocoDB",
"main": "dist/bundle.js", "main": "dist/bundle.js",
"repository": "https://github.com/nocodb/nocodb", "repository": "https://github.com/nocodb/nocodb",
@ -151,10 +151,10 @@
"nanoid": "^3.1.20", "nanoid": "^3.1.20",
"nc-common": "0.0.6", "nc-common": "0.0.6",
"nc-help": "^0.2.44", "nc-help": "^0.2.44",
"nc-lib-gui": "0.90.1", "nc-lib-gui": "0.90.2",
"nc-plugin": "^0.1.1", "nc-plugin": "^0.1.1",
"ncp": "^2.0.0", "ncp": "^2.0.0",
"nocodb-sdk": "0.90.1", "nocodb-sdk": "0.90.2",
"nodemailer": "^6.4.10", "nodemailer": "^6.4.10",
"ora": "^4.0.4", "ora": "^4.0.4",
"os-locale": "^5.0.0", "os-locale": "^5.0.0",

7
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 // Create a custom migration source class
export default class XcMigrationSourcev2 { export default class XcMigrationSourcev2 {
@ -7,7 +8,7 @@ export default class XcMigrationSourcev2 {
// arguments to getMigrationName and getMigration // arguments to getMigrationName and getMigration
public getMigrations(): Promise<any> { public getMigrations(): Promise<any> {
// In this example we are just returning migration names // 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 { public getMigrationName(migration): string {
@ -18,6 +19,8 @@ export default class XcMigrationSourcev2 {
switch (migration) { switch (migration) {
case 'nc_011': case 'nc_011':
return nc_011; return nc_011;
case 'nc_012_alter_column_data_types':
return nc_012_alter_column_data_types;
} }
} }
} }

6
packages/nocodb/src/lib/noco/meta/helpers/catchError.ts

@ -8,7 +8,7 @@ export default function(
// todo: error log // todo: error log
console.log(requestHandler.name ? `${requestHandler.name} ::` : '', e); console.log(requestHandler.name ? `${requestHandler.name} ::` : '', e);
if (e instanceof BasRequest) { if (e instanceof BadRequest) {
return res.status(400).json({ msg: e.message }); return res.status(400).json({ msg: e.message });
} else if (e instanceof Unauthorized) { } else if (e instanceof Unauthorized) {
return res.status(401).json({ msg: e.message }); 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 Unauthorized extends Error {}
class Forbidden extends Error {} class Forbidden extends Error {}
class NotFound extends Error {} class NotFound extends Error {}
@ -38,7 +38,7 @@ export class NcError {
throw new NotFound(message); throw new NotFound(message);
} }
static badRequest(message) { static badRequest(message) {
throw new BasRequest(message); throw new BadRequest(message);
} }
static unauthorized(message) { static unauthorized(message) {
throw new Unauthorized(message); throw new Unauthorized(message);

0
packages/nocodb/src/lib/noco/migrations/nc_011.ts → packages/nocodb/src/lib/noco/migrationsv2/nc_011.ts

48
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 <wingkwong.code@gmail.com>
*
* @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 <http://www.gnu.org/licenses/>.
*
*/
Loading…
Cancel
Save