mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
fix random test failing part 2 (#3395)
* fix random failing test core search/comment/auth/user * fix node delete directive * fix lint issues * node restore fix * fix comment test * remove fdescribe * fix tests and tslint * fix upload test * unsubscribe success event task test * copy comment object during test * use the data pipe performance improvement and standard usage * uncomment random test * fix comment date random failing test * disposable unsubscribe * fix start process * remove fdescribe * change start process test and remove commented code * fix error event check double click * clone object form test * refactor date time test * fix service mock * fix test dropdown and context * git hook lint * fix language test * unsubscribe documentlist event test * fix disposable error * fix console log service error document list * unusbscribe search test * clear input field * remove wrong test
This commit is contained in:
committed by
Denys Vuika
parent
22006395c7
commit
eb0f91c5db
@@ -15,20 +15,17 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges, ViewChild } from '@angular/core';
|
||||
import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges, ViewChild } from '@angular/core';
|
||||
import { MatDialog } from '@angular/material';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { Observer } from 'rxjs/Observer';
|
||||
import { TaskDetailsModel } from '../models/task-details.model';
|
||||
import { TaskListService } from './../services/tasklist.service';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-checklist',
|
||||
templateUrl: './checklist.component.html',
|
||||
styleUrls: ['./checklist.component.scss'],
|
||||
providers: [TaskListService]
|
||||
styleUrls: ['./checklist.component.scss']
|
||||
})
|
||||
export class ChecklistComponent implements OnInit, OnChanges {
|
||||
export class ChecklistComponent implements OnChanges {
|
||||
|
||||
/** (required) The id of the parent task to which subtasks are
|
||||
* attached.
|
||||
@@ -50,7 +47,7 @@ export class ChecklistComponent implements OnInit, OnChanges {
|
||||
@Output()
|
||||
checklistTaskCreated: EventEmitter<TaskDetailsModel> = new EventEmitter<TaskDetailsModel>();
|
||||
|
||||
/** Emitted when a checklist task is deleted. */
|
||||
/** Emitted when a checklitst task is deleted. */
|
||||
@Output()
|
||||
checklistTaskDeleted: EventEmitter<string> = new EventEmitter<string>();
|
||||
|
||||
@@ -65,25 +62,13 @@ export class ChecklistComponent implements OnInit, OnChanges {
|
||||
|
||||
checklist: TaskDetailsModel [] = [];
|
||||
|
||||
private taskObserver: Observer<TaskDetailsModel>;
|
||||
task$: Observable<TaskDetailsModel>;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param auth
|
||||
* @param translate
|
||||
*/
|
||||
constructor(
|
||||
private activitiTaskList: TaskListService,
|
||||
private dialog: MatDialog
|
||||
) {
|
||||
this.task$ = new Observable<TaskDetailsModel>(observer => this.taskObserver = observer).share();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.task$.subscribe((task: TaskDetailsModel) => {
|
||||
this.checklist.push(task);
|
||||
});
|
||||
constructor(private activitiTaskList: TaskListService,
|
||||
private dialog: MatDialog) {
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges) {
|
||||
@@ -98,9 +83,9 @@ export class ChecklistComponent implements OnInit, OnChanges {
|
||||
this.checklist = [];
|
||||
if (this.taskId) {
|
||||
this.activitiTaskList.getTaskChecklist(this.taskId).subscribe(
|
||||
(res: TaskDetailsModel[]) => {
|
||||
res.forEach((task) => {
|
||||
this.taskObserver.next(task);
|
||||
(taskDetailsModel: TaskDetailsModel[]) => {
|
||||
taskDetailsModel.forEach((task) => {
|
||||
this.checklist.push(task);
|
||||
});
|
||||
},
|
||||
(error) => {
|
||||
@@ -148,9 +133,6 @@ export class ChecklistComponent implements OnInit, OnChanges {
|
||||
|
||||
public cancel() {
|
||||
this.dialog.closeAll();
|
||||
// if (this.addNewDialog) {
|
||||
// this.addNewDialog.nativeElement.close();
|
||||
// }
|
||||
this.taskName = '';
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user