mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ACS-7429] cleanup APS1 task-list before refactorings (#9650)
This commit is contained in:
@@ -2,10 +2,12 @@
|
||||
Title: Add Permission Dialog Component
|
||||
Added: v2.4.0
|
||||
Status: Active
|
||||
Last reviewed: 2018-11-13
|
||||
Last reviewed: 2024-05-07
|
||||
---
|
||||
|
||||
# [Add Permission Dialog Component](../../../lib/content-services/src/lib/permission-manager/components/add-permission/add-permission-dialog.component.ts "Defined in add-permission-dialog.component.ts")
|
||||
# Add Permission Dialog Component
|
||||
|
||||
`import { NodePermissionDialogService } from '@alfresco/adf-content-services';`
|
||||
|
||||
Displays a dialog to search for people or groups to add to the current node permissions.
|
||||
|
||||
@@ -15,41 +17,53 @@ Displays a dialog to search for people or groups to add to the current node perm
|
||||
|
||||
```ts
|
||||
import { NodePermissionDialogService } from '@alfresco/adf-content-services';
|
||||
import { inject } from '@angular/core';
|
||||
|
||||
constructor(private nodePermissionDialogService: nodePermissionDialogService) {
|
||||
export class MyComponent {
|
||||
private nodePermissionDialogService = inject(NodePermissionDialogService);
|
||||
|
||||
showDialog() {
|
||||
this.nodePermissionDialogService
|
||||
.openAddPermissionDialog(this.nodeId)
|
||||
.subscribe((selectedNodes) => {
|
||||
//action for selected nodes
|
||||
},
|
||||
(error) => {
|
||||
this.showErrorMessage(error);
|
||||
});
|
||||
}
|
||||
|
||||
this.nodePermissionDialogService.openAddPermissionDialog(this.nodeId).subscribe((selectedNodes) => {
|
||||
//action for selected nodes
|
||||
},
|
||||
(error) => {
|
||||
this.showErrorMessage(error);
|
||||
});
|
||||
}
|
||||
```
|
||||
|
||||
## Details
|
||||
|
||||
This component extends the [Add permission panel component](add-permission-panel.component.md)
|
||||
to apply the chosen selection of permissions when they are accepted.
|
||||
|
||||
You can open the dialog with the `openAddPermissionDialog` method from the
|
||||
[Node Permission Dialog Service](../services/node-permission-dialog.service.md).
|
||||
This returns an [`Observable`](http://reactivex.io/documentation/observable.html)
|
||||
that you can subscribe to so you can get the details of the node after the update.
|
||||
Use the `updateNodePermissionByDialog` nethod from the service to update node permissions, as shown in
|
||||
that you can subscribe to, so you can get the details of the node after the update.
|
||||
|
||||
Use the `updateNodePermissionByDialog` method from the service to update node permissions, as shown in
|
||||
the following example:
|
||||
|
||||
```ts
|
||||
import { NodePermissionDialogService } from '@alfresco/adf-content-services';
|
||||
import { inject } from '@angular/core';
|
||||
|
||||
constructor(private nodePermissionDialogService: nodePermissionDialogService) {
|
||||
export class MyComponent {
|
||||
private nodePermissionDialogService = inject(NodePermissionDialogService);
|
||||
|
||||
updateNodePermissions() {
|
||||
this.nodePermissionDialogService.updateNodePermissionByDialog(this.nodeId).subscribe((node) => {
|
||||
//updated node
|
||||
},
|
||||
(error) => {
|
||||
this.showErrorMessage(error);
|
||||
});
|
||||
}
|
||||
|
||||
this.nodePermissionDialogService.updateNodePermissionByDialog(this.nodeId).subscribe((node) => {
|
||||
//updated node
|
||||
},
|
||||
(error) => {
|
||||
this.showErrorMessage(error);
|
||||
});
|
||||
}
|
||||
```
|
||||
|
||||
## See also
|
||||
|
@@ -2,42 +2,52 @@
|
||||
Title: Aspect List component
|
||||
Added: v2.0.0
|
||||
Status: Active
|
||||
Last reviewed: 2021-01-20
|
||||
Last reviewed: 2024-05-07
|
||||
---
|
||||
|
||||
# [Aspect List component](../../../lib/content-services/src/lib/aspect-list/aspect-list.component.ts "Defined in aspect-list.component.ts")
|
||||
# Aspect List Component
|
||||
|
||||
`import { AspectListComponent } from '@alfresco/adf-content-services';`
|
||||
|
||||
This component will show in an expandable row list with checkboxes all the aspect of a node, if a node id is given, or otherwise a complete list.
|
||||
The aspect are filtered via the app.config.json in this way :
|
||||
|
||||
The aspects are filtered via the `app.config.json` in the following way :
|
||||
|
||||
```json
|
||||
"aspect-visible": {
|
||||
"default" : ["as:aspectThatWillBeShowedIfPresent"]
|
||||
}
|
||||
{
|
||||
"aspect-visible": {
|
||||
"default": [
|
||||
"as:aspectThatWillBeShowedIfPresent"
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Basic Usage
|
||||
|
||||
```html
|
||||
<adf-aspect-list (valueChanged)="onValueChanged($event)" (updateCounter)="onUpdateCounter($event)" [nodeId]="nodeId">
|
||||
</adf-aspect-list>
|
||||
<adf-aspect-list
|
||||
[nodeId]="nodeId"
|
||||
(valueChanged)="onValueChanged($event)"
|
||||
(updateCounter)="onUpdateCounter($event)">
|
||||
</adf-aspect-list>
|
||||
```
|
||||
|
||||
## Class members
|
||||
|
||||
### Properties
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| ---- | ---- | ------------- | ----------- |
|
||||
| nodeId | `string` | "" | Node Id of the node that we want to update |
|
||||
| excludedAspects | `string[]` | undefined | List of aspects' ids which should not be displayed. |
|
||||
| Name | Type | Default value | Description |
|
||||
|-----------------|------------|---------------|-----------------------------------------------------|
|
||||
| nodeId | `string` | "" | Node Id of the node that we want to update |
|
||||
| excludedAspects | `string[]` | undefined | List of aspects' ids which should not be displayed. |
|
||||
|
||||
### Events
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| valueChanged | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<string[]>` | Emitted every time the user select a new aspect |
|
||||
| updateCounter | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<number>` | Emitted every time the number of selected aspects changes |
|
||||
| Name | Type | Description |
|
||||
|---------------|------------------------------------------------------------------------|-----------------------------------------------------------|
|
||||
| valueChanged | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<string[]>` | Emitted every time the user select a new aspect |
|
||||
| updateCounter | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<number>` | Emitted every time the number of selected aspects changes |
|
||||
|
||||
## See also
|
||||
|
||||
|
Reference in New Issue
Block a user