From 630de0f3394efd1cdd3d5bbe9afbf1ba8148bee9 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Wed, 12 Apr 2023 13:23:48 +0800 Subject: [PATCH 1/9] fix(nc-gui): attachment input height --- packages/nc-gui/components/smartsheet/Cell.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nc-gui/components/smartsheet/Cell.vue b/packages/nc-gui/components/smartsheet/Cell.vue index 4a61552030..2023ec9604 100644 --- a/packages/nc-gui/components/smartsheet/Cell.vue +++ b/packages/nc-gui/components/smartsheet/Cell.vue @@ -193,7 +193,7 @@ onUnmounted(() => { `nc-cell-${(column?.uidt || 'default').toLowerCase()}`, { 'text-blue-600': isPrimary(column) && !props.virtual && !isForm }, { 'nc-grid-numeric-cell': isGrid && !isForm && isNumericField }, - { 'h-[40px]': !props.editEnabled && isForm && !isSurveyForm }, + { 'h-[40px]': !props.editEnabled && isForm && !isSurveyForm && !isAttachment(column) }, ]" @keydown.enter.exact="navigate(NavigateDir.NEXT, $event)" @keydown.shift.enter.exact="navigate(NavigateDir.PREV, $event)" From 694b6126d8a73d1a41b0069fc47c3e2fa627dbf5 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Thu, 13 Apr 2023 19:57:15 +0800 Subject: [PATCH 2/9] fix(nocodb): use multipart/form-data to make multer works --- packages/nocodb/src/schema/swagger.json | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/packages/nocodb/src/schema/swagger.json b/packages/nocodb/src/schema/swagger.json index 1fcfc3e4eb..b4e9f6c9c5 100644 --- a/packages/nocodb/src/schema/swagger.json +++ b/packages/nocodb/src/schema/swagger.json @@ -10886,20 +10886,7 @@ }, "requestBody": { "content": { - "application/json": { - "schema": { - "type": "object", - "description": "Data Object where the key is column and the value is the data value" - }, - "examples": { - "Example 1": { - "value": { - "col1": "foo", - "col2": "bar" - } - } - } - } + "multipart/form-data": {} }, "description": "" }, From 72de7be4a4a7b5eca2b95cd322916d0708b33039 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Thu, 13 Apr 2023 19:57:32 +0800 Subject: [PATCH 3/9] chore(sdk): regenerate Api.ts --- packages/nocodb-sdk/src/lib/Api.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nocodb-sdk/src/lib/Api.ts b/packages/nocodb-sdk/src/lib/Api.ts index 2407419a29..cdcd4d5800 100644 --- a/packages/nocodb-sdk/src/lib/Api.ts +++ b/packages/nocodb-sdk/src/lib/Api.ts @@ -7905,7 +7905,7 @@ export class Api< */ dataCreate: ( sharedViewUuid: string, - data: object, + data: any, params: RequestParams = {} ) => this.request< @@ -7918,7 +7918,7 @@ export class Api< path: `/api/v1/db/public/shared-view/${sharedViewUuid}/rows`, method: 'POST', body: data, - type: ContentType.Json, + type: ContentType.FormData, format: 'json', ...params, }), From d171920cb790958404d0aebfe82508dc2d2f252c Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Thu, 13 Apr 2023 20:02:09 +0800 Subject: [PATCH 4/9] chore(nocodb): add comment --- .../src/lib/controllers/publicControllers/publicData.ctl.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/nocodb/src/lib/controllers/publicControllers/publicData.ctl.ts b/packages/nocodb/src/lib/controllers/publicControllers/publicData.ctl.ts index 76d708e241..311e4ecb58 100644 --- a/packages/nocodb/src/lib/controllers/publicControllers/publicData.ctl.ts +++ b/packages/nocodb/src/lib/controllers/publicControllers/publicData.ctl.ts @@ -31,6 +31,7 @@ async function dataInsert(req: Request & { files: any[] }, res: Response) { password: req.headers?.['xc-password'] as string, body: req.body?.data, siteUrl: (req as any).ncSiteUrl, + // req.files is enriched by multer files: req.files, }); From e86aef08cb1add36c84d25bcccf48d20bd7a08f5 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Fri, 14 Apr 2023 14:05:44 +0800 Subject: [PATCH 5/9] chore(nc-gui): import iconMap --- packages/nc-gui/components/cell/attachment/Image.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/nc-gui/components/cell/attachment/Image.vue b/packages/nc-gui/components/cell/attachment/Image.vue index 8c3669be0f..625096b106 100644 --- a/packages/nc-gui/components/cell/attachment/Image.vue +++ b/packages/nc-gui/components/cell/attachment/Image.vue @@ -1,4 +1,6 @@