diff --git a/backend/src/main/resources/entity-attributes-filters-ui-schema.json b/backend/src/main/resources/entity-attributes-filters-ui-schema.json index 5d71f0ba8..86b31393a 100644 --- a/backend/src/main/resources/entity-attributes-filters-ui-schema.json +++ b/backend/src/main/resources/entity-attributes-filters-ui-schema.json @@ -44,7 +44,8 @@ "description": "tooltip.search-criteria", "type": "object", "widget": { - "id": "filter-target" + "id": "filter-target", + "target": "entityAttributesFilterTargetType" }, "properties": { "entityAttributesFilterTargetType": { diff --git a/backend/src/main/resources/nameid-filter.schema.json b/backend/src/main/resources/nameid-filter.schema.json index bc8c33cb8..cb8a30410 100644 --- a/backend/src/main/resources/nameid-filter.schema.json +++ b/backend/src/main/resources/nameid-filter.schema.json @@ -5,7 +5,7 @@ "type": "group-lg", "fields": [ "name", - "entityAttributesFilterTarget", + "nameIdFormatFilterTarget", "filterEnabled", "@type", "resourceId", @@ -36,15 +36,16 @@ "type": "boolean", "default": false }, - "entityAttributesFilterTarget": { + "nameIdFormatFilterTarget": { "title": "label.search-criteria", "description": "tooltip.search-criteria", "type": "object", "widget": { - "id": "filter-target" + "id": "filter-target", + "target": "nameIdFormatFilterTargetType" }, "properties": { - "entityAttributesFilterTargetType": { + "nameIdFormatFilterTargetType": { "title": "", "type": "string", "default": "ENTITY", @@ -87,7 +88,7 @@ }, "required": [ "value", - "entityAttributesFilterTargetType" + "nameIdFormatFilterTargetType" ] }, "@type": { diff --git a/ui/src/app/schema-form/widget/filter-target/filter-target.component.html b/ui/src/app/schema-form/widget/filter-target/filter-target.component.html index 50de6be03..43ff94a15 100644 --- a/ui/src/app/schema-form/widget/filter-target/filter-target.component.html +++ b/ui/src/app/schema-form/widget/filter-target/filter-target.component.html @@ -1,4 +1,4 @@ -
+
@@ -39,14 +39,14 @@    + *ngIf="targetType !== 'ENTITY'">
-
+
-
+
-
+

    diff --git a/ui/src/app/schema-form/widget/filter-target/filter-target.component.ts b/ui/src/app/schema-form/widget/filter-target/filter-target.component.ts index 45e632e9e..4107ebfd3 100644 --- a/ui/src/app/schema-form/widget/filter-target/filter-target.component.ts +++ b/ui/src/app/schema-form/widget/filter-target/filter-target.component.ts @@ -50,7 +50,7 @@ export class FilterTargetComponent extends ObjectWidget implements OnDestroy, Af .valueChanges .pipe( distinctUntilChanged(), - skipWhile(() => this.entityAttributesFilterTargetType === 'ENTITY') + skipWhile(() => this.targetType === 'ENTITY') ) .subscribe(script => { this.setTargetValue([script]); @@ -92,24 +92,31 @@ export class FilterTargetComponent extends ObjectWidget implements OnDestroy, Af return this.formProperty.getProperty('value').value; } - get entityAttributesFilterTargetType(): string { - return this.formProperty.getProperty('entityAttributesFilterTargetType').value; + get targetType(): string { + return this.formProperty.getProperty(this.targetAttribute).value; } get displayType(): string { - return this.typeOptions.find(opt => opt.value === this.entityAttributesFilterTargetType).description; + if (!this.targetAttribute) { + return null; + } + return this.typeOptions.find(opt => opt.value === this.targetType).description; + } + + get targetAttribute(): string { + return this.formProperty.schema.widget.target; } get typeOptions(): any[] { return this.formProperty - .getProperty('entityAttributesFilterTargetType') + .getProperty(this.targetAttribute) .schema .oneOf .map(option => ({ ...option, value: option.enum[0] })); } select(value: string): void { - this.formProperty.getProperty('entityAttributesFilterTargetType').setValue(value); + this.formProperty.getProperty(this.targetAttribute).setValue(value); this.setTargetValue([]); this.script.reset(); this.search.reset(); diff --git a/ui/src/assets/schema/filter/nameid.schema.json b/ui/src/assets/schema/filter/nameid.schema.json index bc8c33cb8..cb8a30410 100644 --- a/ui/src/assets/schema/filter/nameid.schema.json +++ b/ui/src/assets/schema/filter/nameid.schema.json @@ -5,7 +5,7 @@ "type": "group-lg", "fields": [ "name", - "entityAttributesFilterTarget", + "nameIdFormatFilterTarget", "filterEnabled", "@type", "resourceId", @@ -36,15 +36,16 @@ "type": "boolean", "default": false }, - "entityAttributesFilterTarget": { + "nameIdFormatFilterTarget": { "title": "label.search-criteria", "description": "tooltip.search-criteria", "type": "object", "widget": { - "id": "filter-target" + "id": "filter-target", + "target": "nameIdFormatFilterTargetType" }, "properties": { - "entityAttributesFilterTargetType": { + "nameIdFormatFilterTargetType": { "title": "", "type": "string", "default": "ENTITY", @@ -87,7 +88,7 @@ }, "required": [ "value", - "entityAttributesFilterTargetType" + "nameIdFormatFilterTargetType" ] }, "@type": {