Browse Source

fix: treat Links column as Rollup in case sort, filter and formula

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5848/head
Pranav C 2 years ago
parent
commit
8e6e82fb47
  1. 4
      packages/nocodb/src/db/conditionV2.ts
  2. 2
      packages/nocodb/src/db/formulav2/formulaQueryBuilderv2.ts
  3. 2
      packages/nocodb/src/db/sortV2.ts

4
packages/nocodb/src/db/conditionV2.ts

@ -275,7 +275,7 @@ const parseConditionV2 = async (
return (_qb) => {};
} else if (column.uidt === UITypes.Lookup) {
return await generateLookupCondition(column, filter, knex, aliasCount);
} else if (column.uidt === UITypes.Rollup && !customWhereClause) {
} else if ([UITypes.Rollup,UITypes.Links].includes(column.uidt ) && !customWhereClause) {
const builder = (
await genRollupSelectv2({
knex,
@ -416,6 +416,7 @@ const parseConditionV2 = async (
UITypes.Decimal,
UITypes.Rating,
UITypes.Rollup,
UITypes.Links,
].includes(column.uidt)
) {
qb = qb.where(field, val);
@ -442,6 +443,7 @@ const parseConditionV2 = async (
UITypes.Number,
UITypes.Decimal,
UITypes.Rollup,
UITypes.Links,
].includes(column.uidt)
) {
qb = qb.where((nestedQb) => {

2
packages/nocodb/src/db/formulav2/formulaQueryBuilderv2.ts

@ -229,6 +229,7 @@ async function _formulaQueryBuilder(
}
switch (lookupColumn.uidt) {
case UITypes.Links:
case UITypes.Rollup:
{
const builder = (
@ -415,6 +416,7 @@ async function _formulaQueryBuilder(
};
break;
case UITypes.Rollup:
case UITypes.Links:
aliasToColumn[col.id] = async (): Promise<any> => {
const qb = await genRollupSelectv2({
knex,

2
packages/nocodb/src/db/sortV2.ts

@ -36,6 +36,7 @@ export default async function sortV2(
switch (column.uidt) {
case UITypes.Rollup:
case UITypes.Links:
{
const builder = (
await genRollupSelectv2({
@ -121,6 +122,7 @@ export default async function sortV2(
}
switch (lookupColumn.uidt) {
case UITypes.Links:
case UITypes.Rollup:
{
const builder = (

Loading…
Cancel
Save