+
+
+
+
+ {{ 'ADF_CLOUD_USERS.ERROR.NOT_FOUND' | translate : { userName: searchedValue } }}
+
+
diff --git a/lib/process-services-cloud/src/lib/people/components/people-cloud.component.scss b/lib/process-services-cloud/src/lib/people/components/people-cloud.component.scss
index cfb14d7008..8504eb4a1f 100644
--- a/lib/process-services-cloud/src/lib/people/components/people-cloud.component.scss
+++ b/lib/process-services-cloud/src/lib/people/components/people-cloud.component.scss
@@ -8,6 +8,10 @@
&-people-cloud {
width: 100%;
+
+ &-option-not-active {
+ background: inherit !important;
+ }
}
&-people-cloud-list {
diff --git a/lib/process-services-cloud/src/lib/people/components/people-cloud.component.spec.ts b/lib/process-services-cloud/src/lib/people/components/people-cloud.component.spec.ts
index ac1e44f945..b5787b7189 100644
--- a/lib/process-services-cloud/src/lib/people/components/people-cloud.component.spec.ts
+++ b/lib/process-services-cloud/src/lib/people/components/people-cloud.component.spec.ts
@@ -113,7 +113,7 @@ describe('PeopleCloudComponent', () => {
fixture.detectChanges();
fixture.whenStable().then(() => {
fixture.detectChanges();
- expect(fixture.debugElement.queryAll(By.css('mat-option')).length).toEqual(3);
+ expect(fixture.debugElement.queryAll(By.css('[data-automation-id="adf-people-cloud-row"]')).length).toEqual(3);
expect(findUsersByNameSpy).toHaveBeenCalled();
done();
});
@@ -134,7 +134,7 @@ describe('PeopleCloudComponent', () => {
fixture.whenStable().then(() => {
fixture.detectChanges();
- expect(fixture.debugElement.queryAll(By.css('mat-option')).length).toEqual(2);
+ expect(fixture.debugElement.queryAll(By.css('[data-automation-id="adf-people-cloud-row"]')).length).toEqual(2);
done();
});
});
@@ -190,7 +190,7 @@ describe('PeopleCloudComponent', () => {
fixture.detectChanges();
fixture.whenStable().then(() => {
- expect(element.querySelector('mat-option')).toBeNull();
+ expect(element.querySelector('[data-automation-id="adf-people-cloud-row"]')).toBeNull();
done();
});
});
@@ -330,7 +330,8 @@ describe('PeopleCloudComponent', () => {
fixture.detectChanges();
fixture.whenStable().then(() => {
fixture.detectChanges();
- expect(element.querySelectorAll('mat-option').length).toEqual(0);
+ expect(fixture.debugElement.queryAll(By.css('[data-automation-id="adf-people-cloud-row"]')).length).toEqual(0);
+ expect(fixture.debugElement.queryAll(By.css('[data-automation-id="adf-people-cloud-no-results"]')).length).toEqual(1);
done();
});
});
@@ -347,7 +348,7 @@ describe('PeopleCloudComponent', () => {
fixture.detectChanges();
fixture.whenStable().then(() => {
fixture.detectChanges();
- expect(fixture.debugElement.queryAll(By.css('mat-option')).length).toEqual(3);
+ expect(fixture.debugElement.queryAll(By.css('[data-automation-id="adf-people-cloud-row"]')).length).toEqual(3);
expect(checkUserHasAnyClientAppRoleSpy).toHaveBeenCalled();
done();
});
@@ -366,7 +367,8 @@ describe('PeopleCloudComponent', () => {
fixture.detectChanges();
fixture.whenStable().then(() => {
fixture.detectChanges();
- expect(fixture.debugElement.queryAll(By.css('mat-option')).length).toEqual(0);
+ expect(fixture.debugElement.queryAll(By.css('[data-automation-id="adf-people-cloud-row"]')).length).toEqual(0);
+ expect(fixture.debugElement.queryAll(By.css('[data-automation-id="adf-people-cloud-no-results"]')).length).toEqual(1);
expect(checkUserHasAnyClientAppRoleSpy).toHaveBeenCalled();
done();
});
@@ -486,7 +488,7 @@ describe('PeopleCloudComponent', () => {
fixture.detectChanges();
fixture.whenStable().then(() => {
fixture.detectChanges();
- expect(fixture.debugElement.queryAll(By.css('mat-option')).length).toEqual(3);
+ expect(fixture.debugElement.queryAll(By.css('[data-automation-id="adf-people-cloud-row"]')).length).toEqual(3);
expect(checkUserHasRoleSpy).toHaveBeenCalledTimes(3);
done();
});
@@ -504,7 +506,8 @@ describe('PeopleCloudComponent', () => {
fixture.detectChanges();
fixture.whenStable().then(() => {
fixture.detectChanges();
- expect(element.querySelectorAll('mat-option').length).toEqual(0);
+ expect(fixture.debugElement.queryAll(By.css('[data-automation-id="adf-people-cloud-row"]')).length).toEqual(0);
+ expect(fixture.debugElement.queryAll(By.css('[data-automation-id="adf-people-cloud-no-results"]')).length).toEqual(1);
expect(checkUserHasRoleSpy).toHaveBeenCalled();
done();
});
diff --git a/lib/process-services-cloud/src/lib/people/components/people-cloud.component.ts b/lib/process-services-cloud/src/lib/people/components/people-cloud.component.ts
index 98dd906ce7..cade14ea66 100644
--- a/lib/process-services-cloud/src/lib/people/components/people-cloud.component.ts
+++ b/lib/process-services-cloud/src/lib/people/components/people-cloud.component.ts
@@ -138,7 +138,8 @@ export class PeopleCloudComponent implements OnInit, OnChanges, OnDestroy {
validateUsersMessage: string;
searchedValue = '';
- isLoading = false;
+ validationLoading = false;
+ searchLoading = false;
constructor(
private identityUserService: IdentityUserService,
@@ -183,6 +184,7 @@ export class PeopleCloudComponent implements OnInit, OnChanges, OnDestroy {
private initSearch(): void {
this.searchUserCtrl.valueChanges.pipe(
filter((value) => {
+ this.searchLoading = true;
return typeof value === 'string';
}),
tap((value: string) => {
@@ -207,6 +209,7 @@ export class PeopleCloudComponent implements OnInit, OnChanges, OnDestroy {
this.identityUserService.findUsersByName(search.trim())),
mergeMap((users) => {
this.resetSearchUsers();
+ this.searchLoading = false;
return users;
}),
filter(user => !this.isUserAlreadySelected(user)),
@@ -283,9 +286,9 @@ export class PeopleCloudComponent implements OnInit, OnChanges, OnDestroy {
}
this.userChipsCtrl.setValue(this.selectedUsers[0].username);
if (this.isValidationEnabled()) {
- this.isLoading = true;
+ this.validationLoading = true;
await this.validatePreselectUsers();
- this.isLoading = false;
+ this.validationLoading = false;
}
}
@@ -381,23 +384,25 @@ export class PeopleCloudComponent implements OnInit, OnChanges, OnDestroy {
}
onSelect(user: IdentityUserModel): void {
- this.selectUser.emit(user);
+ if (user) {
+ this.selectUser.emit(user);
- if (this.isMultipleMode()) {
- if (!this.isUserAlreadySelected(user)) {
- this.selectedUsers.push(user);
+ if (this.isMultipleMode()) {
+ if (!this.isUserAlreadySelected(user)) {
+ this.selectedUsers.push(user);
+ }
+ } else {
+ this.invalidUsers = [];
+ this.selectedUsers = [user];
}
- } else {
- this.invalidUsers = [];
- this.selectedUsers = [user];
+
+ this.userInput.nativeElement.value = '';
+ this.searchUserCtrl.setValue('');
+ this.userChipsCtrlValue(this.selectedUsers[0].username);
+
+ this.changedUsers.emit(this.selectedUsers);
+ this.resetSearchUsers();
}
-
- this.userInput.nativeElement.value = '';
- this.searchUserCtrl.setValue('');
- this.userChipsCtrlValue(this.selectedUsers[0].username);
-
- this.changedUsers.emit(this.selectedUsers);
- this.resetSearchUsers();
}
onRemove(userToRemove: IdentityUserModel): void {
@@ -522,7 +527,7 @@ export class PeopleCloudComponent implements OnInit, OnChanges, OnDestroy {
}
isValidationLoading(): boolean {
- return this.isValidationEnabled() && this.isLoading;
+ return this.isValidationEnabled() && this.validationLoading;
}
setFocus(isFocused: boolean) {
diff --git a/lib/testing/src/lib/process-services-cloud/pages/group-cloud-component.page.ts b/lib/testing/src/lib/process-services-cloud/pages/group-cloud-component.page.ts
index 1b2474efaf..3876dee1d2 100644
--- a/lib/testing/src/lib/process-services-cloud/pages/group-cloud-component.page.ts
+++ b/lib/testing/src/lib/process-services-cloud/pages/group-cloud-component.page.ts
@@ -97,4 +97,9 @@ export class GroupCloudComponentPage {
}
}
+ async checkNoResultsFoundError(): Promise
{
+ const errorLocator = element(by.css('[data-automation-id="adf-cloud-group-no-results"]'));
+ await BrowserVisibility.waitUntilElementIsVisible(errorLocator);
+ }
+
}
diff --git a/lib/testing/src/lib/process-services-cloud/pages/people-cloud-component.page.ts b/lib/testing/src/lib/process-services-cloud/pages/people-cloud-component.page.ts
index 454de3cc49..505e5b5c01 100644
--- a/lib/testing/src/lib/process-services-cloud/pages/people-cloud-component.page.ts
+++ b/lib/testing/src/lib/process-services-cloud/pages/people-cloud-component.page.ts
@@ -133,4 +133,9 @@ export class PeopleCloudComponentPage {
}
}
+ async checkNoResultsFoundError(): Promise {
+ const errorLocator = element(by.css('[data-automation-id="adf-people-cloud-no-results"]'));
+ await BrowserVisibility.waitUntilElementIsVisible(errorLocator);
+ }
+
}