From 838842caac31c8b887529124ee8a64cf82b50348 Mon Sep 17 00:00:00 2001 From: Andy Stark <30621568+therealandeeee@users.noreply.github.com> Date: Mon, 26 Mar 2018 13:32:12 +0100 Subject: [PATCH] [ADF-2451] Reviewed component docs and fixed package.json (#3118) * [ADF-2451] Reviewed component docs and fixed package.json issues * [ADF-2451] Fixed permission list brief desc and rebuilt indexes * [ADF-2451] Fixed incorrect filename for inherited button directive docs --- docs/README.md | 6 +- docs/content-services/README.md | 4 +- ...ctive.md => inherited-button.directive.md} | 0 .../permission-list.component.md | 9 ++- .../upload-button.component.md | 54 ++++---------- .../upload-version-button.component.md | 74 +++++++++++++++++++ docs/process-services/README.md | 2 +- .../components/base-upload/upload-base.ts | 1 + .../upload-version-button.component.ts | 1 + lib/package.json | 4 + 10 files changed, 108 insertions(+), 47 deletions(-) rename docs/content-services/{inherit-permission-directive.md => inherited-button.directive.md} (100%) create mode 100644 docs/content-services/upload-version-button.component.md diff --git a/docs/README.md b/docs/README.md index 325e53d0b5..61eac11f61 100644 --- a/docs/README.md +++ b/docs/README.md @@ -190,6 +190,7 @@ for more information about installing and using the source code. | [Content node selector component](content-services/content-node-selector.component.md) | Allows a user to select items from a Content Services repository. | [Source](../lib/content-services/content-node-selector/content-node-selector.component.ts) | | [Content action component](content-services/content-action.component.md) | Adds options to a Document List actions menu for a particular content type. | [Source](../lib/content-services/document-list/components/content-action/content-action.component.ts) | | [Document list component](content-services/document-list.component.md) | Displays the documents from a repository. | [Source](../lib/content-services/document-list/components/document-list.component.ts) | +| [Permission list component](content-services/permission-list.component.md) | Shows node permissions as a table. | [Source](../lib/content-services/permission-manager/components/permission-list/permission-list.component.ts) | | [Search control component](content-services/search-control.component.md) | Displays a input text which shows find-as-you-type suggestions. | [Source](../lib/content-services/search/components/search-control.component.ts) | | [Search component](content-services/search.component.md) | Searches items for supplied search terms. | [Source](../lib/content-services/search/components/search.component.ts) | | [Sites dropdown component](content-services/sites-dropdown.component.md) | Displays a dropdown menu to show and interact with the sites of the current user. | [Source](../lib/content-services/site-dropdown/sites-dropdown.component.ts) | @@ -201,10 +202,10 @@ for more information about installing and using the source code. | [File uploading dialog component](content-services/file-uploading-dialog.component.md) | Shows a dialog listing all the files uploaded with the Upload Button or Drag Area components. | [Source](../lib/content-services/upload/components/file-uploading-dialog.component.ts) | | [Upload button component](content-services/upload-button.component.md) | Activates a file upload. | [Source](../lib/content-services/upload/components/upload-button.component.ts) | | [Upload drag area component](content-services/upload-drag-area.component.md) | Adds a drag and drop area to upload files to Alfresco. | [Source](../lib/content-services/upload/components/upload-drag-area.component.ts) | +| [Upload version button component](content-services/upload-version-button.component.md) ![Experimental](docassets/images/ExperimentalIcon.png) | Activates a file version upload. | [Source](../lib/content-services/upload/components/upload-version-button.component.ts) | | [Version list component](content-services/version-list.component.md) ![Experimental](docassets/images/ExperimentalIcon.png) | Displays the version history of a node in a Version Manager component | [Source](../lib/content-services/version-manager/version-list.component.ts) | | [Version manager component](content-services/version-manager.component.md) ![Experimental](docassets/images/ExperimentalIcon.png) | Displays the version history of a node with the ability to upload a new version. | [Source](../lib/content-services/version-manager/version-manager.component.ts) | | [Webscript component](content-services/webscript.component.md) | Provides access to Webscript features. | [Source](../lib/content-services/webscript/webscript.component.ts) | -| _Upload version button component_ | _Not currently documented_ | [Source](../lib/content-services/upload/components/upload-version-button.component.ts) | ## Directives @@ -214,6 +215,7 @@ for more information about installing and using the source code. | [Node share directive](content-services/node-share.directive.md) | Create and manage public shared links for files | [Source](../lib/content-services/directives/node-share.directive.ts) | | [Folder create directive](content-services/folder-create.directive.md) | Allows folders to be created. | [Source](../lib/content-services/folder-directive/folder-create.directive.ts) | | [Folder edit directive](content-services/folder-edit.directive.md) | Allows folders to be edited. | [Source](../lib/content-services/folder-directive/folder-edit.directive.ts) | +| [Inherited button directive](content-services/inherited-button.directive.md) | Update the current node by adding/removing the inherited permissions. | [Source](../lib/content-services/permission-manager/components/inherited-button.directive.ts) | | [File draggable directive](core/file-draggable.directive.md) | Provide drag-and-drop features for an element such as a `div`. | [Source](../lib/content-services/upload/directives/file-draggable.directive.ts) | ## Models @@ -297,7 +299,7 @@ for more information about installing and using the source code. | [Process filter service](process-services/process-filter.service.md) | Manage Process Filters, which are pre-configured Process Instance queries. | [Source](../lib/process-services/process-list/services/process-filter.service.ts) | | [Process service](process-services/process.service.md) | Manages Process Instances, Process Variables, and Process Audit Log. | [Source](../lib/process-services/process-list/services/process.service.ts) | | [Task filter service](process-services/task-filter.service.md) | Manage Task Filters, which are pre-configured Task Instance queries. | [Source](../lib/process-services/task-list/services/task-filter.service.ts) | -| [Tasklist service](process-services/tasklist.service.md) | Manage Task Instances. | [Source](../lib/process-services/task-list/services/tasklist.service.ts) | +| [Tasklist service](process-services/tasklist.service.md) | Manages Task Instances. | [Source](../lib/process-services/task-list/services/tasklist.service.ts) | diff --git a/docs/content-services/README.md b/docs/content-services/README.md index dcbaf8897c..6f05bc1789 100644 --- a/docs/content-services/README.md +++ b/docs/content-services/README.md @@ -18,6 +18,7 @@ for more information about installing and using the source code. | [Content node selector component](content-node-selector.component.md) | Allows a user to select items from a Content Services repository. | [Source](../../lib/content-services/content-node-selector/content-node-selector.component.ts) | | [Content action component](content-action.component.md) | Adds options to a Document List actions menu for a particular content type. | [Source](../../lib/content-services/document-list/components/content-action/content-action.component.ts) | | [Document list component](document-list.component.md) | Displays the documents from a repository. | [Source](../../lib/content-services/document-list/components/document-list.component.ts) | +| [Permission list component](permission-list.component.md) | Shows node permissions as a table. | [Source](../../lib/content-services/permission-manager/components/permission-list/permission-list.component.ts) | | [Search control component](search-control.component.md) | Displays a input text which shows find-as-you-type suggestions. | [Source](../../lib/content-services/search/components/search-control.component.ts) | | [Search component](search.component.md) | Searches items for supplied search terms. | [Source](../../lib/content-services/search/components/search.component.ts) | | [Sites dropdown component](sites-dropdown.component.md) | Displays a dropdown menu to show and interact with the sites of the current user. | [Source](../../lib/content-services/site-dropdown/sites-dropdown.component.ts) | @@ -29,10 +30,10 @@ for more information about installing and using the source code. | [File uploading dialog component](file-uploading-dialog.component.md) | Shows a dialog listing all the files uploaded with the Upload Button or Drag Area components. | [Source](../../lib/content-services/upload/components/file-uploading-dialog.component.ts) | | [Upload button component](upload-button.component.md) | Activates a file upload. | [Source](../../lib/content-services/upload/components/upload-button.component.ts) | | [Upload drag area component](upload-drag-area.component.md) | Adds a drag and drop area to upload files to Alfresco. | [Source](../../lib/content-services/upload/components/upload-drag-area.component.ts) | +| [Upload version button component](upload-version-button.component.md) ![Experimental](../docassets/images/ExperimentalIcon.png) | Activates a file version upload. | [Source](../../lib/content-services/upload/components/upload-version-button.component.ts) | | [Version list component](version-list.component.md) ![Experimental](../docassets/images/ExperimentalIcon.png) | Displays the version history of a node in a Version Manager component | [Source](../../lib/content-services/version-manager/version-list.component.ts) | | [Version manager component](version-manager.component.md) ![Experimental](../docassets/images/ExperimentalIcon.png) | Displays the version history of a node with the ability to upload a new version. | [Source](../../lib/content-services/version-manager/version-manager.component.ts) | | [Webscript component](webscript.component.md) | Provides access to Webscript features. | [Source](../../lib/content-services/webscript/webscript.component.ts) | -| _Upload version button component_ | _Not currently documented_ | [Source](../../lib/content-services/upload/components/upload-version-button.component.ts) | ## Directives @@ -42,6 +43,7 @@ for more information about installing and using the source code. | [Node share directive](node-share.directive.md) | Create and manage public shared links for files | [Source](../../lib/content-services/directives/node-share.directive.ts) | | [Folder create directive](folder-create.directive.md) | Allows folders to be created. | [Source](../../lib/content-services/folder-directive/folder-create.directive.ts) | | [Folder edit directive](folder-edit.directive.md) | Allows folders to be edited. | [Source](../../lib/content-services/folder-directive/folder-edit.directive.ts) | +| [Inherited button directive](inherited-button.directive.md) | Update the current node by adding/removing the inherited permissions. | [Source](../../lib/content-services/permission-manager/components/inherited-button.directive.ts) | | [File draggable directive](file-draggable.directive.md) | Provide drag-and-drop features for an element such as a `div`. | [Source](../../lib/content-services/upload/directives/file-draggable.directive.ts) | ## Models diff --git a/docs/content-services/inherit-permission-directive.md b/docs/content-services/inherited-button.directive.md similarity index 100% rename from docs/content-services/inherit-permission-directive.md rename to docs/content-services/inherited-button.directive.md diff --git a/docs/content-services/permission-list.component.md b/docs/content-services/permission-list.component.md index d034a024a3..1d1784ee24 100644 --- a/docs/content-services/permission-list.component.md +++ b/docs/content-services/permission-list.component.md @@ -1,11 +1,13 @@ --- Added: v2.3.0 Status: Active -Last reviewed: 2018-03-12 +Last reviewed: 2018-03-23 --- # Permission List Component +Shows node permissions as a table. + ![Permission List](../docassets/images/adf-permission-list.png) ## Basic Usage @@ -19,8 +21,9 @@ Last reviewed: 2018-03-12 | Name | Type | Default value | Description | | ---- | ---- | ------------- | ----------- | -| nodeId | `string` | `null` | node id which we want to show the permissions | +| nodeId | `string` | `null` | ID of the node whose permissions you want to show. | ## Details -This component use the `datatable` to show the permission retrieved from the node service. \ No newline at end of file +This component uses a [Datatable component](../core/datatable.component.md) to show the +permissions retrieved from the [Node service](../core/node.service.md). \ No newline at end of file diff --git a/docs/content-services/upload-button.component.md b/docs/content-services/upload-button.component.md index 35cda81e67..755ae2256a 100644 --- a/docs/content-services/upload-button.component.md +++ b/docs/content-services/upload-button.component.md @@ -1,7 +1,9 @@ --- Added: v2.0.0 Status: Active +Last reviewed: 2018-03-23 --- + # Upload Button Component Activates a file upload. @@ -28,28 +30,29 @@ Activates a file upload. | uploadFolders | `boolean` | `false` | Allows/disallows upload folders (only for Chrome). | | multipleFiles | `boolean` | `false` | Allows/disallows multiple files | | versioning | `boolean` | `false` | Toggles versioning. | -| acceptedFilesType | `string` | `'*'` | List of allowed file extensions, for example: ".jpg,.gif,.png,.svg". | | maxFilesSize | `number` | | Sets a limit on the maximum size (in bytes) of a file to be uploaded. Has no effect if undefined. | | staticTitle | `string` | | Defines the text of the upload button. | | tooltip | `string` | `null` | Custom tooltip text. | | rootFolderId | `string` | `'-root-'` | The ID of the root. Use the nodeId for Content Services or the taskId/processId for Process Services. | +| acceptedFilesType | `string` | `'*'` | Filter for accepted file types. | ### Events | Name | Type | Description | | ---- | ---- | ----------- | -| success | `EventEmitter<{}>` | Emitted when the file is uploaded successfully. | -| error | `EventEmitter<{}>` | Emitted when an error occurs. | -| createFolder | `EventEmitter<{}>` | Emitted when a folder is created. | -| permissionEvent | `EventEmitter` | Emitted when delete permission is missing. | +| success | `EventEmitter<{}>` | Emitted when the file is uploaded successfully. | +| error | `EventEmitter<{}>` | Emitted when an error occurs. | +| createFolder | `EventEmitter<{}>` | Emitted when a folder is created. | +| permissionEvent | `EventEmitter` | Emitted when delete permission is missing. | ## Details -### How to show notification message with no permission +### How to show a notification message for bad permission -You can show a notification error when the user doesn't have the right permission to perform the action. -The UploadButtonComponent provides the event permissionEvent that is raised when the delete permission is missing -You can subscribe to this event from your component and use the NotificationService to show a message. +You can show a notification error when the user doesn't have the right permission to perform +the action. The component emits a `permissionEvent` when the user does not have delete permission. +You can subscribe to this event from your component and use the +[Notification service](../core/notification.service.md) to show a message. ```html - -``` - -### Properties and events - -Since UploadVersionButtonComponent extends UploadButtonComponent, the properties are the same. Note that some properties doesn't make sense in case of version upload button, thus are just simply ignored. For the version upload button the **node** (which is about to be versioned) is a mandatory input parameter. - -Since UploadVersionButtonComponent extends UploadButtonComponent the events are the same. - -### Restrictions -At the moment the API only allows new version uploads for a node, if the name of the new version is exactly the same as the old version (**and most importantly the extension**). Because of it, this workaround component uploads the chosen file with the same name as what the original file had (that is the reason, the **node** is a mandatory dependency for this component). - -So at the end what this component can and can not do: - -**Can**: -- upload a new version from the same file extension regardless of the file name. - -**Can not**: -- upload a new version which has a different file extension, than what the originally uploaded file had. (an error message is emitted on the error EventEmitter of the component). +- [Upload Version Button component](upload-version-button.component.md) diff --git a/docs/content-services/upload-version-button.component.md b/docs/content-services/upload-version-button.component.md new file mode 100644 index 0000000000..9c4099c370 --- /dev/null +++ b/docs/content-services/upload-version-button.component.md @@ -0,0 +1,74 @@ +--- +Added: v2.3.0 +Status: Experimental +Last reviewed: 2018-03-23 +--- + +# Upload Version Button Component (Workaround) + +Activates a file version upload. + +Until further backend API improvements are implemented, this component is meant to be used +to enrich the features and decrease the restrictions currently applied to node version uploading. + +## Basic usage + +```html + + +``` + +This component extends the [Upload Button component](upload-button.component.md). The +properties and events are the same except for the `node` property that specifies the node +to be versioned (this is a _required_ input parameter). However, some properties don't make +sense when applied to the Upload Version Button component, so they are simply ignored. + +### Properties + +| Name | Type | Default value | Description | +| ---- | ---- | ------------- | ----------- | +| node | `MinimalNodeEntryEntity` | | (**Required**) The node to be versioned. | +| disabled | `boolean` | `false` | Toggles component disabled state (if there is no node permission checking). | +| uploadFolders | `boolean` | `false` | Allows/disallows upload folders (only for Chrome). | +| multipleFiles | `boolean` | `false` | Allows/disallows multiple files | +| versioning | `boolean` | `false` | Toggles versioning. | +| maxFilesSize | `number` | | Sets a limit on the maximum size (in bytes) of a file to be uploaded. Has no effect if undefined. | +| staticTitle | `string` | | Defines the text of the upload button. | +| tooltip | `string` | `null` | Custom tooltip text. | +| rootFolderId | `string` | `'-root-'` | The ID of the root. Use the nodeId for Content Services or the taskId/processId for Process Services. | +| acceptedFilesType | `string` | `'*'` | Filter for accepted file types. | + +### Events + +| Name | Type | Description | +| ---- | ---- | ----------- | +| success | `EventEmitter<{}>` | Emitted when the file is uploaded successfully. | +| error | `EventEmitter<{}>` | Emitted when an error occurs. | +| createFolder | `EventEmitter<{}>` | Emitted when a folder is created. | +| permissionEvent | `EventEmitter` | Emitted when delete permission is missing. | + +## Details + +### Restrictions + +Currently, the API only allows new version uploads for a node where the name +(and most importantly the _extension_) of the new version +is exactly the same as the old version. As a result, this workaround component uploads the +chosen file with the same name that the original file had. This is the reason why the `node` +is a mandatory dependency for this component. + +So, to sum up, this component: + +- **Can** upload a new version from the same file extension regardless of the file name. +- **Cannot** upload a new version that has a different file extension, to the file that was + originally uploaded (an error message will be emitted by the `error` EventEmitter of the component. + +## See also + +- [Upload Button component](upload-button.component.md) diff --git a/docs/process-services/README.md b/docs/process-services/README.md index 441a8c84a8..795bbdfdd9 100644 --- a/docs/process-services/README.md +++ b/docs/process-services/README.md @@ -57,6 +57,6 @@ for more information about installing and using the source code. | [Process filter service](process-filter.service.md) | Manage Process Filters, which are pre-configured Process Instance queries. | [Source](../../lib/process-services/process-list/services/process-filter.service.ts) | | [Process service](process.service.md) | Manages Process Instances, Process Variables, and Process Audit Log. | [Source](../../lib/process-services/process-list/services/process.service.ts) | | [Task filter service](task-filter.service.md) | Manage Task Filters, which are pre-configured Task Instance queries. | [Source](../../lib/process-services/task-list/services/task-filter.service.ts) | -| [Tasklist service](tasklist.service.md) | Manage Task Instances. | [Source](../../lib/process-services/task-list/services/tasklist.service.ts) | +| [Tasklist service](tasklist.service.md) | Manages Task Instances. | [Source](../../lib/process-services/task-list/services/tasklist.service.ts) | diff --git a/lib/content-services/upload/components/base-upload/upload-base.ts b/lib/content-services/upload/components/base-upload/upload-base.ts index 89c3a73c6a..e0de4b1308 100644 --- a/lib/content-services/upload/components/base-upload/upload-base.ts +++ b/lib/content-services/upload/components/base-upload/upload-base.ts @@ -20,6 +20,7 @@ import { Input } from '@angular/core'; export abstract class UploadBase { + /** Filter for accepted file types. */ @Input() acceptedFilesType: string = '*'; diff --git a/lib/content-services/upload/components/upload-version-button.component.ts b/lib/content-services/upload/components/upload-version-button.component.ts index 566ef5cef6..80c1d49fa4 100644 --- a/lib/content-services/upload/components/upload-version-button.component.ts +++ b/lib/content-services/upload/components/upload-version-button.component.ts @@ -31,6 +31,7 @@ import { FileModel, EXTENDIBLE_COMPONENT } from '@alfresco/adf-core'; }) export class UploadVersionButtonComponent extends UploadButtonComponent implements OnChanges { + /** (**Required**) The node to be versioned. */ @Input() node: MinimalNodeEntryEntity; diff --git a/lib/package.json b/lib/package.json index 61ef0783ae..73b0a89d17 100644 --- a/lib/package.json +++ b/lib/package.json @@ -125,6 +125,9 @@ "loader-utils": "1.1.0", "markdown-toc": "1.1.0", "markdownlint-cli": "^0.3.1", + "mdast-util-heading-range": "^2.1.0", + "mdast-util-toc": "^2.0.1", + "mdast-zone": "^3.0.1", "merge-stream": "1.0.1", "nconf": "^0.10.0", "ng-packagr": "2.2.0", @@ -132,6 +135,7 @@ "null-loader": "0.1.1", "raw-loader": "0.5.1", "remap-istanbul": "0.6.3", + "remark-frontmatter": "^1.2.0", "rimraf": "^2.6.2", "rollup-plugin-cleanup": "^2.0.0", "rollup-plugin-commonjs": "8.3.0",