Browse Source

Merge branch 'develop' of https://github.com/nocodb/nocodb into fix/fields-hover-effects

pull/7114/head
musharaf 1 year ago
parent
commit
b2bad103b2
  1. 2
      packages/nc-gui/package.json
  2. 2
      packages/nc-lib-gui/package.json
  3. 2
      packages/nocodb-sdk/package.json
  4. 2837
      packages/nocodb-sdk/pnpm-lock.yaml
  5. 6
      packages/nocodb/package.json
  6. 8
      packages/nocodb/src/controllers/data-table.controller.ts
  7. 42
      packages/nocodb/src/db/BaseModelSqlv2.ts
  8. 8
      packages/nocodb/src/services/data-table.service.ts
  9. 12
      pnpm-lock.yaml

2
packages/nc-gui/package.json

@ -65,7 +65,7 @@
"locale-codes": "^1.3.1", "locale-codes": "^1.3.1",
"monaco-editor": "^0.33.0", "monaco-editor": "^0.33.0",
"monaco-sql-languages": "^0.11.0", "monaco-sql-languages": "^0.11.0",
"nocodb-sdk": "workspace:^", "nocodb-sdk": "0.202.9",
"papaparse": "^5.4.1", "papaparse": "^5.4.1",
"parse-github-url": "^1.0.2", "parse-github-url": "^1.0.2",
"pinia": "^2.1.7", "pinia": "^2.1.7",

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

@ -1,6 +1,6 @@
{ {
"name": "nc-lib-gui", "name": "nc-lib-gui",
"version": "0.202.8", "version": "0.202.9",
"description": "NocoDB GUI", "description": "NocoDB GUI",
"author": { "author": {
"name": "NocoDB", "name": "NocoDB",

2
packages/nocodb-sdk/package.json

@ -1,6 +1,6 @@
{ {
"name": "nocodb-sdk", "name": "nocodb-sdk",
"version": "0.202.8", "version": "0.202.9",
"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",

2837
packages/nocodb-sdk/pnpm-lock.yaml

File diff suppressed because it is too large Load Diff

6
packages/nocodb/package.json

@ -1,6 +1,6 @@
{ {
"name": "nocodb", "name": "nocodb",
"version": "0.202.8", "version": "0.202.9",
"description": "NocoDB Backend", "description": "NocoDB Backend",
"main": "dist/bundle.js", "main": "dist/bundle.js",
"author": { "author": {
@ -132,12 +132,12 @@
"mysql2": "^3.6.5", "mysql2": "^3.6.5",
"nanoid": "^3.1.20", "nanoid": "^3.1.20",
"nc-help": "0.3.1", "nc-help": "0.3.1",
"nc-lib-gui": "0.202.8", "nc-lib-gui": "0.202.9",
"nc-plugin": "^0.1.3", "nc-plugin": "^0.1.3",
"ncp": "^2.0.0", "ncp": "^2.0.0",
"nestjs-kafka": "^1.0.6", "nestjs-kafka": "^1.0.6",
"nestjs-throttler-storage-redis": "^0.3.3", "nestjs-throttler-storage-redis": "^0.3.3",
"nocodb-sdk": "workspace:^", "nocodb-sdk": "0.202.9",
"nodemailer": "^6.4.10", "nodemailer": "^6.4.10",
"object-hash": "^3.0.0", "object-hash": "^3.0.0",
"object-sizeof": "^2.6.3", "object-sizeof": "^2.6.3",

8
packages/nocodb/src/controllers/data-table.controller.ts

@ -153,7 +153,13 @@ export class DataTableController {
@Param('columnId') columnId: string, @Param('columnId') columnId: string,
@Param('rowId') rowId: string, @Param('rowId') rowId: string,
@Body() @Body()
refRowIds: string | string[] | number | number[] | Record<string, any>, refRowIds:
| string
| string[]
| number
| number[]
| Record<string, any>
| Record<string, any>[],
) { ) {
return await this.dataTableService.nestedLink({ return await this.dataTableService.nestedLink({
modelId, modelId,

42
packages/nocodb/src/db/BaseModelSqlv2.ts

@ -4869,7 +4869,9 @@ class BaseModelSqlv2 {
); );
NcError.unprocessableEntity( NcError.unprocessableEntity(
`Child record with id [${missingIds.join(', ')}] not found`, `Child record with id [${extractIdsString(
missingIds,
)}] not found`,
); );
} }
@ -4878,8 +4880,11 @@ class BaseModelSqlv2 {
.filter((childRow) => !childRow[vChildCol.column_name]) .filter((childRow) => !childRow[vChildCol.column_name])
// generate insert data for new links // generate insert data for new links
.map((childRow) => ({ .map((childRow) => ({
[vParentCol.column_name]: childRow[parentColumn.column_name], [vParentCol.column_name]:
[vChildCol.column_name]: row[childColumn.column_name], childRow[parentColumn.title] ??
childRow[parentColumn.column_name],
[vChildCol.column_name]:
row[childColumn.title] ?? row[childColumn.column_name],
})); }));
// if no new links, return true // if no new links, return true
@ -4930,7 +4935,9 @@ class BaseModelSqlv2 {
); );
NcError.unprocessableEntity( NcError.unprocessableEntity(
`Child record with id [${missingIds.join(', ')}] not found`, `Child record with id [${extractIdsString(
missingIds,
)}] not found`,
); );
} }
} }
@ -4980,7 +4987,10 @@ class BaseModelSqlv2 {
if (!childRow) { if (!childRow) {
NcError.unprocessableEntity( NcError.unprocessableEntity(
`Child record with id [${childIds[0]}] not found`, `Child record with id [${extractIdsString(
childIds,
true,
)}] not found`,
); );
} }
} }
@ -5106,7 +5116,9 @@ class BaseModelSqlv2 {
); );
NcError.unprocessableEntity( NcError.unprocessableEntity(
`Child record with id [${missingIds.join(', ')}] not found`, `Child record with id [${extractIdsString(
missingIds,
)}] not found`,
); );
} }
} }
@ -5154,7 +5166,9 @@ class BaseModelSqlv2 {
); );
NcError.unprocessableEntity( NcError.unprocessableEntity(
`Child record with id [${missingIds.join(', ')}] not found`, `Child record with id [${extractIdsString(
missingIds,
)}] not found`,
); );
} }
} }
@ -5208,7 +5222,10 @@ class BaseModelSqlv2 {
if (!childRow) { if (!childRow) {
NcError.unprocessableEntity( NcError.unprocessableEntity(
`Child record with id [${childIds[0]}] not found`, `Child record with id [${extractIdsString(
childIds,
true,
)}] not found`,
); );
} }
} }
@ -5674,4 +5691,13 @@ export function getListArgs(
return obj; return obj;
} }
function extractIdsString(
childIds: (string | number | Record<string, any>)[],
isBt = false,
) {
return (isBt ? childIds.slice(0, 1) : childIds)
.map((r) => (typeof r === 'object' ? JSON.stringify(r) : r))
.join(', ');
}
export { BaseModelSqlv2 }; export { BaseModelSqlv2 };

