mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ACA-4361] permission layout modified (#6937)
* * reusable data table column moved * [ACA-4361] permission layout modified * * build fixed * fix build * * import fixed * * null safety operation * * fixed comments * * fix lint * * wait for reload list * * remove sleep * * add sleep * * fix comments * * fix comments * * floating promises fix * * remove wait
This commit is contained in:
@@ -33,6 +33,9 @@
|
||||
<data-column type="text" key="users" title="Users"></data-column>
|
||||
<data-column key="status" title="Status">
|
||||
<ng-template let-value="value">{{value | json }}</ng-template>
|
||||
<adf-data-column-header>
|
||||
<ng-template>STATUS</ng-template>
|
||||
</adf-data-column-header>
|
||||
</data-column>
|
||||
</data-columns>
|
||||
-->
|
||||
|
@@ -410,7 +410,7 @@
|
||||
(execute)="onManageMetadata($event)">
|
||||
</content-action>
|
||||
<content-action
|
||||
icon="settings_input_component"
|
||||
icon="supervisor_account"
|
||||
title="DOCUMENT_LIST.ACTIONS.PERMISSION"
|
||||
permission="copy"
|
||||
(error)="onContentActionError($event)"
|
||||
|
@@ -1,18 +1,3 @@
|
||||
<div class="app-inherit_permission_button">
|
||||
<button mat-raised-button
|
||||
[color]="toggleStatus?'accent':'primary'"
|
||||
adf-inherit-permission [nodeId]="nodeId"
|
||||
(error)="showErrorMessage($event)"
|
||||
(updated)="onUpdatedPermissions($event)">
|
||||
{{ (toggleStatus?'DEMO_PERMISSION.INHERITED_PERMISSIONS_BUTTON':'DEMO_PERMISSION.INHERIT_PERMISSION_BUTTON') | translate}}</button>
|
||||
<button mat-button color="primary" (click)="openAddPermissionDialog()" data-automation-id="adf-add-permission-button">Add User or Group</button>
|
||||
<div class="app-permission-section">
|
||||
<adf-permission-list [nodeId]="nodeId"></adf-permission-list>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<adf-permission-list #permissionList
|
||||
[nodeId]="nodeId"
|
||||
(update)="reloadList()"
|
||||
(error)="showErrorMessage($event)">
|
||||
</adf-permission-list>
|
||||
</div>
|
||||
|
||||
|
@@ -1,6 +1,4 @@
|
||||
.app-inherit_permission_button {
|
||||
padding-top: 20px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding-bottom: 20px;
|
||||
.app-permission-section {
|
||||
box-sizing: border-box;
|
||||
height: 100%;
|
||||
}
|
||||
|
@@ -15,11 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, Optional, OnInit, ViewChild } from '@angular/core';
|
||||
import { Component, OnInit, Optional } from '@angular/core';
|
||||
import { ActivatedRoute, Params } from '@angular/router';
|
||||
import { PermissionListComponent, NodePermissionDialogService } from '@alfresco/adf-content-services';
|
||||
import { MinimalNodeEntryEntity } from '@alfresco/js-api';
|
||||
import { NodesApiService, NotificationService } from '@alfresco/adf-core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-permissions',
|
||||
@@ -28,16 +25,9 @@ import { NodesApiService, NotificationService } from '@alfresco/adf-core';
|
||||
})
|
||||
export class DemoPermissionComponent implements OnInit {
|
||||
|
||||
@ViewChild('permissionList', { static: true })
|
||||
displayPermissionComponent: PermissionListComponent;
|
||||
|
||||
nodeId: string;
|
||||
toggleStatus = false;
|
||||
|
||||
constructor(@Optional() private route: ActivatedRoute,
|
||||
private nodeService: NodesApiService,
|
||||
private nodePermissionDialogService: NodePermissionDialogService,
|
||||
private notificationService: NotificationService) {
|
||||
constructor(@Optional() private route: ActivatedRoute) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -48,34 +38,5 @@ export class DemoPermissionComponent implements OnInit {
|
||||
}
|
||||
});
|
||||
}
|
||||
this.nodeService
|
||||
.getNode(this.nodeId, {include: ['permissions'] })
|
||||
.subscribe( (currentNode: MinimalNodeEntryEntity) => {
|
||||
this.toggleStatus = currentNode.permissions?.isInheritanceEnabled ?? false;
|
||||
});
|
||||
}
|
||||
|
||||
onUpdatedPermissions(node: MinimalNodeEntryEntity) {
|
||||
this.toggleStatus = node.permissions?.isInheritanceEnabled ?? false;
|
||||
this.displayPermissionComponent.reload();
|
||||
}
|
||||
|
||||
reloadList() {
|
||||
this.displayPermissionComponent.reload();
|
||||
}
|
||||
|
||||
openAddPermissionDialog() {
|
||||
this.nodePermissionDialogService
|
||||
.updateNodePermissionByDialog(this.nodeId)
|
||||
.subscribe(
|
||||
() => this.displayPermissionComponent.reload(),
|
||||
(error) => this.showErrorMessage(error)
|
||||
);
|
||||
}
|
||||
|
||||
showErrorMessage(error) {
|
||||
const message = error.message ? error.message : error;
|
||||
this.notificationService.openSnackMessage(message);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user