mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +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[];
|
||||
description?: string[];
|
||||
processDefinitionName?: string[];
|
||||
id?: string[];
|
||||
parentId?: string[];
|
||||
processName?: string[];
|
||||
priority?: string[];
|
||||
status?: string[];
|
||||
completedBy?: string[];
|
||||
assignee?: string[];
|
||||
processInstanceId?: string;
|
||||
processInstanceId?: string[];
|
||||
createdFrom?: string;
|
||||
createdTo?: string;
|
||||
lastModifiedFrom?: string;
|
||||
@@ -140,6 +142,8 @@ export class TaskListRequestModel {
|
||||
this.name = obj.name;
|
||||
this.description = obj.description;
|
||||
this.processDefinitionName = obj.processDefinitionName;
|
||||
this.id = obj.id;
|
||||
this.parentId = obj.parentId;
|
||||
this.processName = obj.processName;
|
||||
this.priority = obj.priority;
|
||||
this.status = obj.status;
|
||||
@@ -177,11 +181,14 @@ export class TaskFilterCloudAdapter extends TaskListRequestModel {
|
||||
onlyStandalone: filter.standalone,
|
||||
name: filter.taskNames,
|
||||
processDefinitionName: filter.processDefinitionNames,
|
||||
id: filter.taskIds,
|
||||
parentId: filter.parentTaskIds,
|
||||
processName: filter.processNames,
|
||||
priority: filter.priorities?.map((priority) => priority.toString()),
|
||||
status: filter.statuses,
|
||||
completedBy: filter.completedByUsers,
|
||||
assignee: filter.assignees,
|
||||
processInstanceId: filter.processInstanceIds,
|
||||
createdFrom: filter.createdFrom,
|
||||
createdTo: filter.createdTo,
|
||||
lastModifiedFrom: filter.lastModifiedFrom,
|
||||
|
@@ -33,7 +33,7 @@ export class TaskListRequestSortingModel extends TaskListCloudSortingModel {
|
||||
|
||||
isFieldProcessVariable: boolean;
|
||||
processVariableData?: {
|
||||
processDefinitionKeys: string[];
|
||||
processDefinitionKey: string;
|
||||
type: string;
|
||||
}
|
||||
|
||||
@@ -42,9 +42,7 @@ export class TaskListRequestSortingModel extends TaskListCloudSortingModel {
|
||||
if (obj.isFieldProcessVariable) {
|
||||
this.isFieldProcessVariable = true;
|
||||
this.processVariableData = obj.processVariableData;
|
||||
if (!this.processVariableData.processDefinitionKeys?.length ||
|
||||
!this.processVariableData.type
|
||||
) {
|
||||
if (!this.processVariableData.processDefinitionKey || !this.processVariableData.type) {
|
||||
throw new Error('missing required property when sorting by process variable');
|
||||
}
|
||||
} 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.
|
||||
*/
|
||||
@Input()
|
||||
processNames: string[] = [];
|
||||
names: string[] = [];
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
@Input()
|
||||
processInstanceIds: string[] = [];
|
||||
ids: string[] = [];
|
||||
|
||||
/**
|
||||
* 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 {
|
||||
const requestNode = {
|
||||
const requestNode: ProcessListRequestModel = {
|
||||
appName: this.appName,
|
||||
pagination: {
|
||||
maxItems: this.size,
|
||||
skipCount: this.skipCount
|
||||
},
|
||||
sorting: this.getProcessListRequestSorting(),
|
||||
processName: this.processNames,
|
||||
processInstanceId: this.processInstanceIds,
|
||||
name: this.names,
|
||||
id: this.ids,
|
||||
parentId: this.parentIds,
|
||||
processDefinitionName: this.processDefinitionNames,
|
||||
initiator: this.initiators,
|
||||
@@ -602,16 +602,14 @@ export class ProcessListCloudComponent
|
||||
const isFieldProcessVariable = orderByColumn?.customData?.columnType === 'process-variable-column';
|
||||
|
||||
if (isFieldProcessVariable) {
|
||||
const processDefinitionKeys = orderByColumn.customData.variableDefinitionsPayload.map(
|
||||
(variableDefinition) => variableDefinition.split('/')[0]
|
||||
);
|
||||
const processDefinitionKey = orderByColumn.customData.variableDefinitionsPayload[0].split('/')[0];
|
||||
const variableName = orderByColumn.customData.variableDefinitionsPayload[0].split('/')[1];
|
||||
return new ProcessListRequestSortingModel({
|
||||
orderBy: variableName,
|
||||
direction,
|
||||
isFieldProcessVariable: true,
|
||||
processVariableData: {
|
||||
processDefinitionKeys,
|
||||
processDefinitionKey,
|
||||
type: orderByColumn.customData.variableType
|
||||
}
|
||||
});
|
||||
|
@@ -87,8 +87,8 @@ export class ProcessListRequestModel {
|
||||
pagination?: Pagination;
|
||||
sorting?: ProcessListRequestSortingModel;
|
||||
|
||||
processName?: string[];
|
||||
processInstanceId?: string[];
|
||||
name?: string[];
|
||||
id?: string[];
|
||||
parentId?: string[];
|
||||
processDefinitionName?: string[];
|
||||
initiator?: string[];
|
||||
@@ -115,8 +115,8 @@ export class ProcessListRequestModel {
|
||||
this.pagination = obj.pagination;
|
||||
this.sorting = obj.sorting;
|
||||
|
||||
this.processName = obj.processName;
|
||||
this.processInstanceId = obj.processInstanceId;
|
||||
this.name = obj.name;
|
||||
this.id = obj.id;
|
||||
this.parentId = obj.parentId;
|
||||
this.processDefinitionName = obj.processDefinitionName;
|
||||
this.initiator = obj.initiator;
|
||||
@@ -147,8 +147,8 @@ export class ProcessFilterCloudAdapter extends ProcessListRequestModel {
|
||||
}),
|
||||
|
||||
processDefinitionName: filter.processDefinitionNames,
|
||||
processName: filter.processNames,
|
||||
processInstanceId: filter.processInstanceIds,
|
||||
name: filter.processNames,
|
||||
id: filter.processInstanceIds,
|
||||
parentId: filter.parentIds,
|
||||
initiator: filter.initiators,
|
||||
appVersion: filter.appVersions,
|
||||
|
@@ -31,7 +31,7 @@ export class ProcessListRequestSortingModel extends ProcessListCloudSortingModel
|
||||
|
||||
isFieldProcessVariable: boolean;
|
||||
processVariableData?: {
|
||||
processDefinitionKeys: string[];
|
||||
processDefinitionKey: string;
|
||||
type: string;
|
||||
}
|
||||
|
||||
@@ -40,9 +40,7 @@ export class ProcessListRequestSortingModel extends ProcessListCloudSortingModel
|
||||
if (obj.isFieldProcessVariable) {
|
||||
this.isFieldProcessVariable = true;
|
||||
this.processVariableData = obj.processVariableData;
|
||||
if (!this.processVariableData.processDefinitionKeys?.length ||
|
||||
!this.processVariableData.type
|
||||
) {
|
||||
if (!this.processVariableData.processDefinitionKey || !this.processVariableData.type) {
|
||||
throw new Error('missing required property when sorting by process variable');
|
||||
}
|
||||
} else {
|
||||
|
@@ -102,8 +102,8 @@ export class ProcessListCloudService extends BaseCloudService {
|
||||
|
||||
protected buildQueryData(requestNode: ProcessListRequestModel) {
|
||||
const queryData: any = {
|
||||
name: requestNode.processName,
|
||||
processInstanceId: requestNode.processInstanceId,
|
||||
name: requestNode.name,
|
||||
id: requestNode.id,
|
||||
parentId: requestNode.parentId,
|
||||
processDefinitionName: requestNode.processDefinitionName,
|
||||
initiator: requestNode.initiator,
|
||||
@@ -128,7 +128,7 @@ export class ProcessListCloudService extends BaseCloudService {
|
||||
isProcessVariable: requestNode.sorting.isFieldProcessVariable
|
||||
};
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@@ -66,6 +66,9 @@ export class TaskFilterCloudModel {
|
||||
assignees: string[] | null;
|
||||
processNames: string[] | null;
|
||||
processDefinitionNames: string[] | null;
|
||||
taskIds: string[] | null;
|
||||
parentTaskIds: string[] | null;
|
||||
processInstanceIds: string[] | null;
|
||||
priorities: string[] | null;
|
||||
completedByUsers: string[] | null;
|
||||
|
||||
@@ -124,6 +127,9 @@ export class TaskFilterCloudModel {
|
||||
this.assignees = obj.assignees || null;
|
||||
this.processNames = obj.processNames || 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.completedByUsers = obj.completedByUsers || null;
|
||||
this.processVariableFilters = obj.processVariableFilters ?? [];
|
||||
|
@@ -176,6 +176,27 @@ export class TaskListCloudComponent extends BaseTaskListCloudComponent<ProcessLi
|
||||
@Input()
|
||||
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.
|
||||
* 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,
|
||||
name: this.names,
|
||||
processDefinitionName: this.processDefinitionNames,
|
||||
id: this.ids,
|
||||
parentId: this.parentIds,
|
||||
processName: this.processNames,
|
||||
processInstanceId: this.processInstanceId,
|
||||
processInstanceId: this.processInstanceIds,
|
||||
priority: this.priorities,
|
||||
status: this.statuses,
|
||||
completedBy: this.completedByUsers,
|
||||
@@ -365,16 +388,14 @@ export class TaskListCloudComponent extends BaseTaskListCloudComponent<ProcessLi
|
||||
const isFieldProcessVariable = orderByColumn?.customData?.columnType === 'process-variable-column';
|
||||
|
||||
if (isFieldProcessVariable) {
|
||||
const processDefinitionKeys = orderByColumn.customData.variableDefinitionsPayload.map(
|
||||
(variableDefinition) => variableDefinition.split('/')[0]
|
||||
);
|
||||
const processDefinitionKey = orderByColumn.customData.variableDefinitionsPayload[0].split('/')[0];
|
||||
const variableName = orderByColumn.customData.variableDefinitionsPayload[0].split('/')[1];
|
||||
return new TaskListRequestSortingModel({
|
||||
orderBy: variableName,
|
||||
direction,
|
||||
isFieldProcessVariable: true,
|
||||
processVariableData: {
|
||||
processDefinitionKeys,
|
||||
processDefinitionKey,
|
||||
type: orderByColumn.customData.variableType
|
||||
}
|
||||
});
|
||||
|
@@ -99,6 +99,9 @@ export class TaskListCloudService extends BaseCloudService implements TaskListCl
|
||||
|
||||
protected buildQueryData(requestNode: TaskListRequestModel) {
|
||||
const queryData: any = {
|
||||
id: requestNode.id,
|
||||
parentId: requestNode.parentId,
|
||||
processInstanceId: requestNode.processInstanceId,
|
||||
status: requestNode.status,
|
||||
processDefinitionName: requestNode.processDefinitionName,
|
||||
processName: requestNode.processName,
|
||||
@@ -123,7 +126,7 @@ export class TaskListCloudService extends BaseCloudService implements TaskListCl
|
||||
isProcessVariable: requestNode.sorting.isFieldProcessVariable
|
||||
};
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user