diff --git a/docs/README.md b/docs/README.md index 1c5f92b02c..763c0aa63f 100644 --- a/docs/README.md +++ b/docs/README.md @@ -55,7 +55,8 @@ for more information about installing and using the source code. | Name | Description | Source link | | ---- | ----------- | ----------- | -| [About component](core/about.component.md) ![Experimental](docassets/images/ExperimentalIcon.png) | This component allow you to have a general overview of the version of ADF installed and the status of the Content service and Process service. | [Source](../lib/core/about/about.component.ts) | +| [About component](core/about.component.md) ![Experimental](docassets/images/ExperimentalIcon.png) | This component allow you to have a general overview of the version of ADF installed and the status of the Content service and Process service +Note at the moment this component is mostly for internal use and it require: | [Source](../lib/core/about/about.component.ts) | | [Buttons menu component](core/buttons-menu.component.md) | Displays buttons on a responsive menu. | [Source](../lib/core/buttons-menu/buttons-menu.component.ts) | | [Card view component](core/card-view.component.md) | Displays a configurable property list renderer. | [Source](../lib/core/card-view/components/card-view/card-view.component.ts) | | [Accordion group component](core/accordion-group.component.md) | Adds a collapsible panel to an accordion menu. | [Source](../lib/core/collapsable/accordion-group.component.ts) | @@ -203,8 +204,8 @@ 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) | -| [Add permission dialog component](content-services/add-permission-dialog.component.md) | Allow user to search people or group that could be added to the current node permissions. | [Source](../lib/content-services/permission-manager/components/add-permission/add-permission-dialog.component.ts) | -| [Add permission panel component](content-services/add-permission-panel.component.md) | Allow user to search people or group that could be added to the current node permissions. | [Source](../lib/content-services/permission-manager/components/add-permission/add-permission-panel.component.ts) | +| [Add permission dialog component](content-services/add-permission-dialog.component.md) | Displays a dialog to search for people or groups to add to the current node permissions. | [Source](../lib/content-services/permission-manager/components/add-permission/add-permission-dialog.component.ts) | +| [Add permission panel component](content-services/add-permission-panel.component.md) | Searches for people or groups to add to the current node permissions. | [Source](../lib/content-services/permission-manager/components/add-permission/add-permission-panel.component.ts) | | [Add permission component](content-services/add-permission.component.md) | Searches for people or groups to add to the current node permissions. | [Source](../lib/content-services/permission-manager/components/add-permission/add-permission.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 chip list component](content-services/search-chip-list.component.md) | Displays search criteria as a set of "chips". | [Source](../lib/content-services/search/components/search-chip-list/search-chip-list.component.ts) | @@ -254,11 +255,11 @@ for more information about installing and using the source code. | [Document actions service](content-services/document-actions.service.md) | Implements the document menu actions for the [Document List component](../content-services/document-list.component.md). | [Source](../lib/content-services/document-list/services/document-actions.service.ts) | | [Document list service](content-services/document-list.service.md) | Implements node operations used by the [Document List component](../content-services/document-list.component.md). | [Source](../lib/content-services/document-list/services/document-list.service.ts) | | [Folder actions service](content-services/folder-actions.service.md) | Implements the folder menu actions for the [Document List component](../content-services/document-list.component.md). | [Source](../lib/content-services/document-list/services/folder-actions.service.ts) | +| [Node permission dialog service](content-services/node-permission-dialog.service.md) | Displays dialogs to let the user set node permissions. | [Source](../lib/content-services/permission-manager/services/node-permission-dialog.service.ts) | | [Node permission service](content-services/node-permission.service.md) | Manages role permissions for content nodes. | [Source](../lib/content-services/permission-manager/services/node-permission.service.ts) | | [Search query builder service](content-services/search-query-builder.service.md) | Stores information from all the custom search and faceted search widgets, compiles and runs the final Search query. | [Source](../lib/content-services/search/search-query-builder.service.ts) | | [Rating service](content-services/rating.service.md) | Manages ratings for items in Content Services. | [Source](../lib/content-services/social/services/rating.service.ts) | | [Tag service](content-services/tag.service.md) | Manages tags in Content Services. | [Source](../lib/content-services/tag/services/tag.service.ts) | -| _Node permission dialog service_ | _Not currently documented_ | [Source](../lib/content-services/permission-manager/services/node-permission-dialog.service.ts) | diff --git a/docs/content-services/README.md b/docs/content-services/README.md index 305ceeaf47..8842300d00 100644 --- a/docs/content-services/README.md +++ b/docs/content-services/README.md @@ -18,8 +18,8 @@ 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) | -| [Add permission dialog component](add-permission-dialog.component.md) | Allow user to search people or group that could be added to the current node permissions. | [Source](../../lib/content-services/permission-manager/components/add-permission/add-permission-dialog.component.ts) | -| [Add permission panel component](add-permission-panel.component.md) | Allow user to search people or group that could be added to the current node permissions. | [Source](../../lib/content-services/permission-manager/components/add-permission/add-permission-panel.component.ts) | +| [Add permission dialog component](add-permission-dialog.component.md) | Displays a dialog to search for people or groups to add to the current node permissions. | [Source](../../lib/content-services/permission-manager/components/add-permission/add-permission-dialog.component.ts) | +| [Add permission panel component](add-permission-panel.component.md) | Searches for people or groups to add to the current node permissions. | [Source](../../lib/content-services/permission-manager/components/add-permission/add-permission-panel.component.ts) | | [Add permission component](add-permission.component.md) | Searches for people or groups to add to the current node permissions. | [Source](../../lib/content-services/permission-manager/components/add-permission/add-permission.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 chip list component](search-chip-list.component.md) | Displays search criteria as a set of "chips". | [Source](../../lib/content-services/search/components/search-chip-list/search-chip-list.component.ts) | @@ -69,10 +69,10 @@ for more information about installing and using the source code. | [Document actions service](document-actions.service.md) | Implements the document menu actions for the [Document List component](../content-services/document-list.component.md). | [Source](../../lib/content-services/document-list/services/document-actions.service.ts) | | [Document list service](document-list.service.md) | Implements node operations used by the [Document List component](../content-services/document-list.component.md). | [Source](../../lib/content-services/document-list/services/document-list.service.ts) | | [Folder actions service](folder-actions.service.md) | Implements the folder menu actions for the [Document List component](../content-services/document-list.component.md). | [Source](../../lib/content-services/document-list/services/folder-actions.service.ts) | +| [Node permission dialog service](node-permission-dialog.service.md) | Displays dialogs to let the user set node permissions. | [Source](../../lib/content-services/permission-manager/services/node-permission-dialog.service.ts) | | [Node permission service](node-permission.service.md) | Manages role permissions for content nodes. | [Source](../../lib/content-services/permission-manager/services/node-permission.service.ts) | | [Search query builder service](search-query-builder.service.md) | Stores information from all the custom search and faceted search widgets, compiles and runs the final Search query. | [Source](../../lib/content-services/search/search-query-builder.service.ts) | | [Rating service](rating.service.md) | Manages ratings for items in Content Services. | [Source](../../lib/content-services/social/services/rating.service.ts) | | [Tag service](tag.service.md) | Manages tags in Content Services. | [Source](../../lib/content-services/tag/services/tag.service.ts) | -| _Node permission dialog service_ | _Not currently documented_ | [Source](../../lib/content-services/permission-manager/services/node-permission-dialog.service.ts) | diff --git a/docs/content-services/add-permission-dialog.component.md b/docs/content-services/add-permission-dialog.component.md index 75b15f9db5..9dde52e0f9 100644 --- a/docs/content-services/add-permission-dialog.component.md +++ b/docs/content-services/add-permission-dialog.component.md @@ -6,7 +6,7 @@ Last reviewed: 2018-05-03 # Add Permission Dialog Component -Allow user to search people or group that could be added to the current node permissions. +Displays a dialog to search for people or groups to add to the current node permissions. ![Add Permission Component](../docassets/images/add-permission-component.png) @@ -28,10 +28,12 @@ import { NodePermissionDialogService } from '@alfresco/adf-content-services'; ## 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 dialog will be opened via the nodePermissionDialogService which will provide an Observable to subscribe to for getting the node selected. -In case you want the dialog service to take care of update the current node you can call `updateNodePermissionByDialog` in this way : +This component extends the [Add permission panel component](../content-services/add-permission-panel.component.md) +to apply the chosen selection of permissions when they are accepted. +You can open the dialog with the [Node Permission Dialog Service](../content-services/node-permission-dialog.service.md). This returns Observables that +you can subscribe to for get the details of the node after the update. +Use the `updateNodePermissionByDialog` from the service to update node permissions, as shown in +the following example: ```ts import { NodePermissionDialogService } from '@alfresco/adf-content-services'; @@ -46,3 +48,8 @@ import { NodePermissionDialogService } from '@alfresco/adf-content-services'; this.showErrorMessage(error); }); ``` + +## See also + +- [Node permission dialog service](node-permission-dialog.service.md) +- [Add permission panel component](add-permission-panel.component.md) diff --git a/docs/content-services/add-permission-panel.component.md b/docs/content-services/add-permission-panel.component.md index 0369109be6..3bae3fba7f 100644 --- a/docs/content-services/add-permission-panel.component.md +++ b/docs/content-services/add-permission-panel.component.md @@ -4,17 +4,19 @@ Status: Active Last reviewed: 2018-05-03 --- -# Add Permission Component +# Add Permission Panel 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) ## Basic Usage ```html - + ``` @@ -30,4 +32,13 @@ Allow user to search people or group that could be added to the current node per 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. +The `select` event is emitted when a result is clicked from the list. + +The [Add permission dialog component](../content-services/add-permission-dialog.component.md) +and [Add permission component](../content-services/add-permission.component.md) extend this behavior by applying the chosen +permissions to the node once the selection has been made. + +## See also + +- [Add permission dialog component](../content-services/add-permission-dialog.component.md) +- [Add permission component](../content-services/add-permission.component.md) diff --git a/docs/content-services/add-permission.component.md b/docs/content-services/add-permission.component.md index 6f3f8f6a9d..7e2156fb93 100644 --- a/docs/content-services/add-permission.component.md +++ b/docs/content-services/add-permission.component.md @@ -13,8 +13,10 @@ Searches for people or groups to add to the current node permissions. ## Basic Usage ```html - + ``` @@ -35,5 +37,11 @@ Searches for people or groups to add to the current node permissions. ## 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. +This component extends the [Add permission panel component](../content-services/add-permission-panel.component.md) +to apply the chosen selection of permissions when they are accepted. You can also +use the [Add permission dialog component](../content-services/add-permission-dialog.component.md) to perform the same action using a dialog. + +## See also + +- [Add permission panel component](../content-services/add-permission-panel.component.md) +- [Add permission dialog component](../content-services/add-permission-dialog.component.md) diff --git a/docs/content-services/node-permission-dialog.service.md b/docs/content-services/node-permission-dialog.service.md new file mode 100644 index 0000000000..ab57c9a4e4 --- /dev/null +++ b/docs/content-services/node-permission-dialog.service.md @@ -0,0 +1,36 @@ +--- +Added: v2.4.0 +Status: Active +Last reviewed: 2018-05-23 +--- + +# Node permission dialog service + +Displays dialogs to let the user set node permissions. + +## Class members + +### Methods + +- **close**()
+ Closes the currently-open dialog. +- **openAddPermissionDialog**(nodeId: `string` = `null`, title?: `string` = `null`): `Observable`
+ Opens a dialog to add permissions to a node. + - _nodeId:_ `string` - ID of the target node + - _title:_ `string` - (Optional)Dialog title + - **Returns** `Observable` - Node with updated permissions +- **updateNodePermissionByDialog**(nodeId?: `string` = `null`, title?: `string` = `null`): `Observable`
+ Opens a dialog to update permissions for a node. + - _nodeId:_ `string` - (Optional)ID of the target node + - _title:_ `string` - (Optional)Dialog title + - **Returns** `Observable` - Node with updated permissions + +## Details + +This service sets up an [Add Permission Dialog component](../content-services/add-permission-dialog.component.md) to provide a user +interface for updating permissions. + +## See also + +- [Node Permission service](node-permission.service.md) +- [Add Permission Dialog component](add-permission-dialog.component.md) diff --git a/lib/content-services/permission-manager/services/node-permission-dialog.service.ts b/lib/content-services/permission-manager/services/node-permission-dialog.service.ts index b0c433021b..fa6de27a9b 100644 --- a/lib/content-services/permission-manager/services/node-permission-dialog.service.ts +++ b/lib/content-services/permission-manager/services/node-permission-dialog.service.ts @@ -31,6 +31,12 @@ export class NodePermissionDialogService { private nodePermissionService: NodePermissionService) { } + /** + * Opens a dialog to add permissions to a node. + * @param nodeId ID of the target node + * @param title Dialog title + * @returns Node with updated permissions + */ openAddPermissionDialog(nodeId: string, title?: string): Observable { const confirm = new Subject(); @@ -52,10 +58,19 @@ export class NodePermissionDialogService { this.dialog.open(AddPermissionDialogComponent, { data, panelClass: currentPanelClass, width: chosenWidth }); } + /** + * Closes the currently-open dialog. + */ close() { this.dialog.closeAll(); } + /** + * Opens a dialog to update permissions for a node. + * @param nodeId ID of the target node + * @param title Dialog title + * @returns Node with updated permissions + */ updateNodePermissionByDialog(nodeId?: string, title?: string): Observable { return this.openAddPermissionDialog(nodeId, title).switchMap((selection) => { return this.nodePermissionService.updateNodePermissions(nodeId, selection);