[ADF-4038] People/GroupCloudDemo - add appName filter (#4283)

* [ADF-4038] - People/Group Cloud Component add app name filter

* [ADF-4038] add unit test, modify ngOnChange appName condition

* [ADF-4038] People/GroupCloudDemo - add radio button to filter application name or roles
This commit is contained in:
Silviu Popa
2019-02-26 11:41:42 +02:00
committed by Eugenio Romano
parent 8901261ec9
commit 898d62477e
8 changed files with 150 additions and 21 deletions

View File

@@ -107,19 +107,24 @@ export class GroupCloudComponent implements OnInit, OnChanges {
}
ngOnInit() {
this.initSearch();
if (this.appName) {
this.disableSearch();
this.loadClientId();
}
}
ngOnChanges(changes: SimpleChanges) {
if (changes.preSelectGroups && this.hasPreSelectGroups()) {
this.loadPreSelectGroups();
}
if (changes.appName && this.isAppNameChanged(changes.appName)) {
this.disableSearch();
this.loadClientId();
} else {
this.enableSearch();
}
}
private isAppNameChanged(change) {
return change.previousValue !== change.currentValue && this.appName && this.appName.length > 0;
}
private async loadClientId() {