From 6fffeef5c666072d14ec0aab812c0076bb97fd5d Mon Sep 17 00:00:00 2001 From: davidcanonieto Date: Sun, 27 Jan 2019 02:17:42 +0000 Subject: [PATCH] [ADF-3943] Remove non-working filters from Edit Task Filter Cloud (#4194) * [ADF-3943] Remove non-working filters from Edit Task Filter Cloud and add live configuration for Task List Cloud Component * [ADF-3943] Fix unit test --- demo-shell/resources/i18n/en.json | 1 - demo-shell/src/app.config.json | 45 +++++++++++++++++ .../cloud/tasks-cloud-demo.component.html | 8 ---- .../config-editor.component.html | 7 +++ .../config-editor/config-editor.component.ts | 6 +++ .../edit-task-filter-cloud.component.md | 2 +- .../edit-task-filter-cloud.component.spec.ts | 8 ++-- .../edit-task-filter-cloud.component.ts | 48 ------------------- 8 files changed, 63 insertions(+), 62 deletions(-) diff --git a/demo-shell/resources/i18n/en.json b/demo-shell/resources/i18n/en.json index 51149754be..c9800fce56 100644 --- a/demo-shell/resources/i18n/en.json +++ b/demo-shell/resources/i18n/en.json @@ -62,7 +62,6 @@ "TASK_LIST": "Task List", "PROCESS_LIST": "Process List", "PROCESS_CLOUD": "Process Cloud", - "PROCESS_LIST_CLOUD": "Process List Cloud", "CARD_VIEW": "CardView", "PROCESS_SERVICES": "Process Services", "LOGIN": "Login", diff --git a/demo-shell/src/app.config.json b/demo-shell/src/app.config.json index 0875b82eda..95d7bac7bb 100644 --- a/demo-shell/src/app.config.json +++ b/demo-shell/src/app.config.json @@ -549,5 +549,50 @@ "sideNav": { "expandedSidenav": true, "preserveState": true + }, + "adf-cloud-task-list": { + "presets": { + "default": [ + { + "key": "entry.id", + "type": "text", + "title": "Id", + "sortable": true + }, + { + "key": "entry.name", + "type": "text", + "title": "Name", + "sortable": true, + "cssClass": "full-width name-column ellipsis-cell" + }, + { + "key": "entry.status", + "type": "text", + "title": "Status", + "sortable": true + }, + { + "key": "entry.priority", + "type": "text", + "title": "Priority", + "sortable": true + }, + { + "key": "entry.createdDate", + "type": "date", + "title": "Created Date", + "sortable": true, + "format": "timeAgo" + }, + { + "key": "entry.lastModified", + "type": "date", + "title": "Last Modified", + "sortable": true, + "format": "timeAgo" + } + ] + } } } 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 63ea2f8616..3cd478e279 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 @@ -12,14 +12,6 @@ [assignee]="editedFilter.assignment" [sorting]="sortArray" (rowClick)="onRowClick($event)"> - - - - - - - - diff --git a/demo-shell/src/app/components/config-editor/config-editor.component.html b/demo-shell/src/app/components/config-editor/config-editor.component.html index 8190537002..c6484883aa 100644 --- a/demo-shell/src/app/components/config-editor/config-editor.component.html +++ b/demo-shell/src/app/components/config-editor/config-editor.component.html @@ -41,6 +41,13 @@ info + + + Task List Cloud + +
diff --git a/demo-shell/src/app/components/config-editor/config-editor.component.ts b/demo-shell/src/app/components/config-editor/config-editor.component.ts index 8fed801830..1ce6792b02 100644 --- a/demo-shell/src/app/components/config-editor/config-editor.component.ts +++ b/demo-shell/src/app/components/config-editor/config-editor.component.ts @@ -106,6 +106,12 @@ export class ConfigEditorComponent { this.indentCode(); } + taskListCloudConfClick() { + this.code = JSON.stringify(this.appConfig.config['adf-cloud-task-list']); + this.field = 'adf-cloud-task-list'; + this.indentCode(); + } + indentCode() { setTimeout(() => { this.editor.getAction('editor.action.formatDocument').run(); diff --git a/docs/process-services-cloud/edit-task-filter-cloud.component.md b/docs/process-services-cloud/edit-task-filter-cloud.component.md index 4696a15005..c325568f3e 100644 --- a/docs/process-services-cloud/edit-task-filter-cloud.component.md +++ b/docs/process-services-cloud/edit-task-filter-cloud.component.md @@ -93,6 +93,6 @@ With this configuration, only the four listed properties will be shown. The 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_**. +**_appName_**, **_state_**, **_assignment_**, **_sort_**, **_order_**, **_processDefinitionId_**, **_processInstanceId_**, **_taskName_**, **_parentTaskId_**, **_priority_**, **_standAlone_**, **_lastModifiedFrom_**, **_lastModifiedTo_**, **_owner_**. ![edit-task-filter-cloud](../docassets/images/edit-task-filter-cloud.component.png) 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 00572c06cf..5ad70e6c8b 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 @@ -265,13 +265,13 @@ describe('EditTaskFilterCloudComponent', () => { })); it('should able to build a editTaskFilter form with given input properties', async(() => { - getTaskFilterSpy.and.returnValue({ processInstanceId: 'process-instance-id', dueBefore: 'Fri Jan 04 2019 19:16:32 GMT+0530 (IST)' }); + getTaskFilterSpy.and.returnValue({ processInstanceId: 'process-instance-id', priority: '12' }); component.appName = 'mock-app-name'; - component.filterProperties = ['appName', 'processInstanceId', 'dueBefore']; + component.filterProperties = ['appName', 'processInstanceId', 'priority']; let change = new SimpleChange(undefined, 'mock-task-id', true); component.ngOnChanges({ 'id': change }); const appController = component.editTaskFilterForm.get('appName'); - const dueDateController = component.editTaskFilterForm.get('dueBefore'); + const propertyController = component.editTaskFilterForm.get('priority'); const processInsIdController = component.editTaskFilterForm.get('processInstanceId'); fixture.detectChanges(); fixture.whenStable().then(() => { @@ -281,7 +281,7 @@ describe('EditTaskFilterCloudComponent', () => { expect(component.editTaskFilterForm).toBeDefined(); expect(component.taskFilterProperties.length).toBe(3); expect(appController).toBeDefined(); - expect(dueDateController).toBeDefined(); + expect(propertyController.value).toBe('12'); expect(processInsIdController).toBeDefined(); expect(appController.value).toBe('mock-app-name'); expect(processInsIdController.value).toBe('process-instance-id'); 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 1307104a94..b6e3a1bf37 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 @@ -330,42 +330,6 @@ export class EditTaskFilterCloudComponent implements OnChanges { key: 'processInstanceId', value: currentTaskFilter.processInstanceId || '' }), - new TaskFilterProperties({ - label: 'ADF_CLOUD_EDIT_TASK_FILTER.LABEL.DUE_AFTER', - type: 'date', - key: 'dueAfter', - value: '' - }), - new TaskFilterProperties({ - label: 'ADF_CLOUD_EDIT_TASK_FILTER.LABEL.DUE_BEFORE', - type: 'date', - key: 'dueBefore', - value: '' - }), - new TaskFilterProperties({ - label: 'ADF_CLOUD_EDIT_TASK_FILTER.LABEL.CLAIMED_DATE_FROM', - type: 'date', - key: 'claimedDateFrom', - value: '' - }), - new TaskFilterProperties({ - label: 'ADF_CLOUD_EDIT_TASK_FILTER.LABEL.CLAIMED_DATE_TO', - type: 'date', - key: 'claimedDateTo', - value: '' - }), - new TaskFilterProperties({ - label: 'ADF_CLOUD_EDIT_TASK_FILTER.LABEL.CREATED_DATE_FORM', - type: 'date', - key: 'createdDateFrom', - value: '' - }), - new TaskFilterProperties({ - label: 'ADF_CLOUD_EDIT_TASK_FILTER.LABEL.CREATED_DATE_TO', - type: 'date', - key: 'createdDateTo', - value: '' - }), new TaskFilterProperties({ label: 'ADF_CLOUD_EDIT_TASK_FILTER.LABEL.TASK_NAME', type: 'text', @@ -409,18 +373,6 @@ export class EditTaskFilterCloudComponent implements OnChanges { type: 'text', key: 'owner', value: currentTaskFilter.owner || '' - }), - new TaskFilterProperties({ - label: 'ADF_CLOUD_EDIT_TASK_FILTER.LABEL.DUE_DATE_FROM', - type: 'date', - key: 'dueDateFrom', - value: '' - }), - new TaskFilterProperties({ - label: 'ADF_CLOUD_EDIT_TASK_FILTER.LABEL.DUE_DATE_TO', - type: 'date', - key: 'dueDateTo', - value: '' }) ]; }