Browse Source

fix: include group by column in response (#8283)

* fix: include group by column in response

Signed-off-by: mertmit <mertmit99@gmail.com>

* fix: add new record if grouped by checkbox

Signed-off-by: mertmit <mertmit99@gmail.com>

---------

Signed-off-by: mertmit <mertmit99@gmail.com>
pull/8289/head
Mert E 3 months ago committed by GitHub
parent
commit
9245ffb332
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      packages/nc-gui/components/smartsheet/grid/GroupByTable.vue
  2. 10
      packages/nocodb/src/helpers/getAst.ts

5
packages/nc-gui/components/smartsheet/grid/GroupByTable.vue

@ -51,6 +51,11 @@ function addEmptyRow(group: Group, addAfter?: number, metaValue = meta.value) {
![UITypes.Rollup, UITypes.Lookup, UITypes.Formula, UITypes.Barcode, UITypes.QrCode].includes(curr.column_uidt)
) {
acc[curr.title] = curr.key
if (curr.column_uidt === UITypes.Checkbox) {
acc[curr.title] =
acc[curr.title] === GROUP_BY_VARS.TRUE ? true : acc[curr.title] === GROUP_BY_VARS.FALSE ? false : !!acc[curr.title]
}
}
return acc
}, {} as Record<string, any>)

10
packages/nocodb/src/helpers/getAst.ts

@ -13,7 +13,13 @@ import type {
Model,
} from '~/models';
import { NcError } from '~/helpers/catchError';
import { CalendarRange, GalleryView, KanbanView, View } from '~/models';
import {
CalendarRange,
GalleryView,
GridViewColumn,
KanbanView,
View,
} from '~/models';
const getAst = async ({
query,
@ -127,7 +133,7 @@ const getAst = async ({
allowedCols = (await View.getColumns(view.id)).reduce(
(o, c) => ({
...o,
[c.fk_column_id]: c.show,
[c.fk_column_id]: c.show || (c instanceof GridViewColumn && c.group_by),
}),
{},
);

Loading…
Cancel
Save