diff --git a/pmp-ui/src/app/features/resources/shared/mater-data-common-body/mater-data-common-body.component.html b/pmp-ui/src/app/features/resources/shared/mater-data-common-body/mater-data-common-body.component.html index 448f5cd00..eec53f941 100644 --- a/pmp-ui/src/app/features/resources/shared/mater-data-common-body/mater-data-common-body.component.html +++ b/pmp-ui/src/app/features/resources/shared/mater-data-common-body/mater-data-common-body.component.html @@ -53,15 +53,17 @@ placeholder="{{ field.label[primaryLang] }}" required > + - {{ data.fieldValue }} + {{ data.fieldCode }} diff --git a/pmp-ui/src/app/features/resources/shared/mater-data-common-body/mater-data-common-body.component.scss b/pmp-ui/src/app/features/resources/shared/mater-data-common-body/mater-data-common-body.component.scss index 8301a6f7b..f6a57f3f5 100644 --- a/pmp-ui/src/app/features/resources/shared/mater-data-common-body/mater-data-common-body.component.scss +++ b/pmp-ui/src/app/features/resources/shared/mater-data-common-body/mater-data-common-body.component.scss @@ -9,4 +9,9 @@ mat-form-field{ .mat-card-content>:first-child { margin-top: 14px; +} + +.search-input { + height: 35px; + width: 50px; } \ No newline at end of file diff --git a/pmp-ui/src/app/features/resources/shared/mater-data-common-body/mater-data-common-body.component.ts b/pmp-ui/src/app/features/resources/shared/mater-data-common-body/mater-data-common-body.component.ts index a4c85523d..0490f37b9 100644 --- a/pmp-ui/src/app/features/resources/shared/mater-data-common-body/mater-data-common-body.component.ts +++ b/pmp-ui/src/app/features/resources/shared/mater-data-common-body/mater-data-common-body.component.ts @@ -44,6 +44,7 @@ export class MaterDataCommonBodyComponent implements OnInit { disableForms: boolean; copyPrimaryWord: any; copySecondaryWord: any; + searchResult: any[] = []; @Input() primaryData: any = {}; @Input() secondaryData: any; @@ -131,12 +132,12 @@ export class MaterDataCommonBodyComponent implements OnInit { else if(url === "datasharepolicy"){ this.pageName = "Data Share Policy"; this.primaryData = {"name": "", "desc": "", "policies": "", "policyGroupName": "", "policyType": "DataShare", "version": "1.1"}; - this.getPolicyGroup("policyGroupName"); + this.getPolicyGroup(); } else if(url === "authpolicy"){ this.pageName = "Auth Policy"; this.primaryData = {"name": "", "desc": "", "policies": "", "policyGroupName": "", "policyType": "Auth", "version": "1.1"}; - this.getPolicyGroup("policyGroupName"); + this.getPolicyGroup(); } else if(url === "policymapping"){ this.pageName = "Map Policy"; @@ -456,8 +457,17 @@ export class MaterDataCommonBodyComponent implements OnInit { }); } - getPolicyGroup(key) { - const filterObject = new FilterValuesModel('name', 'unique', ''); + onKey(value) { + this.searchResult = this.search(value); + } + + search(value: string) { + let filter = value.toLowerCase(); + return this.dropDownValues.partnerTypeCode.primary.filter(option => option.fieldCode.toLowerCase().startsWith(filter)); + } + + getPolicyGroup() { + const filterObject = new FilterValuesModel('id', 'unique', ''); let optinalFilterObject = new OptionalFilterValuesModel('isActive', 'equals', 'true'); let filterRequest = new FilterRequest([filterObject], this.primaryLang, [optinalFilterObject]); filterRequest["purpose"] = "REGISTRATION"; @@ -465,7 +475,9 @@ export class MaterDataCommonBodyComponent implements OnInit { this.dataStorageService .getFiltersForAllDropDown('policymanager/policies/group', request) .subscribe(response => { - this.dropDownValues[key] = response.response.filters; + if(response.response.filters) + this.searchResult = response.response.filters.sort((a, b) => (a.id && b.id) ? a.id.localeCompare(b.id) : 0); + this.dropDownValues.partnerTypeCode.primary = response.response.filters.sort((a, b) => (a.id && b.id) ? a.id.localeCompare(b.id) : 0); }); }