From d3a78b8ad5fc76e5aa6cc1db529b620f449c09ab Mon Sep 17 00:00:00 2001 From: Kim Shepherd Date: Sat, 23 Apr 2022 16:05:20 +1200 Subject: [PATCH] [TLC-254] Add getTypeBindRelations helper method to bind service --- .../ds-dynamic-type-bind-relation.service.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-type-bind-relation.service.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-type-bind-relation.service.ts index f3e93790f0..40e80bc34b 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-type-bind-relation.service.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-type-bind-relation.service.ts @@ -11,7 +11,7 @@ import { DynamicFormControlMatcher, DynamicFormControlModel, DynamicFormControlRelation, - DynamicFormRelationService, + DynamicFormRelationService, MATCH_VISIBLE, OR_OPERATOR } from '@ng-dynamic-forms/core'; @@ -217,4 +217,20 @@ export class DsDynamicTypeBindRelationService { return subscriptions; } + + public getTypeBindRelations(configuredTypeBindValues: string[]): DynamicFormControlRelation[] { + const bindValues = []; + configuredTypeBindValues.forEach((value) => { + bindValues.push({ + id: 'dc.type', + value: value + }); + }); + return [{ + match: MATCH_VISIBLE, + operator: OR_OPERATOR, + when: bindValues + }]; + } + }