[ADF-4391] Doc review for 3.2 (#4601)

* [ADF-4391] Reviewed new clipboard class docs

* [ADF-4391] Reviewed new proc cloud class docs

* [ADF-4391] Reviewed new datatable doc additions
This commit is contained in:
Andy Stark
2019-04-12 16:18:43 +01:00
committed by Eugenio Romano
parent 16aaa0f0b3
commit 921fdc00df
16 changed files with 256 additions and 153 deletions

View File

@@ -1,26 +0,0 @@
---
Title: Claim Task Directive
Added: v3.1.0
Status: Experimental
Last reviewed: 2019-03-05
---
# [Claim task directive](../../lib/process-services-cloud/src/lib/task/directives/claim-task.directive.ts "Defined in claim-task.directive.ts")
Claim a task
## Basic Usage
```html
<button adf-claim-task [appName]="appName" [taskId]="taskId" (success)="onTaskClaimed()">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

@@ -1,13 +1,13 @@
---
Title: Form component
Title: Form cloud component
Added: v3.2.0
Status: Active
Last reviewed: 2019-04-01
Last reviewed: 2019-04-12
---
# [Form cloud component](../../../lib/process-services-cloud/src/lib/form/components/form-cloud.component.ts "Defined in form-cloud.component.ts")
Shows a [`form`](../../../lib/process-services-cloud/src/lib/form/models/form-cloud.model.ts) from Process Services
Shows a [`form`](../../../lib/process-services-cloud/src/lib/form/models/form-cloud.model.ts) from Process Services.
## Contents
@@ -53,21 +53,21 @@ The template defined inside `empty-form` will be shown when no form definition i
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| appName | `string` | | App id to fetch corresponding form and values. |
| taskId | `string` | | Task id to fetch corresponding form and values. |
| form | [`FormCloudModel`](../../../lib/process-services-cloud/src/lib/form/models/form-cloud.model.ts) | | Underlying [form model](../../../lib/process-services-cloud/src/lib/form/models/form-cloud.model.ts) instance. |
| formId | `string` | | The id of the form definition to load and display with custom values. |
| data | [`TaskVariableCloud[]`](../../../lib/process-services-cloud/src/lib/form/models/task-variable.model.ts) | | Custom form values map to be used with the rendered form. |
| data | [`TaskVariableCloud`](../../../lib/process-services-cloud/src/lib/form/models/task-variable-cloud.model.ts)`[]` | | Custom form values map to be used with the rendered form. |
| disableCompleteButton | `boolean` | false | If true then the `Complete` outcome button is shown but it will be disabled. |
| disableStartProcessButton | `boolean` | false | If true then the `Start Process` outcome button is shown but it will be disabled. |
| fieldValidators | [`FormFieldValidator`](../../../lib/core/form/components/widgets/core/form-field-validator.ts)`[]` | \[] | Contains a list of form field validator instances. |
| form | [`FormCloud`](../../../lib/process-services-cloud/src/lib/form/models/form-cloud.model.ts) | | Underlying [form model](../../../lib/core/form/components/widgets/core/form.model.ts) instance. |
| formId | `string` | | Task id to fetch corresponding form and values. |
| nameNode | `string` | | Name to assign to the new node where the metadata are stored. |
| path | `string` | | Path of the folder where the metadata will be stored. |
| readOnly | `boolean` | false | Toggle readonly state of the form. Forces all form widgets to render as readonly if enabled. |
| showCompleteButton | `boolean` | true | Toggle rendering of the `Complete` outcome button. |
| showDebugButton | `boolean` | false | Toggle debug options. |
| showRefreshButton | `boolean` | true | Toggle rendering of the `Refresh` button. |
| showSaveButton | `boolean` | true | Toggle rendering of the `Save` outcome button. |
| showTitle | `boolean` | true | Toggle rendering of the form title. |
| showValidationIcon | `boolean` | true | Toggle rendering of the validation icon next to the form title. |
| taskId | `string` | | Task id to fetch corresponding form and values. |
### Events
@@ -75,11 +75,11 @@ The template defined inside `empty-form` will be shown when no form definition i
| ---- | ---- | ----------- |
| error | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<any>` | Emitted when any error occurs. |
| executeOutcome | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`FormOutcomeEvent`](../../../lib/core/form/components/widgets/core/form-outcome-event.model.ts)`>` | Emitted when any outcome is executed. Default behaviour can be prevented via `event.preventDefault()`. |
| formCompleted | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`FormCloudModel`](../../../lib/process-services-cloud/src/lib/form/models/form-cloud.model.ts)`>` | Emitted when the form is submitted with the `Complete` outcome. |
| formDataRefreshed | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`FormCloudModel`](../../../lib/process-services-cloud/src/lib/form/models/form-cloud.model.ts)`>` | Emitted when form values are refreshed due to a data property change. |
| formCompleted | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`FormCloud`](../../../lib/process-services-cloud/src/lib/form/models/form-cloud.model.ts)`>` | Emitted when the form is submitted with the `Complete` outcome. |
| formDataRefreshed | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`FormCloud`](../../../lib/process-services-cloud/src/lib/form/models/form-cloud.model.ts)`>` | Emitted when form values are refreshed due to a data property change. |
| formError | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`FormFieldModel`](../../core/models/form-field.model.md)`[]>` | Emitted when the supplied form values have a validation error. |
| formLoaded | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`FormCloudModel`](../../../lib/process-services-cloud/src/lib/form/models/form-cloud.model.ts)`>` | Emitted when the form is loaded or reloaded. |
| formSaved | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`FormCloudModel`](../../../lib/process-services-cloud/src/lib/form/models/form-cloud.model.ts)`>` | Emitted when the form is submitted with the `Save` or custom outcomes. |
| formLoaded | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`FormCloud`](../../../lib/process-services-cloud/src/lib/form/models/form-cloud.model.ts)`>` | Emitted when the form is loaded or reloaded. |
| formSaved | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`FormCloud`](../../../lib/process-services-cloud/src/lib/form/models/form-cloud.model.ts)`>` | Emitted when the form is submitted with the `Save` or custom outcomes. |
## Details
@@ -130,7 +130,6 @@ For an existing Task both the form and its values will be fetched and displayed.
In this case, only the form definition will be fetched.
### Controlling outcome execution behaviour
In unusual circumstances, you may need to take complete control of form outcome execution.
@@ -252,11 +251,10 @@ In the CSS, you can target any outcome ID and change the style as in this exampl
![](../../docassets/images/form-style-sample.png)
## See also
- [Form Field Validator interface](../../core/interfaces/form-field-validator.interface.md)
- [Extensibility](../../user-guide/extensibility.md)
- [Form rendering service](../../core/services/form-rendering.service.md)
- [Form field model](../../core/models/form-field.model.md)
- [Form service](../services/form-cloud.service.md)
- [Form cloud service](../services/form-cloud.service.md)

