mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
79
lib/process-services/mock/apps-list.mock.ts
Normal file
79
lib/process-services/mock/apps-list.mock.ts
Normal file
@@ -0,0 +1,79 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { AppDefinitionRepresentationModel } from '../task-list';
|
||||
|
||||
export let nonDeployedApps = [new AppDefinitionRepresentationModel({
|
||||
id: '1',
|
||||
name: '1',
|
||||
icon: 'icon1'
|
||||
}), new AppDefinitionRepresentationModel({
|
||||
id: '1',
|
||||
name: '2',
|
||||
icon: 'icon2'
|
||||
}), new AppDefinitionRepresentationModel({
|
||||
id: '1',
|
||||
name: '3',
|
||||
icon: 'icon3'
|
||||
})];
|
||||
export let deployedApps = [new AppDefinitionRepresentationModel({
|
||||
id: 1,
|
||||
name: 'App1',
|
||||
icon: 'icon1',
|
||||
deploymentId: '1',
|
||||
defaultAppId: 'fake-app-1',
|
||||
modelId: null,
|
||||
tenantId: null
|
||||
}), new AppDefinitionRepresentationModel({
|
||||
id: 2,
|
||||
name: 'App2',
|
||||
icon: 'icon2',
|
||||
deploymentId: '2',
|
||||
modelId: null,
|
||||
tenantId: null
|
||||
}), new AppDefinitionRepresentationModel({
|
||||
id: 3,
|
||||
name: 'App3',
|
||||
icon: 'icon3',
|
||||
deploymentId: '3',
|
||||
modelId: null,
|
||||
tenantId: null
|
||||
}), new AppDefinitionRepresentationModel({
|
||||
id: 4,
|
||||
name: 'App4',
|
||||
icon: 'icon4',
|
||||
deploymentId: '4',
|
||||
modelId: 65,
|
||||
tenantId: null
|
||||
}), new AppDefinitionRepresentationModel({
|
||||
id: 5,
|
||||
name: 'App5',
|
||||
icon: 'icon5',
|
||||
deploymentId: '5',
|
||||
modelId: 66,
|
||||
tenantId: 9
|
||||
}), new AppDefinitionRepresentationModel({
|
||||
id: 6,
|
||||
name: 'App6',
|
||||
icon: 'icon6',
|
||||
deploymentId: '6',
|
||||
tenantId: 9,
|
||||
modelId: 66
|
||||
})];
|
||||
export let defaultApp = [new AppDefinitionRepresentationModel({
|
||||
defaultAppId: 'tasks'
|
||||
})];
|
18
lib/process-services/mock/index.ts
Normal file
18
lib/process-services/mock/index.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export * from './public-api';
|
@@ -0,0 +1,74 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ProcessInstance } from '../../process-list/models/process-instance.model';
|
||||
|
||||
export let fakeProcessInstance = [
|
||||
new ProcessInstance({
|
||||
id: 1,
|
||||
name: 'Process 773443333',
|
||||
processDefinitionId: 'fakeprocess:5:7507',
|
||||
processDefinitionKey: 'fakeprocess',
|
||||
processDefinitionName: 'Fake Process Name',
|
||||
description: null, category: null,
|
||||
started: '2015-11-09T12:36:14.184+0000',
|
||||
startedBy: {
|
||||
id: 3, firstName: 'tenant2', lastName: 'tenantLastname', email: 'tenant2@tenant'
|
||||
}
|
||||
}),
|
||||
new ProcessInstance({
|
||||
id: 2,
|
||||
name: 'Process 382927392',
|
||||
processDefinitionId: 'fakeprocess:5:7507',
|
||||
processDefinitionKey: 'fakeprocess',
|
||||
processDefinitionName: 'Fake Process Name',
|
||||
description: null,
|
||||
category: null,
|
||||
started: '2017-11-09T12:37:25.184+0000',
|
||||
startedBy: {
|
||||
id: 3, firstName: 'tenant2', lastName: 'tenantLastname', email: 'tenant2@tenant'
|
||||
}
|
||||
})
|
||||
];
|
||||
|
||||
export let fakeProcessInstancesWithNoName = [
|
||||
new ProcessInstance({
|
||||
id: 1,
|
||||
name: null,
|
||||
processDefinitionId: 'fakeprocess:5:7507',
|
||||
processDefinitionKey: 'fakeprocess',
|
||||
processDefinitionName: 'Fake Process Name',
|
||||
description: null, category: null,
|
||||
started: '2017-11-09T12:36:14.184+0000',
|
||||
startedBy: {
|
||||
id: 3, firstName: 'tenant2', lastName: 'tenantLastname', email: 'tenant2@tenant'
|
||||
}
|
||||
}),
|
||||
new ProcessInstance({
|
||||
id: 2,
|
||||
name: '',
|
||||
processDefinitionId: 'fakeprocess:5:7507',
|
||||
processDefinitionKey: 'fakeprocess',
|
||||
processDefinitionName: 'Fake Process Name',
|
||||
description: null,
|
||||
category: null,
|
||||
started: '2017-11-09T12:37:25.184+0000',
|
||||
startedBy: {
|
||||
id: 3, firstName: 'tenant2', lastName: 'tenantLastname', email: 'tenant2@tenant'
|
||||
}
|
||||
})
|
||||
];
|
161
lib/process-services/mock/process/process.model.mock.ts
Normal file
161
lib/process-services/mock/process/process.model.mock.ts
Normal file
@@ -0,0 +1,161 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ProcessInstance } from '../../process-list/models/process-instance.model';
|
||||
|
||||
export class ProcessList {
|
||||
|
||||
data: ProcessInstance[];
|
||||
size: number;
|
||||
start: number;
|
||||
total: number;
|
||||
|
||||
constructor(data?: ProcessInstance[]) {
|
||||
this.data = data || [];
|
||||
}
|
||||
}
|
||||
|
||||
export class SingleProcessList extends ProcessList {
|
||||
constructor(name?: string) {
|
||||
let instance = new ProcessInstance({
|
||||
id: '123',
|
||||
name: name
|
||||
});
|
||||
super([instance]);
|
||||
}
|
||||
}
|
||||
|
||||
export let exampleProcess = new ProcessInstance({
|
||||
id: '123',
|
||||
name: 'Process 123',
|
||||
started: '2016-11-10T03:37:30.010+0000',
|
||||
startedBy: {
|
||||
id: 1001,
|
||||
firstName: 'Bob',
|
||||
lastName: 'Jones',
|
||||
email: 'bob@app.activiti.com'
|
||||
}
|
||||
});
|
||||
|
||||
export let processEnded = new ProcessInstance({
|
||||
id: '123',
|
||||
name: 'Process 123',
|
||||
started: '2016-11-10T03:37:30.010+0000',
|
||||
startedBy: {
|
||||
id: 1001,
|
||||
firstName: 'Bob',
|
||||
lastName: 'Jones',
|
||||
email: 'bob@app.activiti.com'
|
||||
},
|
||||
ended: '2016-11-11T03:37:30.010+0000'
|
||||
});
|
||||
|
||||
export let exampleProcessNoName = new ProcessInstance({
|
||||
id: '123',
|
||||
name: null,
|
||||
started: '2016-11-10T03:37:30.010+0000',
|
||||
startedBy: {
|
||||
id: 1001,
|
||||
firstName: 'Bob',
|
||||
lastName: 'Jones',
|
||||
email: 'bob@app.activiti.com'
|
||||
},
|
||||
processDefinitionName: 'My Process'
|
||||
});
|
||||
|
||||
export let fakeProcessInstances = {
|
||||
size: 2,
|
||||
total: 2,
|
||||
start: 0,
|
||||
data: [
|
||||
{
|
||||
id: '340124',
|
||||
name: 'James Franklin EMEA Onboarding',
|
||||
businessKey: null,
|
||||
processDefinitionId: 'HROnboarding:60:338704',
|
||||
tenantId: 'tenant_1',
|
||||
started: new Date('2017-10-09T12:19:44.560+0000'),
|
||||
ended: null,
|
||||
startedBy: {
|
||||
id: 4004,
|
||||
firstName: 'Integration',
|
||||
lastName: 'Test',
|
||||
email: 'srintegrationtest@test.com'
|
||||
},
|
||||
processDefinitionName: 'HROnboarding',
|
||||
processDefinitionDescription: 'HR Onboarding Workflow',
|
||||
processDefinitionKey: 'fakeProcessDefinitionKey1',
|
||||
processDefinitionCategory: 'http://www.activiti.org/processdef',
|
||||
processDefinitionVersion: 60,
|
||||
processDefinitionDeploymentId: '338695',
|
||||
graphicalNotationDefined: true,
|
||||
startFormDefined: false,
|
||||
suspended: false,
|
||||
variables: []
|
||||
},
|
||||
{
|
||||
id: '340063',
|
||||
name: 'Mary Franklin AMERICAS Onboarding',
|
||||
businessKey: null,
|
||||
processDefinitionId: 'HROnboarding:60:338704',
|
||||
tenantId: 'tenant_1',
|
||||
started: '2017-10-09T12:18:07.484+0000',
|
||||
ended: null,
|
||||
startedBy: {
|
||||
id: 4004,
|
||||
firstName: 'Integration',
|
||||
lastName: 'Test',
|
||||
email: 'srintegrationtest@test.com'
|
||||
},
|
||||
processDefinitionName: 'HROnboarding',
|
||||
processDefinitionDescription: 'HR Onboarding Workflow',
|
||||
processDefinitionKey: 'HROnboarding',
|
||||
processDefinitionCategory: 'http://www.activiti.org/processdef',
|
||||
processDefinitionVersion: 60,
|
||||
processDefinitionDeploymentId: '338695',
|
||||
graphicalNotationDefined: true,
|
||||
startFormDefined: false,
|
||||
suspended: false,
|
||||
variables: []
|
||||
},
|
||||
{
|
||||
id: '337604',
|
||||
name: 'John Jacobs AMERICAS Onboarding',
|
||||
businessKey: null,
|
||||
processDefinitionId: 'HROnboarding:49:303243',
|
||||
tenantId: 'tenant_1',
|
||||
started: '2017-09-25T10:02:23.522+0000',
|
||||
ended: null,
|
||||
startedBy: {
|
||||
id: 4004,
|
||||
firstName: 'Integration',
|
||||
lastName: 'Test',
|
||||
email: 'srintegrationtest@test.com'
|
||||
},
|
||||
processDefinitionName: 'HROnboarding',
|
||||
processDefinitionDescription: 'HR Onboarding Workflow',
|
||||
processDefinitionKey: 'fakeProcessDefinitionKey2',
|
||||
processDefinitionCategory: 'http://www.activiti.org/processdef',
|
||||
processDefinitionVersion: 49,
|
||||
processDefinitionDeploymentId: '303234',
|
||||
graphicalNotationDefined: true,
|
||||
startFormDefined: false,
|
||||
suspended: false,
|
||||
variables: []
|
||||
}
|
||||
]
|
||||
};
|
82
lib/process-services/mock/process/process.service.mock.ts
Normal file
82
lib/process-services/mock/process/process.service.mock.ts
Normal file
@@ -0,0 +1,82 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { AppDefinitionRepresentationModel, TaskDetailsModel } from '../../task-list';
|
||||
import { FilterProcessRepresentationModel } from '../../process-list/models/filter-process.model';
|
||||
import { ProcessDefinitionRepresentation } from '../../process-list/models/process-definition.model';
|
||||
|
||||
export let fakeProcessFilters = {
|
||||
size: 1, total: 1, start: 0,
|
||||
data: [new FilterProcessRepresentationModel({
|
||||
'name': 'Running',
|
||||
'appId': '22',
|
||||
'id': 333,
|
||||
'recent': true,
|
||||
'icon': 'glyphicon-random',
|
||||
'filter': { 'sort': 'created-desc', 'name': '', 'state': 'running' }
|
||||
})]
|
||||
};
|
||||
|
||||
export let fakeEmptyFilters = {
|
||||
size: 0, total: 0, start: 0,
|
||||
data: []
|
||||
};
|
||||
|
||||
export let fakeError = {
|
||||
message: null,
|
||||
messageKey: 'GENERAL.ERROR.FORBIDDEN'
|
||||
};
|
||||
|
||||
export let fakeApp1 = new AppDefinitionRepresentationModel({
|
||||
deploymentId: 26,
|
||||
name: 'HR processes',
|
||||
icon: 'glyphicon-cloud',
|
||||
description: null,
|
||||
theme: 'theme-6',
|
||||
modelId: 4,
|
||||
id: 1
|
||||
});
|
||||
|
||||
export let fakeApp2 = new AppDefinitionRepresentationModel({
|
||||
deploymentId: 2501,
|
||||
name: 'Sales onboarding',
|
||||
icon: 'glyphicon-asterisk',
|
||||
description: null,
|
||||
theme: 'theme-1',
|
||||
modelId: 1002,
|
||||
id: 1000
|
||||
});
|
||||
|
||||
export let fakeTasksList = {
|
||||
data: [new TaskDetailsModel({
|
||||
id: 1,
|
||||
name: 'Task 1',
|
||||
processInstanceId: 1000,
|
||||
created: '2016-11-10T03:37:30.010+0000'
|
||||
}), new TaskDetailsModel({
|
||||
id: 2,
|
||||
name: 'Task 2',
|
||||
processInstanceId: 1000,
|
||||
created: '2016-11-10T03:37:30.010+0000'
|
||||
})]
|
||||
};
|
||||
|
||||
export let fakeProcessDef = new ProcessDefinitionRepresentation({
|
||||
id: '32323',
|
||||
key: 'blah',
|
||||
name: 'Process 1'
|
||||
});
|
@@ -0,0 +1,46 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ProcessDefinitionRepresentation } from '../../process-list/models/process-definition.model';
|
||||
import { ProcessInstance } from '../../process-list/models/process-instance.model';
|
||||
|
||||
export let newProcess = new ProcessInstance({
|
||||
id: '32323',
|
||||
name: 'Process'
|
||||
});
|
||||
|
||||
export let testProcessDefRepr = new ProcessDefinitionRepresentation({
|
||||
id: 'my:process1',
|
||||
name: 'My Process 1',
|
||||
hasStartForm: false
|
||||
});
|
||||
|
||||
export let testProcessDefs = [new ProcessDefinitionRepresentation({
|
||||
id: 'my:process1',
|
||||
name: 'My Process 1',
|
||||
hasStartForm: false
|
||||
}), new ProcessDefinitionRepresentation({
|
||||
id: 'my:process2',
|
||||
name: 'My Process 2',
|
||||
hasStartForm: false
|
||||
})];
|
||||
|
||||
export let testProcessDefWithForm = [new ProcessDefinitionRepresentation({
|
||||
id: 'my:process1',
|
||||
name: 'My Process 1',
|
||||
hasStartForm: true
|
||||
})];
|
26
lib/process-services/mock/public-api.ts
Normal file
26
lib/process-services/mock/public-api.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export * from './process/process-instances-list.mock';
|
||||
export * from './process/process.service.mock';
|
||||
export * from './process/start-process.component.mock';
|
||||
export * from './process/process.model.mock';
|
||||
|
||||
export * from './task/start-task.mock';
|
||||
export * from './task/task-details.mock';
|
||||
export * from './task/task-details.component.mock';
|
||||
export * from './task/tasklist-service.mock';
|
34
lib/process-services/mock/task/start-task.mock.ts
Normal file
34
lib/process-services/mock/task/start-task.mock.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export let startTaskMock = {
|
||||
'name': 'fakeName',
|
||||
'description': 'fakeDescription',
|
||||
'assignee': null,
|
||||
'dueDate': '2017-11-03T15:25:42.749+0000',
|
||||
'formKey': null,
|
||||
'category': 'fakeAppId'
|
||||
};
|
||||
//
|
||||
// export let noDataMock = {
|
||||
// 'name': '',
|
||||
// 'description': '',
|
||||
// 'assignee': {},
|
||||
// 'dueDate': '',
|
||||
// 'formKey': '',
|
||||
// 'category': ';'
|
||||
// };
|
@@ -0,0 +1,20 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export let mockTaskDetailsComponent = {
|
||||
noTaskDetailsTemplateComponent: null
|
||||
};
|
313
lib/process-services/mock/task/task-details.mock.ts
Normal file
313
lib/process-services/mock/task/task-details.mock.ts
Normal file
@@ -0,0 +1,313 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { TaskDetailsModel } from '../../task-list/models/task-details.model';
|
||||
|
||||
export let taskDetailsMock = new TaskDetailsModel({
|
||||
'id': '91',
|
||||
'name': 'Request translation',
|
||||
'description': null,
|
||||
'category': null,
|
||||
'assignee': {'id': 1001, 'firstName': 'Wilbur', 'lastName': 'Adams', 'email': 'wilbur@app.activiti.com'},
|
||||
'created': '2016-11-03T15:25:42.749+0000',
|
||||
'dueDate': null,
|
||||
'endDate': null,
|
||||
'duration': null,
|
||||
'priority': 50,
|
||||
'parentTaskId': null,
|
||||
'parentTaskName': null,
|
||||
'processInstanceId': '86',
|
||||
'processInstanceName': null,
|
||||
'processDefinitionId': 'TranslationProcess:2:8',
|
||||
'processDefinitionName': 'Translation Process',
|
||||
'processDefinitionDescription': null,
|
||||
'processDefinitionKey': 'TranslationProcess',
|
||||
'processDefinitionCategory': 'http://www.activiti.org/processdef',
|
||||
'processDefinitionVersion': 2,
|
||||
'processDefinitionDeploymentId': '5',
|
||||
'formKey': '4',
|
||||
'processInstanceStartUserId': '1001',
|
||||
'initiatorCanCompleteTask': false,
|
||||
'adhocTaskCanBeReassigned': false,
|
||||
'taskDefinitionKey': 'sid-DDECD9E4-0299-433F-9193-C3D905C3EEBE',
|
||||
'executionId': '86',
|
||||
'involvedGroups': [],
|
||||
'involvedPeople': [],
|
||||
'memberOfCandidateUsers': false,
|
||||
'managerOfCandidateGroup': false,
|
||||
'memberOfCandidateGroup': false
|
||||
});
|
||||
|
||||
export let completedTaskDetailsMock = new TaskDetailsModel({
|
||||
'id': '91',
|
||||
'name': 'Request translation',
|
||||
'description': null,
|
||||
'category': null,
|
||||
'assignee': {'id': 1001, 'firstName': 'Wilbur', 'lastName': 'Adams', 'email': 'wilbur@app.activiti.com'},
|
||||
'created': '2016-11-03T15:25:42.749+0000',
|
||||
'dueDate': null,
|
||||
'endDate': '2016-11-03T15:25:42.749+0000',
|
||||
'duration': null,
|
||||
'priority': 50,
|
||||
'parentTaskId': null,
|
||||
'parentTaskName': null,
|
||||
'processInstanceId': '86',
|
||||
'processInstanceName': null,
|
||||
'processDefinitionId': 'TranslationProcess:2:8',
|
||||
'processDefinitionName': 'Translation Process',
|
||||
'involvedGroups': [],
|
||||
'involvedPeople': []
|
||||
});
|
||||
|
||||
export let taskDetailsWithOutAssigneeMock = new TaskDetailsModel({
|
||||
'id': '91',
|
||||
'name': 'Request translation',
|
||||
'description': null,
|
||||
'category': null,
|
||||
'assignee': null,
|
||||
'created': '2016-11-03T15:25:42.749+0000',
|
||||
'dueDate': null,
|
||||
'endDate': null,
|
||||
'duration': null,
|
||||
'priority': 50,
|
||||
'parentTaskId': null,
|
||||
'parentTaskName': null,
|
||||
'processInstanceId': '86',
|
||||
'processInstanceName': null,
|
||||
'processDefinitionId': 'TranslationProcess:2:8',
|
||||
'processDefinitionName': 'Translation Process',
|
||||
'involvedGroups': [{'id': 7007, 'name': 'group1', 'externalId': null, 'status': 'active', 'groups': null},
|
||||
{'id': 8008, 'name': 'group2', 'externalId': null, 'status': 'active', 'groups': null}],
|
||||
'involvedPeople': []
|
||||
});
|
||||
|
||||
export let taskDetailsWithInvolvedGroupMock = new TaskDetailsModel({
|
||||
'id': '91',
|
||||
'name': 'Request translation',
|
||||
'description': null,
|
||||
'category': null,
|
||||
'assignee': {'id': 1001, 'firstName': 'Wilbur', 'lastName': 'Adams', 'email': 'wilbur@app.activiti.com'},
|
||||
'created': '2016-11-03T15:25:42.749+0000',
|
||||
'dueDate': null,
|
||||
'endDate': null,
|
||||
'duration': null,
|
||||
'priority': 50,
|
||||
'parentTaskId': null,
|
||||
'parentTaskName': null,
|
||||
'processInstanceId': '86',
|
||||
'processInstanceName': null,
|
||||
'processDefinitionId': 'TranslationProcess:2:8',
|
||||
'processDefinitionName': 'Translation Process',
|
||||
'involvedGroups': [{'id': 7007, 'name': 'group1', 'externalId': null, 'status': 'active', 'groups': null},
|
||||
{'id': 8008, 'name': 'group2', 'externalId': null, 'status': 'active', 'groups': null}],
|
||||
'involvedPeople': []
|
||||
});
|
||||
|
||||
export let taskDetailsWithInvolvedPeopleMock = new TaskDetailsModel({
|
||||
'id': '91',
|
||||
'name': 'Request translation',
|
||||
'description': null,
|
||||
'category': null,
|
||||
'assignee': {'id': 1001, 'firstName': 'Wilbur', 'lastName': 'Adams', 'email': 'wilbur@app.activiti.com'},
|
||||
'created': '2016-11-03T15:25:42.749+0000',
|
||||
'dueDate': null,
|
||||
'endDate': null,
|
||||
'duration': null,
|
||||
'priority': 50,
|
||||
'parentTaskId': null,
|
||||
'parentTaskName': null,
|
||||
'processInstanceId': '86',
|
||||
'processInstanceName': null,
|
||||
'processDefinitionId': 'TranslationProcess:2:8',
|
||||
'processDefinitionName': 'Translation Process',
|
||||
'involvedGroups': [],
|
||||
'involvedPeople': [{'id': 1001, 'firstName': 'Wilbur', 'lastName': 'Adams', 'email': 'wilbur@app.activiti.com'},
|
||||
{'id': 111, 'firstName': 'fake-first-name', 'lastName': 'fake-last-name', 'email': 'fake@app.activiti.com'}]
|
||||
});
|
||||
|
||||
export let taskDetailsWithAssigneeMock = new TaskDetailsModel({
|
||||
'id': '91',
|
||||
'name': 'Request translation',
|
||||
'description': null,
|
||||
'category': null,
|
||||
'assignee': {'id': 111, 'firstName': 'fake-first-name', 'lastName': 'fake-last-name', 'email': 'fake@app.activiti.com'},
|
||||
'created': '2016-11-03T15:25:42.749+0000',
|
||||
'dueDate': null,
|
||||
'endDate': null,
|
||||
'duration': null,
|
||||
'priority': 50,
|
||||
'parentTaskId': null,
|
||||
'parentTaskName': null,
|
||||
'processInstanceId': '86',
|
||||
'processInstanceName': null,
|
||||
'processDefinitionId': 'TranslationProcess:2:8',
|
||||
'processDefinitionName': 'Translation Process',
|
||||
'involvedGroups': [],
|
||||
'involvedPeople': [{'id': 1001, 'firstName': 'Wilbur', 'lastName': 'Adams', 'email': 'wilbur@app.activiti.com'},
|
||||
{'id': 111, 'firstName': 'fake-first-name', 'lastName': 'fake-last-name', 'email': 'fake@app.activiti.com'}]
|
||||
});
|
||||
|
||||
export let taskFormMock = new TaskDetailsModel({
|
||||
'id': 4,
|
||||
'name': 'Translation request',
|
||||
'processDefinitionId': 'TranslationProcess:2:8',
|
||||
'processDefinitionName': 'Translation Process',
|
||||
'processDefinitionKey': 'TranslationProcess',
|
||||
'taskId': '91',
|
||||
'taskName': 'Request translation',
|
||||
'taskDefinitionKey': 'sid-DDECD9E4-0299-433F-9193-C3D905C3EEBE',
|
||||
'tabs': [],
|
||||
'fields': [{
|
||||
'fieldType': 'ContainerRepresentation',
|
||||
'id': '1478093984155',
|
||||
'name': 'Label',
|
||||
'type': 'container',
|
||||
'value': null,
|
||||
'required': false,
|
||||
'readOnly': false,
|
||||
'overrideId': false,
|
||||
'colspan': 1,
|
||||
'placeholder': null,
|
||||
'minLength': 0,
|
||||
'maxLength': 0,
|
||||
'minValue': null,
|
||||
'maxValue': null,
|
||||
'regexPattern': null,
|
||||
'optionType': null,
|
||||
'hasEmptyValue': null,
|
||||
'options': null,
|
||||
'restUrl': null,
|
||||
'restResponsePath': null,
|
||||
'restIdProperty': null,
|
||||
'restLabelProperty': null,
|
||||
'tab': null,
|
||||
'className': null,
|
||||
'dateDisplayFormat': null,
|
||||
'layout': null,
|
||||
'sizeX': 2,
|
||||
'sizeY': 1,
|
||||
'row': -1,
|
||||
'col': -1,
|
||||
'visibilityCondition': null,
|
||||
'numberOfColumns': 2,
|
||||
'fields': {
|
||||
'1': [{
|
||||
'fieldType': 'AttachFileFieldRepresentation',
|
||||
'id': 'originalcontent',
|
||||
'name': 'Original content',
|
||||
'type': 'upload',
|
||||
'value': [],
|
||||
'required': true,
|
||||
'readOnly': false,
|
||||
'overrideId': false,
|
||||
'colspan': 1,
|
||||
'placeholder': null,
|
||||
'minLength': 0,
|
||||
'maxLength': 0,
|
||||
'minValue': null,
|
||||
'maxValue': null,
|
||||
'regexPattern': null,
|
||||
'optionType': null,
|
||||
'hasEmptyValue': null,
|
||||
'options': null,
|
||||
'restUrl': null,
|
||||
'restResponsePath': null,
|
||||
'restIdProperty': null,
|
||||
'restLabelProperty': null,
|
||||
'tab': null,
|
||||
'className': null,
|
||||
'params': {},
|
||||
'dateDisplayFormat': null,
|
||||
'layout': {'row': -1, 'column': -1, 'colspan': 1},
|
||||
'sizeX': 1,
|
||||
'sizeY': 1,
|
||||
'row': -1,
|
||||
'col': -1,
|
||||
'visibilityCondition': null,
|
||||
'metaDataColumnDefinitions': []
|
||||
}],
|
||||
'2': [{
|
||||
'fieldType': 'RestFieldRepresentation',
|
||||
'id': 'language',
|
||||
'name': 'Language',
|
||||
'type': 'dropdown',
|
||||
'value': 'Choose one...',
|
||||
'required': true,
|
||||
'readOnly': false,
|
||||
'overrideId': false,
|
||||
'colspan': 1,
|
||||
'placeholder': null,
|
||||
'minLength': 0,
|
||||
'maxLength': 0,
|
||||
'minValue': null,
|
||||
'maxValue': null,
|
||||
'regexPattern': null,
|
||||
'optionType': null,
|
||||
'hasEmptyValue': true,
|
||||
'options': [{'id': 'empty', 'name': 'Choose one...'}, {'id': 'fr', 'name': 'French'}, {
|
||||
'id': 'de',
|
||||
'name': 'German'
|
||||
}, {'id': 'es', 'name': 'Spanish'}],
|
||||
'restUrl': null,
|
||||
'restResponsePath': null,
|
||||
'restIdProperty': null,
|
||||
'restLabelProperty': null,
|
||||
'tab': null,
|
||||
'className': null,
|
||||
'params': {'existingColspan': 1, 'maxColspan': 1},
|
||||
'dateDisplayFormat': null,
|
||||
'layout': {'row': -1, 'column': -1, 'colspan': 1},
|
||||
'sizeX': 1,
|
||||
'sizeY': 1,
|
||||
'row': -1,
|
||||
'col': -1,
|
||||
'visibilityCondition': null,
|
||||
'endpoint': null,
|
||||
'requestHeaders': null
|
||||
}]
|
||||
}
|
||||
}],
|
||||
'outcomes': [],
|
||||
'javascriptEvents': [],
|
||||
'className': '',
|
||||
'style': '',
|
||||
'customFieldTemplates': {},
|
||||
'metadata': {},
|
||||
'variables': [],
|
||||
'gridsterForm': false,
|
||||
'globalDateFormat': 'D-M-YYYY'
|
||||
});
|
||||
|
||||
export let tasksMock = new TaskDetailsModel({
|
||||
data: [
|
||||
taskDetailsMock
|
||||
]
|
||||
});
|
||||
|
||||
export let noDataMock = new TaskDetailsModel({
|
||||
data: [{
|
||||
'size': 1,
|
||||
'total': 1,
|
||||
'start': 0,
|
||||
'data': [{
|
||||
'id': 1005,
|
||||
'message': 'example-message',
|
||||
'created': '2017-10-06T11:54:53.443+0000',
|
||||
'createdBy': {'id': 4004, 'firstName': 'gadget', 'lastName': 'inspector', 'email': 'gadget@inspector.com'}
|
||||
}]
|
||||
}]
|
||||
});
|
270
lib/process-services/mock/task/tasklist-service.mock.ts
Normal file
270
lib/process-services/mock/task/tasklist-service.mock.ts
Normal file
@@ -0,0 +1,270 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
AppDefinitionRepresentationModel,
|
||||
FilterRepresentationModel
|
||||
} from '../../task-list/models/filter.model';
|
||||
|
||||
export let fakeFilters = {
|
||||
size: 2, total: 2, start: 0,
|
||||
data: [
|
||||
new AppDefinitionRepresentationModel(
|
||||
{
|
||||
id: 1, name: 'FakeInvolvedTasks', recent: false, icon: 'glyphicon-align-left',
|
||||
filter: { sort: 'created-desc', name: '', state: 'open', assignment: 'fake-involved' }
|
||||
}
|
||||
),
|
||||
{
|
||||
id: 2, name: 'FakeMyTasks', recent: false, icon: 'glyphicon-align-left',
|
||||
filter: { sort: 'created-desc', name: '', state: 'open', assignment: 'fake-assignee' }
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
export let fakeAppFilter = {
|
||||
size: 1, total: 1, start: 0,
|
||||
data: [
|
||||
{
|
||||
id: 1, name: 'FakeInvolvedTasks', recent: false, icon: 'glyphicon-align-left',
|
||||
filter: { sort: 'created-desc', name: '', state: 'open', assignment: 'fake-involved' }
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
export let fakeApps = {
|
||||
size: 2, total: 2, start: 0,
|
||||
data: [
|
||||
{
|
||||
id: 1, defaultAppId: null, name: 'Sales-Fakes-App', description: 'desc-fake1', modelId: 22,
|
||||
theme: 'theme-1-fake', icon: 'glyphicon-asterisk', 'deploymentId': '111', 'tenantId': null
|
||||
},
|
||||
{
|
||||
id: 2, defaultAppId: null, name: 'health-care-Fake', description: 'desc-fake2', modelId: 33,
|
||||
theme: 'theme-2-fake', icon: 'glyphicon-asterisk', 'deploymentId': '444', 'tenantId': null
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
export let fakeFilter = {
|
||||
sort: 'created-desc', text: '', state: 'open', assignment: 'fake-assignee'
|
||||
};
|
||||
|
||||
export let fakeUser1 = { id: 1, email: 'fake-email@dom.com', firstName: 'firstName', lastName: 'lastName' };
|
||||
|
||||
export let fakeUser2 = { id: 1001, email: 'some-one@somegroup.com', firstName: 'some', lastName: 'one' };
|
||||
|
||||
export let fakeTaskList = {
|
||||
size: 1, total: 1, start: 0,
|
||||
data: [
|
||||
{
|
||||
id: '1', name: 'FakeNameTask', description: null, category: null,
|
||||
assignee: fakeUser1,
|
||||
created: '2016-07-15T11:19:17.440+0000'
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
export let fakeTaskListDifferentProcessDefinitionKey = {
|
||||
size: 2, total: 1, start: 0,
|
||||
data: [
|
||||
{
|
||||
id: '1', name: 'FakeNameTask', description: null, category: null,
|
||||
assignee: fakeUser1,
|
||||
processDefinitionKey: '1',
|
||||
created: '2016-07-15T11:19:17.440+0000'
|
||||
},
|
||||
{
|
||||
id: '2', name: 'FakeNameTask2', description: null, category: null,
|
||||
assignee: fakeUser1,
|
||||
processDefinitionKey: '2',
|
||||
created: '2016-07-15T11:19:17.440+0000'
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
export let secondFakeTaskList = {
|
||||
size: 1, total: 1, start: 0,
|
||||
data: [
|
||||
{
|
||||
id: '200', name: 'FakeNameTask', description: null, category: null,
|
||||
assignee: fakeUser1,
|
||||
created: '2016-07-15T11:19:17.440+0000'
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
export let fakeErrorTaskList = {
|
||||
error: 'wrong request'
|
||||
};
|
||||
|
||||
export let fakeTaskDetails = { id: '999', name: 'fake-task-name', formKey: '99', assignee: fakeUser1 };
|
||||
|
||||
export let fakeTasksComment = {
|
||||
size: 2, total: 2, start: 0,
|
||||
data: [
|
||||
{
|
||||
id: 1, message: 'fake-message-1', created: '', createdBy: fakeUser1
|
||||
},
|
||||
{
|
||||
id: 2, message: 'fake-message-2', created: '', createdBy: fakeUser1
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
export let fakeTasksChecklist = {
|
||||
size: 1, total: 1, start: 0,
|
||||
data: [
|
||||
{
|
||||
id: 1, name: 'FakeCheckTask1', description: null, category: null,
|
||||
assignee: fakeUser1,
|
||||
created: '2016-07-15T11:19:17.440+0000'
|
||||
},
|
||||
{
|
||||
id: 2, name: 'FakeCheckTask2', description: null, category: null,
|
||||
assignee: fakeUser1,
|
||||
created: '2016-07-15T11:19:17.440+0000'
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
export let fakeRepresentationFilter1: FilterRepresentationModel = new FilterRepresentationModel({
|
||||
appId: 1,
|
||||
name: 'CONTAIN FILTER',
|
||||
recent: true,
|
||||
icon: 'glyphicon-align-left',
|
||||
filter: {
|
||||
processDefinitionId: null,
|
||||
processDefinitionKey: null,
|
||||
name: null,
|
||||
state: 'open',
|
||||
sort: 'created-desc',
|
||||
assignment: 'involved',
|
||||
dueAfter: null,
|
||||
dueBefore: null
|
||||
}
|
||||
});
|
||||
|
||||
export let fakeRepresentationFilter2: FilterRepresentationModel = new FilterRepresentationModel({
|
||||
appId: 2,
|
||||
name: 'NO TASK FILTER',
|
||||
recent: false,
|
||||
icon: 'glyphicon-inbox',
|
||||
filter: {
|
||||
processDefinitionId: null,
|
||||
processDefinitionKey: null,
|
||||
name: null,
|
||||
state: 'open',
|
||||
sort: 'created-desc',
|
||||
assignment: 'assignee',
|
||||
dueAfter: null,
|
||||
dueBefore: null
|
||||
}
|
||||
});
|
||||
|
||||
export let fakeAppPromise = new Promise(function (resolve, reject) {
|
||||
resolve(fakeAppFilter);
|
||||
});
|
||||
|
||||
export let fakeFormList = {
|
||||
size: 2,
|
||||
total: 2,
|
||||
start: 0,
|
||||
data: [{
|
||||
id: 1,
|
||||
name: 'form with all widgets',
|
||||
description: '',
|
||||
createdBy: 2,
|
||||
createdByFullName: 'Admin Admin',
|
||||
lastUpdatedBy: 2,
|
||||
lastUpdatedByFullName: 'Admin Admin',
|
||||
lastUpdated: 1491400951205,
|
||||
latestVersion: true,
|
||||
version: 4,
|
||||
comment: null,
|
||||
stencilSet: null,
|
||||
referenceId: null,
|
||||
modelType: 2,
|
||||
favorite: null,
|
||||
permission: 'write',
|
||||
tenantId: null
|
||||
}, {
|
||||
id: 2,
|
||||
name: 'uppy',
|
||||
description: '',
|
||||
createdBy: 2,
|
||||
createdByFullName: 'Admin Admin',
|
||||
lastUpdatedBy: 2,
|
||||
lastUpdatedByFullName: 'Admin Admin',
|
||||
lastUpdated: 1490951054477,
|
||||
latestVersion: true,
|
||||
version: 2,
|
||||
comment: null,
|
||||
stencilSet: null,
|
||||
referenceId: null,
|
||||
modelType: 2,
|
||||
favorite: null,
|
||||
permission: 'write',
|
||||
tenantId: null
|
||||
}]
|
||||
};
|
||||
|
||||
export let fakeTaskOpen1 = {
|
||||
id: '1', name: 'FakeOpenTask1', description: null, category: null,
|
||||
assignee: fakeUser1,
|
||||
created: '2017-07-15T11:19:17.440+0000',
|
||||
dueDate: null,
|
||||
endDate: null
|
||||
};
|
||||
|
||||
export let fakeTaskOpen2 = {
|
||||
id: '1', name: 'FakeOpenTask2', description: null, category: null,
|
||||
assignee: { id: 1, email: 'fake-open-email@dom.com', firstName: 'firstName', lastName: 'lastName' },
|
||||
created: '2017-07-15T11:19:17.440+0000',
|
||||
dueDate: null,
|
||||
endDate: null
|
||||
};
|
||||
|
||||
export let fakeTaskCompleted1 = {
|
||||
id: '1', name: 'FakeCompletedTaskName1', description: null, category: null,
|
||||
assignee: { id: 1, email: 'fake-completed-email@dom.com', firstName: 'firstName', lastName: 'lastName' },
|
||||
created: '2016-07-15T11:19:17.440+0000',
|
||||
dueDate: null,
|
||||
endDate: '2016-11-03T15:25:42.749+0000'
|
||||
};
|
||||
|
||||
export let fakeTaskCompleted2 = {
|
||||
id: '1', name: 'FakeCompletedTaskName2', description: null, category: null,
|
||||
assignee: fakeUser1,
|
||||
created: null,
|
||||
dueDate: null,
|
||||
endDate: '2016-11-03T15:25:42.749+0000'
|
||||
};
|
||||
|
||||
export let fakeOpenTaskList = {
|
||||
size: 2,
|
||||
total: 2,
|
||||
start: 0,
|
||||
data: [fakeTaskOpen1, fakeTaskOpen2]
|
||||
};
|
||||
|
||||
export let fakeCompletedTaskList = {
|
||||
size: 2,
|
||||
total: 2,
|
||||
start: 0,
|
||||
data: [fakeTaskCompleted1, fakeTaskCompleted2]
|
||||
};
|
Reference in New Issue
Block a user