From a64e13bec5bf83cb08366273a3951a67767704ab Mon Sep 17 00:00:00 2001 From: Mercy Chrysolite <48274621+mcchrys@users.noreply.github.com> Date: Mon, 14 Sep 2020 13:01:19 +0530 Subject: [PATCH] [ACA-3623] Process definition name filter in task list (#5871) * [ACA-3623] Process definition name filter in task list * Added unit test * Aligning with changes in process list * Added all option --- .../process-list-cloud.component.md | 62 +++++++++---------- .../services/start-process-cloud.service.md | 9 ++- .../services/task-cloud.service.md | 5 +- .../src/lib/i18n/en.json | 1 + .../lib/task/services/task-cloud.service.ts | 21 +++++++ .../edit-task-filter-cloud.component.spec.ts | 19 ++++++ .../edit-task-filter-cloud.component.ts | 38 ++++++++++-- .../task-filters/models/filter-cloud.model.ts | 2 + .../components/task-list-cloud.component.ts | 5 ++ .../task-list/models/filter-cloud-model.ts | 2 + 10 files changed, 123 insertions(+), 41 deletions(-) diff --git a/docs/process-services-cloud/components/process-list-cloud.component.md b/docs/process-services-cloud/components/process-list-cloud.component.md index a63b61ac0c..0df4b90ccc 100644 --- a/docs/process-services-cloud/components/process-list-cloud.component.md +++ b/docs/process-services-cloud/components/process-list-cloud.component.md @@ -48,40 +48,40 @@ when the process list is empty: ### Properties -| Name | Type | Default value | Description | -| ---- | ---- | ------------- | ----------- | -| actionsPosition | `string` | "right" | Position of the actions dropdown menu. Can be "left" or "right". | -| appName | `string` | "" | The name of the application. | -| appVersion | `number` | | The release version of the application. | -| businessKey | `string` | "" | Filter the processes to display only the ones with this businessKey value. | -| id | `string` | "" | Filter the processes to display only the ones with this ID. | -| initiator | `string` | "" | Name of the initiator of the process. | -| lastModifiedFrom | `string` | "" | Filter the processes. Display only process with lastModifiedTo equal to the supplied date. | -| lastModifiedTo | `string` | "" | Filter the processes. Display only process with lastModifiedTo equal to the supplied date. | -| multiselect | `boolean` | false | Toggles multiple row selection and renders checkboxes at the beginning of each row | -| name | `string` | "" | Filter the processes to display only the ones with this name. | -| presetColumn | `string` | | Custom preset column schema in JSON format. | -| processDefinitionId | `string` | "" | Filter the processes to display only the ones with this process definition ID. | -| processDefinitionKey | `string` | "" | Filter the processes to display only the ones with this process definition key. | -| processDefinitionName | `string` | "" | Filter the processes to display only the ones with this process definition name. | -| selectionMode | `string` | "single" | Row selection mode. Can be "none", "single" or "multiple". For multiple mode, you can use Cmd (macOS) or Ctrl (Win) modifier key to toggle selection for multiple rows. | -| showActions | `boolean` | false | Toggles the data actions column. | -| showContextMenu | `boolean` | false | Toggles custom context menu for the component. | -| sorting | [`ProcessListCloudSortingModel`](../../../lib/process-services-cloud/src/lib/process/process-list/models/process-list-sorting.model.ts)`[]` | | Array of objects specifying the sort order and direction for the list. The sort parameters are for BE sorting. | -| status | `string` | "" | Filter the processes to display only the ones with this status. | -| stickyHeader | `boolean` | false | Toggles the sticky header mode. | +| Name | Type | Default value | Description | +| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| actionsPosition | `string` | "right" | Position of the actions dropdown menu. Can be "left" or "right". | +| appName | `string` | "" | The name of the application. | +| appVersion | `number` | | The release version of the application. | +| businessKey | `string` | "" | Filter the processes to display only the ones with this businessKey value. | +| id | `string` | "" | Filter the processes to display only the ones with this ID. | +| initiator | `string` | "" | Name of the initiator of the process. | +| lastModifiedFrom | `string` | "" | Filter the processes. Display only process with lastModifiedTo equal to the supplied date. | +| lastModifiedTo | `string` | "" | Filter the processes. Display only process with lastModifiedTo equal to the supplied date. | +| multiselect | `boolean` | false | Toggles multiple row selection and renders checkboxes at the beginning of each row | +| name | `string` | "" | Filter the processes to display only the ones with this name. | +| presetColumn | `string` | | Custom preset column schema in JSON format. | +| processDefinitionId | `string` | "" | Filter the processes to display only the ones with this process definition ID. | +| processDefinitionKey | `string` | "" | Filter the processes to display only the ones with this process definition key. | +| processDefinitionName | `string` | "" | Filter the processes to display only the ones with this process definition name. | +| selectionMode | `string` | "single" | Row selection mode. Can be "none", "single" or "multiple". For multiple mode, you can use Cmd (macOS) or Ctrl (Win) modifier key to toggle selection for multiple rows. | +| showActions | `boolean` | false | Toggles the data actions column. | +| showContextMenu | `boolean` | false | Toggles custom context menu for the component. | +| sorting | [`ProcessListCloudSortingModel`](../../../lib/process-services-cloud/src/lib/process/process-list/models/process-list-sorting.model.ts)`[]` | | Array of objects specifying the sort order and direction for the list. The sort parameters are for BE sorting. | +| status | `string` | "" | Filter the processes to display only the ones with this status. | +| stickyHeader | `boolean` | false | Toggles the sticky header mode. | ### Events -| Name | Type | Description | -| ---- | ---- | ----------- | -| error | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`` | Emitted when an error occurs while loading the list of process instances from the server. | -| executeRowAction | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`DataRowActionEvent`](../../../lib/core/datatable/components/data-row-action.event.ts)`>` | Emitted when the user executes a row action. | -| rowClick | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`` | Emitted when a row in the process list is clicked. | -| rowsSelected | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`` | Emitted when rows are selected/unselected. | -| showRowActionsMenu | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`DataCellEvent`](../../../lib/core/datatable/components/data-cell.event.ts)`>` | Emitted before the actions menu is displayed for a row. | -| showRowContextMenu | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`DataCellEvent`](../../../lib/core/datatable/components/data-cell.event.ts)`>` | Emitted before the context menu is displayed for a row. | -| success | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`` | Emitted when the list of process instances has been loaded successfully from the server. | +| Name | Type | Description | +| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| error | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`` | Emitted when an error occurs while loading the list of process instances from the server. | +| executeRowAction | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`DataRowActionEvent`](../../../lib/core/datatable/components/data-row-action.event.ts)`>` | Emitted when the user executes a row action. | +| rowClick | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`` | Emitted when a row in the process list is clicked. | +| rowsSelected | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`` | Emitted when rows are selected/unselected. | +| showRowActionsMenu | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`DataCellEvent`](../../../lib/core/datatable/components/data-cell.event.ts)`>` | Emitted before the actions menu is displayed for a row. | +| showRowContextMenu | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`DataCellEvent`](../../../lib/core/datatable/components/data-cell.event.ts)`>` | Emitted before the context menu is displayed for a row. | +| success | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`` | Emitted when the list of process instances has been loaded successfully from the server. | ## Details diff --git a/docs/process-services-cloud/services/start-process-cloud.service.md b/docs/process-services-cloud/services/start-process-cloud.service.md index 97c98be327..e5fc3ce8c5 100644 --- a/docs/process-services-cloud/services/start-process-cloud.service.md +++ b/docs/process-services-cloud/services/start-process-cloud.service.md @@ -15,19 +15,18 @@ Gets process definitions and starts processes. - **createProcess**(appName: `string`, payload: [`ProcessPayloadCloud`](../../../lib/process-services-cloud/src/lib/process/start-process/models/process-payload-cloud.model.ts)): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`ProcessInstanceCloud`](../../../lib/process-services-cloud/src/lib/process/start-process/models/process-instance-cloud.model.ts)`>`
Create a process based on a process definition, name, form values or variables. - - _appName:_ `string` - name of the [Application](../../../lib/testing/src/lib/core/structure/application.ts) + - _appName:_ `string` - name of the Application - _payload:_ [`ProcessPayloadCloud`](../../../lib/process-services-cloud/src/lib/process/start-process/models/process-payload-cloud.model.ts) - Details of the process (definition key, name, variables, etc) - **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`ProcessInstanceCloud`](../../../lib/process-services-cloud/src/lib/process/start-process/models/process-instance-cloud.model.ts)`>` - Details of the process instance just created - **deleteProcess**(appName: `string`, processInstanceId: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)``
Delete an existing process instance - - _appName:_ `string` - name of the [Application](../../../lib/testing/src/lib/core/structure/application.ts) + - _appName:_ `string` - name of the Application - _processInstanceId:_ `string` - process instance to update - **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`` - - **getBasePath**(appName: `string`): `string`
- _appName:_ `string` - - **Returns** `string` - - - **getProcessDefinitions**(appName: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`ProcessDefinitionCloud`](../../../lib/process-services-cloud/src/lib/models/process-definition-cloud.model.ts)`[]>`
Gets the process definitions associated with an app. - _appName:_ `string` - Name of the target app @@ -40,12 +39,12 @@ Gets process definitions and starts processes. - **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`ProcessInstanceCloud`](../../../lib/process-services-cloud/src/lib/process/start-process/models/process-instance-cloud.model.ts)`>` - Details of the process instance just started - **startProcess**(appName: `string`, payload: [`ProcessPayloadCloud`](../../../lib/process-services-cloud/src/lib/process/start-process/models/process-payload-cloud.model.ts)): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`ProcessInstanceCloud`](../../../lib/process-services-cloud/src/lib/process/start-process/models/process-instance-cloud.model.ts)`>`
Starts a process based on a process definition, name, form values or variables. - - _appName:_ `string` - name of the [Application](../../../lib/testing/src/lib/core/structure/application.ts) + - _appName:_ `string` - name of the Application - _payload:_ [`ProcessPayloadCloud`](../../../lib/process-services-cloud/src/lib/process/start-process/models/process-payload-cloud.model.ts) - Details of the process (definition key, name, variables, etc) - **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`ProcessInstanceCloud`](../../../lib/process-services-cloud/src/lib/process/start-process/models/process-instance-cloud.model.ts)`>` - Details of the process instance just started - **updateProcess**(appName: `string`, processInstanceId: `string`, payload: [`ProcessPayloadCloud`](../../../lib/process-services-cloud/src/lib/process/start-process/models/process-payload-cloud.model.ts)): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`ProcessInstanceCloud`](../../../lib/process-services-cloud/src/lib/process/start-process/models/process-instance-cloud.model.ts)`>`
Update an existing process instance - - _appName:_ `string` - name of the [Application](../../../lib/testing/src/lib/core/structure/application.ts) + - _appName:_ `string` - name of the Application - _processInstanceId:_ `string` - process instance to update - _payload:_ [`ProcessPayloadCloud`](../../../lib/process-services-cloud/src/lib/process/start-process/models/process-payload-cloud.model.ts) - Details of the process (definition key, name, variables, etc) - **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`ProcessInstanceCloud`](../../../lib/process-services-cloud/src/lib/process/start-process/models/process-instance-cloud.model.ts)`>` - Details of the process instance just started diff --git a/docs/process-services-cloud/services/task-cloud.service.md b/docs/process-services-cloud/services/task-cloud.service.md index b875cdae2c..1f1db0a056 100644 --- a/docs/process-services-cloud/services/task-cloud.service.md +++ b/docs/process-services-cloud/services/task-cloud.service.md @@ -45,7 +45,6 @@ Manages task cloud. - _appName:_ `string` - - **Returns** `string` - - - **getCandidateGroups**(appName: `string`, taskId: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)``
Gets candidate groups of the task. - _appName:_ `string` - Name of the app @@ -56,6 +55,10 @@ Manages task cloud. - _appName:_ `string` - Name of the app - _taskId:_ `string` - ID of the task - **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`` - Candidate users +- **getProcessDefinitions**(appName: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`ProcessDefinitionCloud`](../../../lib/process-services-cloud/src/lib/models/process-definition-cloud.model.ts)`[]>`
+ Gets the process definitions associated with an app. + - _appName:_ `string` - Name of the target app + - **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`ProcessDefinitionCloud`](../../../lib/process-services-cloud/src/lib/models/process-definition-cloud.model.ts)`[]>` - Array of process definitions - **getTaskById**(appName: `string`, taskId: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`TaskDetailsCloudModel`](../../../lib/process-services-cloud/src/lib/task/start-task/models/task-details-cloud.model.ts)`>`
Gets details of a task. - _appName:_ `string` - Name of the app diff --git a/lib/process-services-cloud/src/lib/i18n/en.json b/lib/process-services-cloud/src/lib/i18n/en.json index a609375fed..85e620e67e 100644 --- a/lib/process-services-cloud/src/lib/i18n/en.json +++ b/lib/process-services-cloud/src/lib/i18n/en.json @@ -126,6 +126,7 @@ "LABEL": { "APP_NAME": "ApplicationName", "TASK_ID": "Task ID", + "PROCESS_DEF_NAME": "ProcessDefinitionName", "PROCESS_DEF_ID": "ProcessDefinitionId", "STATUS": "Status", "ASSIGNMENT": "Assignee", diff --git a/lib/process-services-cloud/src/lib/task/services/task-cloud.service.ts b/lib/process-services-cloud/src/lib/task/services/task-cloud.service.ts index 53af83358d..9507f44790 100644 --- a/lib/process-services-cloud/src/lib/task/services/task-cloud.service.ts +++ b/lib/process-services-cloud/src/lib/task/services/task-cloud.service.ts @@ -22,6 +22,7 @@ import { map } from 'rxjs/operators'; import { TaskDetailsCloudModel, StartTaskCloudResponseModel } from '../start-task/models/task-details-cloud.model'; import { BaseCloudService } from '../../services/base-cloud.service'; import { StartTaskCloudRequestModel } from '../start-task/models/start-task-cloud-request.model'; +import { ProcessDefinitionCloud } from '../../models/process-definition-cloud.model'; @Injectable({ providedIn: 'root' @@ -236,6 +237,26 @@ export class TaskCloudService extends BaseCloudService { } } + /** + * Gets the process definitions associated with an app. + * @param appName Name of the target app + * @returns Array of process definitions + */ + getProcessDefinitions(appName: string): Observable { + if (appName || appName === '') { + const url = `${this.getBasePath(appName)}/rb/v1/process-definitions`; + + return this.get(url).pipe( + map((res: any) => { + return res.list.entries.map((processDefs) => new ProcessDefinitionCloud(processDefs.entry)); + }) + ); + } else { + this.logService.error('AppName is mandatory for querying task'); + return throwError('AppName not configured'); + } + } + private isAssignedToMe(assignee: string): boolean { const currentUser = this.identityUserService.getCurrentUserInfo().username; return assignee === currentUser; diff --git a/lib/process-services-cloud/src/lib/task/task-filters/components/edit-task-filter-cloud.component.spec.ts b/lib/process-services-cloud/src/lib/task/task-filters/components/edit-task-filter-cloud.component.spec.ts index 710e62c050..15f340cfb7 100644 --- a/lib/process-services-cloud/src/lib/task/task-filters/components/edit-task-filter-cloud.component.spec.ts +++ b/lib/process-services-cloud/src/lib/task/task-filters/components/edit-task-filter-cloud.component.spec.ts @@ -31,6 +31,7 @@ import { fakeApplicationInstance } from '../../../app/mock/app-model.mock'; import { TaskFiltersCloudModule } from '../task-filters-cloud.module'; import { EditTaskFilterCloudComponent } from './edit-task-filter-cloud.component'; import { TaskFilterCloudService } from '../services/task-filter-cloud.service'; +import { TaskCloudService } from '../../services/task-cloud.service'; import { TaskFilterDialogCloudComponent } from './task-filter-dialog-cloud.component'; import { fakeFilter } from '../mock/task-filters-cloud.mock'; import { AbstractControl } from '@angular/forms'; @@ -45,6 +46,7 @@ describe('EditTaskFilterCloudComponent', () => { let dialog: MatDialog; let getTaskFilterSpy: jasmine.Spy; let getRunningApplicationsSpy: jasmine.Spy; + let taskService: TaskCloudService; setupTestBed({ imports: [ @@ -63,6 +65,7 @@ describe('EditTaskFilterCloudComponent', () => { component = fixture.componentInstance; service = TestBed.inject(TaskFilterCloudService); appsService = TestBed.inject(AppsProcessCloudService); + taskService = TestBed.inject(TaskCloudService); dialog = TestBed.inject(MatDialog); spyOn(dialog, 'open').and.returnValue({ afterClosed: of({ action: TaskFilterDialogCloudComponent.ACTION_SAVE, @@ -90,6 +93,22 @@ describe('EditTaskFilterCloudComponent', () => { }); }); + it('should fetch process definitions when processDefinitionName filter property is set', async(() => { + const processSpy = spyOn(taskService, 'getProcessDefinitions').and.returnValue(of([{ id: 'fake-id', name: 'fake-name' }])); + fixture.detectChanges(); + component.filterProperties = ['processDefinitionName']; + fixture.detectChanges(); + const taskFilterIdChange = new SimpleChange(null, 'mock-process-filter-id', true); + component.ngOnChanges({ 'id': taskFilterIdChange }); + fixture.detectChanges(); + const controller = component.editTaskFilterForm.get('processDefinitionName'); + fixture.detectChanges(); + fixture.whenStable().then(() => { + expect(processSpy).toHaveBeenCalled(); + expect(controller).toBeDefined(); + }); + })); + it('should display filter name as title', async(() => { const taskFilterIdChange = new SimpleChange(undefined, 'mock-task-filter-id', true); component.ngOnChanges({ 'id': taskFilterIdChange }); diff --git a/lib/process-services-cloud/src/lib/task/task-filters/components/edit-task-filter-cloud.component.ts b/lib/process-services-cloud/src/lib/task/task-filters/components/edit-task-filter-cloud.component.ts index 56422076c2..d8d400cf40 100644 --- a/lib/process-services-cloud/src/lib/task/task-filters/components/edit-task-filter-cloud.component.ts +++ b/lib/process-services-cloud/src/lib/task/task-filters/components/edit-task-filter-cloud.component.ts @@ -31,6 +31,8 @@ import { TranslationService, UserPreferencesService, UserPreferenceValues } from import { AppsProcessCloudService } from '../../../app/services/apps-process-cloud.service'; import { ApplicationInstanceModel } from '../../../app/models/application-instance.model'; import { DateCloudFilterType, DateRangeFilter } from '../../../models/date-cloud-filter.model'; +import { ProcessDefinitionCloud } from '../../../models/process-definition-cloud.model'; +import { TaskCloudService } from '../../services/task-cloud.service'; @Component({ selector: 'adf-cloud-edit-task-filter', @@ -44,6 +46,7 @@ export class EditTaskFilterCloudComponent implements OnInit, OnChanges, OnDestro public static ACTION_DELETE = 'delete'; public static APP_RUNNING_STATUS: string = 'RUNNING'; public static APPLICATION_NAME: string = 'appName'; + public static PROCESS_DEFINITION_NAME: string = 'processDefinitionName'; public static LAST_MODIFIED: string = 'lastModified'; public static SORT: string = 'sort'; public static ORDER: string = 'order'; @@ -116,8 +119,10 @@ export class EditTaskFilterCloudComponent implements OnInit, OnChanges, OnDestro EditTaskFilterCloudComponent.ACTION_SAVE, EditTaskFilterCloudComponent.ACTION_DELETE ]; + allProcessDefinitionNamesOption = { label: 'All', value: '' }; private applicationNames: any[] = []; + private processDefinitionNames: any[] = []; private formHasBeenChanged = false; editTaskFilterForm: FormGroup; taskFilterProperties: TaskFilterProperties[] = []; @@ -134,7 +139,8 @@ export class EditTaskFilterCloudComponent implements OnInit, OnChanges, OnDestro private taskFilterCloudService: TaskFilterCloudService, private dateAdapter: DateAdapter, private userPreferencesService: UserPreferencesService, - private appsProcessCloudService: AppsProcessCloudService) { + private appsProcessCloudService: AppsProcessCloudService, + private taskCloudService: TaskCloudService) { } ngOnInit() { @@ -227,10 +233,14 @@ export class EditTaskFilterCloudComponent implements OnInit, OnChanges, OnDestro createAndFilterProperties() { this.checkMandatoryFilterProperties(); - if (this.checkForApplicationNameProperty()) { + if (this.checkForProperty(EditTaskFilterCloudComponent.APPLICATION_NAME)) { this.applicationNames = []; this.getRunningApplications(); } + if (this.checkForProperty(EditTaskFilterCloudComponent.PROCESS_DEFINITION_NAME)) { + this.processDefinitionNames = []; + this.getProcessDefinitions(); + } const defaultProperties = this.createTaskFilterProperties(this.taskFilter); let filteredProperties = defaultProperties.filter((filterProperty: TaskFilterProperties) => this.isValidProperty(this.filterProperties, filterProperty)); @@ -255,8 +265,8 @@ export class EditTaskFilterCloudComponent implements OnInit, OnChanges, OnDestro return filterProperties ? filterProperties.indexOf(filterProperty.key) >= 0 : true; } - checkForApplicationNameProperty(): boolean { - return this.filterProperties ? this.filterProperties.indexOf(EditTaskFilterCloudComponent.APPLICATION_NAME) >= 0 : false; + checkForProperty(property: string): boolean { + return this.filterProperties ? this.filterProperties.indexOf(property) >= 0 : false; } hasSortProperty(): boolean { @@ -359,6 +369,19 @@ export class EditTaskFilterCloudComponent implements OnInit, OnChanges, OnDestro }); } + getProcessDefinitions() { + this.taskCloudService.getProcessDefinitions(this.appName) + .pipe(takeUntil(this.onDestroy$)) + .subscribe((processDefinitions: ProcessDefinitionCloud[]) => { + if (processDefinitions && processDefinitions.length > 0) { + this.processDefinitionNames.push(this.allProcessDefinitionNamesOption); + processDefinitions.map((processDefinition) => { + this.processDefinitionNames.push({ label: processDefinition.name, value: processDefinition.name }); + }); + } + }); + } + executeFilterActions(action: TaskFilterAction): void { if (action.actionType === EditTaskFilterCloudComponent.ACTION_SAVE) { this.save(action); @@ -567,6 +590,13 @@ export class EditTaskFilterCloudComponent implements OnInit, OnChanges, OnDestro key: 'assignee', value: currentTaskFilter.assignee || '' }), + new TaskFilterProperties({ + label: 'ADF_CLOUD_EDIT_TASK_FILTER.LABEL.PROCESS_DEF_NAME', + type: 'select', + key: 'processDefinitionName', + value: currentTaskFilter.processDefinitionName || '', + options: this.processDefinitionNames + }), new TaskFilterProperties({ label: 'ADF_CLOUD_EDIT_TASK_FILTER.LABEL.PROCESS_INSTANCE_ID', type: 'text', diff --git a/lib/process-services-cloud/src/lib/task/task-filters/models/filter-cloud.model.ts b/lib/process-services-cloud/src/lib/task/task-filters/models/filter-cloud.model.ts index ae24bdbe0a..e41d4ccbb0 100644 --- a/lib/process-services-cloud/src/lib/task/task-filters/models/filter-cloud.model.ts +++ b/lib/process-services-cloud/src/lib/task/task-filters/models/filter-cloud.model.ts @@ -29,6 +29,7 @@ export class TaskFilterCloudModel { assignee: string; order: string; owner: string; + processDefinitionName?: string; processDefinitionId: string; processInstanceId: string; createdDate: Date; @@ -56,6 +57,7 @@ export class TaskFilterCloudModel { this.assignee = obj.assignee || null; this.order = obj.order || null; this.owner = obj.owner || null; + this.processDefinitionName = obj.processDefinitionName || null; this.processDefinitionId = obj.processDefinitionId || null; this.processInstanceId = obj.processInstanceId || null; this.createdDate = obj.createdDate || null; diff --git a/lib/process-services-cloud/src/lib/task/task-list/components/task-list-cloud.component.ts b/lib/process-services-cloud/src/lib/task/task-list/components/task-list-cloud.component.ts index 81b0f738dc..6f32144ce0 100644 --- a/lib/process-services-cloud/src/lib/task/task-list/components/task-list-cloud.component.ts +++ b/lib/process-services-cloud/src/lib/task/task-list/components/task-list-cloud.component.ts @@ -90,6 +90,10 @@ export class TaskListCloudComponent extends DataTableSchema implements OnChanges @Input() parentTaskId: string = ''; + /** Filter the tasks. Display only tasks with processDefinitionName equal to the supplied value. */ + @Input() + processDefinitionName: string = ''; + /** Filter the tasks. Display only tasks with processDefinitionId equal to the supplied value. */ @Input() processDefinitionId: string = ''; @@ -346,6 +350,7 @@ export class TaskListCloudComponent extends DataTableSchema implements OnChanges id: this.id, name: this.name, parentTaskId: this.parentTaskId, + processDefinitionName: this.processDefinitionName, processDefinitionId: this.processDefinitionId, processInstanceId: this.processInstanceId, owner: this.owner, diff --git a/lib/process-services-cloud/src/lib/task/task-list/models/filter-cloud-model.ts b/lib/process-services-cloud/src/lib/task/task-list/models/filter-cloud-model.ts index 6484259266..fb6fcf1252 100644 --- a/lib/process-services-cloud/src/lib/task/task-list/models/filter-cloud-model.ts +++ b/lib/process-services-cloud/src/lib/task/task-list/models/filter-cloud-model.ts @@ -36,6 +36,7 @@ export class TaskQueryCloudRequestModel { standalone?: boolean; priority?: number; processDefinitionId?: string; + processDefinitionName?: string; processInstanceId?: string; status?: string; maxItems: number; @@ -62,6 +63,7 @@ export class TaskQueryCloudRequestModel { this.standalone = obj.standalone; this.priority = obj.priority; this.processDefinitionId = obj.processDefinitionId; + this.processDefinitionName = obj.processDefinitionName; this.processInstanceId = obj.processInstanceId; this.status = obj.status; this.maxItems = obj.maxItems;