Skip to content

Commit

Permalink
Merge pull request #243 from GOKULRAJ136/develop
Browse files Browse the repository at this point in the history
MOSIP-31929 : Fetched the deviceType & deviceSubType details.
  • Loading branch information
aranaravi authored Mar 13, 2024
2 parents 4b5bc77 + 43b15eb commit d21ed2e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,15 @@
placeholder="{{ field.label[primaryLang] }}"
required
>
<input placeholder="Search..." matInput type="text" (keyup)="onKey($event.target.value)" class="search-input" >
<mat-option
*ngFor="let data of searchResult"
*ngFor="let data of dropDownValues[field.name]"
(onSelectionChange)="
captureDropDownValue($event, field.name, 'primary')
"
panelMaxHeight="500px"
[id]="data.fieldValue"
[value]="data.fieldValue"
[id]="data.fieldCode"
[value]="data.fieldCode"
>
{{ data.fieldCode }}
{{ data.fieldValue }}
</mat-option>
</mat-select>
</mat-form-field>
Expand All @@ -77,9 +75,8 @@
required
disabled="{{setreadonly}}"
>
<input placeholder="Search..." matInput type="text" (keyup)="onKey($event.target.value)" class="search-input">
<mat-option
*ngFor="let data of searchResult"
*ngFor="let data of dropDownValues[field.name]"
(onSelectionChange)="
captureDropDownValue($event, field.name, 'primary')
"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,3 @@ mat-form-field{
margin-top: 14px;
}

.search-input {
height: 35px;
width: 50px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ export class MaterDataCommonBodyComponent implements OnInit {
disableForms: boolean;
copyPrimaryWord: any;
copySecondaryWord: any;
searchResult: any[] = [];

@Input() primaryData: any = {};
@Input() secondaryData: any;
Expand Down Expand Up @@ -132,12 +131,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();
this.getPolicyGroup("policyGroupName");
}
else if(url === "authpolicy"){
this.pageName = "Auth Policy";
this.primaryData = {"name": "", "desc": "", "policies": "", "policyGroupName": "", "policyType": "Auth", "version": "1.1"};
this.getPolicyGroup();
this.getPolicyGroup("policyGroupName");
}
else if(url === "policymapping"){
this.pageName = "Map Policy";
Expand Down Expand Up @@ -414,9 +413,7 @@ export class MaterDataCommonBodyComponent implements OnInit {
this.dataStorageService
.getFiltersForAllDropDown('partnermanager/partners', request)
.subscribe(response => {
if(response.response.filters)
this.searchResult = response.response.filters.sort((a, b) => (a.name && b.name) ? a.id.localeCompare(b.name) : 0);
this.dropDownValues.partnerTypeCode.primary = response.response.filters.sort((a, b) => (a.name && b.name) ? a.name.localeCompare(b.name) : 0);
this.dropDownValues[key] = response.response.filters;
});
}

Expand Down Expand Up @@ -459,27 +456,17 @@ export class MaterDataCommonBodyComponent implements OnInit {
});
}

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', '');
getPolicyGroup(key) {
const filterObject = new FilterValuesModel('name', 'unique', '');
let optinalFilterObject = new OptionalFilterValuesModel('isActive', 'equals', 'true');
let filterRequest = new FilterRequest([filterObject], this.primaryLang, [optinalFilterObject]);
filterRequest["purpose"] = "REGISTRATION";
let request = new RequestModel('', null, filterRequest);
this.dataStorageService
.getFiltersForAllDropDown('policymanager/policies/group', request)
.subscribe(response => {
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);
this.dropDownValues[key] = response.response.filters;
});
}

Expand Down
2 changes: 1 addition & 1 deletion pmp-ui/src/assets/entity-spec/policy-mapping.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
"showAsLink": "",
"linkType": "",
"LinkURL": "",
"inputType": "dropdown",
"inputType": "dropdownpartner",
"ismandatory": "true",
"showInListView": "false",
"showInSingleView": "true"
Expand Down

0 comments on commit d21ed2e

Please sign in to comment.