mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
AAE-27328 Add process variables to the search for searching Tasks (#10414)
* AAE-27328 Add process variables to the search for searching Tasks * fix after rebase
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
import { Pagination } from '@alfresco/js-api';
|
import { Pagination } from '@alfresco/js-api';
|
||||||
import { TaskListCloudSortingModel, TaskListRequestSortingModel } from './task-list-sorting.model';
|
import { TaskListCloudSortingModel, TaskListRequestSortingModel } from './task-list-sorting.model';
|
||||||
import { TaskFilterCloudModel } from '../task/task-filters/models/filter-cloud.model';
|
import { TaskFilterCloudModel } from '../task/task-filters/models/filter-cloud.model';
|
||||||
|
import { ProcessVariableFilterModel } from './process-variable-filter.model';
|
||||||
|
|
||||||
export class TaskQueryCloudRequestModel {
|
export class TaskQueryCloudRequestModel {
|
||||||
appName: string;
|
appName: string;
|
||||||
@@ -93,13 +94,6 @@ export class TaskQueryCloudRequestModel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface TaskListRequestTaskVariableFilter {
|
|
||||||
name?: string;
|
|
||||||
type?: string;
|
|
||||||
value?: string;
|
|
||||||
operator?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export class TaskListRequestModel {
|
export class TaskListRequestModel {
|
||||||
appName: string;
|
appName: string;
|
||||||
pagination?: Pagination;
|
pagination?: Pagination;
|
||||||
@@ -128,8 +122,8 @@ export class TaskListRequestModel {
|
|||||||
candidateUserId?: string[];
|
candidateUserId?: string[];
|
||||||
candidateGroupId?: string[];
|
candidateGroupId?: string[];
|
||||||
|
|
||||||
taskVariableFilters?: TaskListRequestTaskVariableFilter[];
|
|
||||||
processVariableKeys?: string[];
|
processVariableKeys?: string[];
|
||||||
|
processVariableFilters?: ProcessVariableFilterModel[];
|
||||||
|
|
||||||
constructor(obj: Partial<TaskListRequestModel>) {
|
constructor(obj: Partial<TaskListRequestModel>) {
|
||||||
if (!obj.appName) {
|
if (!obj.appName) {
|
||||||
@@ -162,7 +156,7 @@ export class TaskListRequestModel {
|
|||||||
this.completedTo = obj.completedTo;
|
this.completedTo = obj.completedTo;
|
||||||
this.candidateUserId = obj.candidateUserId;
|
this.candidateUserId = obj.candidateUserId;
|
||||||
this.candidateGroupId = obj.candidateGroupId;
|
this.candidateGroupId = obj.candidateGroupId;
|
||||||
this.taskVariableFilters = obj.taskVariableFilters;
|
this.processVariableFilters = obj.processVariableFilters ?? [];
|
||||||
this.processVariableKeys = obj.processVariableKeys;
|
this.processVariableKeys = obj.processVariableKeys;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,26 @@
|
|||||||
|
/*!
|
||||||
|
* @license
|
||||||
|
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||||
|
*
|
||||||
|
* 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 type ProcessFilterOperators = 'eq' | 'like' | 'gt' | 'gte' | 'lt' | 'lte';
|
||||||
|
|
||||||
|
export interface ProcessVariableFilterModel {
|
||||||
|
processDefinitionKey: string;
|
||||||
|
name: string;
|
||||||
|
type: string;
|
||||||
|
value: string | number;
|
||||||
|
operator: ProcessFilterOperators;
|
||||||
|
}
|
@@ -20,16 +20,7 @@
|
|||||||
import { DateCloudFilterType } from '../../../models/date-cloud-filter.model';
|
import { DateCloudFilterType } from '../../../models/date-cloud-filter.model';
|
||||||
import { DateRangeFilterService } from '../../../common/date-range-filter/date-range-filter.service';
|
import { DateRangeFilterService } from '../../../common/date-range-filter/date-range-filter.service';
|
||||||
import { ComponentSelectionMode } from '../../../types';
|
import { ComponentSelectionMode } from '../../../types';
|
||||||
|
import { ProcessVariableFilterModel } from '../../../models/process-variable-filter.model';
|
||||||
export type ProcessFilterOperators = 'eq' | 'like' | 'gt' | 'gte' | 'lt' | 'lte';
|
|
||||||
|
|
||||||
export interface ProcessVariableFilterModel {
|
|
||||||
processDefinitionKey: string;
|
|
||||||
name: string;
|
|
||||||
type: string;
|
|
||||||
value: string | number;
|
|
||||||
operator: ProcessFilterOperators;
|
|
||||||
}
|
|
||||||
|
|
||||||
export class ProcessFilterCloudModel {
|
export class ProcessFilterCloudModel {
|
||||||
id: string;
|
id: string;
|
||||||
|
@@ -63,7 +63,7 @@ import {
|
|||||||
} from '../../../models/data-column-custom-data';
|
} from '../../../models/data-column-custom-data';
|
||||||
import { VariableMapperService } from '../../../services/variable-mapper.sevice';
|
import { VariableMapperService } from '../../../services/variable-mapper.sevice';
|
||||||
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
||||||
import { ProcessVariableFilterModel } from '../../process-filters/models/process-filter-cloud.model';
|
import { ProcessVariableFilterModel } from '../../../models/process-variable-filter.model';
|
||||||
|
|
||||||
const PRESET_KEY = 'adf-cloud-process-list.presets';
|
const PRESET_KEY = 'adf-cloud-process-list.presets';
|
||||||
|
|
||||||
@@ -241,7 +241,7 @@ 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()
|
||||||
processVariables: ProcessVariableFilterModel[]
|
processVariables: ProcessVariableFilterModel[];
|
||||||
|
|
||||||
/** Emitted when a row in the process list is clicked. */
|
/** Emitted when a row in the process list is clicked. */
|
||||||
@Output()
|
@Output()
|
||||||
|
@@ -17,7 +17,8 @@
|
|||||||
|
|
||||||
import { Pagination } from '@alfresco/js-api';
|
import { Pagination } from '@alfresco/js-api';
|
||||||
import { ProcessListCloudSortingModel, ProcessListRequestSortingModel } from './process-list-sorting.model';
|
import { ProcessListCloudSortingModel, ProcessListRequestSortingModel } from './process-list-sorting.model';
|
||||||
import { ProcessFilterCloudModel, ProcessVariableFilterModel } from '../../process-filters/models/process-filter-cloud.model';
|
import { ProcessFilterCloudModel } from '../../process-filters/models/process-filter-cloud.model';
|
||||||
|
import { ProcessVariableFilterModel } from '../../../models/process-variable-filter.model';
|
||||||
|
|
||||||
export class ProcessQueryCloudRequestModel {
|
export class ProcessQueryCloudRequestModel {
|
||||||
appName: string;
|
appName: string;
|
||||||
|
@@ -24,6 +24,7 @@ import { DateRangeFilterService } from '../../../common/date-range-filter/date-r
|
|||||||
import { ComponentSelectionMode } from '../../../types';
|
import { ComponentSelectionMode } from '../../../types';
|
||||||
import { IdentityGroupModel } from '../../../group/models/identity-group.model';
|
import { IdentityGroupModel } from '../../../group/models/identity-group.model';
|
||||||
import { IdentityUserModel } from '../../../people/models/identity-user.model';
|
import { IdentityUserModel } from '../../../people/models/identity-user.model';
|
||||||
|
import { ProcessVariableFilterModel } from '../../../models/process-variable-filter.model';
|
||||||
|
|
||||||
export class TaskFilterCloudModel {
|
export class TaskFilterCloudModel {
|
||||||
id: string;
|
id: string;
|
||||||
@@ -75,6 +76,8 @@ export class TaskFilterCloudModel {
|
|||||||
private _createdTo: string;
|
private _createdTo: string;
|
||||||
private dateRangeFilterService = new DateRangeFilterService();
|
private dateRangeFilterService = new DateRangeFilterService();
|
||||||
|
|
||||||
|
processVariableFilters?: ProcessVariableFilterModel[];
|
||||||
|
|
||||||
constructor(obj?: any) {
|
constructor(obj?: any) {
|
||||||
if (obj) {
|
if (obj) {
|
||||||
this.id = obj.id || Math.random().toString(36).substr(2, 9);
|
this.id = obj.id || Math.random().toString(36).substr(2, 9);
|
||||||
@@ -115,13 +118,13 @@ export class TaskFilterCloudModel {
|
|||||||
this.createdTo = obj._createdTo || null;
|
this.createdTo = obj._createdTo || null;
|
||||||
this.candidateGroups = obj.candidateGroups || null;
|
this.candidateGroups = obj.candidateGroups || null;
|
||||||
this.showCounter = obj.showCounter || false;
|
this.showCounter = obj.showCounter || false;
|
||||||
|
|
||||||
this.taskNames = obj.taskNames || null;
|
this.taskNames = obj.taskNames || null;
|
||||||
this.statuses = obj.statuses || null;
|
this.statuses = obj.statuses || null;
|
||||||
this.assignees = obj.assignees || null;
|
this.assignees = obj.assignees || null;
|
||||||
this.processDefinitionNames = obj.processDefinitionNames || null;
|
this.processDefinitionNames = obj.processDefinitionNames || 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 ?? [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -33,6 +33,7 @@ import { TaskInstanceCloudListViewModel } from '../models/task-cloud-view.model'
|
|||||||
import { TasksListDatatableAdapter } from '../datatable/task-list-datatable-adapter';
|
import { TasksListDatatableAdapter } from '../datatable/task-list-datatable-adapter';
|
||||||
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
||||||
import { TaskListRequestSortingModel } from '../../../models/task-list-sorting.model';
|
import { TaskListRequestSortingModel } from '../../../models/task-list-sorting.model';
|
||||||
|
import { ProcessVariableFilterModel } from '../../../models/process-variable-filter.model';
|
||||||
|
|
||||||
const PRESET_KEY = 'adf-cloud-task-list.presets';
|
const PRESET_KEY = 'adf-cloud-task-list.presets';
|
||||||
|
|
||||||
@@ -189,6 +190,13 @@ export class TaskListCloudComponent extends BaseTaskListCloudComponent<ProcessLi
|
|||||||
@Input()
|
@Input()
|
||||||
completedByUsers: string[] = [];
|
completedByUsers: string[] = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filter the processes. Display only processes with specific process variables.
|
||||||
|
* This input will be used only if PROCESS_SEARCH_API_METHOD_TOKEN is provided with 'POST' value.
|
||||||
|
*/
|
||||||
|
@Input()
|
||||||
|
processVariableFilters: ProcessVariableFilterModel[];
|
||||||
|
|
||||||
rows: TaskInstanceCloudListViewModel[] = [];
|
rows: TaskInstanceCloudListViewModel[] = [];
|
||||||
dataAdapter: TasksListDatatableAdapter | undefined;
|
dataAdapter: TasksListDatatableAdapter | undefined;
|
||||||
|
|
||||||
@@ -278,7 +286,8 @@ export class TaskListCloudComponent extends BaseTaskListCloudComponent<ProcessLi
|
|||||||
dueDateTo: this.dueDateTo,
|
dueDateTo: this.dueDateTo,
|
||||||
completedFrom: this.completedFrom,
|
completedFrom: this.completedFrom,
|
||||||
completedTo: this.completedTo,
|
completedTo: this.completedTo,
|
||||||
processVariableKeys: this.getRequestNodeVariables()
|
processVariableKeys: this.getRequestNodeVariables(),
|
||||||
|
processVariableFilters: this.processVariableFilters ?? []
|
||||||
};
|
};
|
||||||
|
|
||||||
return new TaskListRequestModel(requestNode);
|
return new TaskListRequestModel(requestNode);
|
||||||
@@ -362,7 +371,7 @@ export class TaskListCloudComponent extends BaseTaskListCloudComponent<ProcessLi
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
return new TaskListRequestSortingModel({orderBy, direction, isFieldProcessVariable: false});
|
return new TaskListRequestSortingModel({ orderBy, direction, isFieldProcessVariable: false });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -111,7 +111,8 @@ export class TaskListCloudService extends BaseCloudService implements TaskListCl
|
|||||||
createdTo: requestNode.createdTo,
|
createdTo: requestNode.createdTo,
|
||||||
dueDateFrom: requestNode.dueDateFrom,
|
dueDateFrom: requestNode.dueDateFrom,
|
||||||
dueDateTo: requestNode.dueDateTo,
|
dueDateTo: requestNode.dueDateTo,
|
||||||
processVariableKeys: requestNode.processVariableKeys
|
processVariableKeys: requestNode.processVariableKeys,
|
||||||
|
processVariableFilters: requestNode.processVariableFilters
|
||||||
};
|
};
|
||||||
|
|
||||||
if (requestNode.sorting) {
|
if (requestNode.sorting) {
|
||||||
|
@@ -39,3 +39,4 @@ export * from './lib/models/task-list-sorting.model';
|
|||||||
export * from './lib/models/process-instance-variable.model';
|
export * from './lib/models/process-instance-variable.model';
|
||||||
export * from './lib/models/variable-definition';
|
export * from './lib/models/variable-definition';
|
||||||
export * from './lib/models/date-format-cloud.model';
|
export * from './lib/models/date-format-cloud.model';
|
||||||
|
export * from './lib/models/process-variable-filter.model'
|
||||||
|
Reference in New Issue
Block a user