Browse Source

fix: Group-by didn't display Attachment field earlier. It gets listed now

pull/7173/head
Ramesh Mane 12 months ago
parent
commit
3bec8215c5
  1. 16
      packages/nc-gui/components/smartsheet/toolbar/CreateGroupBy.vue
  2. 13
      packages/nc-gui/components/smartsheet/toolbar/GroupByMenu.vue

16
packages/nc-gui/components/smartsheet/toolbar/CreateGroupBy.vue

@ -5,11 +5,12 @@ import { RelationTypes, UITypes, isLinksOrLTAR, isSystemColumn } from 'nocodb-sd
const props = defineProps<{ const props = defineProps<{
// As we need to focus search box when the parent is opened // As we need to focus search box when the parent is opened
isParentOpen: boolean isParentOpen: boolean
columns?: ColumnType[]
}>() }>()
const emits = defineEmits(['created']) const emits = defineEmits(['created'])
const { isParentOpen } = toRefs(props) const { isParentOpen, columns } = toRefs(props)
const inputRef = ref() const inputRef = ref()
@ -27,22 +28,23 @@ const { groupBy } = useViewGroupBy(activeView)
const options = computed<ColumnType[]>( const options = computed<ColumnType[]>(
() => () =>
meta.value?.columns (columns.value || meta.value?.columns)
?.filter((c: ColumnType) => { ?.filter((c: ColumnType) => {
if (c.uidt === UITypes.Links) { if (c.uidt === UITypes.Links) {
return true return true
} }
if (isSystemColumn(metaColumnById?.value?.[c.id!])) { if (isSystemColumn(metaColumnById?.value?.[c.id!])) {
return ( /** hide system columns if not enabled */
/** hide system columns if not enabled */ if (c?.colOptions) {
showSystemFields.value /** 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) { } else if (c.uidt === UITypes.QrCode || c.uidt === UITypes.Barcode || c.uidt === UITypes.ID) {
return false return false
} else { } else {
/** ignore hasmany and manytomany relations if it's using within group menu */ /** ignore hasmany and manytomany relations if it's using within group menu */
return !(isLinksOrLTAR(c) && (c.colOptions as LinkToAnotherRecordType).type !== RelationTypes.BELONGS_TO) 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)) .filter((c: ColumnType) => !groupBy.value.find((g) => g.column?.id === c.id))

13
packages/nc-gui/components/smartsheet/toolbar/GroupByMenu.vue

@ -243,7 +243,12 @@ watch(meta, async () => {
</a-button> </a-button>
</div> </div>
<template #overlay> <template #overlay>
<SmartsheetToolbarCreateGroupBy v-if="!_groupBy.length" :is-parent-open="open" @created="addFieldToGroupBy" /> <SmartsheetToolbarCreateGroupBy
v-if="!_groupBy.length"
:is-parent-open="open"
:columns="fieldsToGroupBy"
@created="addFieldToGroupBy"
/>
<div <div
v-else v-else
:class="{ ' min-w-[400px]': _groupBy.length }" :class="{ ' min-w-[400px]': _groupBy.length }"
@ -318,7 +323,11 @@ watch(meta, async () => {
</div> </div>
</NcButton> </NcButton>
<template #overlay> <template #overlay>
<SmartsheetToolbarCreateGroupBy :is-parent-open="showCreateGroupBy" @created="addFieldToGroupBy" /> <SmartsheetToolbarCreateGroupBy
:is-parent-open="showCreateGroupBy"
:columns="fieldsToGroupBy"
@created="addFieldToGroupBy"
/>
</template> </template>
</NcDropdown> </NcDropdown>
</div> </div>

Loading…
Cancel
Save