mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-1594] Fix partial group name of a valid group should not be valid, fix form-cloud able to search when people/group widget is readonly (#5417)
This commit is contained in:
@@ -266,7 +266,7 @@ export class GroupCloudComponent implements OnInit, OnChanges, OnDestroy {
|
||||
await Promise.all(preselectedGroupsToValidate.map(async (group: IdentityGroupModel) => {
|
||||
try {
|
||||
const validationResult = await this.searchGroup(group.name);
|
||||
if (!this.hasGroupIdOrName(validationResult)) {
|
||||
if (this.isPreselectedGroupInvalid(group, validationResult)) {
|
||||
this.invalidGroups.push(group);
|
||||
}
|
||||
} catch (error) {
|
||||
@@ -380,8 +380,12 @@ export class GroupCloudComponent implements OnInit, OnChanges, OnDestroy {
|
||||
this.searchGroupsSubject.next(this.searchGroups);
|
||||
}
|
||||
|
||||
hasGroupIdOrName(group: IdentityGroupModel): boolean {
|
||||
return group && (group.id !== undefined || group.name !== undefined);
|
||||
isPreselectedGroupInvalid(preselectedGroup: IdentityGroupModel, validatedGroup: IdentityGroupModel): boolean {
|
||||
if (validatedGroup && validatedGroup.name !== undefined) {
|
||||
return preselectedGroup.name !== validatedGroup.name;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
isSingleMode(): boolean {
|
||||
|
Reference in New Issue
Block a user