Browse Source

feat: import date/datetime filters from airtable

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
pull/6730/head
Raju Udava 1 year ago
parent
commit
5a445fd8a1
  1. 33
      packages/nocodb/src/modules/jobs/jobs/at-import/at-import.processor.ts

33
packages/nocodb/src/modules/jobs/jobs/at-import/at-import.processor.ts

@ -2012,8 +2012,8 @@ export class AtImportProcessor {
'<=': 'lte',
'>': 'gt',
'>=': 'gte',
isEmpty: 'empty',
isNotEmpty: 'notempty',
isEmpty: 'blank',
isNotEmpty: 'notblank',
contains: 'like',
doesNotContain: 'nlike',
isAnyOf: 'anyof',
@ -2043,12 +2043,9 @@ export class AtImportProcessor {
const ncFilters = [];
// console.log(filter)
if (
datatype === UITypes.Date ||
datatype === UITypes.DateTime ||
datatype === UITypes.Links
) {
// skip filters over data datatype
if (datatype === UITypes.Links) {
// skip filters for links; Link filters in NocoDB are only rollup counts
// where-as in airtable, filter can be textual
updateMigrationSkipLog(
await sMap.getNcNameFromAtId(viewId),
colSchema.title,
@ -2092,6 +2089,26 @@ export class AtImportProcessor {
};
ncFilters.push(fx);
}
} else if (datatype === UITypes.Date || datatype === UITypes.DateTime) {
if (filter.operator === 'isWithin') {
const fx = {
fk_column_id: columnId,
logical_op: f.conjunction,
comparison_op: filter.operator,
comparison_sub_op: filter.value?.mode,
value: filter.value?.numberOfDays,
};
ncFilters.push(fx);
} else {
const fx = {
fk_column_id: columnId,
logical_op: f.conjunction,
comparison_op: filterMap[filter.operator],
comparison_sub_op: filter.value?.mode,
value: filter.value?.exactDate,
};
ncFilters.push(fx);
}
}
// other data types (number/ text/ long text/ ..)

Loading…
Cancel
Save