diff --git a/app/src/components/v-field-list/v-field-list.vue b/app/src/components/v-field-list/v-field-list.vue index f43eab1f27..7beae0bd75 100644 --- a/app/src/components/v-field-list/v-field-list.vue +++ b/app/src/components/v-field-list/v-field-list.vue @@ -36,11 +36,13 @@ interface Props { field?: string; disabledFields?: string[]; includeFunctions?: boolean; + includeRelations?: boolean; } const props = withDefaults(defineProps(), { disabledFields: () => [], includeFunctions: false, + includeRelations: true, field: undefined, }); @@ -48,7 +50,7 @@ defineEmits(['select-field']); const fieldsStore = useFieldsStore(); -const { collection } = toRefs(props); +const { collection, includeRelations } = toRefs(props); const fieldsCount = computed(() => fieldsStore.getFieldsForCollection(collection.value)?.length ?? 0); @@ -85,6 +87,7 @@ const treeList = computed(() => { }); function filter(field: Field): boolean { + if (!includeRelations.value && (field.collection !== collection.value || field.type === 'alias')) return false; if (!search.value) return true; const children = fieldsStore.getFieldGroupChildren(collection.value, field.field); return children?.some((field) => matchesSearch(field)) || matchesSearch(field); diff --git a/app/src/interfaces/_system/system-filter/nodes.vue b/app/src/interfaces/_system/system-filter/nodes.vue index 6647bcb4f3..92984f7761 100644 --- a/app/src/interfaces/_system/system-filter/nodes.vue +++ b/app/src/interfaces/_system/system-filter/nodes.vue @@ -28,6 +28,7 @@ :collection="collection" :field="field" include-functions + :include-relations="includeRelations" @select-field="updateField(index, $event)" /> @@ -139,6 +140,7 @@ interface Props { depth?: number; inline?: boolean; includeValidation?: boolean; + includeRelations?: boolean; } const props = withDefaults(defineProps(), { @@ -146,6 +148,7 @@ const props = withDefaults(defineProps(), { depth: 1, inline: false, includeValidation: false, + includeRelations: true, }); const emit = defineEmits(['remove-node', 'update:filter', 'change']); diff --git a/app/src/interfaces/_system/system-filter/system-filter.vue b/app/src/interfaces/_system/system-filter/system-filter.vue index 4ec0b7caf4..6229addccb 100644 --- a/app/src/interfaces/_system/system-filter/system-filter.vue +++ b/app/src/interfaces/_system/system-filter/system-filter.vue @@ -19,6 +19,7 @@ :field="fieldName" :depth="1" :include-validation="includeValidation" + :include-relations="includeRelations" @remove-node="removeNode($event)" @change="emitValue" /> @@ -42,6 +43,7 @@ v-if="collectionRequired" :collection="collection" include-functions + :include-relations="includeRelations" @select-field="addNode($event)" >