diff --git a/src-ui/src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.html b/src-ui/src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.html
index e94ba7993..404f094ab 100644
--- a/src-ui/src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.html
+++ b/src-ui/src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.html
@@ -63,9 +63,9 @@
diff --git a/src-ui/src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.ts b/src-ui/src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.ts
index f08260b09..bebab5d0f 100644
--- a/src-ui/src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.ts
+++ b/src-ui/src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.ts
@@ -189,10 +189,8 @@ export class CustomFieldsQueryDropdownComponent {
expression.addExpression()
}
- public removeComponent(
- component: CustomFieldQueryAtom | CustomFieldQueryExpression
- ) {
- this.selectionModel.removeElement(component)
+ public removeElement(element: CustomFieldQueryElement) {
+ this.selectionModel.removeElement(element)
}
public reset() {
diff --git a/src-ui/src/app/data/custom-field-query.ts b/src-ui/src/app/data/custom-field-query.ts
index 0e3467587..e70c5efb2 100644
--- a/src-ui/src/app/data/custom-field-query.ts
+++ b/src-ui/src/app/data/custom-field-query.ts
@@ -135,6 +135,7 @@ export class CustomFieldQueryElement {
public readonly type: CustomFieldQueryElementType
public changed: Subject
protected valueModelChanged: Subject
+ public depth: number = 0
constructor(type: CustomFieldQueryElementType) {
this.type = type
@@ -292,6 +293,7 @@ export class CustomFieldQueryExpression extends CustomFieldQueryElement {
'true',
])
) {
+ atom.depth = this.depth + 1
;(this._value as CustomFieldQueryElement[]).push(atom)
atom.changed.subscribe(() => {
this.changed.next(this)
@@ -301,6 +303,7 @@ export class CustomFieldQueryExpression extends CustomFieldQueryElement {
public addExpression(
expression: CustomFieldQueryExpression = new CustomFieldQueryExpression()
) {
+ expression.depth = this.depth + 1
;(this._value as CustomFieldQueryElement[]).push(expression)
expression.changed.subscribe(() => {
this.changed.next(this)