[ADF-4128] ProcessCloud - add complete task directive (#4364)

* [ADF-4128] ProcessCloud - add complete task directive

* [ADF-4128]  ProcessCloud - fix completion functionality and add documentation

* [ADF-4128] ProcessCloud - PR changes

* [ADF-4128] ProcessCloud - lint

* [ADF-4148] ProcessServicesCloud - change layout

* [ADF-4128] fix PR changes

* [ADF-4128] - refractor complete task directive

* [ADF-4128] - fix lint

* [ADF-4128] - PR changes

* [ADF-4128] - replace isCompleted method  from service with model method

* [ADF-4128] fix unit tests

* [ADF-4128] - change travis yml

* [ADF-4128] - fix travis.yml

* [ADF-4128] - travis lint
This commit is contained in:
Silviu Popa
2019-03-18 14:34:08 +02:00
committed by Eugenio Romano
parent e586ee17d5
commit 791051edee
20 changed files with 654 additions and 82 deletions

View File

@@ -0,0 +1,26 @@
---
Title: Complete Cloud Task
Added: v3.1.0
Status: Experimental
Last reviewed: 2019-02-28
---
# [Complete task directive](../../lib/process-services-cloud/src/lib/task/task-header/directives/complete-task.directive.ts "Defined in complete-task.directive.ts")
Complete a task
## Basic Usage
```html
<button adf-cloud-complete-task [appName]="appName" [taskId]="taskId" (success)="onTaskCompleted()">Complete</button>
```
## Class members
### Properties
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| taskId | `string` | empty |(Required) The id of the task. |
| appName | `string` | empty | (Required) The name of the application. |
| success | `EventEmitter<any>` | empty | Emitted when the task is completed. |
| error | `EventEmitter<any>` | empty | Emitted when the task cannot be completed. |

View File

@@ -0,0 +1,57 @@
---
Title: Task Cloud Service
Added: v3.1.0
Status: Experimental
Last reviewed: 2019-02-28
---
# [Task Cloud Service](../../lib/process-services-cloud/src/lib/task/task-header/services/task-cloud.service.ts "Defined in task-cloud.service.ts")
Manage task cloud.
## Class members
### Methods
- **completeTask**(appName: `string`, taskId: `string`)<br/>
Complete a task
- _appName:_ `string` - Name of the app
- _taskId:_ `string` - ID of the task to complete
- **canCompleteTask**(taskDetails: [`TaskDetailsCloudModel`](../../lib/process-services-cloud/src/lib/task/start-filters/models/task-details-cloud.model.ts))<br/>
Validate if a task can be completed.
- _taskDetails:_ [`TaskDetailsCloudModel`](../../lib/process-services-cloud/src/lib/task/start-filters/models/task-details-cloud.model.ts) - Task details object
- **claimTask**(appName: `string`, taskId: `string`, assignee: `string`): `any`<br/>
Claims a task for an assignee.
- _appName:_ `string` - Name of the app
- _taskId:_ `string` - ID of the task to claim
- _assignee:_ `string` - User to assign the task to
- **Returns** `any` - Details of the claimed task
- **getTaskById**(appName: `string`, taskId: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`TaskDetailsCloudModel`](../../lib/process-services-cloud/src/lib/task/start-task/models/task-details-cloud.model.ts)`>`<br/>
Gets details of a task.
- _appName:_ `string` - Name of the app
- _taskId:_ `string` - ID of the task whose details you want
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`TaskDetailsCloudModel`](../../lib/process-services-cloud/src/lib/task/start-task/models/task-details-cloud.model.ts)`>` - Task details
- **unclaimTask**(appName: `string`, taskId: `string`): `any`<br/>
Un-claims a task.
- _appName:_ `string` - Name of the app
- _taskId:_ `string` - ID of the task to unclaim
- **Returns** `any` - Details of the task that was unclaimed
- **updateTask**(appName: `string`, taskId: `string`, updatePayload: `any`): `any`<br/>
Updates the details (name, description, due date) for a task.
- _appName:_ `string` - Name of the app
- _taskId:_ `string` - ID of the task to update
- _updatePayload:_ `any` - Data to update the task
- **Returns** `any` - Updated task details
## Details
The methods work in much the same way as the equivalent methods in the
[Tasklist service](../process-services/tasklist.service.md)
but they use the cloud variants of the classes for return values. See the
[Tasklist service](../process-services/tasklist.service.md) page for usage examples.
## See also
- [Tasklist service](../process-services/tasklist.service.md)