[ADF-3591] spellcheck support for code (#3827)

* setup spellcheck
This commit is contained in:
Denys Vuika
2018-10-23 15:05:38 +01:00
committed by Eugenio Romano
parent 53d96679ea
commit e39a2b149b
262 changed files with 1561 additions and 1005 deletions

View File

@@ -114,7 +114,7 @@ describe('AppsListComponent', () => {
expect(component.appList[0].modelId).toEqual(66);
});
it('should show the apps filtered by tenandId', () => {
it('should show the apps filtered by tenantId', () => {
component.filtersAppId = [{tenantId: 9}];
fixture.detectChanges();
expect(component.isEmpty()).toBe(false);
@@ -190,7 +190,7 @@ describe('AppsListComponent', () => {
expect(debugElement.queryAll(By.css('h1')).length).toBe(6);
});
it('should not display undeployed apps', () => {
it('should not display apps that are not deployed', () => {
getAppsSpy.and.returnValue(of(nonDeployedApps));
fixture.detectChanges();
expect(debugElement.queryAll(By.css('h1')).length).toBe(0);

View File

@@ -15,6 +15,7 @@
* limitations under the License.
*/
/* spellchecker: disable */
export class IconModel {
public static DEFAULT_TASKS_APP_MATERIAL_ICON: string = 'favorite_border';

View File

@@ -91,7 +91,7 @@ export class ProcessAttachmentListComponent implements OnChanges, AfterContentIn
});
}
hasCutomEmptyTemplate() {
hasCustomEmptyTemplate() {
return !!this.emptyTemplate;
}

View File

@@ -32,7 +32,7 @@ describe('TaskAttachmentList', () => {
let mockAttachment: any;
let deleteContentSpy: jasmine.Spy;
let getFileRawContentSpy: jasmine.Spy;
let disposablelSuccess: any;
let disposableSuccess: any;
setupTestBed({
imports: [ProcessTestingModule],
@@ -96,8 +96,8 @@ describe('TaskAttachmentList', () => {
overlayContainer.innerHTML = '';
});
if (disposablelSuccess) {
disposablelSuccess.unsubscribe();
if (disposableSuccess) {
disposableSuccess.unsubscribe();
}
});
@@ -117,7 +117,7 @@ describe('TaskAttachmentList', () => {
it('should emit a success event when the attachments are loaded', () => {
let change = new SimpleChange(null, '123', true);
disposablelSuccess = component.success.subscribe((attachments) => {
disposableSuccess = component.success.subscribe((attachments) => {
expect(attachments[0].name).toEqual(mockAttachment.data[0].name);
expect(attachments[0].id).toEqual(mockAttachment.data[0].id);
});

View File

@@ -34,7 +34,7 @@ export class TaskAttachmentListComponent implements OnChanges, AfterContentInit
@Input()
taskId: string;
/** Disable/Enable read only mode for attachement list. */
/** Disable/Enable read only mode for attachment list. */
@Input()
disabled: boolean = false;
@@ -82,7 +82,7 @@ export class TaskAttachmentListComponent implements OnChanges, AfterContentInit
this.attachments = [];
}
hasCutomEmptyTemplate() {
hasCustomEmptyTemplate() {
return !!this.emptyTemplate;
}

View File

@@ -186,8 +186,8 @@ export class AttachFileWidgetComponent extends UploadWidgetComponent implements
let currentECMHost = this.getDomainHost(this.appConfigService.get(AppConfigValues.ECMHOST));
let chosenRepositoryHost = this.getDomainHost(repository.repositoryUrl);
if (chosenRepositoryHost !== currentECMHost) {
let formattedReporistoryHost = repository.repositoryUrl.replace('/alfresco', '');
this.attachDialogService.openLogin(formattedReporistoryHost).subscribe(
let formattedRepositoryHost = repository.repositoryUrl.replace('/alfresco', '');
this.attachDialogService.openLogin(formattedRepositoryHost).subscribe(
(selections: any[]) => {
selections.forEach((node) => node.isExternal = true);
this.tempFilesList.push(...selections);
@@ -213,8 +213,8 @@ export class AttachFileWidgetComponent extends UploadWidgetComponent implements
)
)
)
.subscribe(([mymeType, res, isExternal]) => {
res.mimeType = mymeType;
.subscribe(([mimeType, res, isExternal]) => {
res.mimeType = mimeType;
res.isExternal = isExternal;
filesSaved.push(res);
},

View File

@@ -18,15 +18,24 @@
import { ObjectDataColumn } from '@alfresco/adf-core';
export let fakeProcessInstance = {
size: 2, total: 2, start: 0,
size: 2,
total: 2,
start: 0,
data: [
{
id: '1', name: 'Process 773443333', businessKey: null,
id: '1',
name: 'Process 773443333',
businessKey: null,
processDefinitionId: 'fakeprocess:5:7507',
tenantId: 'tenant_1',
started: '2015-11-09T12:36:14.184+0000',
ended: null,
startedBy: { id: 3, firstName: 'tenant2', lastName: 'tenantLastname', email: 'tenant2@tenant'},
startedBy: {
id: 3,
firstName: 'tenant2',
lastName: 'tenantLastName',
email: 'tenant2@tenant'
},
processDefinitionName: 'Fake Process Name',
processDefinitionDescription: null,
processDefinitionKey: 'fakeprocess',
@@ -39,12 +48,19 @@ export let fakeProcessInstance = {
variables: []
},
{
id: '2', name: 'Process 382927392', businessKey: null,
id: '2',
name: 'Process 382927392',
businessKey: null,
processDefinitionId: 'fakeprocess:5:7507',
tenantId: 'tenant_1',
started: '2018-01-10T17:02:22.597+0000',
ended: null,
startedBy: { id: 3, firstName: 'tenant2', lastName: 'tenantLastname', email: 'tenant2@tenant' },
startedBy: {
id: 3,
firstName: 'tenant2',
lastName: 'tenantLastName',
email: 'tenant2@tenant'
},
processDefinitionName: 'Fake Process Name',
processDefinitionDescription: null,
processDefinitionKey: 'fakeprocess',
@@ -60,7 +76,9 @@ export let fakeProcessInstance = {
};
export let fakeProcessInstancesWithNoName = {
size: 2, total: 2, start: 0,
size: 2,
total: 2,
start: 0,
data: [
{
id: '1',
@@ -68,10 +86,14 @@ export let fakeProcessInstancesWithNoName = {
processDefinitionId: 'fakeprocess:5:7507',
processDefinitionKey: 'fakeprocess',
processDefinitionName: 'Fake Process Name',
description: null, category: null,
description: null,
category: null,
started: '2017-11-09T12:36:14.184+0000',
startedBy: {
id: 3, firstName: 'tenant2', lastName: 'tenantLastname', email: 'tenant2@tenant'
id: 3,
firstName: 'tenant2',
lastName: 'tenantLastName',
email: 'tenant2@tenant'
}
},
{
@@ -84,36 +106,38 @@ export let fakeProcessInstancesWithNoName = {
category: null,
started: '2017-11-09T12:37:25.184+0000',
startedBy: {
id: 3, firstName: 'tenant2', lastName: 'tenantLastname', email: 'tenant2@tenant'
id: 3,
firstName: 'tenant2',
lastName: 'tenantLastName',
email: 'tenant2@tenant'
}
}
]
};
export let fakeProcessCutomSchema =
[
new ObjectDataColumn({
'key': 'fakeName',
'type': 'text',
'title': 'ADF_PROCESS_LIST.PROPERTIES.FAKE',
'sortable': true
}),
new ObjectDataColumn({
'key': 'fakeProcessName',
'type': 'text',
'title': 'ADF_PROCESS_LIST.PROPERTIES.PROCESS_FAKE',
'sortable': true
})
];
export let fakeProcessCustomSchema = [
new ObjectDataColumn({
key: 'fakeName',
type: 'text',
title: 'ADF_PROCESS_LIST.PROPERTIES.FAKE',
sortable: true
}),
new ObjectDataColumn({
key: 'fakeProcessName',
type: 'text',
title: 'ADF_PROCESS_LIST.PROPERTIES.PROCESS_FAKE',
sortable: true
})
];
export let fakeProcessColumnSchema = {
'default': [
default: [
{
'key': 'name',
'type': 'text',
'title': 'ADF_PROCESS_LIST.PROPERTIES.NAME',
'sortable': true
key: 'name',
type: 'text',
title: 'ADF_PROCESS_LIST.PROPERTIES.NAME',
sortable: true
}
]
, fakeProcessCutomSchema
],
fakeProcessCustomSchema
};

View File

@@ -15,6 +15,7 @@
* limitations under the License.
*/
/* spell-checker: disable */
import { ProcessInstance } from '../../process-list/models/process-instance.model';
export class ProcessList {

View File

@@ -23,7 +23,7 @@ export let newProcess = new ProcessInstance({
name: 'Process'
});
export let testProcessDefRepr = new ProcessDefinitionRepresentation({
export let testProcessDef = new ProcessDefinitionRepresentation({
id: 'my:process1',
name: 'My Process 1',
hasStartForm: false

View File

@@ -23,11 +23,15 @@ export let fakeGlobalTask = {
total: 2,
data: [
{
id: 14, name: 'nameFake1',
id: 14,
name: 'nameFake1',
description: 'descriptionFake1',
category: 'categoryFake1',
assignee: {
id: 2, firstName: 'firstNameFake1', lastName: 'lastNameFake1', email: 'emailFake1'
id: 2,
firstName: 'firstNameFake1',
lastName: 'lastNameFake1',
email: 'emailFake1'
},
created: '2017-03-01T12:25:17.189+0000',
dueDate: '2017-04-02T12:25:17.189+0000',
@@ -57,9 +61,15 @@ export let fakeGlobalTask = {
},
{
id: 2, name: '', description: 'descriptionFake2', category: null,
id: 2,
name: '',
description: 'descriptionFake2',
category: null,
assignee: {
id: 1, firstName: 'fistNameFake2', lastName: 'Administrator2', email: 'admin'
id: 1,
firstName: 'fistNameFake2',
lastName: 'Administrator2',
email: 'admin'
},
created: '2017-03-01T12:25:17.189+0000',
dueDate: '2017-04-02T12:25:17.189+0000',
@@ -68,30 +78,29 @@ export let fakeGlobalTask = {
]
};
export let fakeCutomSchema =
[
new ObjectDataColumn({
'key': 'fakeName',
'type': 'text',
'title': 'ADF_TASK_LIST.PROPERTIES.FAKE',
'sortable': true
}),
new ObjectDataColumn({
'key': 'fakeTaskName',
'type': 'text',
'title': 'ADF_TASK_LIST.PROPERTIES.TASK_FAKE',
'sortable': true
})
];
export let fakeCustomSchema = [
new ObjectDataColumn({
key: 'fakeName',
type: 'text',
title: 'ADF_TASK_LIST.PROPERTIES.FAKE',
sortable: true
}),
new ObjectDataColumn({
key: 'fakeTaskName',
type: 'text',
title: 'ADF_TASK_LIST.PROPERTIES.TASK_FAKE',
sortable: true
})
];
export let fakeColumnSchema = {
'default': [
default: [
{
'key': 'name',
'type': 'text',
'title': 'ADF_TASK_LIST.PROPERTIES.NAME',
'sortable': true
key: 'name',
type: 'text',
title: 'ADF_TASK_LIST.PROPERTIES.NAME',
sortable: true
}
]
, fakeCutomSchema
],
fakeCustomSchema
};

View File

@@ -71,7 +71,7 @@ describe('PeopleSelectorComponent', () => {
});
});
it('should emit an event with the selected users\'s id when userSelected method is invoked', (done) => {
it('should emit an event with the selected users id when userSelected method is invoked', (done) => {
component.peopleIdChange.subscribe((userId) => {
expect(userId).toBe(789);

View File

@@ -7,7 +7,7 @@
<div *ngIf="!hasPeople()" class="assigment-count" id="no-people-label">
{{ 'ADF_TASK_LIST.DETAILS.PEOPLE.NONE' | translate }}
</div>
<div *ngIf="isEditMode()" class="add-people" (click)="onAddAssignement()">
<div *ngIf="isEditMode()" class="add-people" (click)="onAddAssignment()">
<mat-icon class="adf-add-person-icon">person_add</mat-icon>
</div>
</div>

View File

@@ -105,7 +105,7 @@ describe('PeopleComponent', () => {
});
}));
it('should remove pepole involved', async(() => {
it('should remove people involved', async(() => {
activitiPeopleComponent.removeInvolvedUser(fakeUser);
jasmine.Ajax.requests.mostRecent().respondWith({
status: 200
@@ -119,7 +119,7 @@ describe('PeopleComponent', () => {
});
}));
it('should involve pepole', async(() => {
it('should involve people', async(() => {
activitiPeopleComponent.involveUser(fakeUser);
jasmine.Ajax.requests.mostRecent().respondWith({
status: 200

View File

@@ -110,7 +110,7 @@ export class PeopleComponent implements OnInit, AfterViewInit {
return this.getDisplayUser(firstName, lastName, '');
}
onAddAssignement() {
onAddAssignment() {
this.showAssignment = true;
}

View File

@@ -28,7 +28,7 @@
<mat-card>
<mat-card-content>
<adf-process-instance-comments #activiticomments
<adf-process-instance-comments #activitiComments
[readOnly]="false"
[processInstanceId]="processInstanceDetails.id">
</adf-process-instance-comments>

View File

@@ -79,7 +79,7 @@
</adf-start-form>
</div>
<div mat-dialog-actions class="adf-start-process-dialog-actions">
<button mat-button type="button" (click)="closeSartDialog()">{{ 'ADF_PROCESS_LIST.DETAILS.TASKS.TASK_CLOSE' | translate }}</button>
<button mat-button type="button" (click)="closeStartDialog()">{{ 'ADF_PROCESS_LIST.DETAILS.TASKS.TASK_CLOSE' | translate }}</button>
</div>
</div>
</ng-template>

View File

@@ -61,8 +61,8 @@ export class ProcessInstanceTasksComponent implements OnInit, OnChanges {
@ViewChild('startDialog')
startDialog: any;
@ViewChild('taskdetails')
taskdetails: any;
@ViewChild('taskDetails')
taskDetails: any;
/** Emitted when a task is clicked. */
@Output()
@@ -170,7 +170,7 @@ export class ProcessInstanceTasksComponent implements OnInit, OnChanges {
this.dialog.open(this.startDialog, { height: '500px', width: '700px' });
}
closeSartDialog() {
closeStartDialog() {
this.dialog.closeAll();
}
@@ -179,6 +179,6 @@ export class ProcessInstanceTasksComponent implements OnInit, OnChanges {
}
onFormContentClick() {
this.closeSartDialog();
this.closeStartDialog();
}
}

View File

@@ -28,7 +28,7 @@ import { DataRowEvent, ObjectDataRow, ObjectDataTableAdapter } from '@alfresco/a
import { fakeProcessInstance, fakeProcessInstancesWithNoName } from '../../mock';
import { ProcessService } from '../services/process.service';
import { ProcessTestingModule } from '../../testing/process.testing.module';
import { fakeProcessCutomSchema } from '../../mock';
import { fakeProcessCustomSchema } from '../../mock';
describe('ProcessInstanceListComponent', () => {
@@ -53,7 +53,7 @@ describe('ProcessInstanceListComponent', () => {
getProcessInstancesSpy = spyOn(service, 'getProcessInstances').and.returnValue(of(fakeProcessInstance));
appConfig.config['adf-process-list'] = {
'presets': {
'fakeProcessCutomSchema': [
'fakeProcessCustomSchema': [
{
'key': 'fakeName',
'type': 'text',
@@ -91,14 +91,14 @@ describe('ProcessInstanceListComponent', () => {
});
it('should fetch the custom schemaColumn from app.config.json', () => {
component.presetColumn = 'fakeProcessCutomSchema';
component.presetColumn = 'fakeProcessCustomSchema';
component.ngAfterContentInit();
fixture.detectChanges();
expect(component.columns).toEqual(fakeProcessCutomSchema);
expect(component.columns).toEqual(fakeProcessCustomSchema);
});
it('should fetch custom schemaColumn when the input presetColumn is defined', () => {
component.presetColumn = 'fakeProcessCutomSchema';
component.presetColumn = 'fakeProcessCustomSchema';
component.ngAfterContentInit();
fixture.detectChanges();
expect(component.columns).toBeDefined();

View File

@@ -25,7 +25,7 @@ import { ProcessService } from '../services/process.service';
import {
newProcess,
taskFormMock,
testProcessDefRepr,
testProcessDef,
testMultipleProcessDefs,
testProcessDefWithForm,
testProcessDefinitions
@@ -89,7 +89,7 @@ describe('StartFormComponent', () => {
it('should enable start button when name and process filled out', async(() => {
spyOn(component, 'loadStartProcess').and.callThrough();
component.processNameInput.setValue('My Process');
component.processDefinitionInput.setValue(testProcessDefRepr.name);
component.processDefinitionInput.setValue(testProcessDef.name);
fixture.detectChanges();
@@ -102,7 +102,7 @@ describe('StartFormComponent', () => {
it('should have start button disabled when name not filled out', async(() => {
spyOn(component, 'loadStartProcess').and.callThrough();
component.processNameInput.setValue('');
component.processDefinitionInput.setValue(testProcessDefRepr.name);
component.processDefinitionInput.setValue(testProcessDef.name);
fixture.detectChanges();
fixture.whenStable().then(() => {
let startBtn = fixture.nativeElement.querySelector('#button-start');
@@ -257,9 +257,9 @@ describe('StartFormComponent', () => {
fixture.detectChanges();
fixture.whenStable().then(() => {
let noprocessElement = fixture.nativeElement.querySelector('#no-process-message');
expect(noprocessElement).not.toBeNull('Expected no available process message to be present');
expect(noprocessElement.innerText.trim()).toBe('ADF_PROCESS_LIST.START_PROCESS.NO_PROCESS_DEFINITIONS');
const noProcessElement = fixture.nativeElement.querySelector('#no-process-message');
expect(noProcessElement).not.toBeNull('Expected no available process message to be present');
expect(noProcessElement.innerText.trim()).toBe('ADF_PROCESS_LIST.START_PROCESS.NO_PROCESS_DEFINITIONS');
});
}));
@@ -298,7 +298,7 @@ describe('StartFormComponent', () => {
it('should hide the process dropdown button if showSelectProcessDropdown is false', async(() => {
fixture.detectChanges();
getDefinitionsSpy = getDefinitionsSpy.and.returnValue(of([testProcessDefRepr]));
getDefinitionsSpy = getDefinitionsSpy.and.returnValue(of([testProcessDef]));
component.appId = 123;
component.showSelectProcessDropdown = false;
component.ngOnChanges({});
@@ -379,7 +379,7 @@ describe('StartFormComponent', () => {
});
it('should call service to start process if required fields provided', async(() => {
component.selectedProcessDef = testProcessDefRepr;
component.selectedProcessDef = testProcessDef;
component.startProcess();
fixture.whenStable().then(() => {
expect(startProcessSpy).toHaveBeenCalled();
@@ -395,7 +395,7 @@ describe('StartFormComponent', () => {
}));
it('should call service to start process with the correct parameters', async(() => {
component.selectedProcessDef = testProcessDefRepr;
component.selectedProcessDef = testProcessDef;
component.startProcess();
fixture.whenStable().then(() => {
expect(startProcessSpy).toHaveBeenCalledWith('my:process1', 'My new process', undefined, undefined, undefined);
@@ -412,7 +412,7 @@ describe('StartFormComponent', () => {
inputProcessVariable.push(variable);
component.variables = inputProcessVariable;
component.selectedProcessDef = testProcessDefRepr;
component.selectedProcessDef = testProcessDef;
component.startProcess();
fixture.whenStable().then(() => {
expect(startProcessSpy).toHaveBeenCalledWith('my:process1', 'My new process', undefined, undefined, inputProcessVariable);
@@ -421,7 +421,7 @@ describe('StartFormComponent', () => {
it('should output start event when process started successfully', async(() => {
let emitSpy = spyOn(component.start, 'emit');
component.selectedProcessDef = testProcessDefRepr;
component.selectedProcessDef = testProcessDef;
component.startProcess();
fixture.whenStable().then(() => {
expect(emitSpy).toHaveBeenCalledWith(newProcess);
@@ -432,7 +432,7 @@ describe('StartFormComponent', () => {
let errorSpy = spyOn(component.error, 'error');
let error = { message: 'My error' };
startProcessSpy = startProcessSpy.and.returnValue(throwError(error));
component.selectedProcessDef = testProcessDefRepr;
component.selectedProcessDef = testProcessDef;
component.startProcess();
fixture.whenStable().then(() => {
expect(errorSpy).toHaveBeenCalledWith(error);
@@ -442,7 +442,7 @@ describe('StartFormComponent', () => {
it('should indicate an error to the user if process cannot be started', async(() => {
fixture.detectChanges();
startProcessSpy = startProcessSpy.and.returnValue(throwError({}));
component.selectedProcessDef = testProcessDefRepr;
component.selectedProcessDef = testProcessDef;
component.startProcess();
fixture.detectChanges();
fixture.whenStable().then(() => {
@@ -458,7 +458,7 @@ describe('StartFormComponent', () => {
done();
});
component.selectedProcessDef = testProcessDefRepr;
component.selectedProcessDef = testProcessDef;
component.name = 'my:Process';
component.startProcess();
fixture.detectChanges();
@@ -491,7 +491,7 @@ describe('StartFormComponent', () => {
it('should able to start the process when the required fields are filled up', (done) => {
component.name = 'my:process1';
component.selectedProcessDef = testProcessDefRepr;
component.selectedProcessDef = testProcessDef;
let disposableStart = component.start.subscribe(() => {
disposableStart.unsubscribe();
@@ -502,7 +502,7 @@ describe('StartFormComponent', () => {
});
it('should return true if startFrom defined', async(() => {
component.selectedProcessDef = testProcessDefRepr;
component.selectedProcessDef = testProcessDef;
component.name = 'my:process1';
component.selectedProcessDef.hasStartForm = true;
component.hasStartForm();

View File

@@ -83,6 +83,7 @@ describe('ProcessService', () => {
expect(instances.data.length).toBe(1);
let instance = instances.data[0];
expect(instance.id).toBe('340124');
/* cspell:disable-next-line */
expect(instance.name).toBe('James Franklin EMEA Onboarding');
expect(instance.started).toEqual(new Date('2017-10-09T12:19:44.560+0000'));
});

View File

@@ -47,7 +47,7 @@ export class ChecklistComponent implements OnChanges {
@Output()
checklistTaskCreated: EventEmitter<TaskDetailsModel> = new EventEmitter<TaskDetailsModel>();
/** Emitted when a checklitst task is deleted. */
/** Emitted when a checklist task is deleted. */
@Output()
checklistTaskDeleted: EventEmitter<string> = new EventEmitter<string>();

View File

@@ -11,7 +11,7 @@
<input matInput
class="adf-grid-full-width"
placeholder="{{'ADF_TASK_LIST.START_TASK.FORM.LABEL.NAME'|translate}}"
[(ngModel)]="startTaskmodel.name"
[(ngModel)]="startTaskModel.name"
required
id="name_id">
</mat-form-field>
@@ -23,7 +23,7 @@
matInput
class="adf-grid-full-width"
placeholder="{{'ADF_TASK_LIST.START_TASK.FORM.LABEL.DESCRIPTION'|translate}}"
[(ngModel)]="startTaskmodel.description"
[(ngModel)]="startTaskModel.description"
rows="1"
id="description_id">
</textarea>
@@ -40,7 +40,7 @@
(keyup)="onDateChanged($event.srcElement.value)"
(dateInput)="onDateChanged($event.value)"
placeholder="{{'ADF_TASK_LIST.START_TASK.FORM.LABEL.DATE'|translate}}"
[(ngModel)]="startTaskmodel.dueDate"
[(ngModel)]="startTaskModel.dueDate"
id="date_id">
<mat-datepicker-toggle matSuffix [for]="taskDatePicker"></mat-datepicker-toggle>
<mat-datepicker #taskDatePicker
@@ -79,7 +79,7 @@
<button mat-button (click)="onCancel()" id="button-cancel">
{{'ADF_TASK_LIST.START_TASK.FORM.ACTION.CANCEL'|translate}}
</button>
<button color="primary" mat-button [disabled]="!startTaskmodel.name || dateError" (click)="start()" id="button-start">
<button color="primary" mat-button [disabled]="!startTaskModel.name || dateError" (click)="start()" id="button-start">
{{'ADF_TASK_LIST.START_TASK.FORM.ACTION.START'|translate}}
</button>
</div>

View File

@@ -30,7 +30,7 @@ describe('StartTaskComponent', () => {
let fixture: ComponentFixture<StartTaskComponent>;
let service: TaskListService;
let element: HTMLElement;
let getFormlistSpy: jasmine.Spy;
let getFormListSpy: jasmine.Spy;
let createNewTaskSpy: jasmine.Spy;
let fakeForms = [
{
@@ -54,7 +54,7 @@ describe('StartTaskComponent', () => {
element = fixture.nativeElement;
service = TestBed.get(TaskListService);
getFormlistSpy = spyOn(service, 'getFormList').and.returnValue(of(fakeForms));
getFormListSpy = spyOn(service, 'getFormList').and.returnValue(of(fakeForms));
fixture.detectChanges();
}));
@@ -63,13 +63,13 @@ describe('StartTaskComponent', () => {
expect(fixture.componentInstance instanceof StartTaskComponent).toBe(true, 'should create StartTaskComponent');
});
it('should fetch fakeform on ngonint', () => {
it('should fetch fake form on init', () => {
component.ngOnInit();
expect(component.forms).toEqual(fakeForms);
expect(component.forms[0].name).toEqual('Display Data');
expect(component.forms[1].name).toEqual('Employee Info');
expect(component.forms[1].id).toEqual(1111);
expect(getFormlistSpy).toHaveBeenCalled();
expect(getFormListSpy).toHaveBeenCalled();
});
describe('create task', () => {
@@ -88,7 +88,7 @@ describe('StartTaskComponent', () => {
it('should create new task when start is clicked', () => {
let successSpy = spyOn(component.success, 'emit');
component.appId = 42;
component.startTaskmodel = new StartTaskModel(startTaskMock);
component.startTaskModel = new StartTaskModel(startTaskMock);
fixture.detectChanges();
let createTaskButton = <HTMLElement> element.querySelector('#button-start');
createTaskButton.click();
@@ -98,7 +98,7 @@ describe('StartTaskComponent', () => {
it('should send on success event when the task is started', () => {
let successSpy = spyOn(component.success, 'emit');
component.appId = 42;
component.startTaskmodel = new StartTaskModel(startTaskMock);
component.startTaskModel = new StartTaskModel(startTaskMock);
fixture.detectChanges();
let createTaskButton = <HTMLElement> element.querySelector('#button-start');
createTaskButton.click();
@@ -113,7 +113,7 @@ describe('StartTaskComponent', () => {
it('should send on success event when only name is given', () => {
let successSpy = spyOn(component.success, 'emit');
component.appId = 42;
component.startTaskmodel.name = 'fakeName';
component.startTaskModel.name = 'fakeName';
fixture.detectChanges();
let createTaskButton = <HTMLElement> element.querySelector('#button-start');
createTaskButton.click();
@@ -122,7 +122,7 @@ describe('StartTaskComponent', () => {
it('should not emit success event when data not present', () => {
let successSpy = spyOn(component.success, 'emit');
component.startTaskmodel = new StartTaskModel(null);
component.startTaskModel = new StartTaskModel(null);
fixture.detectChanges();
let createTaskButton = <HTMLElement> element.querySelector('#button-start');
createTaskButton.click();
@@ -154,7 +154,7 @@ describe('StartTaskComponent', () => {
it('should attach form to the task when a form is selected', () => {
let successSpy = spyOn(component.success, 'emit');
component.appId = 42;
component.startTaskmodel = new StartTaskModel(startTaskMock);
component.startTaskModel = new StartTaskModel(startTaskMock);
component.formKey = 1204;
fixture.detectChanges();
let createTaskButton = <HTMLElement> element.querySelector('#button-start');
@@ -170,7 +170,7 @@ describe('StartTaskComponent', () => {
it('should not attach form to the task when a no form is selected', () => {
let successSpy = spyOn(component.success, 'emit');
component.appId = 42;
component.startTaskmodel = new StartTaskModel(startTaskMock);
component.startTaskModel = new StartTaskModel(startTaskMock);
component.formKey = null;
fixture.detectChanges();
let createTaskButton = <HTMLElement> element.querySelector('#button-start');
@@ -215,7 +215,7 @@ describe('StartTaskComponent', () => {
it('should assign task when an assignee is selected', () => {
let successSpy = spyOn(component.success, 'emit');
component.appId = 42;
component.startTaskmodel = new StartTaskModel(startTaskMock);
component.startTaskModel = new StartTaskModel(startTaskMock);
component.formKey = 1204;
component.assigneeId = testUser.id;
fixture.detectChanges();
@@ -234,7 +234,7 @@ describe('StartTaskComponent', () => {
component.appId = 42;
component.formKey = 1204;
component.assigneeId = null;
component.startTaskmodel = new StartTaskModel(startTaskMock);
component.startTaskModel = new StartTaskModel(startTaskMock);
fixture.detectChanges();
let createTaskButton = <HTMLElement> element.querySelector('#button-start');
createTaskButton.click();
@@ -249,7 +249,7 @@ describe('StartTaskComponent', () => {
it('should assign task with id of selected user assigned', () => {
let successSpy = spyOn(component.success, 'emit');
component.appId = 42;
component.startTaskmodel = new StartTaskModel(startTaskMock);
component.startTaskModel = new StartTaskModel(startTaskMock);
component.formKey = 1204;
component.getAssigneeId(testUser.id);
fixture.detectChanges();
@@ -264,7 +264,7 @@ describe('StartTaskComponent', () => {
});
});
it('should not attach a form when a form id is not slected', () => {
it('should not attach a form when a form id is not selected', () => {
let attachFormToATask = spyOn(service, 'attachFormToATask').and.returnValue(of());
spyOn(service, 'createNewTask').and.callFake(
function() {
@@ -274,7 +274,7 @@ describe('StartTaskComponent', () => {
});
});
let createTaskButton = <HTMLElement> element.querySelector('#button-start');
component.startTaskmodel.name = 'fake-name';
component.startTaskModel.name = 'fake-name';
fixture.detectChanges();
createTaskButton.click();
expect(attachFormToATask).not.toHaveBeenCalled();
@@ -294,7 +294,7 @@ describe('StartTaskComponent', () => {
});
it('should disable start button if name is empty', () => {
component.startTaskmodel.name = '';
component.startTaskModel.name = '';
fixture.detectChanges();
let createTaskButton = fixture.nativeElement.querySelector('#button-start');
expect(createTaskButton.disabled).toBeTruthy();
@@ -303,7 +303,7 @@ describe('StartTaskComponent', () => {
it('should cancel start task on cancel button click', () => {
let emitSpy = spyOn(component.cancel, 'emit');
let cancelTaskButton = fixture.nativeElement.querySelector('#button-cancel');
component.startTaskmodel.name = '';
component.startTaskModel.name = '';
fixture.detectChanges();
cancelTaskButton.click();
expect(emitSpy).not.toBeNull();
@@ -311,7 +311,7 @@ describe('StartTaskComponent', () => {
});
it('should enable start button if name is filled out', () => {
component.startTaskmodel.name = 'fakeName';
component.startTaskModel.name = 'fakeName';
fixture.detectChanges();
let createTaskButton = fixture.nativeElement.querySelector('#button-start');
expect(createTaskButton.disabled).toBeFalsy();
@@ -324,28 +324,28 @@ describe('StartTaskComponent', () => {
expect(selectElement.attributes['aria-label'].value).toContain('ADF_TASK_LIST.START_TASK.FORM.LABEL.FORM');
});
it('should get formatted fullname', () => {
it('should get formatted full name', () => {
let testUser1 = {'id': 1001, 'firstName': 'Wilbur', 'lastName': 'Adams', 'email': 'wilbur@app.activiti.com'};
let testUser2 = {'id': 1002, 'firstName': '', 'lastName': 'Adams', 'email': 'adams@app.activiti.com'};
let testUser3 = {'id': 1003, 'firstName': 'Wilbur', 'lastName': '', 'email': 'wilbur@app.activiti.com'};
let testUser4 = {'id': 1004, 'firstName': '', 'lastName': '', 'email': 'test@app.activiti.com'};
let testFullname1 = component.getDisplayUser(testUser1.firstName, testUser1.lastName, ' ');
let testFullname2 = component.getDisplayUser(testUser2.firstName, testUser2.lastName, ' ');
let testFullname3 = component.getDisplayUser(testUser3.firstName, testUser3.lastName, ' ');
let testFullname4 = component.getDisplayUser(testUser4.firstName, testUser4.lastName, ' ');
let testFullName1 = component.getDisplayUser(testUser1.firstName, testUser1.lastName, ' ');
let testFullName2 = component.getDisplayUser(testUser2.firstName, testUser2.lastName, ' ');
let testFullName3 = component.getDisplayUser(testUser3.firstName, testUser3.lastName, ' ');
let testFullName4 = component.getDisplayUser(testUser4.firstName, testUser4.lastName, ' ');
expect(testFullname1.trim()).toBe('Wilbur Adams');
expect(testFullname2.trim()).toBe('Adams');
expect(testFullname3.trim()).toBe('Wilbur');
expect(testFullname4.trim()).toBe('');
expect(testFullName1.trim()).toBe('Wilbur Adams');
expect(testFullName2.trim()).toBe('Adams');
expect(testFullName3.trim()).toBe('Wilbur');
expect(testFullName4.trim()).toBe('');
});
it('should emit error when there is an error while creating task', () => {
let errorSpy = spyOn(component.error, 'emit');
spyOn(service, 'createNewTask').and.returnValue(throwError({}));
let createTaskButton = <HTMLElement> element.querySelector('#button-start');
component.startTaskmodel.name = 'fake-name';
component.startTaskModel.name = 'fake-name';
fixture.detectChanges();
createTaskButton.click();
expect(errorSpy).toHaveBeenCalled();

View File

@@ -57,7 +57,7 @@ export class StartTaskComponent implements OnInit {
@Output()
error: EventEmitter<any> = new EventEmitter<any>();
startTaskmodel: StartTaskModel = new StartTaskModel();
startTaskModel: StartTaskModel = new StartTaskModel();
forms: Form[];
@@ -92,11 +92,11 @@ export class StartTaskComponent implements OnInit {
}
public start(): void {
if (this.startTaskmodel.name) {
if (this.startTaskModel.name) {
if (this.appId) {
this.startTaskmodel.category = this.appId.toString();
this.startTaskModel.category = this.appId.toString();
}
this.taskService.createNewTask(new TaskDetailsModel(this.startTaskmodel))
this.taskService.createNewTask(new TaskDetailsModel(this.startTaskModel))
.pipe(
switchMap((createRes: any) =>
this.attachForm(createRes.id, this.formKey).pipe(
@@ -181,7 +181,7 @@ export class StartTaskComponent implements OnInit {
clearDateInput() {
const emptyValue = '';
this.startTaskmodel.dueDate = emptyValue;
this.startTaskModel.dueDate = emptyValue;
this.onDateChanged(emptyValue);
}
}

View File

@@ -120,7 +120,8 @@ describe('TaskAuditDirective', () => {
component.fileName = 'FakeAuditName';
component.format = 'json';
component.download = true;
const auditJson = { taskId: '77', taskName: 'Fake Task Naem', assignee: 'FirstName LastName', formData: [], selectedOutcome: null, comments: [] };
const auditJson = { taskId: '77', taskName: 'Fake Task Name', assignee: 'FirstName LastName', formData: [], selectedOutcome: null, comments: [] };
spyOn(service, 'fetchTaskAuditJsonById').and.returnValue(of(auditJson));
spyOn(component, 'onAuditClick').and.callThrough();
@@ -137,7 +138,7 @@ describe('TaskAuditDirective', () => {
}));
it('should fetch the pdf Blob as default when the format is UNKNOW', fakeAsync(() => {
it('should fetch the pdf Blob as default when the format is UNKNOWN', fakeAsync(() => {
component.fileName = 'FakeAuditName';
component.format = 'fakeFormat';
let blob = createFakePdfBlob();

View File

@@ -111,7 +111,7 @@
<adf-info-drawer-tab label="{{ 'ADF_TASK_LIST.DETAILS.LABELS.INFO_DRAWER_TAB_ACTIVITY_TITLE' | translate }}">
<mat-card *ngIf="showComments">
<mat-card-content>
<adf-comments #activiticomments
<adf-comments #activitiComments
[readOnly]="isReadOnlyComment()"
[taskId]="taskDetails.id">
</adf-comments>
@@ -123,7 +123,7 @@
<div *ngIf="showHeaderContent" class="adf-task-details-core-sidebar-checklist">
<div *ngIf="showChecklist">
<adf-checklist #activitichecklist
<adf-checklist #activitiChecklist
[readOnly]="internalReadOnlyForm"
[taskId]="taskDetails.id"
[assignee]="taskDetails?.assignee?.id"

View File

@@ -395,7 +395,7 @@ describe('TaskDetailsComponent', () => {
component.taskDetails.endDate = new Date('2017-10-03T17:03:57.311+0000');
fixture.detectChanges();
expect((component.activiticomments as any).readOnly).toBe(true);
expect((component.activitiComments as any).readOnly).toBe(true);
});
it('should comments be readonly if the task is complete and user are NOT involved', () => {
@@ -407,7 +407,7 @@ describe('TaskDetailsComponent', () => {
component.taskDetails.endDate = new Date('2017-10-03T17:03:57.311+0000');
fixture.detectChanges();
expect((component.activiticomments as any).readOnly).toBe(true);
expect((component.activitiComments as any).readOnly).toBe(true);
});
it('should comments NOT be readonly if the task is NOT complete and user are NOT involved', () => {
@@ -419,7 +419,7 @@ describe('TaskDetailsComponent', () => {
component.taskDetails.endDate = null;
fixture.detectChanges();
expect((component.activiticomments as any).readOnly).toBe(false);
expect((component.activitiComments as any).readOnly).toBe(false);
});
it('should comments NOT be readonly if the task is complete and user are involved', () => {
@@ -431,7 +431,7 @@ describe('TaskDetailsComponent', () => {
component.taskDetails.endDate = new Date('2017-10-03T17:03:57.311+0000');
fixture.detectChanges();
expect((component.activiticomments as any).readOnly).toBe(false);
expect((component.activitiComments as any).readOnly).toBe(false);
});
it('should comments be present if showComments is true', () => {
@@ -442,7 +442,7 @@ describe('TaskDetailsComponent', () => {
component.taskDetails = new TaskDetailsModel(taskDetailsMock);
fixture.detectChanges();
expect(component.activiticomments).toBeDefined();
expect(component.activitiComments).toBeDefined();
});
it('should comments NOT be present if showComments is false', () => {
@@ -452,7 +452,7 @@ describe('TaskDetailsComponent', () => {
component.taskDetails = new TaskDetailsModel(taskDetailsMock);
fixture.detectChanges();
expect(component.activiticomments).not.toBeDefined();
expect(component.activitiComments).not.toBeDefined();
});
});

View File

@@ -53,11 +53,11 @@ import { share } from 'rxjs/operators';
})
export class TaskDetailsComponent implements OnInit, OnChanges {
@ViewChild('activiticomments')
activiticomments: CommentsComponent;
@ViewChild('activitiComments')
activitiComments: CommentsComponent;
@ViewChild('activitichecklist')
activitichecklist: any;
@ViewChild('activitiChecklist')
activitiChecklist: any;
@ViewChild('errorDialog')
errorDialog: TemplateRef<any>;

View File

@@ -333,7 +333,7 @@ describe('TaskFiltersComponent', () => {
expect(component.getCurrentFilter()).toBe(filter);
});
it('should load default list when appid is null', () => {
it('should load default list when app id is null', () => {
spyOn(component, 'getFiltersByAppId').and.stub();
let change = new SimpleChange(undefined, null, true);

View File

@@ -214,7 +214,7 @@ describe('TaskHeaderComponent', () => {
});
}));
it('should display the claime button if the task is claimable by candidates members', async(() => {
it('should display the claim button if the task is claimable by candidates members', async(() => {
component.taskDetails = new TaskDetailsModel(claimableTaskDetailsMock);
component.refreshData();
fixture.detectChanges();
@@ -240,7 +240,7 @@ describe('TaskHeaderComponent', () => {
});
}));
it('should call the service\'s unclaim method on unclaiming', async(() => {
it('should call the service unclaim method on un-claiming', async(() => {
spyOn(service, 'unclaimTask').and.returnValue(of(true));
component.taskDetails = new TaskDetailsModel(claimedTaskDetailsMock);
component.refreshData();
@@ -254,7 +254,7 @@ describe('TaskHeaderComponent', () => {
});
}));
it('should trigger the unclaim event on successful unclaiming', async(() => {
it('should trigger the unclaim event on successful un-claiming', async(() => {
let unclaimed: boolean = false;
spyOn(service, 'unclaimTask').and.returnValue(of(true));
component.taskDetails = new TaskDetailsModel(claimedTaskDetailsMock);

View File

@@ -226,7 +226,7 @@ export class TaskHeaderComponent implements OnChanges, OnInit {
}
/**
* Returns true if the task is assigne to logged in user
* Returns true if the task is assigned to logged in user
*/
public isAssignedTo(userId): boolean {
return this.hasAssignee() ? this.taskDetails.assignee.id === userId : false;

View File

@@ -23,7 +23,7 @@ import { DataRowEvent, ObjectDataRow } from '@alfresco/adf-core';
import { TaskListService } from '../services/tasklist.service';
import { TaskListComponent } from './task-list.component';
import { ProcessTestingModule } from '../../testing/process.testing.module';
import { fakeGlobalTask, fakeCutomSchema } from '../../mock';
import { fakeGlobalTask, fakeCustomSchema } from '../../mock';
import { TranslateService } from '@ngx-translate/core';
import { of } from 'rxjs';
@@ -50,7 +50,7 @@ describe('TaskListComponent', () => {
appConfig.config = Object.assign(appConfig.config, {
'adf-task-list': {
'presets': {
'fakeCutomSchema': [
'fakeCustomSchema': [
{
'key': 'fakeName',
'type': 'text',
@@ -86,14 +86,14 @@ describe('TaskListComponent', () => {
});
it('should use the custom schemaColumn from app.config.json', () => {
component.presetColumn = 'fakeCutomSchema';
component.presetColumn = 'fakeCustomSchema';
component.ngAfterContentInit();
fixture.detectChanges();
expect(component.columns).toEqual(fakeCutomSchema);
expect(component.columns).toEqual(fakeCustomSchema);
});
it('should fetch custom schemaColumn when the input presetColumn is defined', () => {
component.presetColumn = 'fakeCutomSchema';
component.presetColumn = 'fakeCustomSchema';
fixture.detectChanges();
expect(component.columns).toBeDefined();
expect(component.columns.length).toEqual(2);
@@ -151,6 +151,7 @@ describe('TaskListComponent', () => {
it('should return the filtered task list by processDefinitionKey', (done) => {
let state = new SimpleChange(null, 'open', true);
/* cspell:disable-next-line */
let processDefinitionKey = new SimpleChange(null, 'fakeprocess', true);
let assignment = new SimpleChange(null, 'fake-assignee', true);
@@ -250,6 +251,7 @@ describe('TaskListComponent', () => {
it('should return the filtered task list for all state', (done) => {
let state = new SimpleChange(null, 'all', true);
/* cspell:disable-next-line */
let processInstanceId = new SimpleChange(null, 'fakeprocessId', true);
component.success.subscribe((res) => {

View File

@@ -61,10 +61,10 @@ describe('TaskStandaloneComponent', () => {
it('should show No form message if isCompleted is false', async(() => {
component.isCompleted = false;
fixture.detectChanges();
const noformElement = fixture.debugElement.nativeElement.querySelector('#adf-no-form-message');
const noFormElement = fixture.debugElement.nativeElement.querySelector('#adf-no-form-message');
fixture.whenStable().then(() => {
expect(noformElement).toBeDefined();
expect(noformElement.innerText).toBe('ADF_TASK_LIST.STANDALONE_TASK.NO_FORM_MESSAGE');
expect(noFormElement).toBeDefined();
expect(noFormElement.innerText).toBe('ADF_TASK_LIST.STANDALONE_TASK.NO_FORM_MESSAGE');
expect(element.querySelector('#adf-completed-form-message')).toBeNull();
expect(element.querySelector('.adf-no-form-submessage')).toBeNull();
});

View File

@@ -174,14 +174,14 @@ describe('Activiti Task filter Service', () => {
it('should add a filter', (done) => {
let filterFake = new FilterRepresentationModel({
name: 'FakeNameFilter',
assignment: 'fake-assignement'
assignment: 'fake-assignment'
});
service.addFilter(filterFake).subscribe((res: FilterRepresentationModel) => {
expect(res).toBeDefined();
expect(res.id).not.toEqual(null);
expect(res.name).toEqual('FakeNameFilter');
expect(res.filter.assignment).toEqual('fake-assignement');
expect(res.filter.assignment).toEqual('fake-assignment');
done();
});
@@ -189,7 +189,7 @@ describe('Activiti Task filter Service', () => {
'status': 200,
contentType: 'application/json',
responseText: JSON.stringify({
id: '2233', name: 'FakeNameFilter', filter: { assignment: 'fake-assignement' }
id: '2233', name: 'FakeNameFilter', filter: { assignment: 'fake-assignment' }
})
});
});

View File

@@ -466,7 +466,7 @@ describe('Activiti TaskList Service', () => {
let taskId = '1';
let filterFake = new FilterRepresentationModel({
name: 'FakeNameFilter',
assignment: 'fake-assignement',
assignment: 'fake-assignment',
filter: {
processDefinitionKey: '1',
assignment: 'fake',

View File

@@ -342,7 +342,7 @@ export class TaskListService {
}
/**
* Unclaims a task for the current user.
* Un-claims a task for the current user.
* @param taskId ID of the task to unclaim
* @returns Null response notifying when the operation is complete
*/