diff --git a/demo-shell/src/app.config.json b/demo-shell/src/app.config.json
index ac2a175541..482415ac8a 100644
--- a/demo-shell/src/app.config.json
+++ b/demo-shell/src/app.config.json
@@ -587,9 +587,9 @@
}
},
"adf-edit-task-filter": {
- "properties": [
- "state", "assignment", "sort", "order"
- ]
+ "filterProperties": [ "status", "assignee", "sort", "order" ],
+ "sortProperties": [ "id", "name", "createdDate", "priority", "processDefinitionId" ],
+ "actions": [ "save", "saveAs", "delete" ]
},
"adf-edit-process-filter": {
"filterProperties": [ "status", "sort", "order", "processName" ],
diff --git a/demo-shell/src/app/components/app-layout/cloud/tasks-cloud-demo.component.html b/demo-shell/src/app/components/app-layout/cloud/tasks-cloud-demo.component.html
index 4564d37b87..a6d7709655 100644
--- a/demo-shell/src/app/components/app-layout/cloud/tasks-cloud-demo.component.html
+++ b/demo-shell/src/app/components/app-layout/cloud/tasks-cloud-demo.component.html
@@ -2,7 +2,9 @@
@@ -19,8 +21,10 @@
[owner]="editedFilter.owner"
[lastModifiedFrom]="editedFilter.lastModifiedFrom"
[lastModifiedTo]="editedFilter.lastModifiedTo"
- [status]="editedFilter.state"
- [assignee]="editedFilter.assignment"
+ [status]="editedFilter.status"
+ [assignee]="editedFilter.assignee"
+ [createdDate]="editedFilter.createdDate"
+ [dueDate]="editedFilter.dueDate"
[sorting]="sortArray"
[multiselect]="multiselect"
[selectionMode]="selectionMode"
diff --git a/demo-shell/src/app/components/app-layout/cloud/tasks-cloud-demo.component.ts b/demo-shell/src/app/components/app-layout/cloud/tasks-cloud-demo.component.ts
index 1908f1ae52..4cc0058347 100644
--- a/demo-shell/src/app/components/app-layout/cloud/tasks-cloud-demo.component.ts
+++ b/demo-shell/src/app/components/app-layout/cloud/tasks-cloud-demo.component.ts
@@ -27,8 +27,8 @@ import { CloudLayoutService } from './services/cloud-layout.service';
})
export class TasksCloudDemoComponent implements OnInit {
- public static ACTION_SAVE_AS = 'SAVE_AS';
- static TASK_FILTER_PROPERTY_KEYS = 'adf-edit-task-filter.properties';
+ public static ACTION_SAVE_AS = 'saveAs';
+ static TASK_FILTER_PROPERTY_KEYS = 'adf-edit-task-filter';
@ViewChild('taskCloud')
taskCloud: TaskListCloudComponent;
@@ -41,7 +41,7 @@ export class TasksCloudDemoComponent implements OnInit {
sortArray: TaskListCloudSortingModel[];
editedFilter: TaskFilterCloudModel;
- taskFilterProperties: any[] = [];
+ taskFilterProperties: any = { filterProperties: [], sortProperties: [], actions: [] };
filterId;
multiselect: boolean;
diff --git a/docs/process-services-cloud/components/edit-task-filter-cloud.component.md b/docs/process-services-cloud/components/edit-task-filter-cloud.component.md
index f76e364301..67c2f76283 100644
--- a/docs/process-services-cloud/components/edit-task-filter-cloud.component.md
+++ b/docs/process-services-cloud/components/edit-task-filter-cloud.component.md
@@ -41,7 +41,7 @@ Edits Task Filter Details.
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| appName | `string` | | (required) Name of the app. |
-| filterProperties | `string[]` | | List of task filter properties to display. |
+| filterProperties | `string []` | `['status', 'assignee', 'sort', 'order']` | List of task filter properties to display. |
| id | `string` | | (required) ID of the task filter. |
| showFilterActions | `boolean` | true | Toggles the filter actions. |
| showTitle | `boolean` | true | Toggles the title. |
@@ -50,7 +50,7 @@ Edits Task Filter Details.
| Name | Type | Description |
| ---- | ---- | ----------- |
-| action | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`FilterActionType`](../../../lib/process-services-cloud/src/lib/task/task-filters/models/filter-cloud.model.ts)`>` | Emitted when a filter action occurs (i.e Save, Save As, Delete). |
+| action | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`TaskFilterAction`](../../../lib/process-services-cloud/src/lib/task/task-filters/models/filter-cloud.model.ts)`>` | Emitted when a filter action occurs (i.e Save, Save As, Delete). |
| filterChange | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`TaskFilterCloudModel`](../../../lib/process-services-cloud/src/lib/task/task-filters/models/filter-cloud.model.ts)`>` | Emitted when a task filter property changes. |
## Details
@@ -80,21 +80,22 @@ given below:
| **_taskName_** | Name of the task |
| **_parentTaskId_** | ID of the task's parent task |
| **_priority_** | Task priority |
+| **_createdDate_** | Date the task was created |
| **_standAlone_** | Standalone status of the task |
| **_owner_** | User ID of the task's owner |
| **_processDefinitionId_** | Process definition ID |
| **_processDefinitionKey_** | Process definition key |
| **_processInstanceId_** | Process instance ID |
-| **_lastModifiedFrom_** | Finds tasks modified _after_ this date |
-| **_lastModifiedTo_** | Finds tasks modified _before_ this date |
+| **_lastModified_** | Date the task was last modified. If lastModified defined the component will show the range **_lastModifiedFrom_**, **_lastModifiedTo_**|
| **_sort_** | Field on which the filter results will be sorted (doesn't participate in the filtering itself). Can be "id", "name", "createdDate", "priority", "processDefinitionId". |
| **_order_** | Sort ordering of the filter results it can be ASC or DESC (doesn't participate in the filtering itself). |
-By default, the **_state_**, **_assignment_**, **_sort_** and **_order_** properties
+
+By default, the **_status_**, **_assignee_**, **_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
-**_lastModifiedTo_** properties:
+the editor with the **_appName_**, **_processInstanceId_**, **_createdDate_** and
+**_lastModified_** properties:
```ts
import { UserProcessModel } from '@alfresco/adf-core';
@@ -104,22 +105,95 @@ export class SomeComponent implements OnInit {
filterProperties: string[] = [
"appName",
"processInstanceId",
- "startDate",
- "lastModifiedTo"];
+ "createdDate",
+ "lastModified"];
onFilterChange(filter: TaskFilterCloudModel) {
console.log('On filter change: ', filter);
}
- onAction($event: FilterActionType) {
+ onAction($event: TaskFilterAction) {
console.log('Clicked action: ', $event);
}
```
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 tasks.
+
+By default, the **_id_**, **_name_**, **_createdDate_** and **_priority_** 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 **_createdDate_** , **_lastModified_** and **_priority_** properties:
+
+```ts
+
+export class SomeComponent implements OnInit {
+
+ sortProperties: string[] = [
+ "createdDate",
+ "lastModified",
+ "priority"];
+
+ onFilterChange(filter: TaskFilterCloudModel) {
+ console.log('On filter change: ', filter);
+ }
+
+ onAction($event: TaskFilterAction) {
+ console.log('Clicked action: ', $event);
+ }
+```
+```html
+
+
+```
+With this configuration, only the three listed sort properties will be shown.
+
+### Action properties
+
+You can supply various *actions* to apply on task filter.
+
+| Name | Description |
+| -- | -- |
+| **_save_** | Save task filter. |
+| **_saveAs_** | Creates a new task filter. |
+| **_delete_** | Delete task 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: TaskFilterCloudModel) {
+ console.log('On filter change: ', filter);
+ }
+
+ onAction($event: TaskFilterAction) {
+ 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/editTaskFilterCloudComponent.ts b/e2e/pages/adf/process-cloud/editTaskFilterCloudComponent.ts
index aa81c275c3..101bf49bcd 100644
--- a/e2e/pages/adf/process-cloud/editTaskFilterCloudComponent.ts
+++ b/e2e/pages/adf/process-cloud/editTaskFilterCloudComponent.ts
@@ -23,7 +23,7 @@ export class EditTaskFilterCloudComponent {
customiseFilter = element(by.id('adf-edit-task-filter-title-id'));
selectedOption = element.all(by.css('mat-option[class*="mat-selected"]')).first();
- assignment = element(by.css('input[data-automation-id="adf-cloud-edit-task-property-assignment"]'));
+ assignee = element(by.css('input[data-automation-id="adf-cloud-edit-task-property-assignee"]'));
priority = element(by.css('input[data-automation-id="adf-cloud-edit-task-property-priority"]'));
taskName = element(by.css('input[data-automation-id="adf-cloud-edit-task-property-taskName"]'));
processDefinitionId = element(by.css('input[data-automation-id="adf-cloud-edit-task-property-processDefinitionId"]'));
@@ -32,9 +32,9 @@ export class EditTaskFilterCloudComponent {
lastModifiedTo = element(by.css('input[data-automation-id="adf-cloud-edit-task-property-lastModifiedTo"]'));
parentTaskId = element(by.css('input[data-automation-id="adf-cloud-edit-task-property-parentTaskId"]'));
owner = element(by.css('input[data-automation-id="adf-cloud-edit-task-property-owner"]'));
- saveButton = element(by.css('button[id="adf-save-id"]'));
- saveAsButton = element(by.css('button[id="adf-save-as-id"]'));
- deleteButton = element(by.css('button[id="adf-delete-id"]'));
+ saveButton = element(by.css('[data-automation-id="adf-filter-action-save"]'));
+ saveAsButton = element(by.css('[data-automation-id="adf-filter-action-saveAs"]'));
+ deleteButton = element(by.css('[data-automation-id="adf-filter-action-delete"]'));
editTaskFilter = new EditTaskFilterDialog();
@@ -48,18 +48,18 @@ export class EditTaskFilterCloudComponent {
return this;
}
- setStateFilterDropDown(option) {
- this.clickOnDropDownArrow('state');
+ setStatusFilterDropDown(option) {
+ this.clickOnDropDownArrow('status');
- let stateElement = element.all(by.cssContainingText('mat-option span', option)).first();
- Util.waitUntilElementIsVisible(stateElement);
- Util.waitUntilElementIsClickable(stateElement);
- stateElement.click();
+ let statusElement = element.all(by.cssContainingText('mat-option span', option)).first();
+ Util.waitUntilElementIsVisible(statusElement);
+ Util.waitUntilElementIsClickable(statusElement);
+ statusElement.click();
return this;
}
- getStateFilterDropDownValue() {
- return element.all(by.css("mat-select[data-automation-id='adf-cloud-edit-task-property-state'] span")).first().getText();
+ getStatusFilterDropDownValue() {
+ return element.all(by.css("mat-select[data-automation-id='adf-cloud-edit-task-property-status'] span")).first().getText();
}
setSortFilterDropDown(option) {
@@ -99,12 +99,12 @@ export class EditTaskFilterCloudComponent {
Util.waitUntilElementIsVisible(this.selectedOption);
}
- setAssignment(option) {
- return this.setProperty('assignment', option);
+ setAssignee(option) {
+ return this.setProperty('assignee', option);
}
- getAssignment() {
- return this.assignment.getText();
+ getAssignee() {
+ return this.assignee.getText();
}
setPriority(option) {
@@ -200,8 +200,8 @@ export class EditTaskFilterCloudComponent {
return this;
}
- clearAssignment() {
- this.clearField(this.assignment);
+ clearAssignee() {
+ this.clearField(this.assignee);
return this;
}
diff --git a/e2e/process-services-cloud/edit-task-filters-component.e2e.ts b/e2e/process-services-cloud/edit-task-filters-component.e2e.ts
index 978eb5c9b4..f0d95007b6 100644
--- a/e2e/process-services-cloud/edit-task-filters-component.e2e.ts
+++ b/e2e/process-services-cloud/edit-task-filters-component.e2e.ts
@@ -71,7 +71,7 @@ describe('Edit task filters cloud', () => {
tasksCloudDemoPage.editTaskFilterCloudComponent().clickCustomiseFilterHeader();
tasksCloudDemoPage.myTasksFilter().checkTaskFilterIsDisplayed();
expect(tasksCloudDemoPage.getActiveFilterName()).toBe('My Tasks');
- expect(tasksCloudDemoPage.editTaskFilterCloudComponent().getStateFilterDropDownValue()).toEqual('ASSIGNED');
+ expect(tasksCloudDemoPage.editTaskFilterCloudComponent().getStatusFilterDropDownValue()).toEqual('ASSIGNED');
expect(tasksCloudDemoPage.editTaskFilterCloudComponent().getSortFilterDropDownValue()).toEqual('Created Date');
expect(tasksCloudDemoPage.editTaskFilterCloudComponent().getOrderFilterDropDownValue()).toEqual('DESC');
tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(assignedTaskName);
@@ -79,7 +79,7 @@ describe('Edit task filters cloud', () => {
tasksCloudDemoPage.completedTasksFilter().clickTaskFilter();
expect(tasksCloudDemoPage.getActiveFilterName()).toBe('Completed Tasks');
- expect(tasksCloudDemoPage.editTaskFilterCloudComponent().getStateFilterDropDownValue()).toEqual('COMPLETED');
+ expect(tasksCloudDemoPage.editTaskFilterCloudComponent().getStatusFilterDropDownValue()).toEqual('COMPLETED');
expect(tasksCloudDemoPage.editTaskFilterCloudComponent().getSortFilterDropDownValue()).toEqual('Created Date');
expect(tasksCloudDemoPage.editTaskFilterCloudComponent().getOrderFilterDropDownValue()).toEqual('DESC');
tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedByName(assignedTaskName);
diff --git a/e2e/process-services-cloud/start-task-custom-app-cloud.e2e.ts b/e2e/process-services-cloud/start-task-custom-app-cloud.e2e.ts
index 30664fcd71..388f0bdea5 100644
--- a/e2e/process-services-cloud/start-task-custom-app-cloud.e2e.ts
+++ b/e2e/process-services-cloud/start-task-custom-app-cloud.e2e.ts
@@ -138,8 +138,8 @@ describe('Start Task', () => {
startTask.checkStartButtonIsEnabled();
tasksCloudDemoPage.editTaskFilterCloudComponent()
.clickCustomiseFilterHeader()
- .setStateFilterDropDown('CREATED')
- .clearAssignment();
+ .setStatusFilterDropDown('CREATED')
+ .clearAssignee();
tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(unassignedTaskName);
});
@@ -152,8 +152,8 @@ describe('Start Task', () => {
startTask.clickStartButton();
tasksCloudDemoPage.editTaskFilterCloudComponent()
.clickCustomiseFilterHeader()
- .clearAssignment()
- .setStateFilterDropDown('CREATED');
+ .clearAssignee()
+ .setStatusFilterDropDown('CREATED');
tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitForTableBody();
tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(unassignedTaskName);
let taskId = tasksCloudDemoPage.taskListCloudComponent().getIdCellValue(unassignedTaskName);
diff --git a/e2e/process-services-cloud/task-list-properties.e2e.ts b/e2e/process-services-cloud/task-list-properties.e2e.ts
index 4ebf1fe230..7fa63c439e 100644
--- a/e2e/process-services-cloud/task-list-properties.e2e.ts
+++ b/e2e/process-services-cloud/task-list-properties.e2e.ts
@@ -83,7 +83,7 @@ describe('Edit task filters and task list properties', () => {
browser.driver.sleep(5000);
configEditorPage.enterConfiguration('{' +
'"properties": [' +
- '"appName",' + '"state",' + '"assignment",' +
+ '"appName",' + '"status",' + '"assignee",' +
'"taskName",' + '"parentTaskId",' + '"priority",' +
'"standAlone",' + '"owner",' + '"processDefinitionId",' + '"processInstanceId",' +
'"lastModifiedFrom",' + '"lastModifiedTo",' + '"sort",' + '"order"' +
@@ -163,7 +163,7 @@ describe('Edit task filters and task list properties', () => {
expect(tasksCloudDemoPage.getActiveFilterName()).toBe('My Tasks');
tasksCloudDemoPage.editTaskFilterCloudComponent().setProcessInstanceId(processInstance.entry.id)
- .setStateFilterDropDown('ALL').clearAssignment();
+ .setStatusFilterDropDown('ALL').clearAssignee();
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsDisplayed();
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsNotDisplayed();
@@ -184,7 +184,7 @@ describe('Edit task filters and task list properties', () => {
tasksCloudDemoPage.myTasksFilter().checkTaskFilterIsDisplayed();
expect(tasksCloudDemoPage.getActiveFilterName()).toBe('My Tasks');
- tasksCloudDemoPage.editTaskFilterCloudComponent().setAssignment('admin.adf');
+ tasksCloudDemoPage.editTaskFilterCloudComponent().setAssignee('admin.adf');
tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(createdTask.entry.name);
tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedByName(notAssigned.entry.name);
@@ -194,7 +194,7 @@ describe('Edit task filters and task list properties', () => {
tasksCloudDemoPage.myTasksFilter().checkTaskFilterIsDisplayed();
expect(tasksCloudDemoPage.getActiveFilterName()).toBe('My Tasks');
- tasksCloudDemoPage.editTaskFilterCloudComponent().setAssignment('invalid');
+ tasksCloudDemoPage.editTaskFilterCloudComponent().setAssignee('invalid');
expect(tasksCloudDemoPage.taskListCloudComponent().getNoTasksFoundMessage()).toEqual(noTasksFoundMessage);
});
@@ -232,7 +232,7 @@ describe('Edit task filters and task list properties', () => {
tasksCloudDemoPage.myTasksFilter().checkTaskFilterIsDisplayed();
expect(tasksCloudDemoPage.getActiveFilterName()).toBe('My Tasks');
- tasksCloudDemoPage.editTaskFilterCloudComponent().setStateFilterDropDown('ALL').clearAssignment().setOwner('admin.adf');
+ tasksCloudDemoPage.editTaskFilterCloudComponent().setStatusFilterDropDown('ALL').clearAssignee().setOwner('admin.adf');
tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(notAssigned.entry.name);
tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(createdTask.entry.name);
diff --git a/e2e/process-services-cloud/tasks-custom-filters.e2e.ts b/e2e/process-services-cloud/tasks-custom-filters.e2e.ts
index 84fe45c216..e03f97f059 100644
--- a/e2e/process-services-cloud/tasks-custom-filters.e2e.ts
+++ b/e2e/process-services-cloud/tasks-custom-filters.e2e.ts
@@ -93,8 +93,8 @@ describe('Task filters cloud', () => {
done();
});
- it('[C290045] Should display only tasks with Assigned state when Assigned is selected from state dropdown', () => {
- tasksCloudDemoPage.editTaskFilterCloudComponent().clickCustomiseFilterHeader().setStateFilterDropDown('ASSIGNED');
+ it('[C290045] Should display only tasks with Assigned status when Assigned is selected from status dropdown', () => {
+ tasksCloudDemoPage.editTaskFilterCloudComponent().clickCustomiseFilterHeader().setStatusFilterDropDown('ASSIGNED');
tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(assignedTaskName);
tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedByName(createdTaskName);
@@ -102,10 +102,10 @@ describe('Task filters cloud', () => {
tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedByName(deletedTaskName);
});
- it('[C290061] Should display only tasks with Completed state when Completed is selected from state dropdown', () => {
+ it('[C290061] Should display only tasks with Completed status when Completed is selected from status dropdown', () => {
tasksCloudDemoPage.editTaskFilterCloudComponent()
.clickCustomiseFilterHeader()
- .setStateFilterDropDown('COMPLETED');
+ .setStatusFilterDropDown('COMPLETED');
tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(completedTaskName);
tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedByName(assignedTaskName);
@@ -113,9 +113,9 @@ describe('Task filters cloud', () => {
tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedByName(deletedTaskName);
});
- it('[C290139] Should display only tasks with all states when All is selected from state dropdown', () => {
- tasksCloudDemoPage.editTaskFilterCloudComponent().clickCustomiseFilterHeader().clearAssignment()
- .setStateFilterDropDown('ALL');
+ it('[C290139] Should display only tasks with all statuses when All is selected from status dropdown', () => {
+ tasksCloudDemoPage.editTaskFilterCloudComponent().clickCustomiseFilterHeader().clearAssignee()
+ .setStatusFilterDropDown('ALL');
tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(deletedTaskName);
tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(assignedTaskName);
@@ -123,9 +123,9 @@ describe('Task filters cloud', () => {
tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(completedTaskName);
});
- it('[C290154] Should display only tasks with suspended states when Suspended is selected from state dropdown', () => {
- tasksCloudDemoPage.editTaskFilterCloudComponent().clickCustomiseFilterHeader().clearAssignment()
- .setStateFilterDropDown('SUSPENDED');
+ it('[C290154] Should display only tasks with suspended statuses when Suspended is selected from status dropdown', () => {
+ tasksCloudDemoPage.editTaskFilterCloudComponent().clickCustomiseFilterHeader().clearAssignee()
+ .setStatusFilterDropDown('SUSPENDED');
tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedById(suspendedTasks.list.entries[0].entry.id);
tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedByName(deletedTaskName);
tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedByName(createdTaskName);
@@ -133,8 +133,8 @@ describe('Task filters cloud', () => {
tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedByName(assignedTaskName);
});
- it('[C290060] Should display only tasks with Created state when Created is selected from state dropdown', () => {
- tasksCloudDemoPage.editTaskFilterCloudComponent().clickCustomiseFilterHeader().clearAssignment().setStateFilterDropDown('CREATED');
+ it('[C290060] Should display only tasks with Created status when Created is selected from status dropdown', () => {
+ tasksCloudDemoPage.editTaskFilterCloudComponent().clickCustomiseFilterHeader().clearAssignee().setStatusFilterDropDown('CREATED');
tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(createdTaskName);
tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedByName(assignedTaskName);
tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedByName(completedTaskName);
@@ -142,7 +142,7 @@ describe('Task filters cloud', () => {
});
it('[C290069] Should display tasks ordered by name when Name is selected from sort dropdown', () => {
- tasksCloudDemoPage.editTaskFilterCloudComponent().clickCustomiseFilterHeader().setStateFilterDropDown('ASSIGNED')
+ tasksCloudDemoPage.editTaskFilterCloudComponent().clickCustomiseFilterHeader().setStatusFilterDropDown('ASSIGNED')
.setSortFilterDropDown('NAME').setOrderFilterDropDown('ASC');
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsDisplayed();
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsNotDisplayed();
@@ -168,7 +168,7 @@ describe('Task filters cloud', () => {
});
it('[C290156] Should display tasks ordered by id when Id is selected from sort dropdown', () => {
- tasksCloudDemoPage.editTaskFilterCloudComponent().clickCustomiseFilterHeader().setStateFilterDropDown('ASSIGNED')
+ tasksCloudDemoPage.editTaskFilterCloudComponent().clickCustomiseFilterHeader().setStatusFilterDropDown('ASSIGNED')
.setSortFilterDropDown('ID').setOrderFilterDropDown('ASC');
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsDisplayed();
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsNotDisplayed();
diff --git a/lib/process-services-cloud/src/lib/i18n/en.json b/lib/process-services-cloud/src/lib/i18n/en.json
index 8cd8599f4a..a0f0665cd2 100644
--- a/lib/process-services-cloud/src/lib/i18n/en.json
+++ b/lib/process-services-cloud/src/lib/i18n/en.json
@@ -114,7 +114,7 @@
"APP_NAME": "ApplicationName",
"PROCESS_DEF_ID": "ProcessDefinitionId",
"STATUS": "Status",
- "ASSIGNMENT": "Assignment",
+ "ASSIGNMENT": "Assignee",
"DIRECTION": "Direction",
"PROCESS_INSTANCE_ID": "ProcessInstanceId",
"TASK_NAME": "TaskName",
@@ -124,8 +124,9 @@
"LAST_MODIFIED_FROM": "LastModifiedFrom",
"LAST_MODIFIED_TO": "LastModifiedTo",
"OWNER": "Owner",
-
- "SORT": "Sort"
+ "DUE_DATE": "DueDate",
+ "SORT": "Sort",
+ "START_DATE": "StartDate"
},
"DIALOG": {
"TITLE": "Save filter as",
@@ -139,7 +140,7 @@
"APP_NAME": "ApplicationName",
"STATUS": "Status",
"INITIATOR": "Initiator",
- "ASSIGNMENT": "Assignment",
+ "ASSIGNMENT": "Assignee",
"SORT": "Sort",
"DIRECTION": "Direction",
"PROCESS_DEF_ID": "ProcessDefinitionId",
diff --git a/lib/process-services-cloud/src/lib/task/task-filters/components/edit-task-filter-cloud.component.html b/lib/process-services-cloud/src/lib/task/task-filters/components/edit-task-filter-cloud.component.html
index 084c9a9fc5..0f17cab0f7 100644
--- a/lib/process-services-cloud/src/lib/task/task-filters/components/edit-task-filter-cloud.component.html
+++ b/lib/process-services-cloud/src/lib/task/task-filters/components/edit-task-filter-cloud.component.html
@@ -6,14 +6,8 @@
{{ 'ADF_CLOUD_EDIT_TASK_FILTER.TITLE' | translate}}
-
-
-
@@ -27,7 +21,7 @@
placeholder="{{taskFilterProperty.label | translate}}"
[formControlName]="taskFilterProperty.key"
[attr.data-automation-id]="'adf-cloud-edit-task-property-' + taskFilterProperty.key">
-
+
{{ propertyOption.label }}
@@ -50,8 +44,8 @@
[(ngModel)]="dateFilter[taskFilterProperty.key]"
[ngModelOptions]="{standalone: true}"
[attr.data-automation-id]="'adf-cloud-edit-task-property-' + taskFilterProperty.key">
-
-
+
+
{{'ADF_TASK_LIST.START_TASK.FORM.ERROR.DATE'|translate}}
@@ -59,6 +53,14 @@
+
+
+ {{taskFilterProperty.label | translate}}
+
+
diff --git a/lib/process-services-cloud/src/lib/task/task-filters/components/edit-task-filter-cloud.component.scss b/lib/process-services-cloud/src/lib/task/task-filters/components/edit-task-filter-cloud.component.scss
index 6934382cf3..a0d88621bc 100644
--- a/lib/process-services-cloud/src/lib/task/task-filters/components/edit-task-filter-cloud.component.scss
+++ b/lib/process-services-cloud/src/lib/task/task-filters/components/edit-task-filter-cloud.component.scss
@@ -2,6 +2,12 @@
$warn: map-get($theme, warn);
+ .adf-edit-task-filter-checkbox {
+ font-size: 16px;
+ padding-top: 10px;
+ text-align: center;
+ }
+
.adf-edit-task-filter-date-error-container {
position: absolute;
height: 20px;
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 0c797e2310..c7c1afe197 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
@@ -26,11 +26,11 @@ import { of } from 'rxjs';
import { ProcessServiceCloudTestingModule } from '../../../testing/process-service-cloud.testing.module';
import { AppsProcessCloudService } from '../../../app/services/apps-process-cloud.service';
import { fakeApplicationInstance } from '../../../app/mock/app-model.mock';
-import { TaskFilterCloudModel } from '../models/filter-cloud.model';
import { TaskFiltersCloudModule } from '../task-filters-cloud.module';
import { EditTaskFilterCloudComponent } from './edit-task-filter-cloud.component';
import { TaskFilterCloudService } from '../services/task-filter-cloud.service';
import { TaskFilterDialogCloudComponent } from './task-filter-dialog-cloud.component';
+import { fakeFilter } from '../mock/task-filters-cloud.mock';
describe('EditTaskFilterCloudComponent', () => {
let component: EditTaskFilterCloudComponent;
@@ -41,18 +41,6 @@ describe('EditTaskFilterCloudComponent', () => {
let getTaskFilterSpy: jasmine.Spy;
let getRunningApplicationsSpy: jasmine.Spy;
- let fakeFilter = new TaskFilterCloudModel({
- name: 'FakeInvolvedTasks',
- icon: 'adjust',
- id: 'mock-task-filter-id',
- state: 'CREATED',
- appName: 'mock-app-name',
- processDefinitionId: 'process-def-id',
- assignment: 'fake-involved',
- order: 'ASC',
- sort: 'id'
- });
-
setupTestBed({
imports: [ProcessServiceCloudTestingModule, TaskFiltersCloudModule],
providers: [MatDialog]
@@ -86,7 +74,7 @@ describe('EditTaskFilterCloudComponent', () => {
expect(getTaskFilterSpy).toHaveBeenCalled();
expect(component.taskFilter.name).toEqual('FakeInvolvedTasks');
expect(component.taskFilter.icon).toEqual('adjust');
- expect(component.taskFilter.state).toEqual('CREATED');
+ expect(component.taskFilter.status).toEqual('CREATED');
expect(component.taskFilter.order).toEqual('ASC');
expect(component.taskFilter.sort).toEqual('id');
});
@@ -119,20 +107,20 @@ describe('EditTaskFilterCloudComponent', () => {
it('should create editTaskFilter form with default properties', async(() => {
fixture.detectChanges();
fixture.whenStable().then(() => {
- const stateController = component.editTaskFilterForm.get('state');
+ const stateController = component.editTaskFilterForm.get('status');
const sortController = component.editTaskFilterForm.get('sort');
const orderController = component.editTaskFilterForm.get('order');
- const assignmentController = component.editTaskFilterForm.get('assignment');
+ const assigneeController = component.editTaskFilterForm.get('assignee');
expect(component.editTaskFilterForm).toBeDefined();
expect(stateController).toBeDefined();
expect(sortController).toBeDefined();
expect(orderController).toBeDefined();
- expect(assignmentController).toBeDefined();
+ expect(assigneeController).toBeDefined();
expect(stateController.value).toBe('CREATED');
expect(sortController.value).toBe('id');
expect(orderController.value).toBe('ASC');
- expect(assignmentController.value).toBe('fake-involved');
+ expect(assigneeController.value).toBe('fake-involved');
});
}));
@@ -142,7 +130,7 @@ describe('EditTaskFilterCloudComponent', () => {
expansionPanel.click();
fixture.detectChanges();
fixture.whenStable().then(() => {
- let saveButton = fixture.debugElement.nativeElement.querySelector('#adf-save-id');
+ let saveButton = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-filter-action-save"]');
expect(saveButton.disabled).toBe(true);
});
}));
@@ -153,7 +141,7 @@ describe('EditTaskFilterCloudComponent', () => {
expansionPanel.click();
fixture.detectChanges();
fixture.whenStable().then(() => {
- let saveButton = fixture.debugElement.nativeElement.querySelector('#adf-save-as-id');
+ let saveButton = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-filter-action-saveAs"]');
expect(saveButton.disabled).toBe(true);
});
}));
@@ -165,7 +153,7 @@ describe('EditTaskFilterCloudComponent', () => {
expansionPanel.click();
fixture.detectChanges();
fixture.whenStable().then(() => {
- let deleteButton = fixture.debugElement.nativeElement.querySelector('#adf-delete-id');
+ let deleteButton = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-filter-action-delete"]');
expect(deleteButton.disabled).toBe(false);
});
}));
@@ -176,26 +164,26 @@ describe('EditTaskFilterCloudComponent', () => {
let expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header');
expansionPanel.click();
fixture.detectChanges();
- let stateElement = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-cloud-edit-task-property-state"]');
- let assignmentElement = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-cloud-edit-task-property-assignment"]');
+ let stateElement = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-cloud-edit-task-property-status"]');
+ let assigneeElement = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-cloud-edit-task-property-assignee"]');
let sortElement = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-cloud-edit-task-property-sort"]');
let orderElement = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-cloud-edit-task-property-order"]');
expect(stateElement).toBeDefined();
- expect(assignmentElement).toBeDefined();
+ expect(assigneeElement).toBeDefined();
expect(sortElement).toBeDefined();
expect(orderElement).toBeDefined();
expect(stateElement.textContent.trim()).toBe('CREATED');
- expect(sortElement.textContent.trim()).toBe('ID');
+ expect(sortElement.textContent.trim()).toBe('Id');
expect(orderElement.textContent.trim()).toBe('ASC');
});
}));
- it('should display state drop down', async(() => {
+ it('should display status drop down', async(() => {
fixture.detectChanges();
let expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header');
expansionPanel.click();
fixture.detectChanges();
- let stateElement = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-cloud-edit-task-property-state"] .mat-select-trigger');
+ let stateElement = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-cloud-edit-task-property-status"] .mat-select-trigger');
stateElement.click();
fixture.detectChanges();
fixture.whenStable().then(() => {
@@ -214,7 +202,7 @@ describe('EditTaskFilterCloudComponent', () => {
fixture.detectChanges();
fixture.whenStable().then(() => {
const sortOptions = fixture.debugElement.queryAll(By.css('.mat-option-text'));
- expect(sortOptions.length).toEqual(5);
+ expect(sortOptions.length).toEqual(4);
});
}));
@@ -237,7 +225,7 @@ describe('EditTaskFilterCloudComponent', () => {
component.ngOnChanges({ 'id': taskFilterIDchange});
component.filterProperties = [];
fixture.detectChanges();
- const stateController = component.editTaskFilterForm.get('state');
+ const stateController = component.editTaskFilterForm.get('status');
const sortController = component.editTaskFilterForm.get('sort');
const orderController = component.editTaskFilterForm.get('order');
fixture.whenStable().then(() => {
@@ -253,15 +241,9 @@ describe('EditTaskFilterCloudComponent', () => {
expect(orderController.value).toBe('ASC');
});
}));
- });
-
- describe('Task filterProperties', () => {
-
- beforeEach(() => {
- component.filterProperties = ['appName', 'processInstanceId', 'priority'];
- });
it('should able to fetch running applications when appName property defined in the input', async(() => {
+ component.filterProperties = ['appName', 'processInstanceId', 'priority'];
fixture.detectChanges();
let taskFilterIDchange = new SimpleChange(undefined, 'mock-task-filter-id', true);
component.ngOnChanges({ 'id': taskFilterIDchange});
@@ -273,26 +255,141 @@ describe('EditTaskFilterCloudComponent', () => {
expect(appController.value).toBe('mock-app-name');
});
}));
+ });
- it('should able to build a editTaskFilter form with given input properties', async(() => {
- fixture.detectChanges();
- getTaskFilterSpy.and.returnValue({ appName: 'mock-app-name', processInstanceId: 'process-instance-id', priority: '12' });
+ describe('sort properties', () => {
+
+ it('should display default sort properties', async(() => {
let taskFilterIDchange = new SimpleChange(undefined, 'mock-task-filter-id', true);
component.ngOnChanges({ 'id': taskFilterIDchange});
fixture.detectChanges();
- const appController = component.editTaskFilterForm.get('appName');
- const priorityController = component.editTaskFilterForm.get('priority');
- const processInsIdController = component.editTaskFilterForm.get('processInstanceId');
+ let expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header');
+ expansionPanel.click();
+ fixture.detectChanges();
+ let sortElement = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-cloud-edit-task-property-sort"]');
+ sortElement.click();
fixture.detectChanges();
fixture.whenStable().then(() => {
- fixture.detectChanges();
- expect(component.taskFilterProperties).toBeDefined();
- expect(component.editTaskFilterForm).toBeDefined();
- expect(component.taskFilterProperties.length).toBe(3);
- expect(appController).toBeDefined();
- expect(priorityController.value).toBe('12');
- expect(processInsIdController).toBeDefined();
- expect(appController.value).toBe('mock-app-name');
+ const sortController = component.editTaskFilterForm.get('sort');
+ const sortOptions = fixture.debugElement.queryAll(By.css('.mat-option-text'));
+ expect(sortController).toBeDefined();
+ expect(sortController.value).toBe('id');
+ expect(sortOptions.length).toEqual(4);
+ });
+ }));
+
+ it('should display sort properties when sort properties are specified', async(() => {
+ component.sortProperties = ['id', 'name', 'processInstanceId'];
+ getTaskFilterSpy.and.returnValue({ sort: 'my-custom-sort', processInstanceId: 'process-instance-id', priority: '12' });
+ fixture.detectChanges();
+ let taskFilterIDchange = new SimpleChange(undefined, 'mock-task-filter-id', true);
+ component.ngOnChanges({ 'id': taskFilterIDchange});
+ fixture.detectChanges();
+ let expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header');
+ expansionPanel.click();
+ fixture.detectChanges();
+ let sortElement = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-cloud-edit-task-property-sort"]');
+ sortElement.click();
+ fixture.detectChanges();
+ fixture.whenStable().then(() => {
+ const sortController = component.editTaskFilterForm.get('sort');
+ const sortOptions = fixture.debugElement.queryAll(By.css('.mat-option-text'));
+ expect(sortController).toBeDefined();
+ expect(component.sortProperties).toBeDefined();
+ expect(component.sortProperties.length).toBe(3);
+ expect(sortController.value).toBe('my-custom-sort');
+ expect(sortOptions.length).toEqual(3);
+ });
+ }));
+
+ it('should display default sort properties if input is empty', async(() => {
+ let taskFilterIDchange = new SimpleChange(undefined, 'mock-task-filter-id', true);
+ component.ngOnChanges({ 'id': taskFilterIDchange});
+ fixture.detectChanges();
+ component.sortProperties = [];
+ fixture.detectChanges();
+ let expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header');
+ expansionPanel.click();
+ fixture.detectChanges();
+ let sortElement = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-cloud-edit-task-property-sort"]');
+ sortElement.click();
+ fixture.detectChanges();
+ fixture.whenStable().then(() => {
+ const sortController = component.editTaskFilterForm.get('sort');
+ const sortOptions = fixture.debugElement.queryAll(By.css('.mat-option-text'));
+ expect(sortController).toBeDefined();
+ expect(sortController.value).toBe('id');
+ expect(sortOptions.length).toEqual(4);
+ });
+ }));
+ });
+
+ describe('filter actions', () => {
+
+ it('should display default filter actions', async(() => {
+ component.toggleFilterActions = true;
+ let taskFilterIDchange = new SimpleChange(undefined, 'mock-task-filter-id', true);
+ component.ngOnChanges({ 'id': taskFilterIDchange});
+ fixture.detectChanges();
+ let expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header');
+ expansionPanel.click();
+ fixture.detectChanges();
+ fixture.whenStable().then(() => {
+ const saveAsButton = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-filter-action-saveAs"]');
+ const saveButton = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-filter-action-save"]');
+ const deleteButton = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-filter-action-delete"]');
+ expect(component.taskFilterActions).toBeDefined();
+ expect(component.taskFilterActions.length).toBe(3);
+ expect(saveButton).toBeDefined();
+ expect(saveAsButton).toBeDefined();
+ expect(deleteButton).toBeDefined();
+ expect(saveButton.disabled).toBeTruthy();
+ expect(saveAsButton.disabled).toBeTruthy(false);
+ expect(deleteButton.disabled).toBe(false);
+ });
+ }));
+
+ it('should display filter actions when input actions are specified', async(() => {
+ component.actions = ['save'];
+ fixture.detectChanges();
+ let taskFilterIDchange = new SimpleChange(undefined, 'mock-task-filter-id', true);
+ component.ngOnChanges({ 'id': taskFilterIDchange});
+ fixture.detectChanges();
+ component.toggleFilterActions = true;
+ fixture.detectChanges();
+ let expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header');
+ expansionPanel.click();
+ fixture.detectChanges();
+ fixture.whenStable().then(() => {
+ const saveButton = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-filter-action-save"]');
+ expect(component.taskFilterActions).toBeDefined();
+ expect(component.taskFilterActions.length).toBe(1);
+ expect(saveButton).toBeDefined();
+ expect(saveButton.disabled).toBeTruthy();
+ });
+ }));
+
+ it('should display default filter actions if input is empty', async(() => {
+ component.toggleFilterActions = true;
+ component.actions = [];
+ let taskFilterIDchange = new SimpleChange(undefined, 'mock-task-filter-id', true);
+ component.ngOnChanges({ 'id': taskFilterIDchange});
+ fixture.detectChanges();
+ let expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header');
+ expansionPanel.click();
+ fixture.detectChanges();
+ fixture.whenStable().then(() => {
+ const saveAsButton = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-filter-action-saveAs"]');
+ const saveButton = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-filter-action-save"]');
+ const deleteButton = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-filter-action-delete"]');
+ expect(component.taskFilterActions).toBeDefined();
+ expect(component.taskFilterActions.length).toBe(3);
+ expect(saveButton).toBeDefined();
+ expect(saveAsButton).toBeDefined();
+ expect(deleteButton).toBeDefined();
+ expect(saveButton.disabled).toBeTruthy();
+ expect(saveAsButton.disabled).toBeTruthy(false);
+ expect(deleteButton.disabled).toBe(false);
});
}));
});
@@ -317,10 +414,10 @@ describe('EditTaskFilterCloudComponent', () => {
let stateElement = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-cloud-edit-task-property-sort"] .mat-select-trigger');
stateElement.click();
fixture.detectChanges();
- const stateOptions = fixture.debugElement.queryAll(By.css('.mat-option-text'));
- stateOptions[3].nativeElement.click();
+ const sortOptions = fixture.debugElement.queryAll(By.css('.mat-option-text'));
+ sortOptions[3].nativeElement.click();
fixture.detectChanges();
- const saveButton = fixture.debugElement.nativeElement.querySelector('#adf-save-id');
+ const saveButton = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-filter-action-save"]');
saveButton.click();
fixture.detectChanges();
fixture.whenStable().then(() => {
@@ -340,7 +437,7 @@ describe('EditTaskFilterCloudComponent', () => {
let stateElement = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-cloud-edit-task-property-sort"] .mat-select-trigger');
stateElement.click();
fixture.detectChanges();
- let deleteButton = fixture.debugElement.nativeElement.querySelector('#adf-delete-id');
+ let deleteButton = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-filter-action-delete"]');
deleteButton.click();
fixture.detectChanges();
fixture.whenStable().then(() => {
@@ -357,14 +454,14 @@ describe('EditTaskFilterCloudComponent', () => {
let expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header');
expansionPanel.click();
fixture.detectChanges();
- let stateElement = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-cloud-edit-task-property-sort"] .mat-select-trigger');
- stateElement.click();
+ let sortElement = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-cloud-edit-task-property-sort"] .mat-select-trigger');
+ sortElement.click();
fixture.detectChanges();
- const saveButton = fixture.debugElement.nativeElement.querySelector('#adf-save-as-id');
- const stateOptions = fixture.debugElement.queryAll(By.css('.mat-option-text'));
- stateOptions[2].nativeElement.click();
+ const saveAsButton = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-filter-action-saveAs"]');
+ const sortOptions = fixture.debugElement.queryAll(By.css('.mat-option-text'));
+ sortOptions[2].nativeElement.click();
fixture.detectChanges();
- saveButton.click();
+ saveAsButton.click();
fixture.detectChanges();
fixture.whenStable().then(() => {
expect(saveAsFilterSpy).toHaveBeenCalled();
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 5315fa8e5d..1b4b07b9ed 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
@@ -17,7 +17,7 @@
import { Component, OnChanges, Input, Output, EventEmitter, SimpleChanges, OnInit } from '@angular/core';
import { AbstractControl, FormGroup, FormBuilder } from '@angular/forms';
-import { TaskFilterCloudModel, FilterActionType, TaskFilterProperties } from './../models/filter-cloud.model';
+import { TaskFilterCloudModel, TaskFilterProperties, FilterOptions, TaskFilterAction } from './../models/filter-cloud.model';
import { TaskFilterCloudService } from '../services/task-filter-cloud.service';
import { MatDialog, DateAdapter } from '@angular/material';
import { TaskFilterDialogCloudComponent } from './task-filter-dialog-cloud.component';
@@ -35,13 +35,18 @@ import { Moment } from 'moment';
})
export class EditTaskFilterCloudComponent implements OnInit, OnChanges {
- public static ACTION_SAVE = 'SAVE';
- public static ACTION_SAVE_AS = 'SAVE_AS';
- public static ACTION_DELETE = 'DELETE';
+ public static ACTION_SAVE = 'save';
+ public static ACTION_SAVE_AS = 'saveAs';
+ public static ACTION_DELETE = 'delete';
public static APP_RUNNING_STATUS: string = 'RUNNING';
public static MIN_VALUE = 1;
public static APPLICATION_NAME: string = 'appName';
- public static DEFAULT_TASK_FILTER_PROPERTIES = ['state', 'assignment', 'sort', 'order'];
+ public static LAST_MODIFIED: string = 'lastModified';
+ public static SORT: string = 'sort';
+ public static ORDER: string = 'order';
+ public static DEFAULT_TASK_FILTER_PROPERTIES = ['status', 'assignee', 'sort', 'order'];
+ public static DEFAULT_SORT_PROPERTIES = ['id', 'name', 'createdDate', 'priority'];
+ public static DEFAULT_ACTIONS = ['save', 'saveAs', 'delete'];
public FORMAT_DATE: string = 'DD/MM/YYYY';
/** (required) Name of the app. */
@@ -54,7 +59,15 @@ export class EditTaskFilterCloudComponent implements OnInit, OnChanges {
/** List of task filter properties to display. */
@Input()
- filterProperties: string[] = EditTaskFilterCloudComponent.DEFAULT_TASK_FILTER_PROPERTIES; // default ['state', 'assignment', 'sort', 'order']
+ filterProperties: string[] = EditTaskFilterCloudComponent.DEFAULT_TASK_FILTER_PROPERTIES;
+
+ /** List of sort properties to display. */
+ @Input()
+ sortProperties: string[] = EditTaskFilterCloudComponent.DEFAULT_SORT_PROPERTIES;
+
+ /** List of task filter actions. */
+ @Input()
+ actions: string[] = EditTaskFilterCloudComponent.DEFAULT_ACTIONS;
/** Toggles the filter actions. */
@Input()
@@ -70,19 +83,11 @@ export class EditTaskFilterCloudComponent implements OnInit, OnChanges {
/** Emitted when a filter action occurs (i.e Save, Save As, Delete). */
@Output()
- action: EventEmitter = new EventEmitter();
+ action: EventEmitter = new EventEmitter();
taskFilter: TaskFilterCloudModel;
changedTaskFilter: TaskFilterCloudModel;
- columns = [
- { value: 'id', label: 'ID' },
- { value: 'name', label: 'NAME' },
- { value: 'createdDate', label: 'Created Date' },
- { value: 'priority', label: 'PRIORITY' },
- { value: 'processDefinitionId', label: 'PROCESS DEFINITION ID' }
- ];
-
status = [
{ label: 'ALL', value: '' },
{ label: 'CREATED', value: 'CREATED' },
@@ -102,7 +107,8 @@ export class EditTaskFilterCloudComponent implements OnInit, OnChanges {
dateFilter: any[] = [];
formHasBeenChanged = false;
editTaskFilterForm: FormGroup;
- taskFilterProperties: any[] = [];
+ taskFilterProperties: TaskFilterProperties[] = [];
+ taskFilterActions: TaskFilterAction[] = [];
toggleFilterActions: boolean = false;
constructor(
@@ -125,6 +131,7 @@ export class EditTaskFilterCloudComponent implements OnInit, OnChanges {
const id = changes['id'];
if (id && id.currentValue !== id.previousValue) {
this.taskFilterProperties = this.createAndFilterProperties();
+ this.taskFilterActions = this.createAndFilterActions();
this.buildForm(this.taskFilterProperties);
}
}
@@ -162,13 +169,25 @@ export class EditTaskFilterCloudComponent implements OnInit, OnChanges {
createAndFilterProperties(): TaskFilterProperties[] {
this.checkMandatoryFilterProperties();
+
if (this.checkForApplicationNameProperty()) {
this.applicationNames = [];
this.getRunningApplications();
}
+
this.taskFilter = this.retrieveTaskFilter();
const defaultProperties = this.createTaskFilterProperties(this.taskFilter);
- return defaultProperties.filter((filterProperty: TaskFilterProperties) => this.isValidProperty(this.filterProperties, filterProperty));
+ let filteredProperties = defaultProperties.filter((filterProperty: TaskFilterProperties) => this.isValidProperty(this.filterProperties, filterProperty));
+
+ if (!this.hasSortProperty()) {
+ filteredProperties = this.removeOrderProperty(filteredProperties);
+ }
+
+ if (this.hasLastModifiedProperty()) {
+ filteredProperties = [...filteredProperties, ...this.createLastModifiedProperty()];
+ }
+
+ return filteredProperties;
}
checkMandatoryFilterProperties() {
@@ -185,6 +204,51 @@ export class EditTaskFilterCloudComponent implements OnInit, OnChanges {
return this.filterProperties ? this.filterProperties.indexOf(EditTaskFilterCloudComponent.APPLICATION_NAME) >= 0 : false;
}
+ hasSortProperty(): boolean {
+ return this.filterProperties.indexOf(EditTaskFilterCloudComponent.SORT) >= 0;
+ }
+
+ removeOrderProperty(filteredProperties: TaskFilterProperties[]) {
+ if (filteredProperties && filteredProperties.length > 0) {
+ const propertiesWithOutOrderProperty = filteredProperties.filter((property: TaskFilterProperties) => { return property.key !== EditTaskFilterCloudComponent.ORDER; });
+ return propertiesWithOutOrderProperty;
+ }
+ }
+
+ hasLastModifiedProperty(): boolean {
+ return this.filterProperties.indexOf(EditTaskFilterCloudComponent.LAST_MODIFIED) >= 0;
+ }
+
+ createSortProperties(): any {
+ this.checkMandatorySortProperties();
+ const sortProperties = this.sortProperties.map((property: string) => {
+ return { label: property.charAt(0).toUpperCase() + property.slice(1), value: property };
+ });
+ return sortProperties;
+ }
+
+ checkMandatorySortProperties() {
+ if (this.sortProperties === undefined || this.sortProperties.length === 0) {
+ this.sortProperties = EditTaskFilterCloudComponent.DEFAULT_SORT_PROPERTIES;
+ }
+ }
+
+ createAndFilterActions() {
+ this.checkMandatoryActions();
+ const allActions = this.createFilterActions();
+ return allActions.filter((action: TaskFilterAction) => this.isValidAction(this.actions, action));
+ }
+
+ checkMandatoryActions() {
+ if (this.actions === undefined || this.actions.length === 0) {
+ this.actions = EditTaskFilterCloudComponent.DEFAULT_ACTIONS;
+ }
+ }
+
+ private isValidAction(actions: string[], action: any): boolean {
+ return actions ? actions.indexOf(action.actionType) >= 0 : true;
+ }
+
isFormValid(): boolean {
return this.editTaskFilterForm.valid;
}
@@ -228,18 +292,30 @@ export class EditTaskFilterCloudComponent implements OnInit, OnChanges {
});
}
- onSave() {
+ executeFilterActions(action: TaskFilterAction): void {
+ if (action.actionType === EditTaskFilterCloudComponent.ACTION_SAVE) {
+ this.save(action);
+ } else if (action.actionType === EditTaskFilterCloudComponent.ACTION_SAVE_AS) {
+ this.saveAs(action);
+ } else if (action.actionType === EditTaskFilterCloudComponent.ACTION_DELETE) {
+ this.delete(action);
+ }
+ }
+
+ save(saveAction: TaskFilterAction) {
this.taskFilterCloudService.updateFilter(this.changedTaskFilter);
- this.action.emit({actionType: EditTaskFilterCloudComponent.ACTION_SAVE, filter: this.changedTaskFilter});
+ saveAction.filter = this.changedTaskFilter;
+ this.action.emit(saveAction);
this.formHasBeenChanged = this.compareFilters(this.changedTaskFilter, this.taskFilter);
}
- onDelete() {
+ delete(deleteAction: TaskFilterAction) {
this.taskFilterCloudService.deleteFilter(this.taskFilter);
- this.action.emit({actionType: EditTaskFilterCloudComponent.ACTION_DELETE, filter: this.taskFilter});
+ deleteAction.filter = this.taskFilter;
+ this.action.emit(deleteAction);
}
- onSaveAs() {
+ saveAs(saveAsAction: TaskFilterAction) {
const dialogRef = this.dialog.open(TaskFilterDialogCloudComponent, {
data: {
name: this.translateService.instant(this.taskFilter.name)
@@ -259,7 +335,8 @@ export class EditTaskFilterCloudComponent implements OnInit, OnChanges {
};
const resultFilter = Object.assign({}, this.changedTaskFilter, newFilter);
this.taskFilterCloudService.addFilter(resultFilter);
- this.action.emit({actionType: EditTaskFilterCloudComponent.ACTION_SAVE_AS, filter: resultFilter});
+ saveAsAction.filter = resultFilter;
+ this.action.emit(saveAsAction);
}
});
@@ -299,6 +376,60 @@ export class EditTaskFilterCloudComponent implements OnInit, OnChanges {
return property.type === 'text';
}
+ isCheckBoxType(property: TaskFilterProperties): boolean {
+ return property.type === 'checkbox';
+ }
+
+ hasFormChanged(action: any): boolean {
+ if (action.actionType === EditTaskFilterCloudComponent.ACTION_SAVE) {
+ return !this.formHasBeenChanged;
+ }
+ if (action.actionType === EditTaskFilterCloudComponent.ACTION_SAVE_AS) {
+ return !this.formHasBeenChanged;
+ }
+ if (action.actionType === EditTaskFilterCloudComponent.ACTION_DELETE) {
+ return false;
+ }
+ }
+
+ createFilterActions(): TaskFilterAction[] {
+ return [
+ new TaskFilterAction({
+ actionType: EditTaskFilterCloudComponent.ACTION_SAVE,
+ icon: 'save',
+ tooltip: 'ADF_CLOUD_EDIT_TASK_FILTER.TOOL_TIP.SAVE'
+ }),
+ new TaskFilterAction({
+ actionType: EditTaskFilterCloudComponent.ACTION_SAVE_AS,
+ icon: 'unarchive',
+ tooltip: 'ADF_CLOUD_EDIT_TASK_FILTER.TOOL_TIP.SAVE_AS'
+ }),
+ new TaskFilterAction({
+ actionType: EditTaskFilterCloudComponent.ACTION_DELETE,
+ icon: 'delete',
+ tooltip: 'ADF_CLOUD_EDIT_TASK_FILTER.TOOL_TIP.DELETE'
+ })
+ ];
+ }
+
+ createLastModifiedProperty(): TaskFilterProperties[] {
+ return [
+ new TaskFilterProperties({
+ label: 'ADF_CLOUD_EDIT_TASK_FILTER.LABEL.LAST_MODIFIED_FROM',
+ type: 'date',
+ key: 'lastModifiedFrom',
+ value: ''
+ }),
+
+ new TaskFilterProperties({
+ label: 'ADF_CLOUD_EDIT_TASK_FILTER.LABEL.LAST_MODIFIED_TO',
+ type: 'date',
+ key: 'lastModifiedTo',
+ value: ''
+ })
+ ];
+ }
+
createTaskFilterProperties(currentTaskFilter: TaskFilterCloudModel): TaskFilterProperties[] {
return [
new TaskFilterProperties({
@@ -311,35 +442,15 @@ export class EditTaskFilterCloudComponent implements OnInit, OnChanges {
new TaskFilterProperties({
label: 'ADF_CLOUD_EDIT_TASK_FILTER.LABEL.STATUS',
type: 'select',
- key: 'state',
- value: currentTaskFilter.state || this.status[0].value,
+ key: 'status',
+ value: currentTaskFilter.status || this.status[0].value,
options: this.status
}),
new TaskFilterProperties({
label: 'ADF_CLOUD_EDIT_TASK_FILTER.LABEL.ASSIGNMENT',
type: 'text',
- key: 'assignment',
- value: currentTaskFilter.assignment || ''
- }),
- new TaskFilterProperties({
- label: 'ADF_CLOUD_EDIT_TASK_FILTER.LABEL.PROCESS_DEF_ID',
- type: 'text',
- key: 'processDefinitionId',
- value: currentTaskFilter.processDefinitionId || ''
- }),
- new TaskFilterProperties({
- label: 'ADF_CLOUD_EDIT_TASK_FILTER.LABEL.SORT',
- type: 'select',
- key: 'sort',
- value: currentTaskFilter.sort || this.columns[0].value,
- options: this.columns
- }),
- new TaskFilterProperties({
- label: 'ADF_CLOUD_EDIT_TASK_FILTER.LABEL.DIRECTION',
- type: 'select',
- key: 'order',
- value: currentTaskFilter.order || this.directions[0].value,
- options: this.directions
+ key: 'assignee',
+ value: currentTaskFilter.assignee || ''
}),
new TaskFilterProperties({
label: 'ADF_CLOUD_EDIT_TASK_FILTER.LABEL.PROCESS_INSTANCE_ID',
@@ -347,6 +458,12 @@ export class EditTaskFilterCloudComponent implements OnInit, OnChanges {
key: 'processInstanceId',
value: currentTaskFilter.processInstanceId || ''
}),
+ new TaskFilterProperties({
+ label: 'ADF_CLOUD_EDIT_TASK_FILTER.LABEL.PROCESS_DEF_ID',
+ type: 'text',
+ key: 'processDefinitionId',
+ value: currentTaskFilter.processDefinitionId || ''
+ }),
new TaskFilterProperties({
label: 'ADF_CLOUD_EDIT_TASK_FILTER.LABEL.TASK_NAME',
type: 'text',
@@ -365,31 +482,43 @@ export class EditTaskFilterCloudComponent implements OnInit, OnChanges {
key: 'priority',
value: currentTaskFilter.priority || ''
}),
- new TaskFilterProperties({
- label: 'ADF_CLOUD_EDIT_TASK_FILTER.LABEL.STAND_ALONE',
- type: 'text',
- key: 'standAlone',
- value: currentTaskFilter.standAlone || ''
- }),
-
- new TaskFilterProperties({
- label: 'ADF_CLOUD_EDIT_TASK_FILTER.LABEL.LAST_MODIFIED_FROM',
- type: 'date',
- key: 'lastModifiedFrom',
- value: ''
- }),
-
- new TaskFilterProperties({
- label: 'ADF_CLOUD_EDIT_TASK_FILTER.LABEL.LAST_MODIFIED_TO',
- type: 'date',
- key: 'lastModifiedTo',
- value: ''
- }),
new TaskFilterProperties({
label: 'ADF_CLOUD_EDIT_TASK_FILTER.LABEL.OWNER',
type: 'text',
key: 'owner',
value: currentTaskFilter.owner || ''
+ }),
+ new TaskFilterProperties({
+ label: 'ADF_CLOUD_EDIT_TASK_FILTER.LABEL.CREATED_DATE',
+ type: 'date',
+ key: 'createdDate',
+ value: ''
+ }),
+ new TaskFilterProperties({
+ label: 'ADF_CLOUD_EDIT_TASK_FILTER.LABEL.DUE_DATE',
+ type: 'date',
+ key: 'dueDate',
+ value: ''
+ }),
+ new TaskFilterProperties({
+ label: 'ADF_CLOUD_EDIT_TASK_FILTER.LABEL.SORT',
+ type: 'select',
+ key: 'sort',
+ value: currentTaskFilter.sort || this.createSortProperties[0].value,
+ options: this.createSortProperties()
+ }),
+ new TaskFilterProperties({
+ label: 'ADF_CLOUD_EDIT_TASK_FILTER.LABEL.DIRECTION',
+ type: 'select',
+ key: 'order',
+ value: currentTaskFilter.order || this.directions[0].value,
+ options: this.directions
+ }),
+ new TaskFilterProperties({
+ label: 'ADF_CLOUD_EDIT_TASK_FILTER.LABEL.STAND_ALONE',
+ type: 'checkbox',
+ key: 'standAlone',
+ value: currentTaskFilter.standAlone || false
})
];
}
diff --git a/lib/process-services-cloud/src/lib/task/task-filters/components/task-filters-cloud.component.spec.ts b/lib/process-services-cloud/src/lib/task/task-filters/components/task-filters-cloud.component.spec.ts
index 2c74026cf7..c16e51c654 100644
--- a/lib/process-services-cloud/src/lib/task/task-filters/components/task-filters-cloud.component.spec.ts
+++ b/lib/process-services-cloud/src/lib/task/task-filters/components/task-filters-cloud.component.spec.ts
@@ -19,44 +19,18 @@ import { SimpleChange } from '@angular/core';
import { ComponentFixture, TestBed, async } from '@angular/core/testing';
import { setupTestBed } from '@alfresco/adf-core';
import { from, Observable } from 'rxjs';
-import { TaskFilterCloudModel, FilterParamsModel } from '../models/filter-cloud.model';
+import { FilterParamsModel } from '../models/filter-cloud.model';
import { TaskFilterCloudService } from '../services/task-filter-cloud.service';
import { TaskFiltersCloudComponent } from './task-filters-cloud.component';
import { By } from '@angular/platform-browser';
import { ProcessServiceCloudTestingModule } from '../../../testing/process-service-cloud.testing.module';
import { TaskFiltersCloudModule } from '../task-filters-cloud.module';
+import { fakeGlobalFilter } from '../mock/task-filters-cloud.mock';
describe('TaskFiltersCloudComponent', () => {
let taskFilterService: TaskFilterCloudService;
- let fakeGlobalFilter = [
- new TaskFilterCloudModel({
- name: 'FakeInvolvedTasks',
- key: 'fake-involved-tasks',
- icon: 'adjust',
- id: 10,
- state: 'open',
- assignment: 'fake-involved'
- }),
- new TaskFilterCloudModel({
- name: 'FakeMyTasks1',
- key: 'fake-my-tast1',
- icon: 'done',
- id: 11,
- state: 'open',
- assignment: 'fake-assignee'
- }),
- new TaskFilterCloudModel({
- name: 'FakeMyTasks2',
- key: 'fake-my-tast2',
- icon: 'inbox',
- id: 12,
- state: 'open',
- assignment: 'fake-assignee'
- })
- ];
-
let fakeGlobalFilterObservable =
new Observable(function(observer) {
observer.next(fakeGlobalFilter);
diff --git a/lib/process-services-cloud/src/lib/task/task-filters/mock/task-filters-cloud.mock.ts b/lib/process-services-cloud/src/lib/task/task-filters/mock/task-filters-cloud.mock.ts
new file mode 100644
index 0000000000..4272581f9b
--- /dev/null
+++ b/lib/process-services-cloud/src/lib/task/task-filters/mock/task-filters-cloud.mock.ts
@@ -0,0 +1,57 @@
+/*!
+ * @license
+ * Copyright 2019 Alfresco Software, Ltd.
+ *
+ * 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.
+ */
+
+import { TaskFilterCloudModel } from '../models/filter-cloud.model';
+
+export let fakeGlobalFilter = [
+ new TaskFilterCloudModel({
+ name: 'FakeInvolvedTasks',
+ key: 'fake-involved-tasks',
+ icon: 'adjust',
+ id: 10,
+ status: 'open',
+ assignee: 'fake-involved'
+ }),
+ new TaskFilterCloudModel({
+ name: 'FakeMyTasks1',
+ key: 'fake-my-tast1',
+ icon: 'done',
+ id: 11,
+ status: 'open',
+ assignee: 'fake-assignee'
+ }),
+ new TaskFilterCloudModel({
+ name: 'FakeMyTasks2',
+ key: 'fake-my-tast2',
+ icon: 'inbox',
+ id: 12,
+ status: 'open',
+ assignee: 'fake-assignee'
+ })
+];
+
+export let fakeFilter = new TaskFilterCloudModel({
+ name: 'FakeInvolvedTasks',
+ icon: 'adjust',
+ id: 'mock-task-filter-id',
+ status: 'CREATED',
+ appName: 'mock-app-name',
+ processDefinitionId: 'process-def-id',
+ assignee: 'fake-involved',
+ order: 'ASC',
+ sort: 'id'
+});
diff --git a/lib/process-services-cloud/src/lib/task/task-filters/mock/task-list-service.mock.ts b/lib/process-services-cloud/src/lib/task/task-filters/mock/task-list-service.mock.ts
deleted file mode 100644
index 318ae04e8d..0000000000
--- a/lib/process-services-cloud/src/lib/task/task-filters/mock/task-list-service.mock.ts
+++ /dev/null
@@ -1,267 +0,0 @@
-/*!
- * @license
- * Copyright 2019 Alfresco Software, Ltd.
- *
- * 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.
- */
-
-import { FilterRepresentationModel, AppDefinitionRepresentationModel } from '../models/filter-cloud.model';
-
-export let fakeFilters = {
- size: 2, total: 2, start: 0,
- data: [
- new AppDefinitionRepresentationModel(
- {
- id: 1, name: 'FakeInvolvedTasks', recent: false, icon: 'glyphicon-align-left',
- filter: { sort: 'created-desc', name: '', state: 'open', assignment: 'fake-involved' }
- }
- ),
- {
- id: 2, name: 'FakeMyTasks', recent: false, icon: 'glyphicon-align-left',
- filter: { sort: 'created-desc', name: '', state: 'open', assignment: 'fake-assignee' }
- }
- ]
-};
-
-export let fakeAppFilter = {
- size: 1, total: 1, start: 0,
- data: [
- {
- id: 1, name: 'FakeInvolvedTasks', recent: false, icon: 'glyphicon-align-left',
- filter: { sort: 'created-desc', name: '', state: 'open', assignment: 'fake-involved' }
- }
- ]
-};
-
-export let fakeApps = {
- size: 2, total: 2, start: 0,
- data: [
- {
- id: 1, defaultAppId: null, name: 'Sales-Fakes-App', description: 'desc-fake1', modelId: 22,
- theme: 'theme-1-fake', icon: 'glyphicon-asterisk', 'deploymentId': '111', 'tenantId': null
- },
- {
- id: 2, defaultAppId: null, name: 'health-care-Fake', description: 'desc-fake2', modelId: 33,
- theme: 'theme-2-fake', icon: 'glyphicon-asterisk', 'deploymentId': '444', 'tenantId': null
- }
- ]
-};
-
-export let fakeFilter = {
- sort: 'created-desc', text: '', state: 'open', assignment: 'fake-assignee'
-};
-
-export let fakeUser1 = { id: 1, email: 'fake-email@dom.com', firstName: 'firstName', lastName: 'lastName' };
-
-export let fakeUser2 = { id: 1001, email: 'some-one@somegroup.com', firstName: 'some', lastName: 'one' };
-
-export let fakeTaskList = {
- size: 1, total: 1, start: 0,
- data: [
- {
- id: '1', name: 'FakeNameTask', description: null, category: null,
- assignee: fakeUser1,
- created: '2016-07-15T11:19:17.440+0000'
- }
- ]
-};
-
-export let fakeTaskListDifferentProcessDefinitionKey = {
- size: 2, total: 1, start: 0,
- data: [
- {
- id: '1', name: 'FakeNameTask', description: null, category: null,
- assignee: fakeUser1,
- processDefinitionKey: '1',
- created: '2016-07-15T11:19:17.440+0000'
- },
- {
- id: '2', name: 'FakeNameTask2', description: null, category: null,
- assignee: fakeUser1,
- processDefinitionKey: '2',
- created: '2016-07-15T11:19:17.440+0000'
- }
- ]
-};
-
-export let secondFakeTaskList = {
- size: 1, total: 1, start: 0,
- data: [
- {
- id: '200', name: 'FakeNameTask', description: null, category: null,
- assignee: fakeUser1,
- created: '2016-07-15T11:19:17.440+0000'
- }
- ]
-};
-
-export let mockErrorTaskList = {
- error: 'wrong request'
-};
-
-export let fakeTaskDetails = { id: '999', name: 'fake-task-name', formKey: '99', assignee: fakeUser1 };
-
-export let fakeTasksComment = {
- size: 2, total: 2, start: 0,
- data: [
- {
- id: 1, message: 'fake-message-1', created: '', createdBy: fakeUser1
- },
- {
- id: 2, message: 'fake-message-2', created: '', createdBy: fakeUser1
- }
- ]
-};
-
-export let fakeTasksChecklist = {
- size: 1, total: 1, start: 0,
- data: [
- {
- id: 1, name: 'FakeCheckTask1', description: null, category: null,
- assignee: fakeUser1,
- created: '2016-07-15T11:19:17.440+0000'
- },
- {
- id: 2, name: 'FakeCheckTask2', description: null, category: null,
- assignee: fakeUser1,
- created: '2016-07-15T11:19:17.440+0000'
- }
- ]
-};
-
-export let fakeRepresentationFilter1: FilterRepresentationModel = new FilterRepresentationModel({
- appId: 1,
- name: 'CONTAIN FILTER',
- recent: true,
- icon: 'glyphicon-align-left',
- filter: {
- processDefinitionId: null,
- processDefinitionKey: null,
- name: null,
- state: 'open',
- sort: 'created-desc',
- assignment: 'involved',
- dueAfter: null,
- dueBefore: null
- }
-});
-
-export let fakeRepresentationFilter2: FilterRepresentationModel = new FilterRepresentationModel({
- appId: 2,
- name: 'NO TASK FILTER',
- recent: false,
- icon: 'glyphicon-inbox',
- filter: {
- processDefinitionId: null,
- processDefinitionKey: null,
- name: null,
- state: 'open',
- sort: 'created-desc',
- assignment: 'assignee',
- dueAfter: null,
- dueBefore: null
- }
-});
-
-export let fakeAppPromise = new Promise(function (resolve, reject) {
- resolve(fakeAppFilter);
-});
-
-export let fakeFormList = {
- size: 2,
- total: 2,
- start: 0,
- data: [{
- id: 1,
- name: 'form with all widgets',
- description: '',
- createdBy: 2,
- createdByFullName: 'Admin Admin',
- lastUpdatedBy: 2,
- lastUpdatedByFullName: 'Admin Admin',
- lastUpdated: 1491400951205,
- latestVersion: true,
- version: 4,
- comment: null,
- stencilSet: null,
- referenceId: null,
- modelType: 2,
- favorite: null,
- permission: 'write',
- tenantId: null
- }, {
- id: 2,
- name: 'uppy',
- description: '',
- createdBy: 2,
- createdByFullName: 'Admin Admin',
- lastUpdatedBy: 2,
- lastUpdatedByFullName: 'Admin Admin',
- lastUpdated: 1490951054477,
- latestVersion: true,
- version: 2,
- comment: null,
- stencilSet: null,
- referenceId: null,
- modelType: 2,
- favorite: null,
- permission: 'write',
- tenantId: null
- }]
-};
-
-export let fakeTaskOpen1 = {
- id: '1', name: 'FakeOpenTask1', description: null, category: null,
- assignee: fakeUser1,
- created: '2017-07-15T11:19:17.440+0000',
- dueDate: null,
- endDate: null
- };
-
-export let fakeTaskOpen2 = {
- id: '1', name: 'FakeOpenTask2', description: null, category: null,
- assignee: { id: 1, email: 'fake-open-email@dom.com', firstName: 'firstName', lastName: 'lastName' },
- created: '2017-07-15T11:19:17.440+0000',
- dueDate: null,
- endDate: null
- };
-
-export let fakeTaskCompleted1 = {
- id: '1', name: 'FakeCompletedTaskName1', description: null, category: null,
- assignee: { id: 1, email: 'fake-completed-email@dom.com', firstName: 'firstName', lastName: 'lastName' },
- created: '2016-07-15T11:19:17.440+0000',
- dueDate: null,
- endDate: '2016-11-03T15:25:42.749+0000'
- };
-
-export let fakeTaskCompleted2 = {
- id: '1', name: 'FakeCompletedTaskName2', description: null, category: null,
- assignee: fakeUser1,
- created: null,
- dueDate: null,
- endDate: '2016-11-03T15:25:42.749+0000'
- };
-
-export let fakeOpenTaskList = {
- size: 2,
- total: 2,
- start: 0,
- data: [fakeTaskOpen1, fakeTaskOpen2]
-};
-
-export let fakeCompletedTaskList = {
- size: 2,
- total: 2,
- start: 0,
- data: [fakeTaskCompleted1, fakeTaskCompleted2]
-};
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 91a62da0fe..e438917270 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
@@ -22,26 +22,19 @@ export class TaskFilterCloudModel {
icon: string;
index: number;
appName: string;
- processDefinitionId: string;
- state: string;
+ status: string;
sort: string;
- assignment: string;
+ assignee: string;
order: string;
- description: string;
- dueAfter: Date;
- dueBefore: Date;
owner: string;
+ processDefinitionId: string;
processInstanceId: string;
- claimedDateFrom: Date;
- claimedDateTo: Date;
- createdDateFrom: Date;
- createdDateTo: Date;
- dueDateFrom: Date;
- dueDateTo: Date;
+ createdDate: Date;
+ dueDate: Date;
taskName: string;
parentTaskId: string;
priority: number;
- standAlone: any;
+ standAlone: boolean;
lastModifiedFrom: Date;
lastModifiedTo: Date;
@@ -53,24 +46,17 @@ export class TaskFilterCloudModel {
this.icon = obj.icon || null;
this.index = obj.index || null;
this.appName = obj.appName || null;
- this.processDefinitionId = obj.processDefinitionId || null;
- this.state = obj.state || null;
+ this.status = obj.status || null;
this.sort = obj.sort || null;
- this.assignment = obj.assignment || null;
+ this.assignee = obj.assignee || null;
this.order = obj.order || null;
- this.description = obj.description || null;
- this.dueAfter = obj.dueAfter || null;
- this.dueBefore = obj.dueBefore || null;
+ this.owner = obj.owner || null;
+ this.processDefinitionId = obj.processDefinitionId || null;
this.processInstanceId = obj.processInstanceId || null;
- this.claimedDateFrom = obj.claimedDateFrom || null;
- this.claimedDateTo = obj.claimedDateTo || null;
- this.createdDateFrom = obj.createdDateFrom || null;
- this.createdDateTo = obj.createdDateTo || null;
- this.dueDateFrom = obj.dueDateFrom || null;
- this.dueDateTo = obj.dueDateTo || null;
+ this.createdDate = obj.createdDate || null;
+ this.dueDate = obj.dueDate || null;
this.taskName = obj.taskName || null;
this.parentTaskId = obj.parentTaskId || null;
- this.owner = obj.owner;
this.priority = obj.priority || null;
this.standAlone = obj.standAlone || null;
this.lastModifiedFrom = obj.lastModifiedFrom || null;
@@ -95,9 +81,20 @@ export class FilterParamsModel {
}
}
-export interface FilterActionType {
+export class TaskFilterAction {
actionType: string;
+ icon: string;
+ tooltip: string;
filter: TaskFilterCloudModel;
+
+ constructor(obj?: any) {
+ if (obj) {
+ this.actionType = obj.actionType || null;
+ this.icon = obj.icon || null;
+ this.tooltip = obj.tooltip || null;
+ this.filter = obj.filter || null;
+ }
+ }
}
export interface FilterOptions {
@@ -108,7 +105,7 @@ export interface FilterOptions {
export class TaskFilterProperties {
label: string;
type: string;
- value: string;
+ value: any;
key: string;
options: FilterOptions[];
diff --git a/lib/process-services-cloud/src/lib/task/task-filters/services/task-filter-cloud.service.ts b/lib/process-services-cloud/src/lib/task/task-filters/services/task-filter-cloud.service.ts
index c6e17e5014..45abc78fc7 100644
--- a/lib/process-services-cloud/src/lib/task/task-filters/services/task-filter-cloud.service.ts
+++ b/lib/process-services-cloud/src/lib/task/task-filters/services/task-filter-cloud.service.ts
@@ -166,8 +166,8 @@ export class TaskFilterCloudService {
key: 'my-tasks',
icon: 'inbox',
appName: appName,
- state: 'ASSIGNED',
- assignment: username,
+ status: 'ASSIGNED',
+ assignee: username,
sort: 'createdDate',
order: 'DESC'
});
@@ -184,8 +184,8 @@ export class TaskFilterCloudService {
key: 'completed-tasks',
icon: 'done',
appName: appName,
- state: 'COMPLETED',
- assignment: '',
+ status: 'COMPLETED',
+ assignee: '',
sort: 'createdDate',
order: 'DESC'
});
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 e8fd279100..0132656712 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
@@ -263,6 +263,8 @@ export class TaskListCloudComponent extends DataTableSchema implements OnChanges
lastModifiedFrom: this.lastModifiedFrom,
lastModifiedTo: this.lastModifiedTo,
status: this.status,
+ dueDate: this.dueDate,
+ createdDate: this.createdDate,
maxItems: this.size,
skipCount: this.skipCount,
sorting: this.sorting