+
+ (onRowClicked)="involveUser($event)"
+ [results]="peopleSearch$">
diff --git a/ng2-components/ng2-activiti-tasklist/src/components/activiti-people.component.spec.ts b/ng2-components/ng2-activiti-tasklist/src/components/activiti-people.component.spec.ts
index d462229df4..7ede77c23e 100644
--- a/ng2-components/ng2-activiti-tasklist/src/components/activiti-people.component.spec.ts
+++ b/ng2-components/ng2-activiti-tasklist/src/components/activiti-people.component.spec.ts
@@ -157,7 +157,7 @@ describe('Activiti People Component', () => {
}));
it('should return an observable with user search results', (done) => {
- activitiPeopleComponent.people$.subscribe((users) => {
+ activitiPeopleComponent.peopleSearch$.subscribe((users) => {
expect(users.length).toBe(2);
expect(users[0].firstName).toBe('fake-test-1');
expect(users[0].lastName).toBe('fake-last-1');
@@ -186,7 +186,7 @@ describe('Activiti People Component', () => {
});
it('should return an empty list for not valid search', (done) => {
- activitiPeopleComponent.people$.subscribe((users) => {
+ activitiPeopleComponent.peopleSearch$.subscribe((users) => {
expect(users.length).toBe(0);
done();
});
@@ -211,7 +211,7 @@ describe('Activiti People Component', () => {
it('should log error message when search fails', async(() => {
console.log = jasmine.createSpy('log');
- activitiPeopleComponent.people$.subscribe(() => {
+ activitiPeopleComponent.peopleSearch$.subscribe(() => {
expect(console.log).toHaveBeenCalledWith('Could not load users');
});
activitiPeopleComponent.searchUser('fake-search');
diff --git a/ng2-components/ng2-activiti-tasklist/src/components/activiti-people.component.ts b/ng2-components/ng2-activiti-tasklist/src/components/activiti-people.component.ts
index cbbed85c77..e4fa29919e 100644
--- a/ng2-components/ng2-activiti-tasklist/src/components/activiti-people.component.ts
+++ b/ng2-components/ng2-activiti-tasklist/src/components/activiti-people.component.ts
@@ -41,8 +41,8 @@ export class ActivitiPeople {
@ViewChild('dialog')
dialog: any;
- private peopleObserver: Observer;
- people$: Observable;
+ private peopleSearchObserver: Observer;
+ peopleSearch$: Observable;
/**
* Constructor
@@ -54,7 +54,7 @@ export class ActivitiPeople {
if (translate) {
translate.addTranslationFolder('node_modules/ng2-activiti-tasklist/src');
}
- this.people$ = new Observable(observer => this.peopleObserver = observer).share();
+ this.peopleSearch$ = new Observable(observer => this.peopleSearchObserver = observer).share();
}
public showDialog() {
@@ -69,14 +69,14 @@ export class ActivitiPeople {
public cancel() {
if (this.dialog) {
this.dialog.nativeElement.close();
- this.peopleObserver.next([]);
+ this.peopleSearchObserver.next([]);
}
}
searchUser(searchedWord: string) {
this.peopleService.getWorkflowUsers(this.taskId, searchedWord)
.subscribe((users) => {
- this.peopleObserver.next(users);
+ this.peopleSearchObserver.next(users);
}, error => console.log('Could not load users'));
}
@@ -96,4 +96,10 @@ export class ActivitiPeople {
}, error => console.error('Impossible to remove involved user from task'));
}
+ getDisplayUser(user: User): string {
+ let firstName = user.firstName && user.firstName !== 'null' ? user.firstName : 'N/A';
+ let lastName = user.lastName && user.lastName !== 'null' ? user.lastName : 'N/A';
+ return firstName + ' ' + lastName;
+ }
+
}