From f9dab2a343d015c2bde8ff334a21f88f0484d45f Mon Sep 17 00:00:00 2001 From: Pranav C Date: Thu, 7 Nov 2024 07:22:12 +0000 Subject: [PATCH 1/9] fix: handle if meta is not defined/null --- packages/nocodb/src/db/sql-client/lib/pg/PgClient.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nocodb/src/db/sql-client/lib/pg/PgClient.ts b/packages/nocodb/src/db/sql-client/lib/pg/PgClient.ts index a8e4c805c3..986004f743 100644 --- a/packages/nocodb/src/db/sql-client/lib/pg/PgClient.ts +++ b/packages/nocodb/src/db/sql-client/lib/pg/PgClient.ts @@ -3029,7 +3029,7 @@ class PGClient extends KnexClient { n.dt, castedColumn, limit, - n.meta.date_format || 'YYYY-MM-DD', + n.meta?.date_format || 'YYYY-MM-DD', ); query += this.genQuery(castQuery, [], shouldSanitize); From ea821edb133e621e26183ae65c8ff9ee5d6f2723 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Thu, 7 Nov 2024 07:22:13 +0000 Subject: [PATCH 2/9] fix: password reset page --- packages/nocodb/src/modules/auth/auth.controller.ts | 2 +- packages/nocodb/src/modules/auth/ui/auth/emailVerify.ts | 2 +- packages/nocodb/src/modules/auth/ui/auth/resetPassword.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/nocodb/src/modules/auth/auth.controller.ts b/packages/nocodb/src/modules/auth/auth.controller.ts index 3d880d86d4..48c67a7085 100644 --- a/packages/nocodb/src/modules/auth/auth.controller.ts +++ b/packages/nocodb/src/modules/auth/auth.controller.ts @@ -257,7 +257,7 @@ export class AuthController { (await import('~/modules/auth/ui/auth/resetPassword')).default, { ncPublicUrl: process.env.NC_PUBLIC_URL || '', - token: JSON.stringify(tokenId), + token: tokenId, baseUrl: `/`, }, ), diff --git a/packages/nocodb/src/modules/auth/ui/auth/emailVerify.ts b/packages/nocodb/src/modules/auth/ui/auth/emailVerify.ts index a531ddfb11..34eba67123 100644 --- a/packages/nocodb/src/modules/auth/ui/auth/emailVerify.ts +++ b/packages/nocodb/src/modules/auth/ui/auth/emailVerify.ts @@ -42,7 +42,7 @@ export default ` valid: null, errMsg: null, validForm: false, - token: <%= token %>, + token: '<%= token %>', greeting: 'Password Reset', formdata: { password: '', diff --git a/packages/nocodb/src/modules/auth/ui/auth/resetPassword.ts b/packages/nocodb/src/modules/auth/ui/auth/resetPassword.ts index b8af8c6c42..e4db0ac3ac 100644 --- a/packages/nocodb/src/modules/auth/ui/auth/resetPassword.ts +++ b/packages/nocodb/src/modules/auth/ui/auth/resetPassword.ts @@ -68,7 +68,7 @@ export default ` data: { valid: null, validForm: false, - token: <%= token %>, + token: '<%= token %>', greeting: 'Password Reset', formdata: { password: '', From 09fed8f4d8cd55c4dfecd04154365ba1b6603e98 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Thu, 7 Nov 2024 07:22:13 +0000 Subject: [PATCH 3/9] fix: missing duplicate shared base --- packages/nocodb/src/schema/swagger.json | 95 ++++++++++++++++++++++++- 1 file changed, 94 insertions(+), 1 deletion(-) diff --git a/packages/nocodb/src/schema/swagger.json b/packages/nocodb/src/schema/swagger.json index b12bcd423e..39173a3e95 100644 --- a/packages/nocodb/src/schema/swagger.json +++ b/packages/nocodb/src/schema/swagger.json @@ -15,7 +15,7 @@ "Auth", "API Token" ] - }, + },x { "name": "Public APIs", "tags": [ @@ -4633,6 +4633,99 @@ ] } }, + + "/api/v2/meta/duplicate/:workspaceId/shared/{sharedBaseId}": { + "post": { + "summary": "Duplicate Shared Base", + "operationId": "base-duplicate-shared", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "options": { + "type": "object", + "properties": { + "excludeData": { + "type": "boolean", + "required": false + }, + "excludeViews": { + "type": "boolean", + "required": false + } + } + }, + "base": { + "type": "object", + "required": false + } + } + }, + "examples": { + "Example 1": { + "value": { + "excludeData": true, + "excludeViews": true, + "excludeHooks": true + } + } + } + } + } + }, + "tags": [ + "Base" + ], + "description": "Duplicate a shared base", + "parameters": [ + { + "$ref": "#/components/parameters/xc-auth" + }, + { + "schema": { + "$ref": "#/components/schemas/Id", + "example": "w_124hhlkbeasewh", + "type": "string" + }, + "name": "workspaceId", + "in": "path", + "required": true, + "description": "Unique Workspace ID" + }, + { + "name": "sharedBaseId", + "in": "path", + "required": true, + "description": "Unique Shared Base ID" + } + ] + } + }, "/api/v1/db/meta/projects/{baseId}/{sourceId}/tables": { "parameters": [ { From 52cf3ab2442ae6ed6946103ae87ee9ab215afab2 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Thu, 7 Nov 2024 07:22:13 +0000 Subject: [PATCH 4/9] fix: encode url if not encoded --- packages/nc-gui/components/virtual-cell/Button.vue | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/nc-gui/components/virtual-cell/Button.vue b/packages/nc-gui/components/virtual-cell/Button.vue index 1ce18b62e0..0e2c27a2f0 100644 --- a/packages/nc-gui/components/virtual-cell/Button.vue +++ b/packages/nc-gui/components/virtual-cell/Button.vue @@ -1,6 +1,7 @@