mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-08-07 17:48:54 +00:00
AAE-29217 Align properties with user task and process instance search API (#10480)
This commit is contained in:
@@ -104,12 +104,14 @@ export class TaskListRequestModel {
|
|||||||
name?: string[];
|
name?: string[];
|
||||||
description?: string[];
|
description?: string[];
|
||||||
processDefinitionName?: string[];
|
processDefinitionName?: string[];
|
||||||
|
id?: string[];
|
||||||
|
parentId?: string[];
|
||||||
processName?: string[];
|
processName?: string[];
|
||||||
priority?: string[];
|
priority?: string[];
|
||||||
status?: string[];
|
status?: string[];
|
||||||
completedBy?: string[];
|
completedBy?: string[];
|
||||||
assignee?: string[];
|
assignee?: string[];
|
||||||
processInstanceId?: string;
|
processInstanceId?: string[];
|
||||||
createdFrom?: string;
|
createdFrom?: string;
|
||||||
createdTo?: string;
|
createdTo?: string;
|
||||||
lastModifiedFrom?: string;
|
lastModifiedFrom?: string;
|
||||||
@@ -140,6 +142,8 @@ export class TaskListRequestModel {
|
|||||||
this.name = obj.name;
|
this.name = obj.name;
|
||||||
this.description = obj.description;
|
this.description = obj.description;
|
||||||
this.processDefinitionName = obj.processDefinitionName;
|
this.processDefinitionName = obj.processDefinitionName;
|
||||||
|
this.id = obj.id;
|
||||||
|
this.parentId = obj.parentId;
|
||||||
this.processName = obj.processName;
|
this.processName = obj.processName;
|
||||||
this.priority = obj.priority;
|
this.priority = obj.priority;
|
||||||
this.status = obj.status;
|
this.status = obj.status;
|
||||||
@@ -177,11 +181,14 @@ export class TaskFilterCloudAdapter extends TaskListRequestModel {
|
|||||||
onlyStandalone: filter.standalone,
|
onlyStandalone: filter.standalone,
|
||||||
name: filter.taskNames,
|
name: filter.taskNames,
|
||||||
processDefinitionName: filter.processDefinitionNames,
|
processDefinitionName: filter.processDefinitionNames,
|
||||||
|
id: filter.taskIds,
|
||||||
|
parentId: filter.parentTaskIds,
|
||||||
processName: filter.processNames,
|
processName: filter.processNames,
|
||||||
priority: filter.priorities?.map((priority) => priority.toString()),
|
priority: filter.priorities?.map((priority) => priority.toString()),
|
||||||
status: filter.statuses,
|
status: filter.statuses,
|
||||||
completedBy: filter.completedByUsers,
|
completedBy: filter.completedByUsers,
|
||||||
assignee: filter.assignees,
|
assignee: filter.assignees,
|
||||||
|
processInstanceId: filter.processInstanceIds,
|
||||||
createdFrom: filter.createdFrom,
|
createdFrom: filter.createdFrom,
|
||||||
createdTo: filter.createdTo,
|
createdTo: filter.createdTo,
|
||||||
lastModifiedFrom: filter.lastModifiedFrom,
|
lastModifiedFrom: filter.lastModifiedFrom,
|
||||||
|
@@ -33,7 +33,7 @@ export class TaskListRequestSortingModel extends TaskListCloudSortingModel {
|
|||||||
|
|
||||||
isFieldProcessVariable: boolean;
|
isFieldProcessVariable: boolean;
|
||||||
processVariableData?: {
|
processVariableData?: {
|
||||||
processDefinitionKeys: string[];
|
processDefinitionKey: string;
|
||||||
type: string;
|
type: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -42,9 +42,7 @@ export class TaskListRequestSortingModel extends TaskListCloudSortingModel {
|
|||||||
if (obj.isFieldProcessVariable) {
|
if (obj.isFieldProcessVariable) {
|
||||||
this.isFieldProcessVariable = true;
|
this.isFieldProcessVariable = true;
|
||||||
this.processVariableData = obj.processVariableData;
|
this.processVariableData = obj.processVariableData;
|
||||||
if (!this.processVariableData.processDefinitionKeys?.length ||
|
if (!this.processVariableData.processDefinitionKey || !this.processVariableData.type) {
|
||||||
!this.processVariableData.type
|
|
||||||
) {
|
|
||||||
throw new Error('missing required property when sorting by process variable');
|
throw new Error('missing required property when sorting by process variable');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@@ -221,14 +221,14 @@ export class ProcessListCloudComponent
|
|||||||
* This input will be used only if PROCESS_SEARCH_API_METHOD_TOKEN is provided with 'POST' value.
|
* This input will be used only if PROCESS_SEARCH_API_METHOD_TOKEN is provided with 'POST' value.
|
||||||
*/
|
*/
|
||||||
@Input()
|
@Input()
|
||||||
processNames: string[] = [];
|
names: string[] = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter the processes. Display only processes with instance Ids matching any of the supplied strings.
|
* Filter the processes. Display only processes with instance Ids matching any of the supplied strings.
|
||||||
* This input will be used only if PROCESS_SEARCH_API_METHOD_TOKEN is provided with 'POST' value.
|
* This input will be used only if PROCESS_SEARCH_API_METHOD_TOKEN is provided with 'POST' value.
|
||||||
*/
|
*/
|
||||||
@Input()
|
@Input()
|
||||||
processInstanceIds: string[] = [];
|
ids: string[] = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter the processes. Display only processes with parent Ids matching any of the supplied strings.
|
* Filter the processes. Display only processes with parent Ids matching any of the supplied strings.
|
||||||
@@ -558,15 +558,15 @@ export class ProcessListCloudComponent
|
|||||||
}
|
}
|
||||||
|
|
||||||
private createProcessListRequestNode(): ProcessListRequestModel {
|
private createProcessListRequestNode(): ProcessListRequestModel {
|
||||||
const requestNode = {
|
const requestNode: ProcessListRequestModel = {
|
||||||
appName: this.appName,
|
appName: this.appName,
|
||||||
pagination: {
|
pagination: {
|
||||||
maxItems: this.size,
|
maxItems: this.size,
|
||||||
skipCount: this.skipCount
|
skipCount: this.skipCount
|
||||||
},
|
},
|
||||||
sorting: this.getProcessListRequestSorting(),
|
sorting: this.getProcessListRequestSorting(),
|
||||||
processName: this.processNames,
|
name: this.names,
|
||||||
processInstanceId: this.processInstanceIds,
|
id: this.ids,
|
||||||
parentId: this.parentIds,
|
parentId: this.parentIds,
|
||||||
processDefinitionName: this.processDefinitionNames,
|
processDefinitionName: this.processDefinitionNames,
|
||||||
initiator: this.initiators,
|
initiator: this.initiators,
|
||||||
@@ -602,16 +602,14 @@ export class ProcessListCloudComponent
|
|||||||
const isFieldProcessVariable = orderByColumn?.customData?.columnType === 'process-variable-column';
|
const isFieldProcessVariable = orderByColumn?.customData?.columnType === 'process-variable-column';
|
||||||
|
|
||||||
if (isFieldProcessVariable) {
|
if (isFieldProcessVariable) {
|
||||||
const processDefinitionKeys = orderByColumn.customData.variableDefinitionsPayload.map(
|
const processDefinitionKey = orderByColumn.customData.variableDefinitionsPayload[0].split('/')[0];
|
||||||
(variableDefinition) => variableDefinition.split('/')[0]
|
|
||||||
);
|
|
||||||
const variableName = orderByColumn.customData.variableDefinitionsPayload[0].split('/')[1];
|
const variableName = orderByColumn.customData.variableDefinitionsPayload[0].split('/')[1];
|
||||||
return new ProcessListRequestSortingModel({
|
return new ProcessListRequestSortingModel({
|
||||||
orderBy: variableName,
|
orderBy: variableName,
|
||||||
direction,
|
direction,
|
||||||
isFieldProcessVariable: true,
|
isFieldProcessVariable: true,
|
||||||
processVariableData: {
|
processVariableData: {
|
||||||
processDefinitionKeys,
|
processDefinitionKey,
|
||||||
type: orderByColumn.customData.variableType
|
type: orderByColumn.customData.variableType
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@@ -87,8 +87,8 @@ export class ProcessListRequestModel {
|
|||||||
pagination?: Pagination;
|
pagination?: Pagination;
|
||||||
sorting?: ProcessListRequestSortingModel;
|
sorting?: ProcessListRequestSortingModel;
|
||||||
|
|
||||||
processName?: string[];
|
name?: string[];
|
||||||
processInstanceId?: string[];
|
id?: string[];
|
||||||
parentId?: string[];
|
parentId?: string[];
|
||||||
processDefinitionName?: string[];
|
processDefinitionName?: string[];
|
||||||
initiator?: string[];
|
initiator?: string[];
|
||||||
@@ -115,8 +115,8 @@ export class ProcessListRequestModel {
|
|||||||
this.pagination = obj.pagination;
|
this.pagination = obj.pagination;
|
||||||
this.sorting = obj.sorting;
|
this.sorting = obj.sorting;
|
||||||
|
|
||||||
this.processName = obj.processName;
|
this.name = obj.name;
|
||||||
this.processInstanceId = obj.processInstanceId;
|
this.id = obj.id;
|
||||||
this.parentId = obj.parentId;
|
this.parentId = obj.parentId;
|
||||||
this.processDefinitionName = obj.processDefinitionName;
|
this.processDefinitionName = obj.processDefinitionName;
|
||||||
this.initiator = obj.initiator;
|
this.initiator = obj.initiator;
|
||||||
@@ -147,8 +147,8 @@ export class ProcessFilterCloudAdapter extends ProcessListRequestModel {
|
|||||||
}),
|
}),
|
||||||
|
|
||||||
processDefinitionName: filter.processDefinitionNames,
|
processDefinitionName: filter.processDefinitionNames,
|
||||||
processName: filter.processNames,
|
name: filter.processNames,
|
||||||
processInstanceId: filter.processInstanceIds,
|
id: filter.processInstanceIds,
|
||||||
parentId: filter.parentIds,
|
parentId: filter.parentIds,
|
||||||
initiator: filter.initiators,
|
initiator: filter.initiators,
|
||||||
appVersion: filter.appVersions,
|
appVersion: filter.appVersions,
|
||||||
|
@@ -31,7 +31,7 @@ export class ProcessListRequestSortingModel extends ProcessListCloudSortingModel
|
|||||||
|
|
||||||
isFieldProcessVariable: boolean;
|
isFieldProcessVariable: boolean;
|
||||||
processVariableData?: {
|
processVariableData?: {
|
||||||
processDefinitionKeys: string[];
|
processDefinitionKey: string;
|
||||||
type: string;
|
type: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,9 +40,7 @@ export class ProcessListRequestSortingModel extends ProcessListCloudSortingModel
|
|||||||
if (obj.isFieldProcessVariable) {
|
if (obj.isFieldProcessVariable) {
|
||||||
this.isFieldProcessVariable = true;
|
this.isFieldProcessVariable = true;
|
||||||
this.processVariableData = obj.processVariableData;
|
this.processVariableData = obj.processVariableData;
|
||||||
if (!this.processVariableData.processDefinitionKeys?.length ||
|
if (!this.processVariableData.processDefinitionKey || !this.processVariableData.type) {
|
||||||
!this.processVariableData.type
|
|
||||||
) {
|
|
||||||
throw new Error('missing required property when sorting by process variable');
|
throw new Error('missing required property when sorting by process variable');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@@ -102,8 +102,8 @@ export class ProcessListCloudService extends BaseCloudService {
|
|||||||
|
|
||||||
protected buildQueryData(requestNode: ProcessListRequestModel) {
|
protected buildQueryData(requestNode: ProcessListRequestModel) {
|
||||||
const queryData: any = {
|
const queryData: any = {
|
||||||
name: requestNode.processName,
|
name: requestNode.name,
|
||||||
processInstanceId: requestNode.processInstanceId,
|
id: requestNode.id,
|
||||||
parentId: requestNode.parentId,
|
parentId: requestNode.parentId,
|
||||||
processDefinitionName: requestNode.processDefinitionName,
|
processDefinitionName: requestNode.processDefinitionName,
|
||||||
initiator: requestNode.initiator,
|
initiator: requestNode.initiator,
|
||||||
@@ -128,7 +128,7 @@ export class ProcessListCloudService extends BaseCloudService {
|
|||||||
isProcessVariable: requestNode.sorting.isFieldProcessVariable
|
isProcessVariable: requestNode.sorting.isFieldProcessVariable
|
||||||
};
|
};
|
||||||
if (queryData['sort'].isProcessVariable) {
|
if (queryData['sort'].isProcessVariable) {
|
||||||
queryData['sort'].processDefinitionKeys = requestNode.sorting.processVariableData?.processDefinitionKeys;
|
queryData['sort'].processDefinitionKey = requestNode.sorting.processVariableData?.processDefinitionKey;
|
||||||
queryData['sort'].type = requestNode.sorting.processVariableData?.type;
|
queryData['sort'].type = requestNode.sorting.processVariableData?.type;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -66,6 +66,9 @@ export class TaskFilterCloudModel {
|
|||||||
assignees: string[] | null;
|
assignees: string[] | null;
|
||||||
processNames: string[] | null;
|
processNames: string[] | null;
|
||||||
processDefinitionNames: string[] | null;
|
processDefinitionNames: string[] | null;
|
||||||
|
taskIds: string[] | null;
|
||||||
|
parentTaskIds: string[] | null;
|
||||||
|
processInstanceIds: string[] | null;
|
||||||
priorities: string[] | null;
|
priorities: string[] | null;
|
||||||
completedByUsers: string[] | null;
|
completedByUsers: string[] | null;
|
||||||
|
|
||||||
@@ -124,6 +127,9 @@ export class TaskFilterCloudModel {
|
|||||||
this.assignees = obj.assignees || null;
|
this.assignees = obj.assignees || null;
|
||||||
this.processNames = obj.processNames || null;
|
this.processNames = obj.processNames || null;
|
||||||
this.processDefinitionNames = obj.processDefinitionNames || null;
|
this.processDefinitionNames = obj.processDefinitionNames || null;
|
||||||
|
this.taskIds = obj.taskIds || null;
|
||||||
|
this.parentTaskIds = obj.parentTaskIds || null;
|
||||||
|
this.processInstanceIds = obj.processInstanceIds || null;
|
||||||
this.priorities = obj.priorities || null;
|
this.priorities = obj.priorities || null;
|
||||||
this.completedByUsers = obj.completedByUsers || null;
|
this.completedByUsers = obj.completedByUsers || null;
|
||||||
this.processVariableFilters = obj.processVariableFilters ?? [];
|
this.processVariableFilters = obj.processVariableFilters ?? [];
|
||||||
|
@@ -176,6 +176,27 @@ export class TaskListCloudComponent extends BaseTaskListCloudComponent<ProcessLi
|
|||||||
@Input()
|
@Input()
|
||||||
processDefinitionNames: string[] = [];
|
processDefinitionNames: string[] = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filter the tasks. Display only tasks with Ids matching any of the supplied strings.
|
||||||
|
* This input will be used only if TASK_SEARCH_API_METHOD_TOKEN is provided with 'POST' value.
|
||||||
|
*/
|
||||||
|
@Input()
|
||||||
|
ids: string[] = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filter the tasks. Display only tasks with parentTaskIds matching any of the supplied strings.
|
||||||
|
* This input will be used only if TASK_SEARCH_API_METHOD_TOKEN is provided with 'POST' value.
|
||||||
|
*/
|
||||||
|
@Input()
|
||||||
|
parentIds: string[] = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filter the tasks. Display only tasks with processInstanceIds matching any of the supplied strings.
|
||||||
|
* This input will be used only if TASK_SEARCH_API_METHOD_TOKEN is provided with 'POST' value.
|
||||||
|
*/
|
||||||
|
@Input()
|
||||||
|
processInstanceIds: string[] = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter the tasks. Display only tasks under processes with provided names.
|
* Filter the tasks. Display only tasks under processes with provided names.
|
||||||
* This input will be used only if TASK_SEARCH_API_METHOD_TOKEN is provided with 'POST' value.
|
* This input will be used only if TASK_SEARCH_API_METHOD_TOKEN is provided with 'POST' value.
|
||||||
@@ -280,8 +301,10 @@ export class TaskListCloudComponent extends BaseTaskListCloudComponent<ProcessLi
|
|||||||
onlyStandalone: this.standalone,
|
onlyStandalone: this.standalone,
|
||||||
name: this.names,
|
name: this.names,
|
||||||
processDefinitionName: this.processDefinitionNames,
|
processDefinitionName: this.processDefinitionNames,
|
||||||
|
id: this.ids,
|
||||||
|
parentId: this.parentIds,
|
||||||
processName: this.processNames,
|
processName: this.processNames,
|
||||||
processInstanceId: this.processInstanceId,
|
processInstanceId: this.processInstanceIds,
|
||||||
priority: this.priorities,
|
priority: this.priorities,
|
||||||
status: this.statuses,
|
status: this.statuses,
|
||||||
completedBy: this.completedByUsers,
|
completedBy: this.completedByUsers,
|
||||||
@@ -365,16 +388,14 @@ export class TaskListCloudComponent extends BaseTaskListCloudComponent<ProcessLi
|
|||||||
const isFieldProcessVariable = orderByColumn?.customData?.columnType === 'process-variable-column';
|
const isFieldProcessVariable = orderByColumn?.customData?.columnType === 'process-variable-column';
|
||||||
|
|
||||||
if (isFieldProcessVariable) {
|
if (isFieldProcessVariable) {
|
||||||
const processDefinitionKeys = orderByColumn.customData.variableDefinitionsPayload.map(
|
const processDefinitionKey = orderByColumn.customData.variableDefinitionsPayload[0].split('/')[0];
|
||||||
(variableDefinition) => variableDefinition.split('/')[0]
|
|
||||||
);
|
|
||||||
const variableName = orderByColumn.customData.variableDefinitionsPayload[0].split('/')[1];
|
const variableName = orderByColumn.customData.variableDefinitionsPayload[0].split('/')[1];
|
||||||
return new TaskListRequestSortingModel({
|
return new TaskListRequestSortingModel({
|
||||||
orderBy: variableName,
|
orderBy: variableName,
|
||||||
direction,
|
direction,
|
||||||
isFieldProcessVariable: true,
|
isFieldProcessVariable: true,
|
||||||
processVariableData: {
|
processVariableData: {
|
||||||
processDefinitionKeys,
|
processDefinitionKey,
|
||||||
type: orderByColumn.customData.variableType
|
type: orderByColumn.customData.variableType
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@@ -99,6 +99,9 @@ export class TaskListCloudService extends BaseCloudService implements TaskListCl
|
|||||||
|
|
||||||
protected buildQueryData(requestNode: TaskListRequestModel) {
|
protected buildQueryData(requestNode: TaskListRequestModel) {
|
||||||
const queryData: any = {
|
const queryData: any = {
|
||||||
|
id: requestNode.id,
|
||||||
|
parentId: requestNode.parentId,
|
||||||
|
processInstanceId: requestNode.processInstanceId,
|
||||||
status: requestNode.status,
|
status: requestNode.status,
|
||||||
processDefinitionName: requestNode.processDefinitionName,
|
processDefinitionName: requestNode.processDefinitionName,
|
||||||
processName: requestNode.processName,
|
processName: requestNode.processName,
|
||||||
@@ -123,7 +126,7 @@ export class TaskListCloudService extends BaseCloudService implements TaskListCl
|
|||||||
isProcessVariable: requestNode.sorting.isFieldProcessVariable
|
isProcessVariable: requestNode.sorting.isFieldProcessVariable
|
||||||
};
|
};
|
||||||
if (queryData['sort'].isProcessVariable) {
|
if (queryData['sort'].isProcessVariable) {
|
||||||
queryData['sort'].processDefinitionKeys = requestNode.sorting.processVariableData?.processDefinitionKeys;
|
queryData['sort'].processDefinitionKey = requestNode.sorting.processVariableData?.processDefinitionKey;
|
||||||
queryData['sort'].type = requestNode.sorting.processVariableData?.type;
|
queryData['sort'].type = requestNode.sorting.processVariableData?.type;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user