Browse Source

feat: add nested filter support in webhook

pull/8396/head
Pranav C 7 months ago
parent
commit
a49ee8f15c
  1. 4
      packages/nc-gui/components/smartsheet/toolbar/ColumnFilter.vue
  2. 11
      packages/nocodb/src/helpers/webhookHelpers.ts

4
packages/nc-gui/components/smartsheet/toolbar/ColumnFilter.vue

@ -419,9 +419,9 @@ const onLogicalOpUpdate = async (filter: Filter, index: number) => {
class="min-w-20 capitalize"
placeholder="Group op"
dropdown-class-name="nc-dropdown-filter-logical-op-group"
:disabled="i > 1 && !isLogicalOpChangeAllowed"
@click.stop
@change="saveOrUpdate(filter, i)"
:disabled="(i > 1 && !isLogicalOpChangeAllowed)"
>
<a-select-option v-for="op in logicalOps" :key="op.value" :value="op.value">
<div class="flex items-center w-full justify-between w-full gap-2">
@ -618,7 +618,7 @@ const onLogicalOpUpdate = async (filter: Filter, index: number) => {
</div>
</NcButton>
<NcButton v-if="!webHook && nestedLevel < 5" type="text" size="small" @click.stop="addFilterGroup()">
<NcButton v-if="nestedLevel < 5" type="text" size="small" @click.stop="addFilterGroup()">
<div class="flex items-center gap-1">
<!-- Add Filter Group -->
<component :is="iconMap.plus" />

11
packages/nocodb/src/helpers/webhookHelpers.ts

@ -54,8 +54,15 @@ export async function validateCondition(
const column = await filter.getColumn();
const field = column.title;
let val = data[field];
if (
if (filter.is_group) {
res = await validateCondition(
filter.children || (await filter.getChildren()),
data,
{
client,
},
);
} else if (
[
UITypes.Date,
UITypes.DateTime,

Loading…
Cancel
Save