[ACA-537] remove permission check on toolbar options (#74)

This commit is contained in:
Cilibiu Bogdan
2017-11-21 18:28:18 +02:00
committed by Denys Vuika
parent 4cb51469ab
commit 025210fcce
2 changed files with 9 additions and 12 deletions

View File

@@ -58,7 +58,6 @@
<button <button
mat-menu-item mat-menu-item
*ngIf="canMove(documentList.selection)"
[app-move-node]="documentList.selection"> [app-move-node]="documentList.selection">
<mat-icon>library_books</mat-icon> <mat-icon>library_books</mat-icon>
<span>{{ 'APP.ACTIONS.MOVE' | translate }}</span> <span>{{ 'APP.ACTIONS.MOVE' | translate }}</span>
@@ -66,7 +65,6 @@
<button <button
mat-menu-item mat-menu-item
*ngIf="canDelete(documentList.selection)"
[app-delete-node]="documentList.selection"> [app-delete-node]="documentList.selection">
<mat-icon>delete</mat-icon> <mat-icon>delete</mat-icon>
<span>{{ 'APP.ACTIONS.DELETE' | translate }}</span> <span>{{ 'APP.ACTIONS.DELETE' | translate }}</span>

View File

@@ -34,9 +34,7 @@ export class FavoritesComponent extends PageComponent implements OnInit, OnDestr
@ViewChild(DocumentListComponent) @ViewChild(DocumentListComponent)
documentList: DocumentListComponent; documentList: DocumentListComponent;
private onEditFolder: Subscription; private subscriptions: any = [];
private onMoveNode: Subscription;
private onToggleFavorite: Subscription;
constructor( constructor(
private router: Router, private router: Router,
@@ -47,16 +45,17 @@ export class FavoritesComponent extends PageComponent implements OnInit, OnDestr
} }
ngOnInit() { ngOnInit() {
this.onEditFolder = this.contentService.folderEdit.subscribe(() => this.refresh()); this.subscriptions = this.subscriptions.concat([
this.onMoveNode = this.content.moveNode.subscribe(() => this.refresh()); this.content.deleteNode.subscribe(() => this.refresh()),
this.onToggleFavorite = this.content.toggleFavorite this.content.restoreNode.subscribe(() => this.refresh()),
.debounceTime(300).subscribe(() => this.refresh()); this.contentService.folderEdit.subscribe(() => this.refresh()),
this.content.moveNode.subscribe(() => this.refresh()),
this.content.toggleFavorite.debounceTime(300).subscribe(() => this.refresh())
]);
} }
ngOnDestroy() { ngOnDestroy() {
this.onEditFolder.unsubscribe(); this.subscriptions.forEach(s => s.unsubscribe());
this.onMoveNode.unsubscribe();
this.onToggleFavorite.unsubscribe();
} }
fetchNodes(): void { fetchNodes(): void {