diff --git a/demo-shell/src/app.config.json b/demo-shell/src/app.config.json
index e983422944..0143585c40 100644
--- a/demo-shell/src/app.config.json
+++ b/demo-shell/src/app.config.json
@@ -575,6 +575,12 @@
"state", "assignment", "sort", "order"
]
},
+ "adf-edit-process-filter": {
+ "filterProperties": [ "status", "sort", "order", "processName" ],
+ "sortProperties": [ "id", "name", "status", "startDate" ],
+ "actions": ["save", "saveAs", "delete"]
+
+ },
"content-metadata": {
"presets": {
"default": {
diff --git a/demo-shell/src/app/components/app-layout/cloud/processes-cloud-demo.component.html b/demo-shell/src/app/components/app-layout/cloud/processes-cloud-demo.component.html
index a9e7b786e1..c81c7c78d2 100644
--- a/demo-shell/src/app/components/app-layout/cloud/processes-cloud-demo.component.html
+++ b/demo-shell/src/app/components/app-layout/cloud/processes-cloud-demo.component.html
@@ -2,7 +2,9 @@
diff --git a/demo-shell/src/app/components/app-layout/cloud/processes-cloud-demo.component.ts b/demo-shell/src/app/components/app-layout/cloud/processes-cloud-demo.component.ts
index 9ff71c4c4c..99ec46a3c6 100644
--- a/demo-shell/src/app/components/app-layout/cloud/processes-cloud-demo.component.ts
+++ b/demo-shell/src/app/components/app-layout/cloud/processes-cloud-demo.component.ts
@@ -33,8 +33,8 @@ import { CloudLayoutService } from './services/cloud-layout.service';
})
export class ProcessesCloudDemoComponent implements OnInit {
- public static ACTION_SAVE_AS = 'SAVE_AS';
- static PROCESS_FILTER_PROPERTY_KEYS = 'adf-edit-process-filter.properties';
+ public static ACTION_SAVE_AS = 'saveAs';
+ static PROCESS_FILTER_PROPERTY_KEYS = 'adf-edit-process-filter';
@ViewChild('processCloud')
processCloud: ProcessListCloudComponent;
@@ -52,7 +52,7 @@ export class ProcessesCloudDemoComponent implements OnInit {
selectionMode: string;
selectedRows: string[] = [];
testingMode: boolean;
- processFilterProperties: any[] = [];
+ processFilterProperties: any = { filterProperties: [], sortProperties: [], actions: [] };
editedFilter: ProcessFilterCloudModel;
diff --git a/docs/process-services-cloud/edit-process-filter-cloud.component.md b/docs/process-services-cloud/edit-process-filter-cloud.component.md
index b584f6c63f..4a3d8e1ab5 100644
--- a/docs/process-services-cloud/edit-process-filter-cloud.component.md
+++ b/docs/process-services-cloud/edit-process-filter-cloud.component.md
@@ -20,6 +20,8 @@ Shows Process Filter Details.
- [Details](#details)
- [Editing APS2 process filters](#editing-aps2-process-filters)
- [Filter properties](#filter-properties)
+ - [Sort properties](#sort-properties)
+ - [Action properties](#action-properties)
- [See also](#see-also)
## Basic Usage
@@ -40,17 +42,19 @@ Shows Process Filter Details.
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
+| actions | `string[]` | | List of sort actions. |
| appName | `string` | | The name of the application. |
| filterProperties | `string[]` | | List of process filter properties to display |
| id | `string` | | Id of the process instance filter. |
| showFilterActions | `boolean` | true | Toggles editing of process filter actions. |
| showTitle | `boolean` | true | Toggles editing of the process filter title. |
+| sortProperties | `string[]` | | List of sort properties to display. |
### Events
| Name | Type | Description |
| ---- | ---- | ----------- |
-| action | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`ProcessFilterActionType`](../../lib/process-services-cloud/src/lib/process/process-filters/models/process-filter-cloud.model.ts)`>` | Emitted when a filter action occurs i.e Save, SaveAs, Delete. |
+| action | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`ProcessFilterAction`](../../lib/process-services-cloud/src/lib/process/process-filters/models/process-filter-cloud.model.ts)`>` | Emitted when a filter action occurs i.e Save, SaveAs, Delete. |
| filterChange | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`ProcessFilterCloudModel`](../../lib/process-services-cloud/src/lib/process/process-filters/models/process-filter-cloud.model.ts)`>` | Emitted when a process instance filter property changes. |
## Details
@@ -78,23 +82,21 @@ given below:
| **_processInstanceId_** | Process instance ID |
| **_processName_** | Process name. |
| **_initiator_** | ID of the user who initiated the process |
-| **_state_** | Execution state of the process. |
+| **_status_** | Execution status of the process. |
| **_processDefinitionId_** | Process definition ID |
| **_processDefinitionKey_** | Process definition key |
-| **_lastModifiedFrom_** | Finds processes modified _after_ this date |
-| **_lastModifiedTo_** | Finds processes modified _before_ this date |
+| **_lastModified_** | Date the process was last modified. If lastModified defined the component will show the range **_lastModifiedTo_**, **_lastModifiedFrom_**|
+| **_startDate_** | Date the process was started |
| **_sort_** | Field on which the filter results will be sorted (doesn't participate in the filtering itself). Can be "id", "name", "status" or "startDate". |
| **_order_** | Sort ordering of the filter results (this doesn't participate in the filtering itself) |
-By default, the **_state_**, **_sort_** and **_order_** properties are
+By default, the **_status_**, **_sort_** and **_order_** properties are
displayed in the editor. However, you can also choose which properties
to show using the `filterProperties` array.
For example, the code below initializes the editor with the **_appName_**,
**_processInstanceId_**, **_startDate_** and **_lastModified_** properties:
```ts
-import { UserProcessModel } from '@alfresco/adf-core';
-
export class SomeComponent implements OnInit {
filterProperties: string[] = [
@@ -107,15 +109,94 @@ export class SomeComponent implements OnInit {
console.log('On filter change: ', filter);
}
- onAction($event: ProcessFilterActionType) {
+ onAction($event: ProcessFilterAction) {
console.log('Clicked action: ', $event);
}
```
+```html
+
+
+```
+
With this configuration, only the four listed properties will be shown.
-**Note:** Currently, the `sort` property has a limited set of properties
-to choose from: **_id_**, **_name_**, **_status_** and **_startDate_**.
+### Sort properties
+
+You can supply various _sort properties_ to sort the processes.
+
+By default, the **_id_**, **_name_**, **_status_** and **_startDate_** properties are
+displayed in the editor. However, you can also choose which sort properties
+to show using the `sortProperties` array.
+For example, the code below initializes the editor with the **_startDate_** and **_lastModified_** properties:
+
+```ts
+export class SomeComponent implements OnInit {
+
+ sortProperties: string[] = [
+ "startDate",
+ "lastModified"];
+
+ onFilterChange(filter: ProcessFilterCloudModel) {
+ console.log('On filter change: ', filter);
+ }
+
+ onAction($event: ProcessFilterAction) {
+ console.log('Clicked action: ', $event);
+ }
+```
+
+```html
+
+
+```
+
+With this configuration, only the two listed sort properties will be shown.
+
+### Action properties
+
+You can supply various _actions_ to apply on process filter.
+
+| Name | Description |
+| ---- | ----------- |
+| **_save_** | Save process filter. |
+| **_saveAs_** | Creates a new process filter. |
+| **_delete_** | Delete process filter. |
+
+By default, the **_save_**, **_saveAs_** and **_delete_** actions are
+displayed in the editor. However, you can also choose which actions to
+show using the `actions` array.
+For example, the code below initializes the editor with the **_save_** and **_delete_** actions:
+
+```ts
+export class SomeComponent implements OnInit {
+
+ actions: string[] = ['save', 'delete'];
+
+ onFilterChange(filter: ProcessFilterCloudModel) {
+ console.log('On filter change: ', filter);
+ }
+
+ onAction($event: ProcessFilterAction) {
+ console.log('Clicked action: ', $event);
+ }
+```
+
+```html
+
+
+```
+
+With this configuration, only the two actions will be shown.
## See also
diff --git a/e2e/pages/adf/process-cloud/editProcessFilterCloudComponent.ts b/e2e/pages/adf/process-cloud/editProcessFilterCloudComponent.ts
index 029e36b27b..e924e81516 100644
--- a/e2e/pages/adf/process-cloud/editProcessFilterCloudComponent.ts
+++ b/e2e/pages/adf/process-cloud/editProcessFilterCloudComponent.ts
@@ -46,13 +46,13 @@ export class EditProcessFilterCloudComponent {
return this;
}
- setStateFilterDropDown(option) {
- this.clickOnDropDownArrow('state');
+ setStatusFilterDropDown(option) {
+ this.clickOnDropDownArrow('status');
- let stateElement = element.all(by.cssContainingText('mat-option span', option)).first();
- Util.waitUntilElementIsClickable(stateElement);
- Util.waitUntilElementIsVisible(stateElement);
- stateElement.click();
+ let statusElement = element.all(by.cssContainingText('mat-option span', option)).first();
+ Util.waitUntilElementIsClickable(statusElement);
+ Util.waitUntilElementIsVisible(statusElement);
+ statusElement.click();
return this;
}
diff --git a/e2e/process-services-cloud/process-custom-filters.e2e.ts b/e2e/process-services-cloud/process-custom-filters.e2e.ts
index 7330c6688d..c90ba4c908 100644
--- a/e2e/process-services-cloud/process-custom-filters.e2e.ts
+++ b/e2e/process-services-cloud/process-custom-filters.e2e.ts
@@ -94,7 +94,7 @@ describe('Process list cloud', () => {
});
it('[C290069] Should display processes ordered by name when Name is selected from sort dropdown', async() => {
- processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader().setStateFilterDropDown('RUNNING')
+ processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader().setStatusFilterDropDown('RUNNING')
.setSortFilterDropDown('NAME').setOrderFilterDropDown('ASC');
processCloudDemoPage.processListCloudComponent().getAllRowsNameColumn().then(function (list) {
let initialList = list.slice(0);
@@ -112,7 +112,7 @@ describe('Process list cloud', () => {
});
it('[C291783] Should display processes ordered by id when Id is selected from sort dropdown', async() => {
- processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader().setStateFilterDropDown('RUNNING')
+ processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader().setStatusFilterDropDown('RUNNING')
.setSortFilterDropDown('ID').setOrderFilterDropDown('ASC');
processCloudDemoPage.processListCloudComponent().getDataTable().checkSpinnerIsDisplayed().checkSpinnerIsNotDisplayed();
processCloudDemoPage.getAllRowsByIdColumn().then(function (list) {
diff --git a/lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter-cloud.component.html b/lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter-cloud.component.html
index e242cc3f68..9b97456690 100644
--- a/lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter-cloud.component.html
+++ b/lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter-cloud.component.html
@@ -6,14 +6,8 @@
{{ 'ADF_CLOUD_EDIT_PROCESS_FILTER.TITLE' | translate}}