mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-1594][AAE-1631] Fix not able to search for specific users, valid… (#5429)
* [AAE-1594][AAE-1631] Fix not able to search for specific users, validation not working for partial username * [AAE-1594][AAE-1631] Fix unit tests * [AAE-1594] Refactor comparing preselcted user with keycloak user, add unit tests for search * [AAE-1594] Add missing undefined check * [AAE-1594] Ignore blank space user/groups search
This commit is contained in:
@@ -190,9 +190,12 @@ export class GroupCloudComponent implements OnInit, OnChanges, OnDestroy {
|
||||
return typeof value === 'string';
|
||||
}),
|
||||
tap((value) => {
|
||||
this.searchedValue = value;
|
||||
if (value) {
|
||||
if (value.trim()) {
|
||||
this.searchedValue = value;
|
||||
this.setTypingError();
|
||||
} else {
|
||||
this.searchGroupsControl.markAsPristine();
|
||||
this.searchGroupsControl.markAsUntouched();
|
||||
}
|
||||
}),
|
||||
tap(() => {
|
||||
@@ -238,7 +241,7 @@ export class GroupCloudComponent implements OnInit, OnChanges, OnDestroy {
|
||||
}
|
||||
|
||||
private isGroupAlreadySelected(group: IdentityGroupModel): boolean {
|
||||
if (this.selectedGroups && this.selectedGroups.length > 0 && this.isMultipleMode()) {
|
||||
if (this.selectedGroups && this.selectedGroups.length > 0) {
|
||||
const result = this.selectedGroups.find((selectedGroup: IdentityGroupModel) => {
|
||||
return selectedGroup.name === group.name;
|
||||
});
|
||||
@@ -440,7 +443,7 @@ export class GroupCloudComponent implements OnInit, OnChanges, OnDestroy {
|
||||
}
|
||||
|
||||
private createSearchParam(value: string): IdentityGroupSearchParam {
|
||||
const queryParams: IdentityGroupSearchParam = { name: value };
|
||||
const queryParams: IdentityGroupSearchParam = { name: value.trim() };
|
||||
return queryParams;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user