View File

@@ -2,7 +2,7 @@
Title: Form cloud service
Added: v3.2.0
Status: Active
Last reviewed: 2019-04-02
Last reviewed: 2019-04-12
---
# [Form cloud service](../../../lib/process-services-cloud/src/lib/form/services/form-cloud.service.ts "Defined in form-cloud.service.ts")
@@ -12,55 +12,74 @@ Implements Process Services form methods
## Basic Usage
```ts
import { FormService } from '@alfresco/adf-core';
import { FormCloudService } from '@alfresco/adf-process-services-cloud';
@Component(...)
class MyComponent {
constructor(formService: FormService) {
constructor(formCloudService: FormCloudService) {}
}
```
## Class members
### Methods
- `parseForm(json: any, data?:`[`TaskVariableCloud,`](../../../lib/process-services-cloud/src/lib/form/models/task-variable-cloud.model.ts)`readOnly: boolean = false):`[`FormModel`](../../../lib/core/form/components/widgets/core/form.model.ts)
Parses JSON data to create a corresponding [`Form`](../../../lib/process-services-cloud/src/lib/form/models/form-cloud.model.ts) model.
- `json` - JSON to create the form
- `data` - (Optional) [`Values`](../../../lib/process-services-cloud/src/lib/form/models/task-variable-cloud.model.ts) for the form fields
- `readOnly` - Should the form fields be read-only?
- **completeTaskForm**(appName: `string`, taskId: `string`, formId: `string`, formValues: [`FormValues`](../../../lib/core/form/components/widgets/core/form-values.ts), outcome: `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/>
Completes a task form.
- _appName:_ `string` - Name of the app
- _taskId:_ `string` - ID of the target task
- _formId:_ `string` - ID of the form to complete
- _formValues:_ [`FormValues`](../../../lib/core/form/components/widgets/core/form-values.ts) - [Form](../../../lib/process-services/task-list/models/form.model.ts) values object
- _outcome:_ `string` - (Optional) [Form](../../../lib/process-services/task-list/models/form.model.ts) outcome
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`TaskDetailsCloudModel`](../../../lib/process-services-cloud/src/lib/task/start-task/models/task-details-cloud.model.ts)`>` - Updated task details
- **createTemporaryRawRelatedContent**(file: `any`, nodeId: `any`): [`Observable`](http://reactivex.io/documentation/observable.html)`<any>`<br/>
- `saveTaskForm(appName: string, taskId: string, formId: string, formValues: FormValues):`[`Observable`](http://reactivex.io/documentation/observable.html)`<any>`
Saves task [`form`](../../../lib/process-services-cloud/src/lib/form/models/form-cloud.model.ts).
- `appName` - App Name
- `taskId` - Task Id
- `formId` - Form Id
- `formValues` - [`Form Values`](../../../lib/core/form/components/widgets/core/form-values.ts)
- _file:_ `any` -
- _nodeId:_ `any` -
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<any>` -
- `completeTaskForm(appName: string, taskId: string, formId: string, formValues: FormValues, outcome: string):`[`Observable`](http://reactivex.io/documentation/observable.html)`<any>`
Completes task [`form`](../../../lib/process-services-cloud/src/lib/form/models/form-cloud.model.ts)
- `appName` - App Name
- `taskId` - Task Id
- `formId` - Form Id
- `formValues` - [`Form Values`](../../../lib/core/form/components/widgets/core/form-values.ts)
- `outcome` - (Optional) [`Form`](../../../lib/process-services-cloud/src/lib/form/models/form-cloud.model.ts) Outcome
- **getForm**(appName: `string`, taskId: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<any>`<br/>
Gets a form definition.
- _appName:_ `string` - Name of the app
- _taskId:_ `string` - ID of the target task
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<any>` - Form definition
- **getProcessStorageFolderTask**(appName: `string`, taskId: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<any>`<br/>
- `getTaskForm(appName: string, taskId: string):`[`Observable`](http://reactivex.io/documentation/observable.html)`<any>`
Get form defintion of a task
- `appName` - App Name
- `taskId` - Task Id
- _appName:_ `string` -
- _taskId:_ `string` -
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<any>` -
- `getForm(appName: string, formId: string):`[`Observable`](http://reactivex.io/documentation/observable.html)`<any>`
Get a form definition
- `appName` - App Name
- `formId` - Form Id
- **getTask**(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 target task
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`TaskDetailsCloudModel`](../../../lib/process-services-cloud/src/lib/task/start-task/models/task-details-cloud.model.ts)`>` - Details of the task
- **getTaskForm**(appName: `string`, taskId: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<any>`<br/>
Gets the form definition of a task.
- _appName:_ `string` - Name of the app
- _taskId:_ `string` - ID of the target task
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<any>` - Form definition
- **getTaskVariables**(appName: `string`, taskId: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`TaskVariableCloud`](../../../lib/process-services-cloud/src/lib/form/models/task-variable-cloud.model.ts)`[]>`<br/>
Gets the variables of a task.
- _appName:_ `string` - Name of the app
- _taskId:_ `string` - ID of the target task
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`TaskVariableCloud`](../../../lib/process-services-cloud/src/lib/form/models/task-variable-cloud.model.ts)`[]>` - Task variables
- **parseForm**(json: `any`, data?: [`TaskVariableCloud`](../../../lib/process-services-cloud/src/lib/form/models/task-variable-cloud.model.ts)`[]`, readOnly: `boolean` = `false`): [`FormCloud`](../../../lib/process-services-cloud/src/lib/form/models/form-cloud.model.ts)<br/>
Parses JSON data to create a corresponding form.
- _json:_ `any` - JSON data to create the form
- _data:_ [`TaskVariableCloud`](../../../lib/process-services-cloud/src/lib/form/models/task-variable-cloud.model.ts)`[]` - (Optional) (Optional) Values for the form's fields
- _readOnly:_ `boolean` - Toggles whether or not the form should be read-only
- **Returns** [`FormCloud`](../../../lib/process-services-cloud/src/lib/form/models/form-cloud.model.ts) - [Form](../../../lib/process-services/task-list/models/form.model.ts) created from the JSON specification
- **saveTaskForm**(appName: `string`, taskId: `string`, formId: `string`, formValues: [`FormValues`](../../../lib/core/form/components/widgets/core/form-values.ts)): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`TaskDetailsCloudModel`](../../../lib/process-services-cloud/src/lib/task/start-task/models/task-details-cloud.model.ts)`>`<br/>
Saves a task form.
- _appName:_ `string` - Name of the app
- _taskId:_ `string` - ID of the target task
- _formId:_ `string` - ID of the form to save
- _formValues:_ [`FormValues`](../../../lib/core/form/components/widgets/core/form-values.ts) - [Form](../../../lib/process-services/task-list/models/form.model.ts) values object
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`TaskDetailsCloudModel`](../../../lib/process-services-cloud/src/lib/task/start-task/models/task-details-cloud.model.ts)`>` - Updated task details
- `getTask(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)>
Gets details of a task.
- `appName` - App Name
- `taskId` - Task Id
## See also
- `getTaskVariables(appName: string, taskId: string):`[`Observable`](http://reactivex.io/documentation/observable.html)<[`TaskVariableCloud`](../../../lib/process-services-cloud/src/lib/form/models/task-variable-cloud.model.ts)[]>
Gets variables of a task.
- `appName` - App Name
- `taskId` - Task Id
- [Form cloud component](../components/form-cloud.component.md)

View File

@@ -1,26 +0,0 @@
---
Title: Unclaim Task Directive
Added: v3.1.0
Status: Experimental
Last reviewed: 2019-03-05
---
# [Unclaim task directive](../../lib/process-services-cloud/src/lib/task/directives/unclaim-task.directive.ts "Defined in unclaim-task.directive.ts")
Unclaim a task
## Basic Usage
```html
<button adf-unclaim-task [appName]="appName" [taskId]="taskId" (success)="onTaskUnclaimed()">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. |