[ADF-1769] Added prop tables and JSDocs (#2906)

This commit is contained in:
Andy Stark
2018-02-02 14:56:59 +00:00
committed by Eugenio Romano
parent 819274301b
commit 5ee9b09a21
14 changed files with 132 additions and 42 deletions

View File

@@ -15,19 +15,46 @@ Displays the Start Form for a process.
### Properties
| Name | Type | Default | Description |
| ---- | ---- | ------- | ----------- |
| processDefinitionId | string | | Definition ID of the process to start. |
| processId | string | | Process ID of the process to start. |
| showOutcomeButtons | boolean | true | Should form outcome buttons be shown? |
| showRefreshButton | boolean | true | |
| readOnlyForm | boolean | false | Is the form read-only (ie, can't be edited)? |
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| processDefinitionId | `string` | | Definition ID of the process to start. |
| processId | `string` | | Process ID of the process to start. |
| showOutcomeButtons | `boolean` | `true` | Should form outcome buttons be shown? |
| showRefreshButton | `boolean` | `true` | Should the refresh button be shown? |
| readOnlyForm | `boolean` | `false` | Is the form read-only (ie, can't be edited)? |
| form | `FormModel` | | Underlying form model instance. |
| taskId | `string` | | Task id to fetch corresponding form and values. |
| nodeId | `string` | | Content Services node ID for the form metadata. |
| formId | `string` | | The id of the form definition to load and display with custom values. |
| formName | `string` | | Name of the form definition to load and display with custom values. |
| saveMetadata | `boolean` | `false` | Toggle saving of form metadata. |
| data | `FormValues` | | Custom form values map to be used with the rendered form. |
| path | `string` | | Path of the folder where the metadata will be stored. |
| nameNode | `string` | | Name to assign to the new node where the metadata are stored. |
| showTitle | `boolean` | `true` | Toggle rendering of the form title. |
| showCompleteButton | `boolean` | `true` | Toggle rendering of the `Complete` outcome button. |
| 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. |
| showSaveButton | `boolean` | `true` | Toggle rendering of the `Save` outcome button. |
| showDebugButton | `boolean` | `false` | Toggle debug options. |
| readOnly | `boolean` | `false` | Toggle readonly state of the form. Forces all form widgets to render as readonly if enabled. |
| showRefreshButton | `boolean` | `true` | Toggle rendering of the `Refresh` button. |
| showValidationIcon | `boolean` | `true` | Toggle rendering of the validation icon next to the form title. |
| fieldValidators | `FormFieldValidator[]` | `[]` | Contains a list of form field validator instances. |
### Events
| Name | Description |
| ---- | ----------- |
| outcomeClick | Emitted when the user clicks one of the outcome buttons that completes the form. |
| Name | Type | Description |
| ---- | ---- | ----------- |
| outcomeClick | `EventEmitter<any>` | Emitted when the user clicks one of the outcome buttons that completes the form. |
| formContentClicked | `EventEmitter<ContentLinkModel>` | Emitted when a field of the form is clicked. |
| formSaved | `EventEmitter<FormModel>` | Emitted when the form is submitted with the `Save` or custom outcomes. |
| formCompleted | `EventEmitter<FormModel>` | Emitted when the form is submitted with the `Complete` outcome. |
| formContentClicked | `EventEmitter<ContentLinkModel>` | Emitted when form content is clicked. |
| formLoaded | `EventEmitter<FormModel>` | Emitted when the form is loaded or reloaded. |
| formDataRefreshed | `EventEmitter<FormModel>` | Emitted when form values are refreshed due to a data property change. |
| executeOutcome | `EventEmitter<FormOutcomeEvent>` | Emitted when any outcome is executed. Default behaviour can be prevented via `event.preventDefault()`. |
| onError | `EventEmitter<any>` | Emitted when any error occurs. |
## Details

View File

@@ -15,18 +15,18 @@ Starts a process.
### Properties
| Name | Type | Description |
| ---- | -- | ----------- |
| ---- | ---- | ----------- |
| appId | `number` | (optional): Limit the list of processes which can be started to those contained in the specified app |
| name | `string` | (optional) name to assign to the current process |
| processDefinitionName | `string` | (optional) definition name of the process to start |
| variables | `ProcessInstanceVariable[]` |Variables in input to the process [RestVariable](https://github.com/Alfresco/alfresco-js-api/tree/master/src/alfresco-activiti-rest-api/docs/RestVariable.md) |
| variables | `ProcessInstanceVariable[]` | Variables in input to the process [RestVariable](https://github.com/Alfresco/alfresco-js-api/tree/master/src/alfresco-activiti-rest-api/docs/RestVariable.md) |
| values | `FormValues` | Parameter to pass form field values in the start form if is associated |
| showSelectProcessDropdown | `boolean` | hide or show the process selection drodown, true by default |
### Events
| Name | Type | Description |
| ---- | -- | --------- |
| ---- | ---- | ----------- |
| start | `EventEmitter<ProcessInstance>` | Emitted when the process starts |
| cancel | `EventEmitter<ProcessInstance>` | Emitted when the process is canceled |
| error | `EventEmitter<ProcessInstance>` | Emitted when the start process operation fails |
@@ -53,7 +53,6 @@ If your app has more than one process definition, with the property processDefin
With the property processDefinitionName you can select as dropdown default value your PROCESS_DEFINITION_NAME.
### Custom data example
Here is an example of how to pass in form field values to initialize the start form that has been

View File

@@ -14,14 +14,14 @@ Creates/Starts new task for the specified app
### Properties
| Name | Type | Description |
| --- | --- | --- |
| appId | string | (**required**): The id of the app. |
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| appId | `number` | | (required) The id of the app. |
### Events
| Name | Description |
| --- | --- |
| success | Raised when the task is successfully created |
| cancel | Raised when the cancel button is pressed by the user |
| error | Raised if there is an error during task creation |
| Name | Type | Description |
| ---- | ---- | ----------- |
| success | `EventEmitter<any>` | Emitted when the task is successfully created. |
| cancel | `EventEmitter<void>` | Emitted when the cancel button is clicked by the user. |
| error | `EventEmitter<any>` | Emitted when an error occurs. |

View File

@@ -14,6 +14,14 @@ Shows available actions for tags.
### Properties
| Attribute | Type | Default | Description |
| --------- | ---- | ------- | ----------- |
| nodeId | string | | The identifier of a node |
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| nodeId | `string` | | The identifier of a node. |
### Events
| Name | Type | Description |
| ---- | ---- | ----------- |
| successAdd | `EventEmitter<any>` | Emitted when a tag is added successfully. |
| error | `EventEmitter<any>` | Emitted when an error occurs. |
| result | `EventEmitter<{}>` | Emitted when an action is chosen. |

View File

@@ -4,6 +4,14 @@ Shows tags for an item.
![Custom columns](docassets/images/tag2.png)
## Basic Usage
### Events
| Name | Type | Description |
| ---- | ---- | ----------- |
| result | `EventEmitter<{}>` | Emitted when a tag is selected. |
## See Also
- [Tag service](tag.service.md)

View File

@@ -14,6 +14,12 @@ Shows tags for a node.
### Properties
| Attribute | Type | Default | Description |
| --------- | ---- | ------- | ----------- |
| nodeId | string | | The identifier of a node |
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| nodeId | `string` | | The identifier of a node. |
### Events
| Name | Type | Description |
| ---- | ---- | ----------- |
| results | `EventEmitter<{}>` | Emitted when a tag is selected. |

View File

@@ -12,13 +12,14 @@ Displays attached documents on a specified task.
(attachmentClick)="YOUR_HANDLER">
</adf-task-attachment-list>
```
If the List is empty, a default no content template is displayed.
![default-no-content-template-sample](docassets/images/default-no-content-template.png)
### How to Add Drag and Drop Functionality
If we want user to be able to upload attachments for empty lists, We can wrap our component with upload drag area component. In that case, We should also pass a custom *no content template* as shown below with our component urging the user to drag files to upload whenever the list is empty.
If we want user to be able to upload attachments for empty lists, We can wrap our component with upload drag area component. In that case, We should also pass a custom _no content template_ as shown below with our component urging the user to drag files to upload whenever the list is empty.
```html
<adf-upload-drag-area
@@ -41,6 +42,7 @@ import { UploadService } from '@alfresco/adf-core';
import { TaskUploadService } from '@alfresco/adf-process-services';
Make sure to override the UploadService with the TaskUploadService
```ts
@Component({
selector: 'my-custom-task-attachment',
@@ -61,15 +63,15 @@ If the List is empty, the custom no-content template we passed is displayed.
### Properties
| Name | Type | Description |
| --- | --- | --- |
| taskId | string | (**required**): The ID of the task to display |
| disabled | boolean | false | Disable/Enable read only mode for attachement list |
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| taskId | `string` | | (**required**) The ID of the task to display. |
| disabled | `boolean` | `false` | Disable/Enable read only mode for attachement list. |
### Events
| Name | Description |
| --- | --- |
| attachmentClick | Raised when the attachment double clicked or selected view option from context menu by the user from within the component and return a Blob obj of the object clicker|
| success | Raised when the attachment list fetch all the attach and return a list of attachments |
| error | Raised when the attachment list is not able to fetch the attachments for example network error |
| Name | Type | Description |
| ---- | ---- | ----------- |
| attachmentClick | `EventEmitter<{}>` | Emitted when the attachment is double-clicked or a view option is selected from the context menu by the user from within the component. Returns a Blob representing the clicked object. |
| success | `EventEmitter<{}>` | Emitted when the attachment list has fetched all the attachments. Returns a list of attachments. |
| error | `EventEmitter<any>` | Emitted when an error occurs while fetching the attachments. |

View File

@@ -34,15 +34,19 @@ import { TagService } from './services/tag.service';
})
export class TagActionsComponent implements OnChanges {
/** The identifier of a node. */
@Input()
nodeId: string;
/** Emitted when a tag is added successfully. */
@Output()
successAdd: EventEmitter<any> = new EventEmitter();
/** Emitted when an error occurs. */
@Output()
error: EventEmitter<any> = new EventEmitter();
/** Emitted when an action is chosen. */
@Output()
result = new EventEmitter();

View File

@@ -35,6 +35,7 @@ export class TagListComponent implements OnInit {
tagsEntries: any;
/** Emitted when a tag is selected. */
@Output()
result = new EventEmitter();

View File

@@ -32,12 +32,13 @@ import { TagService } from './services/tag.service';
encapsulation: ViewEncapsulation.None
})
export class TagNodeListComponent implements OnChanges {
/** The identifier of a node. */
@Input()
nodeId: string;
tagsEntries: any;
/** Emitted when a tag is selected. */
@Output()
results = new EventEmitter();

View File

@@ -48,24 +48,31 @@ import { FormOutcomeModel } from './widgets/core/index';
})
export class StartFormComponent extends FormComponent implements OnChanges, OnInit {
/** Definition ID of the process to start. */
@Input()
processDefinitionId: string;
/** Process ID of the process to start. */
@Input()
processId: string;
/** Should form outcome buttons be shown? */
@Input()
showOutcomeButtons: boolean = true;
/** Should the refresh button be shown? */
@Input()
showRefreshButton: boolean = true;
/** Is the form read-only (ie, can't be edited)? */
@Input()
readOnlyForm: boolean = false;
/** Emitted when the user clicks one of the outcome buttons that completes the form. */
@Output()
outcomeClick: EventEmitter<any> = new EventEmitter<any>();
/** Emitted when a field of the form is clicked. */
@Output()
formContentClicked: EventEmitter<ContentLinkModel> = new EventEmitter<ContentLinkModel>();

View File

@@ -30,18 +30,28 @@ export class TaskAttachmentListComponent implements OnChanges, AfterContentInit
@ContentChild(EmptyListComponent)
emptyTemplate: EmptyListComponent;
/** (**required**) The ID of the task to display. */
@Input()
taskId: string;
/** Disable/Enable read only mode for attachement list. */
@Input()
disabled: boolean = false;
/** Emitted when the attachment is double-clicked or a view
* option is selected from the context menu by the user from within the component.
* Returns a Blob representing the clicked object.
*/
@Output()
attachmentClick = new EventEmitter();
/** Emitted when the attachment list has fetched all the attachments.
* Returns a list of attachments.
*/
@Output()
success = new EventEmitter();
/** Emitted when an error occurs while fetching the attachments. */
@Output()
error: EventEmitter<any> = new EventEmitter<any>();

View File

@@ -46,30 +46,43 @@ import { AttachFileWidgetComponent, AttachFolderWidgetComponent } from '../../co
})
export class StartProcessInstanceComponent implements OnChanges {
/** (optional) Limit the list of processes that can be started to those
* contained in the specified app.
*/
@Input()
appId: number;
/** (optional) Definition name of the process to start. */
@Input()
processDefinitionName: string;
/** Variables in input to the process
* [RestVariable](https://github.com/Alfresco/alfresco-js-api/tree/master/src/alfresco-activiti-rest-api/docs/RestVariable.md).
*/
@Input()
variables: ProcessInstanceVariable[];
/** Parameter to pass form field values in the start form if it is associated. */
@Input()
values: FormValues;
/** (optional) Name to assign to the current process. */
@Input()
name: string;
/** Hide or show the process selection drodown. */
@Input()
showSelectProcessDropdown: boolean = true;
/** Emitted when the process starts. */
@Output()
start: EventEmitter<ProcessInstance> = new EventEmitter<ProcessInstance>();
/** Emitted when the process is canceled. */
@Output()
cancel: EventEmitter<ProcessInstance> = new EventEmitter<ProcessInstance>();
/** Emitted when an error occurs. */
@Output()
error: EventEmitter<ProcessInstance> = new EventEmitter<ProcessInstance>();

View File

@@ -40,15 +40,19 @@ export class StartTaskComponent implements OnInit {
public FORMAT_DATE: string = 'DD/MM/YYYY';
/** (required) The id of the app. */
@Input()
appId: number;
/** Emitted when the task is successfully created. */
@Output()
success: EventEmitter<any> = new EventEmitter<any>();
/** Emitted when the cancel button is clicked by the user. */
@Output()
cancel: EventEmitter<void> = new EventEmitter<void>();
/** Emitted when an error occurs. */
@Output()
error: EventEmitter<any> = new EventEmitter<any>();