8
packages/nocodb/src/services/data-table.service.ts

@ -371,7 +371,13 @@ export class DataTableService {
modelId: string; modelId: string;
columnId: string; columnId: string;
query: any; query: any;
refRowIds: string | string[] | number | number[] | Record<string, any>; refRowIds:
| string
| string[]
| number
| number[]
| Record<string, any>
| Record<string, any>[];
rowId: string; rowId: string;
}) { }) {
this.validateIds(param.refRowIds); this.validateIds(param.refRowIds);

12
pnpm-lock.yaml

@ -139,7 +139,7 @@ importers:
specifier: ^0.11.0 specifier: ^0.11.0
version: 0.11.0 version: 0.11.0
nocodb-sdk: nocodb-sdk:
specifier: workspace:^ specifier: 0.202.9
version: link:../nocodb-sdk version: link:../nocodb-sdk
papaparse: papaparse:
specifier: ^5.4.1 specifier: ^5.4.1
@ -671,8 +671,8 @@ importers:
specifier: 0.3.1 specifier: 0.3.1
version: 0.3.1(asn1.js@5.4.1)(debug@4.3.4)(knex@2.4.2) version: 0.3.1(asn1.js@5.4.1)(debug@4.3.4)(knex@2.4.2)
nc-lib-gui: nc-lib-gui:
specifier: 0.202.8 specifier: 0.202.9
version: 0.202.8 version: 0.202.9
nc-plugin: nc-plugin:
specifier: ^0.1.3 specifier: ^0.1.3
version: 0.1.3 version: 0.1.3
@ -686,7 +686,7 @@ importers:
specifier: ^0.3.3 specifier: ^0.3.3
version: 0.3.3(@nestjs/common@10.2.10)(@nestjs/core@10.2.10)(@nestjs/throttler@4.2.1)(ioredis@5.3.2)(reflect-metadata@0.1.13) version: 0.3.3(@nestjs/common@10.2.10)(@nestjs/core@10.2.10)(@nestjs/throttler@4.2.1)(ioredis@5.3.2)(reflect-metadata@0.1.13)
nocodb-sdk: nocodb-sdk:
specifier: workspace:^ specifier: 0.202.9
version: link:../nocodb-sdk version: link:../nocodb-sdk
nodemailer: nodemailer:
specifier: ^6.4.10 specifier: ^6.4.10
@ -18967,8 +18967,8 @@ packages:
- supports-color - supports-color
dev: false dev: false
/nc-lib-gui@0.202.8: /nc-lib-gui@0.202.9:
resolution: {integrity: sha512-WfxbiUgsUBc/FVJdrdsxB2aoc31ADqt922oMwllvxf2pc7dK2bD6+/TwdND4nIK28MOOPuFjH1O7P9+tS+FrxQ==} resolution: {integrity: sha512-+Z+MmfOzpPU/tUALB/nDIHH32FcNicYZpLkrCJ13zRObAS5jm7dFyTGjsBgAlC8MGRLmCixU74uwRc9eJud/+w==}
dependencies: dependencies:
express: 4.18.2 express: 4.18.2
transitivePeerDependencies: transitivePeerDependencies:

Loading…
Cancel
Save