From aba2c78d6ef8b314478e8239938e1c6161bd72e3 Mon Sep 17 00:00:00 2001 From: "alejandro.bulgaris@qcif.edu.au" Date: Tue, 2 Jul 2024 08:49:06 +0000 Subject: [PATCH] Add support to handle suffix and prefix titleFieldArr in ReDBoxQueryLookupDataService in VocabField --- angular-legacy/shared/form/field-vocab.component.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/angular-legacy/shared/form/field-vocab.component.ts b/angular-legacy/shared/form/field-vocab.component.ts index 277eb82762..ce9547b00b 100644 --- a/angular-legacy/shared/form/field-vocab.component.ts +++ b/angular-legacy/shared/form/field-vocab.component.ts @@ -496,7 +496,16 @@ class ReDBoxQueryLookupDataService extends Subject implements C title = `${title}${_.isEmpty(title) ? '' : this.titleFieldDelim}${titleVal}`; } }); - } + } else { + // expecting a delim pair array, 'prefix', 'suffix' + _.forEach(this.titleFieldArr, (titleFld: string, idx) => { + const delimPair: any = this.titleFieldDelim[idx]; + const titleVal = data[titleFld]; + if (titleVal) { + title = `${title} ${titleVal}${delimPair.suffix}`; + } + }); + } } return title; }