From 303fc38f690b940068ad64a73ae8cedcde4f1479 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Fri, 3 May 2024 10:32:13 +0000 Subject: [PATCH] feat: skip showing if gallery/kanban have less than 3 visible non-system columns --- packages/nocodb/src/models/View.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/nocodb/src/models/View.ts b/packages/nocodb/src/models/View.ts index 4b764e58dd..97a12df9b1 100644 --- a/packages/nocodb/src/models/View.ts +++ b/packages/nocodb/src/models/View.ts @@ -549,6 +549,7 @@ export default class View implements ViewType { { fk_model_id: param.fk_model_id }, ncMeta, ); + // keep a map of column id to column object for easy access const colIdMap = new Map(tableColumns.map((c) => [c.id, c])); for (const view of views) { @@ -562,7 +563,7 @@ export default class View implements ViewType { } else if (view.uuid) { // if view is shared, then keep the show state as it is } - // if gallery/kanban view, show only 3 columns + // if gallery/kanban view, show only 3 columns(excluding system columns) else if (view.type === ViewTypes.GALLERY) { const visibleColumnsCount = ( await GalleryViewColumn.list(view.id, ncMeta)