[ADF-3841] Improve edit-task-filter-cloud by adding inputs to control filters, sort and actions (#4113)

* [ADF-3841] Improve edit-task-filter-cloud by adding inputs to control filters, sort and actions

* Refactored editTask
* Added translate keys related to the edittask filter
* Created TaskFilterProperties model

* * Refactored Edit Task Filter
* Added method to fetch all running applications

* * Added date validation error message

* * Added css mixin

* * Removed dateError flag
* Used formController error

* * Added default filter properties

* * Refactored appsProcessCloudService
* Added flexlayout to align all filter properties

* * Modified unit test for the recent changes* Added few unit tests* Updated editTaskFilter documentation

* * Rebased with the latest changes  * updated doc * Updated translate keys
This commit is contained in:
siva kumar
2019-01-10 16:45:34 +05:30
committed by Eugenio Romano
parent 8431f0b1f1
commit 6fdd419476
12 changed files with 629 additions and 137 deletions

View File

@@ -24,8 +24,11 @@ Edits Task Filter Details.
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| appName | `string` | | Name of the app. |
| id | `string` | | ID of the task filter. |
| appName | `string` | | (required) Name of the app. |
| id | `string` | "" | (required) The id of the Task filter. |
| filterProperties | `string []` | `['state', 'assignment', 'sort', 'order']` | List of task filter properties to display. |
| toggleFilterActions | `boolean` | `true` | Toggles edit task filter actions. |
| showTitle | `boolean` | `true` | Toggles edit task filter title. |
### Events
@@ -47,4 +50,50 @@ Use the application name and task filter id property to edit task filter propert
</adf-cloud-edit-task-filter>
```
By default these below properties are displayed:
**_state_**, **_assignment_**, **_sort_**, **_order_**.
However, you can also choose which properties to show using a input property
`filterProperties`:
Populate the filterProperties in the component class:
```ts
import { UserProcessModel } from '@alfresco/adf-core';
export class SomeComponent implements OnInit {
filterProperties: string[] = [
"appName",
"processInstanceId",
"createdDateTo",
"lastModifiedTo"];
onFilterChange(filter: TaskFilterCloudModel) {
console.log('On filter change: ', filter);
}
onAction($event: FilterActionType) {
console.log('Clicked action: ', $event);
}
```
With this configuration, only the four listed properties will be shown.
```html
<adf-cloud-edit-task-filter
[id]="taskFilterId"
[appName]="applicationName"
[filterProperties]="filterProperties"
(filterChange)="onFilterChange($event)"
(action)="onAction($event)">
</adf-cloud-edit-task-filter>
```
All Available properties are:
**_appName_**, **_state_**, **_assignment_**, **_sort_**, **_order_**, **_processDefinitionId_**, **_processInstanceId_**, **_dueAfter_**, **_dueBefore_**, **_claimedDateFrom_**, **_claimedDateTo_**, **_createdDateFrom_**, **_createdDateTo_**, **_taskName_**, **_parentTaskId_**, **_priority_**, **_standAlone_**, **_lastModifiedFrom_**, **_lastModifiedTo_**, **_owner_**, **_dueDateFrom_**, **_dueDateTo_**.
![edit-task-filter-cloud](../docassets/images/edit-task-filter-cloud.component.png)