[ADF-2824] Added and reviewed some content services docs (#3385)

This commit is contained in:
Andy Stark 2018-05-23 19:35:19 +01:00 committed by Eugenio Romano
parent 41777e0540
commit 591bec5bdd
7 changed files with 99 additions and 21 deletions

View File

@ -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) |
<!--content-services end-->

View File

@ -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) |
<!--content-services end-->

View File

@ -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)

View File

@ -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
<adf-add-permission [nodeId]="nodeId"
(success)="onSuccess($event)" (error)="onError($event)">
<adf-add-permission
[nodeId]="nodeId"
(success)="onSuccess($event)"
(error)="onError($event)">
</adf-add-permission>
```
@ -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)

View File

@ -13,8 +13,10 @@ Searches for people or groups to add to the current node permissions.
## Basic Usage
```html
<adf-add-permission [nodeId]="nodeId"
(success)="onSuccess($event)" (error)="onError($event)">
<adf-add-permission
[nodeId]="nodeId"
(success)="onSuccess($event)"
(error)="onError($event)">
</adf-add-permission>
```
@ -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)

View File

@ -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**()<br/>
Closes the currently-open dialog.
- **openAddPermissionDialog**(nodeId: `string` = `null`, title?: `string` = `null`): `Observable<MinimalNodeEntity[]>`<br/>
Opens a dialog to add permissions to a node.
- _nodeId:_ `string` - ID of the target node
- _title:_ `string` - (Optional)Dialog title
- **Returns** `Observable<MinimalNodeEntity[]>` - Node with updated permissions
- **updateNodePermissionByDialog**(nodeId?: `string` = `null`, title?: `string` = `null`): `Observable<MinimalNodeEntryEntity>`<br/>
Opens a dialog to update permissions for a node.
- _nodeId:_ `string` - (Optional)ID of the target node
- _title:_ `string` - (Optional)Dialog title
- **Returns** `Observable<MinimalNodeEntryEntity>` - 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)

View File

@ -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<MinimalNodeEntity[]> {
const confirm = new Subject<MinimalNodeEntity[]>();
@ -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<MinimalNodeEntryEntity> {
return this.openAddPermissionDialog(nodeId, title).switchMap((selection) => {
return this.nodePermissionService.updateNodePermissions(nodeId, selection);