[ADF-] update library to use new js-api 3.0.0 (#4097)

This commit is contained in:
Eugenio Romano
2019-01-06 23:57:01 +01:00
committed by Eugenio Romano
parent 2acd1b4e26
commit 3ef7d3b7ea
430 changed files with 1966 additions and 2149 deletions

View File

@@ -104,8 +104,8 @@ export class AttachFormComponent implements OnInit, OnChanges {
}
private loadFormsTask(): void {
this.taskService.getFormList().subscribe((res: Form[]) => {
this.forms = res;
this.taskService.getFormList().subscribe((form: Form[]) => {
this.forms = form;
},
(err) => {
this.error.emit(err);

View File

@@ -108,9 +108,9 @@ export class ChecklistComponent implements OnChanges {
assignee: { id: this.assignee }
});
this.activitiTaskList.addTask(newTask).subscribe(
(res: TaskDetailsModel) => {
this.checklist.push(res);
this.checklistTaskCreated.emit(res);
(taskDetailsModel: TaskDetailsModel) => {
this.checklist.push(taskDetailsModel);
this.checklistTaskCreated.emit(taskDetailsModel);
this.taskName = '';
},
(error) => {

View File

@@ -145,27 +145,19 @@ describe('TaskDetailsComponent', () => {
expect(fixture.nativeElement.innerText).toBe('ADF_TASK_LIST.DETAILS.MESSAGES.NONE');
});
it('shoud display a form when the task has an associated form', (done) => {
it('should display a form when the task has an associated form', async(() => {
component.taskId = '123';
fixture.detectChanges();
fixture.whenStable().then(() => {
fixture.detectChanges();
expect(fixture.debugElement.query(By.css('adf-form'))).not.toBeNull();
done();
});
});
expect(fixture.debugElement.query(By.css('adf-form'))).not.toBeNull();
}));
it('shoud display a form in readonly when the task has an associated form and readOnlyForm is true', (done) => {
it('should display a form in readonly when the task has an associated form and readOnlyForm is true', async((done) => {
component.readOnlyForm = true;
component.taskId = '123';
fixture.detectChanges();
fixture.whenStable().then(() => {
fixture.detectChanges();
expect(fixture.debugElement.query(By.css('adf-form'))).not.toBeNull();
expect(fixture.debugElement.query(By.css('.adf-readonly-form'))).not.toBeNull();
done();
});
});
expect(fixture.debugElement.query(By.css('adf-form'))).not.toBeNull();
expect(fixture.debugElement.query(By.css('.adf-readonly-form'))).not.toBeNull();
}));
it('should not display a form when the task does not have an associated form', async(() => {
component.taskId = '123';

View File

@@ -43,7 +43,7 @@ import { TaskQueryRequestRepresentationModel } from '../models/filter.model';
import { TaskDetailsModel } from '../models/task-details.model';
import { TaskListService } from './../services/tasklist.service';
import { AttachFileWidgetComponent, AttachFolderWidgetComponent } from '../../content-widget';
import { UserRepresentation } from 'alfresco-js-api';
import { UserRepresentation } from '@alfresco/js-api';
import { share } from 'rxjs/operators';
@Component({

View File

@@ -264,7 +264,7 @@ describe('TaskListComponent', () => {
expect(component.rows[0]['processInstanceId']).toEqual(2511);
expect(component.rows[0]['endDate']).toBeDefined();
expect(component.rows[1]['name']).toEqual('No name');
expect(component.rows[1]['endDate']).toBeNull();
expect(component.rows[1]['endDate']).toBeUndefined();
done();
});

View File

@@ -124,7 +124,7 @@ export class TaskListComponent extends DataTableSchema implements OnChanges, Aft
/** Starting point of the */
@Input()
start: number = 0;
start: number;
/** Emitted when a task in the list is clicked */
@Output()