mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
136
lib/process-services/task-list/models/filter.model.ts
Normal file
136
lib/process-services/task-list/models/filter.model.ts
Normal file
@@ -0,0 +1,136 @@
|
||||
/*!
|
||||
* @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 { TaskQueryRequestRepresentation, UserTaskFilterRepresentation } from 'alfresco-js-api';
|
||||
|
||||
export class AppDefinitionRepresentationModel {
|
||||
defaultAppId: string;
|
||||
deploymentId: string;
|
||||
name: string;
|
||||
description: string;
|
||||
theme: string;
|
||||
icon: string;
|
||||
id: number;
|
||||
modelId: number;
|
||||
tenantId: number;
|
||||
|
||||
constructor(obj?: any) {
|
||||
if (obj) {
|
||||
this.defaultAppId = obj.defaultAppId ? obj.defaultAppId : null;
|
||||
this.deploymentId = obj.deploymentId ? obj.deploymentId : null;
|
||||
this.name = obj.name ? obj.name : null;
|
||||
this.description = obj.description ? obj.description : null;
|
||||
this.theme = obj.theme ? obj.theme : null;
|
||||
this.icon = obj.icon ? obj.icon : null;
|
||||
this.id = obj.id ? obj.id : null;
|
||||
this.modelId = obj.modelId ? obj.modelId : null;
|
||||
this.tenantId = obj.tenantId ? obj.tenantId : null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export class FilterParamsModel {
|
||||
id: string;
|
||||
name: string;
|
||||
index: number;
|
||||
|
||||
constructor(obj?: any) {
|
||||
if (obj) {
|
||||
this.id = obj.id || null;
|
||||
this.name = obj.name || null;
|
||||
this.index = obj.index;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export class FilterRepresentationModel implements UserTaskFilterRepresentation {
|
||||
id: number;
|
||||
appId: number;
|
||||
name: string;
|
||||
recent: boolean;
|
||||
icon: string;
|
||||
filter: FilterParamRepresentationModel;
|
||||
index: number;
|
||||
|
||||
constructor(obj?: any) {
|
||||
if (obj) {
|
||||
this.id = obj.id || null;
|
||||
this.appId = obj.appId || null;
|
||||
this.name = obj.name || null;
|
||||
this.recent = !!obj.recent;
|
||||
this.icon = obj.icon || null;
|
||||
this.filter = new FilterParamRepresentationModel(obj.filter);
|
||||
this.index = obj.index;
|
||||
}
|
||||
}
|
||||
|
||||
hasFilter() {
|
||||
return this.filter ? true : false;
|
||||
}
|
||||
}
|
||||
|
||||
export class FilterParamRepresentationModel {
|
||||
processDefinitionId: string;
|
||||
processDefinitionKey: string;
|
||||
name: string;
|
||||
state: string;
|
||||
sort: string;
|
||||
assignment: string;
|
||||
dueAfter: Date;
|
||||
dueBefore: Date;
|
||||
|
||||
constructor(obj?: any) {
|
||||
if (obj) {
|
||||
this.processDefinitionId = obj.processDefinitionId || null;
|
||||
this.processDefinitionKey = obj.processDefinitionKey || null;
|
||||
this.name = obj.name || null;
|
||||
this.state = obj.state || null;
|
||||
this.sort = obj.sort || null;
|
||||
this.assignment = obj.assignment || null;
|
||||
this.dueAfter = obj.dueAfter || null;
|
||||
this.dueBefore = obj.dueBefore || null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export class TaskQueryRequestRepresentationModel implements TaskQueryRequestRepresentation {
|
||||
appDefinitionId: string;
|
||||
processInstanceId: string;
|
||||
processDefinitionId: string;
|
||||
text: string;
|
||||
assignment: string;
|
||||
state: string;
|
||||
start: string;
|
||||
sort: string;
|
||||
page: number;
|
||||
size: number;
|
||||
|
||||
constructor(obj?: any) {
|
||||
if (obj) {
|
||||
this.appDefinitionId = obj.appDefinitionId || null;
|
||||
this.processInstanceId = obj.processInstanceId || null;
|
||||
this.processDefinitionId = obj.processDefinitionId || null;
|
||||
this.text = obj.text || null;
|
||||
this.assignment = obj.assignment || null;
|
||||
this.state = obj.state || null;
|
||||
this.start = obj.start || null;
|
||||
this.sort = obj.sort || null;
|
||||
this.page = obj.page || 0;
|
||||
this.size = obj.size || 25;
|
||||
}
|
||||
}
|
||||
}
|
34
lib/process-services/task-list/models/form.model.ts
Normal file
34
lib/process-services/task-list/models/form.model.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.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* This object represent of the Form.
|
||||
*
|
||||
*
|
||||
* @returns {Form} .
|
||||
*/
|
||||
export class Form {
|
||||
|
||||
id: number;
|
||||
name: string;
|
||||
|
||||
constructor(id: number, name: string) {
|
||||
this.name = name;
|
||||
this.id = id;
|
||||
}
|
||||
}
|
44
lib/process-services/task-list/models/start-task.model.ts
Normal file
44
lib/process-services/task-list/models/start-task.model.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
/*!
|
||||
* @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.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* This object represent of the StartTaskModel.
|
||||
*
|
||||
*
|
||||
* @returns {StartTaskModel} .
|
||||
*/
|
||||
import { UserProcessModel } from '@alfresco/core';
|
||||
|
||||
export class StartTaskModel {
|
||||
|
||||
name: string;
|
||||
description: string;
|
||||
assignee: UserProcessModel;
|
||||
dueDate: any;
|
||||
formKey: any;
|
||||
category: string;
|
||||
|
||||
constructor(obj?: any) {
|
||||
this.name = obj && obj.name || null;
|
||||
this.description = obj && obj.description || null;
|
||||
this.assignee = obj && obj.assignee ? new UserProcessModel(obj.assignee) : null;
|
||||
this.dueDate = obj && obj.dueDate || null;
|
||||
this.formKey = obj && obj.formKey || null;
|
||||
this.category = obj && obj.category || null;
|
||||
}
|
||||
}
|
40
lib/process-services/task-list/models/task-details.event.ts
Normal file
40
lib/process-services/task-list/models/task-details.event.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
/*!
|
||||
* @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-details.model';
|
||||
|
||||
export class TaskDetailsEvent {
|
||||
|
||||
private _value: TaskDetailsModel;
|
||||
private _defaultPrevented: boolean = false;
|
||||
|
||||
get value(): TaskDetailsModel {
|
||||
return this._value;
|
||||
}
|
||||
|
||||
get defaultPrevented() {
|
||||
return this._defaultPrevented;
|
||||
}
|
||||
|
||||
constructor(value: TaskDetailsModel) {
|
||||
this._value = value;
|
||||
}
|
||||
|
||||
preventDefault() {
|
||||
this._defaultPrevented = true;
|
||||
}
|
||||
}
|
115
lib/process-services/task-list/models/task-details.model.ts
Normal file
115
lib/process-services/task-list/models/task-details.model.ts
Normal file
@@ -0,0 +1,115 @@
|
||||
/*!
|
||||
* @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.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* This object represent the details of a task.
|
||||
*
|
||||
*
|
||||
* @returns {TaskDetailsModel} .
|
||||
*/
|
||||
import { UserProcessModel } from '@alfresco/core';
|
||||
import { TaskRepresentation } from 'alfresco-js-api';
|
||||
import { UserGroupModel } from './user-group.model';
|
||||
|
||||
export class TaskDetailsModel implements TaskRepresentation {
|
||||
id: string;
|
||||
name: string;
|
||||
assignee: UserProcessModel;
|
||||
priority: number;
|
||||
adhocTaskCanBeReassigned: boolean;
|
||||
category: string;
|
||||
created: Date;
|
||||
description: string;
|
||||
dueDate: Date;
|
||||
duration: number;
|
||||
endDate: Date;
|
||||
executionId: string;
|
||||
formKey: string;
|
||||
initiatorCanCompleteTask: boolean;
|
||||
managerOfCandidateGroup: boolean;
|
||||
memberOfCandidateGroup: boolean;
|
||||
memberOfCandidateUsers: boolean;
|
||||
involvedGroups: UserGroupModel [];
|
||||
involvedPeople: UserProcessModel [];
|
||||
parentTaskId: string;
|
||||
parentTaskName: string;
|
||||
processDefinitionCategory: string;
|
||||
processDefinitionDeploymentId: string;
|
||||
processDefinitionDescription: string;
|
||||
processDefinitionId: string;
|
||||
processDefinitionKey: string;
|
||||
processDefinitionName: string;
|
||||
processDefinitionVersion: number = 0;
|
||||
processInstanceId: string;
|
||||
processInstanceName: string;
|
||||
processInstanceStartUserId: string;
|
||||
taskDefinitionKey: string;
|
||||
|
||||
constructor(obj?: any) {
|
||||
if (obj) {
|
||||
this.id = obj.id || null;
|
||||
this.name = obj.name || null;
|
||||
this.priority = obj.priority;
|
||||
this.assignee = obj.assignee ? new UserProcessModel(obj.assignee) : null;
|
||||
this.adhocTaskCanBeReassigned = obj.adhocTaskCanBeReassigned;
|
||||
this.category = obj.category || null;
|
||||
this.created = obj.created || null;
|
||||
this.description = obj.description || null;
|
||||
this.dueDate = obj.dueDate || null;
|
||||
this.duration = obj.duration || null;
|
||||
this.endDate = obj.endDate || null;
|
||||
this.executionId = obj.executionId || null;
|
||||
this.formKey = obj.formKey || null;
|
||||
this.initiatorCanCompleteTask = !!obj.initiatorCanCompleteTask;
|
||||
this.managerOfCandidateGroup = !!obj.managerOfCandidateGroup;
|
||||
this.memberOfCandidateGroup = !!obj.memberOfCandidateGroup;
|
||||
this.memberOfCandidateUsers = !!obj.memberOfCandidateUsers;
|
||||
this.involvedGroups = obj.involvedGroups;
|
||||
this.involvedPeople = obj.involvedPeople;
|
||||
this.parentTaskId = obj.parentTaskId || null;
|
||||
this.parentTaskName = obj.parentTaskName || null;
|
||||
this.processDefinitionCategory = obj.processDefinitionCategory || null;
|
||||
this.processDefinitionDeploymentId = obj.processDefinitionDeploymentId || null;
|
||||
this.processDefinitionDescription = obj.processDefinitionDescription || null;
|
||||
this.processDefinitionId = obj.processDefinitionId || null;
|
||||
this.processDefinitionKey = obj.processDefinitionKey || null;
|
||||
this.processDefinitionName = obj.processDefinitionName || null;
|
||||
this.processDefinitionVersion = obj.processDefinitionVersion || 0;
|
||||
this.processInstanceId = obj.processInstanceId || null;
|
||||
this.processInstanceName = obj.processInstanceName || null;
|
||||
this.processInstanceStartUserId = obj.processInstanceStartUserId || null;
|
||||
this.taskDefinitionKey = obj.taskDefinitionKey || null;
|
||||
}
|
||||
}
|
||||
|
||||
getFullName(): string {
|
||||
let fullName: string = '';
|
||||
|
||||
if (this.assignee) {
|
||||
let firstName: string = this.assignee.firstName ? this.assignee.firstName : '';
|
||||
let lastName: string = this.assignee.lastName ? this.assignee.lastName : '';
|
||||
fullName = `${firstName} ${lastName}`;
|
||||
}
|
||||
|
||||
return fullName.trim();
|
||||
}
|
||||
|
||||
isCompleted(): boolean {
|
||||
return !!this.endDate;
|
||||
}
|
||||
}
|
27
lib/process-services/task-list/models/task-list.model.ts
Normal file
27
lib/process-services/task-list/models/task-list.model.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
/*!
|
||||
* @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-details.model';
|
||||
|
||||
export interface TaskListModel {
|
||||
size: number;
|
||||
total: number;
|
||||
start: number;
|
||||
length: number;
|
||||
data: TaskDetailsModel [];
|
||||
|
||||
}
|
41
lib/process-services/task-list/models/task-preset.model.ts
Normal file
41
lib/process-services/task-list/models/task-preset.model.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
/*!
|
||||
* @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 taskPresetsDefaultModel = {
|
||||
'default': [
|
||||
{
|
||||
'key': 'name',
|
||||
'type': 'text',
|
||||
'title': 'ADF_TASK_LIST.PROPERTIES.NAME',
|
||||
'sortable': true
|
||||
},
|
||||
{
|
||||
'key': 'created',
|
||||
'type': 'text',
|
||||
'title': 'ADF_TASK_LIST.PROPERTIES.CREATED',
|
||||
'cssClass': 'hidden',
|
||||
'sortable': true
|
||||
},
|
||||
{
|
||||
'key': 'assignee',
|
||||
'type': 'text',
|
||||
'title': 'ADF_TASK_LIST.PROPERTIES.ASSIGNEE',
|
||||
'cssClass': 'hidden',
|
||||
'sortable': true
|
||||
}
|
||||
]
|
||||
};
|
33
lib/process-services/task-list/models/user-event.model.ts
Normal file
33
lib/process-services/task-list/models/user-event.model.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
/*!
|
||||
* @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.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* This object represent the User Event.
|
||||
*
|
||||
*
|
||||
* @returns {UserEventModel} .
|
||||
*/
|
||||
export class UserEventModel {
|
||||
type: string = '';
|
||||
value: any = {};
|
||||
|
||||
constructor(obj?: any) {
|
||||
this.type = obj && obj.type;
|
||||
this.value = obj && obj.value || {};
|
||||
}
|
||||
}
|
36
lib/process-services/task-list/models/user-group.model.ts
Normal file
36
lib/process-services/task-list/models/user-group.model.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
/*!
|
||||
* @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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* This object represent the process service user group.*
|
||||
*/
|
||||
|
||||
export class UserGroupModel {
|
||||
id: number;
|
||||
name: string;
|
||||
externalId: string;
|
||||
status: string;
|
||||
groups: any = {};
|
||||
|
||||
constructor(obj?: any) {
|
||||
this.id = obj && obj.id;
|
||||
this.name = obj && obj.name;
|
||||
this.externalId = obj && obj.externalId;
|
||||
this.status = obj && obj.status;
|
||||
this.groups = obj && obj.groups;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user