From 563af3bbfa90c6e1d41816467f2de3e1fc8174ff Mon Sep 17 00:00:00 2001 From: Andy Stark <30621568+therealandeeee@users.noreply.github.com> Date: Fri, 4 May 2018 13:56:01 +0100 Subject: [PATCH] [ADF-2905] Updated JSDocs for content services (#3269) * [ADF-2905] Updated JSDocs for content services * [ADF-2905] Added missing update to version manager MD file --- .../add-permission-panel.component.md | 16 ++++++---------- .../content-services/add-permission.component.md | 13 ++++++------- docs/content-services/document-list.service.md | 6 +++--- docs/content-services/rating.service.md | 7 ++++--- .../upload-drag-area.component.md | 4 ++-- docs/content-services/version-list.component.md | 6 +++--- .../version-manager.component.md | 10 +++++----- .../services/document-list.service.ts | 6 +++--- .../add-permission-panel.component.ts | 1 + .../add-permission/add-permission.component.ts | 3 +++ .../social/services/rating.service.ts | 3 +++ lib/content-services/tag/services/tag.service.ts | 1 + .../components/upload-drag-area.component.ts | 2 +- .../version-manager/version-list.component.ts | 7 ++++--- .../version-manager/version-manager.component.ts | 5 +++++ 15 files changed, 50 insertions(+), 40 deletions(-) diff --git a/docs/content-services/add-permission-panel.component.md b/docs/content-services/add-permission-panel.component.md index 479e7bd0bb..c5126feaa6 100644 --- a/docs/content-services/add-permission-panel.component.md +++ b/docs/content-services/add-permission-panel.component.md @@ -1,12 +1,12 @@ --- Added: v2.4.0 Status: Active -Last reviewed: 2018-05-03 +Last reviewed: 2018-05-04 --- # Add Permission Component -Allow user to search people or group that could be added to the current node permissions. +Searches for people or groups to add to the current node permissions. ![Add Permission Component](../docassets/images/add-permission-component.png) @@ -14,24 +14,20 @@ Allow user to search people or group that could be added to the current node per ```html + (success)="onSuccess($event)" (error)="onError($event)"> ``` ## Class members -### Properties - -| Name | Type | Default value | Description | -| -- | -- | -- | -- | - ### Events | Name | Type | Description | | -- | -- | -- | -| select | `EventEmitter` | | +| select | `EventEmitter` | Emitted when a permission list item is selected. | ## Details + This component uses a [Search component](../search.component.md) to retrieve the groups and people that could be added to the permission list of the current node. -The `select` event will be emitted when a result is clicked from the list. \ No newline at end of file +The `select` event is emitted when a result is clicked from the list. diff --git a/docs/content-services/add-permission.component.md b/docs/content-services/add-permission.component.md index f86e89bd2a..ebeef4fe41 100644 --- a/docs/content-services/add-permission.component.md +++ b/docs/content-services/add-permission.component.md @@ -6,7 +6,7 @@ Last reviewed: 2018-05-03 # Add Permission Component -Allow user to search people or group that could be added to the current node permissions. +Searches for people or groups to add to the current node permissions. ![Add Permission Component](../docassets/images/add-permission-component.png) @@ -14,7 +14,7 @@ Allow user to search people or group that could be added to the current node per ```html + (success)="onSuccess($event)" (error)="onError($event)"> ``` @@ -24,18 +24,17 @@ Allow user to search people or group that could be added to the current node per | Name | Type | Default value | Description | | -- | -- | -- | -- | -| nodeId | `string` | "" | | +| nodeId | `string` | | ID of the target node. | ### Events | Name | Type | Description | | -- | -- | -- | -| success | `EventEmitter` | | -| error | `EventEmitter` | | +| error | `EventEmitter` | Emitted when an error occurs during the update. | +| success | `EventEmitter` | Emitted when the node is updated successfully. | ## Details This component extends the [Add permission panel component](../add-permission-panel.component.md) and apply the action confirm when the selection made is accepted. -The `success` event will be emitted when the node is correctly updated. -The `error` event will be thrown whenever the node update permission will fail. + diff --git a/docs/content-services/document-list.service.md b/docs/content-services/document-list.service.md index d744356e68..1e15501553 100644 --- a/docs/content-services/document-list.service.md +++ b/docs/content-services/document-list.service.md @@ -18,7 +18,7 @@ Implements node operations used by the Document List component. - `targetParentId: string = null` - The id of the folder where the node will be copied - **Returns** `Observable` - NodeEntry for the copied node - `createFolder(name: string = null, parentId: string = null): Observable`
- Create a new folder in the path. + Creates a new folder in the path. - `name: string = null` - Folder name - `parentId: string = null` - Parent folder ID - **Returns** `Observable` - Details of the created folder node @@ -51,7 +51,7 @@ Implements node operations used by the Document List component. - **Returns** `string` - Path to the icon file - `getNode(nodeId: string = null, includeFields: string[] = []): Observable`
Gets a node via its node ID. - - `nodeId: string = null` - + - `nodeId: string = null` - ID of the target node - `includeFields: string[] = []` - Extra information to include (available options are "aspectNames", "isLink" and "association") - **Returns** `Observable` - Details of the folder - `hasPermission(node: any = null, permission: PermissionsEnum | string = null): boolean`
@@ -61,7 +61,7 @@ Implements node operations used by the Document List component. - **Returns** `boolean` - True if the node has the permission, false otherwise - `moveNode(nodeId: string = null, targetParentId: string = null): Observable`
- Move a node to destination node + Moves a node to destination node. - `nodeId: string = null` - The id of the node to be moved - `targetParentId: string = null` - The id of the folder where the node will be moved - **Returns** `Observable` - NodeEntry for the moved node diff --git a/docs/content-services/rating.service.md b/docs/content-services/rating.service.md index f42228554c..2539c4037e 100644 --- a/docs/content-services/rating.service.md +++ b/docs/content-services/rating.service.md @@ -1,6 +1,7 @@ --- Added: v2.0.0 Status: Active +Last reviewed: 2018-05-04 --- # Rating service @@ -15,18 +16,18 @@ Manages ratings for items in Content Services. Removes the current user's rating for a node. - `nodeId: string = null` - Target node - `ratingType: any = null` - Type of rating to remove (can be "likes" or "fiveStar") - - **Returns** `any` - + - **Returns** `any` - Null response indicating that the operation is complete - `getRating(nodeId: string = null, ratingType: any = null): any`
Gets the current user's rating for a node. - `nodeId: string = null` - Node to get the rating from - `ratingType: any = null` - Type of rating (can be "likes" or "fiveStar") - - **Returns** `any` - + - **Returns** `any` - The rating value - `postRating(nodeId: string = null, ratingType: any = null, vote: any = null): any`
Adds the current user's rating for a node. - `nodeId: string = null` - Target node for the rating - `ratingType: any = null` - Type of rating (can be "likes" or "fiveStar") - `vote: any = null` - Rating value (boolean for "likes", numeric 0..5 for "fiveStar") - - **Returns** `any` - + - **Returns** `any` - Details about the rating, including the new value ## Details diff --git a/docs/content-services/upload-drag-area.component.md b/docs/content-services/upload-drag-area.component.md index 39c4f770e3..3aabf9c115 100644 --- a/docs/content-services/upload-drag-area.component.md +++ b/docs/content-services/upload-drag-area.component.md @@ -1,7 +1,7 @@ --- Added: v2.0.0 Status: Active -Last reviewed: 2018-04-16 +Last reviewed: 2018-05-04 --- # Upload Drag Area Component @@ -42,7 +42,7 @@ export class AppComponent { | maxFilesSize | `number` | | Sets a limit on the maximum size (in bytes) of a file to be uploaded. Has no effect if undefined. | | rootFolderId | `string` | "-root-" | The ID of the root. Use the nodeId for Content Services or the taskId/processId for Process Services. | | versioning | `boolean` | false | Toggles versioning. | -| parentId | `` | | | +| parentId | `` | | **Deprecated:** 2.4.0 use rootFolderId ID of parent folder node. | ### Events diff --git a/docs/content-services/version-list.component.md b/docs/content-services/version-list.component.md index 8fe68d4ced..af819dd452 100644 --- a/docs/content-services/version-list.component.md +++ b/docs/content-services/version-list.component.md @@ -21,9 +21,9 @@ Displays the version history of a node in a Version Manager component | -- | -- | -- | -- | | allowDownload | `boolean` | true | Enable/disable possibility to download a version of the current node. | | id | `string` | | **Deprecated:** in 2.3.0 | -| node | `MinimalNodeEntryEntity` | | | -| showActions | `boolean` | true | show/hide version actions | -| showComments | `boolean` | true | show/hide comments | +| node | `MinimalNodeEntryEntity` | | The target node. | +| showActions | `boolean` | true | Toggles showing/hiding of version actions | +| showComments | `boolean` | true | Toggles showing/hiding of comments | ## Details diff --git a/docs/content-services/version-manager.component.md b/docs/content-services/version-manager.component.md index 2ddcd3ef18..b844028ad6 100644 --- a/docs/content-services/version-manager.component.md +++ b/docs/content-services/version-manager.component.md @@ -28,16 +28,16 @@ Displays the version history of a node with the ability to upload a new version. | Name | Type | Default value | Description | | -- | -- | -- | -- | -| allowDownload | `boolean` | true | | -| node | `MinimalNodeEntryEntity` | | | -| showComments | `boolean` | true | | +| allowDownload | `boolean` | true | Enable/disable downloading a version of the current node. | +| node | `MinimalNodeEntryEntity` | | Target node to manage version history. | +| showComments | `boolean` | true | Toggles showing/hiding of comments. | ### Events | Name | Type | Description | | -- | -- | -- | -| uploadError | `EventEmitter` | | -| uploadSuccess | `EventEmitter` | | +| uploadError | `EventEmitter` | Emitted when an error occurs during upload. | +| uploadSuccess | `EventEmitter` | Emitted when a file is uploaded successfully. | ## Details diff --git a/lib/content-services/document-list/services/document-list.service.ts b/lib/content-services/document-list/services/document-list.service.ts index 96a5348004..80c098bfca 100644 --- a/lib/content-services/document-list/services/document-list.service.ts +++ b/lib/content-services/document-list/services/document-list.service.ts @@ -90,7 +90,7 @@ export class DocumentListService { } /** - * Move a node to destination node + * Moves a node to destination node. * * @param nodeId The id of the node to be moved * @param targetParentId The id of the folder where the node will be moved @@ -102,7 +102,7 @@ export class DocumentListService { } /** - * Create a new folder in the path. + * Creates a new folder in the path. * @param name Folder name * @param parentId Parent folder ID * @returns Details of the created folder node @@ -128,7 +128,7 @@ export class DocumentListService { /** * Gets a node via its node ID. - * @param nodeId + * @param nodeId ID of the target node * @param includeFields Extra information to include (available options are "aspectNames", "isLink" and "association") * @returns Details of the folder */ diff --git a/lib/content-services/permission-manager/components/add-permission/add-permission-panel.component.ts b/lib/content-services/permission-manager/components/add-permission/add-permission-panel.component.ts index df35119d07..63eddf1137 100644 --- a/lib/content-services/permission-manager/components/add-permission/add-permission-panel.component.ts +++ b/lib/content-services/permission-manager/components/add-permission/add-permission-panel.component.ts @@ -38,6 +38,7 @@ export class AddPermissionPanelComponent { @ViewChild('search') search: SearchComponent; + /** Emitted when a permission list item is selected. */ @Output() select: EventEmitter = new EventEmitter(); diff --git a/lib/content-services/permission-manager/components/add-permission/add-permission.component.ts b/lib/content-services/permission-manager/components/add-permission/add-permission.component.ts index c6d4b1734d..f5e60bd87f 100644 --- a/lib/content-services/permission-manager/components/add-permission/add-permission.component.ts +++ b/lib/content-services/permission-manager/components/add-permission/add-permission.component.ts @@ -27,12 +27,15 @@ import { NodePermissionService } from '../../services/node-permission.service'; }) export class AddPermissionComponent { + /** ID of the target node. */ @Input() nodeId: string; + /** Emitted when the node is updated successfully. */ @Output() success: EventEmitter = new EventEmitter(); + /** Emitted when an error occurs during the update. */ @Output() error: EventEmitter = new EventEmitter(); diff --git a/lib/content-services/social/services/rating.service.ts b/lib/content-services/social/services/rating.service.ts index 9adf4e834c..37e54016ea 100644 --- a/lib/content-services/social/services/rating.service.ts +++ b/lib/content-services/social/services/rating.service.ts @@ -32,6 +32,7 @@ export class RatingService { * Gets the current user's rating for a node. * @param nodeId Node to get the rating from * @param ratingType Type of rating (can be "likes" or "fiveStar") + * @returns The rating value */ getRating(nodeId: string, ratingType: any): any { return Observable.fromPromise(this.apiService.getInstance().core.ratingsApi.getRating(nodeId, ratingType)) @@ -44,6 +45,7 @@ export class RatingService { * @param nodeId Target node for the rating * @param ratingType Type of rating (can be "likes" or "fiveStar") * @param vote Rating value (boolean for "likes", numeric 0..5 for "fiveStar") + * @returns Details about the rating, including the new value */ postRating(nodeId: string, ratingType: any, vote: any): any { let ratingBody: RatingBody = { @@ -59,6 +61,7 @@ export class RatingService { * Removes the current user's rating for a node. * @param nodeId Target node * @param ratingType Type of rating to remove (can be "likes" or "fiveStar") + * @returns Null response indicating that the operation is complete */ deleteRating(nodeId: string, ratingType: any): any { return Observable.fromPromise(this.apiService.getInstance().core.ratingsApi.removeRating(nodeId, ratingType)) diff --git a/lib/content-services/tag/services/tag.service.ts b/lib/content-services/tag/services/tag.service.ts index 78f87984d3..0c18df6f0e 100644 --- a/lib/content-services/tag/services/tag.service.ts +++ b/lib/content-services/tag/services/tag.service.ts @@ -23,6 +23,7 @@ import 'rxjs/add/observable/throw'; @Injectable() export class TagService { + /** Emitted when tag information is updated. */ @Output() refresh = new EventEmitter(); diff --git a/lib/content-services/upload/components/upload-drag-area.component.ts b/lib/content-services/upload/components/upload-drag-area.component.ts index 3ef2227fba..b1064261c7 100644 --- a/lib/content-services/upload/components/upload-drag-area.component.ts +++ b/lib/content-services/upload/components/upload-drag-area.component.ts @@ -34,7 +34,7 @@ import { UploadBase } from './base-upload/upload-base'; }) export class UploadDragAreaComponent extends UploadBase implements NodePermissionSubject { - /** @deprecaretd 2.4.0 use rootFolderId ID of parent folder node. */ + /** @deprecated 2.4.0 use rootFolderId ID of parent folder node. */ @Input() set parentId(nodeId: string) { this.rootFolderId = nodeId; diff --git a/lib/content-services/version-manager/version-list.component.ts b/lib/content-services/version-manager/version-list.component.ts index 0f4b4cdc60..46f88489f4 100644 --- a/lib/content-services/version-manager/version-list.component.ts +++ b/lib/content-services/version-manager/version-list.component.ts @@ -40,18 +40,19 @@ export class VersionListComponent implements OnChanges { @Input() id: string; + /** The target node. */ @Input() node: MinimalNodeEntryEntity; - /** show/hide comments */ + /** Toggles showing/hiding of comments */ @Input() showComments = true; - /** Enable/disable possibility to download a version of the current node. */ + /** Enable/disable downloading a version of the current node. */ @Input() allowDownload = true; - /** show/hide version actions */ + /** Toggles showing/hiding of version actions */ @Input() showActions = true; diff --git a/lib/content-services/version-manager/version-manager.component.ts b/lib/content-services/version-manager/version-manager.component.ts index efbd6a7db5..f5e167dc72 100644 --- a/lib/content-services/version-manager/version-manager.component.ts +++ b/lib/content-services/version-manager/version-manager.component.ts @@ -43,18 +43,23 @@ import { trigger, state, style, animate, transition } from '@angular/animations' }) export class VersionManagerComponent { + /** Target node to manage version history. */ @Input() node: MinimalNodeEntryEntity; + /** Toggles showing/hiding of comments. */ @Input() showComments = true; + /** Enable/disable downloading a version of the current node. */ @Input() allowDownload = true; + /** Emitted when a file is uploaded successfully. */ @Output() uploadSuccess = new EventEmitter(); + /** Emitted when an error occurs during upload. */ @Output() uploadError = new EventEmitter();