mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-3281] - fixed error when user try to involve people (#3538)
* [ADF-3281] moved current user retrieving in the constructor * [ADF-3281] moved current user retrieving in the constructor #2
This commit is contained in:
@@ -17,15 +17,19 @@
|
||||
|
||||
import { NoTaskDetailsTemplateDirective } from './no-task-detail-template.directive';
|
||||
import { TaskDetailsComponent } from './task-details.component';
|
||||
import { FormRenderingService } from '@alfresco/adf-core';
|
||||
import { FormRenderingService, AuthenticationService } from '@alfresco/adf-core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
describe('NoTaskDetailsTemplateDirective', () => {
|
||||
|
||||
let component: NoTaskDetailsTemplateDirective;
|
||||
let detailsComponent: TaskDetailsComponent;
|
||||
let authService: AuthenticationService;
|
||||
|
||||
beforeEach(() => {
|
||||
detailsComponent = new TaskDetailsComponent(null, null, null, new FormRenderingService(), null, null, null);
|
||||
authService = new AuthenticationService(null, null, null, null);
|
||||
spyOn(authService, 'getBpmLoggedUser').and.returnValue(Observable.of({ email: 'fake-email'}));
|
||||
detailsComponent = new TaskDetailsComponent(null, authService, null, new FormRenderingService(), null, null, null);
|
||||
component = new NoTaskDetailsTemplateDirective(detailsComponent);
|
||||
});
|
||||
|
||||
|
@@ -195,6 +195,9 @@ export class TaskDetailsComponent implements OnInit, OnChanges {
|
||||
this.formRenderingService.setComponentTypeResolver('select-folder', () => AttachFolderWidgetComponent, true);
|
||||
this.formRenderingService.setComponentTypeResolver('upload', () => AttachFileWidgetComponent, true);
|
||||
this.peopleSearch = new Observable<UserProcessModel[]>(observer => this.peopleSearchObserver = observer).share();
|
||||
this.authService.getBpmLoggedUser().subscribe((user: UserRepresentation) => {
|
||||
this.currentLoggedUser = user;
|
||||
});
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -204,10 +207,6 @@ export class TaskDetailsComponent implements OnInit, OnChanges {
|
||||
|
||||
this.cardViewUpdateService.itemUpdated$.subscribe(this.updateTaskDetails.bind(this));
|
||||
this.cardViewUpdateService.itemClicked$.subscribe(this.clickTaskDetails.bind(this));
|
||||
|
||||
this.authService.getBpmLoggedUser().subscribe((user: UserRepresentation) => {
|
||||
this.currentLoggedUser = user;
|
||||
});
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges): void {
|
||||
|
Reference in New Issue
Block a user