Skip to content

Commit

Permalink
Merge pull request #246 from GOKULRAJ136/pmp-release
Browse files Browse the repository at this point in the history
Revert "MOSIP-26354 : PMP UI: All active policies should be display in Policy group dropdown"
  • Loading branch information
aranaravi authored Mar 15, 2024
2 parents 9b20176 + 5b796d7 commit 1324845
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,14 @@
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"
[value]="data.fieldCode"
>
{{ data.fieldCode }}
{{ data.fieldValue }}
</mat-option>
</mat-select>
</mat-form-field>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,4 @@ mat-form-field{

.mat-card-content>:first-child {
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 @@ -459,27 +458,16 @@ 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

0 comments on commit 1324845

Please sign in to comment.