From 8b1b6e6a099a2e0e0a3a15148f2b4177b01b313e Mon Sep 17 00:00:00 2001 From: Ramesh Mane <101566080+rameshmane7218@users.noreply.github.com> Date: Wed, 26 Jun 2024 19:03:35 +0000 Subject: [PATCH] revert(nocodb): columns.service file changes --- .../nocodb/src/services/columns.service.ts | 34 +------------------ 1 file changed, 1 insertion(+), 33 deletions(-) diff --git a/packages/nocodb/src/services/columns.service.ts b/packages/nocodb/src/services/columns.service.ts index 684d3e48c6..22835fb791 100644 --- a/packages/nocodb/src/services/columns.service.ts +++ b/packages/nocodb/src/services/columns.service.ts @@ -12,7 +12,6 @@ import { substituteColumnIdWithAliasInFormula, UITypes, validateFormulaAndExtractTreeWithType, - ViewTypes, } from 'nocodb-sdk'; import { pluralize, singularize } from 'inflection'; import hash from 'object-hash'; @@ -33,7 +32,6 @@ import { CalendarRange, Column, FormulaColumn, - GalleryView, KanbanView, Model, Source, @@ -1460,23 +1458,6 @@ export class ColumnsService { ), }; - if (column.uidt === UITypes.Attachment && column.uidt !== colBody.uidt) { - tableUpdateBody.views = [ - ...(tableUpdateBody.views || []).map((view) => { - if ( - [ViewTypes.GALLERY, ViewTypes.KANBAN].includes(view.type) && - (view.view as KanbanView | GalleryView)?.fk_cover_image_col_id === - param.columnId - ) { - (view.view as KanbanView | GalleryView).fk_cover_image_col_id = - null; - } - - return view; - }), - ]; - } - const sqlMgr = await reuseOrSave('sqlMgr', reuse, async () => ProjectMgrv2.getSqlMgr(context, { id: source.base_id }), ); @@ -2129,6 +2110,7 @@ export class ColumnsService { * providing a more controlled and predictable behavior in the switch statement. */ switch (column.uidt) { + case UITypes.Lookup: case UITypes.Rollup: case UITypes.QrCode: case UITypes.Barcode: @@ -2371,8 +2353,6 @@ export class ColumnsService { } /* falls through to default */ } - /* Lookup columns is also used for cover image so we have to update views */ - case UITypes.Lookup: default: { const tableUpdateBody = { ...table, @@ -2395,18 +2375,6 @@ export class ColumnsService { } return c; }), - views: table.views.map((view) => { - if ( - [ViewTypes.GALLERY, ViewTypes.KANBAN].includes(view.type) && - (view.view as KanbanView | GalleryView)?.fk_cover_image_col_id === - param.columnId - ) { - (view.view as KanbanView | GalleryView).fk_cover_image_col_id = - null; - } - - return view; - }), }; await sqlMgr.sqlOpPlus(source, 'tableUpdate', tableUpdateBody);