From 3bec8215c51dd01a63a02a7cc587ac3cb65dd7fa Mon Sep 17 00:00:00 2001 From: Ramesh Mane <101566080+rameshmane7218@users.noreply.github.com> Date: Mon, 11 Dec 2023 14:07:23 +0530 Subject: [PATCH] fix: Group-by didn't display Attachment field earlier. It gets listed now --- .../smartsheet/toolbar/CreateGroupBy.vue | 16 +++++++++------- .../smartsheet/toolbar/GroupByMenu.vue | 13 +++++++++++-- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/packages/nc-gui/components/smartsheet/toolbar/CreateGroupBy.vue b/packages/nc-gui/components/smartsheet/toolbar/CreateGroupBy.vue index 1d7e1865d2..b548925055 100644 --- a/packages/nc-gui/components/smartsheet/toolbar/CreateGroupBy.vue +++ b/packages/nc-gui/components/smartsheet/toolbar/CreateGroupBy.vue @@ -5,11 +5,12 @@ import { RelationTypes, UITypes, isLinksOrLTAR, isSystemColumn } from 'nocodb-sd const props = defineProps<{ // As we need to focus search box when the parent is opened isParentOpen: boolean + columns?: ColumnType[] }>() const emits = defineEmits(['created']) -const { isParentOpen } = toRefs(props) +const { isParentOpen, columns } = toRefs(props) const inputRef = ref() @@ -27,22 +28,23 @@ const { groupBy } = useViewGroupBy(activeView) const options = computed( () => - meta.value?.columns + (columns.value || meta.value?.columns) ?.filter((c: ColumnType) => { if (c.uidt === UITypes.Links) { return true } if (isSystemColumn(metaColumnById?.value?.[c.id!])) { - return ( - /** hide system columns if not enabled */ - showSystemFields.value - ) + /** hide system columns if not enabled */ + if (c?.colOptions) { + /** ignore virtual fields which are system fields ( mm relation ) and qr code fields */ + return false + } + return showSystemFields.value } else if (c.uidt === UITypes.QrCode || c.uidt === UITypes.Barcode || c.uidt === UITypes.ID) { return false } else { /** ignore hasmany and manytomany relations if it's using within group menu */ return !(isLinksOrLTAR(c) && (c.colOptions as LinkToAnotherRecordType).type !== RelationTypes.BELONGS_TO) - /** ignore virtual fields which are system fields ( mm relation ) and qr code fields */ } }) .filter((c: ColumnType) => !groupBy.value.find((g) => g.column?.id === c.id)) diff --git a/packages/nc-gui/components/smartsheet/toolbar/GroupByMenu.vue b/packages/nc-gui/components/smartsheet/toolbar/GroupByMenu.vue index 426240d0ce..8c66935677 100644 --- a/packages/nc-gui/components/smartsheet/toolbar/GroupByMenu.vue +++ b/packages/nc-gui/components/smartsheet/toolbar/GroupByMenu.vue @@ -243,7 +243,12 @@ watch(meta, async () => {