[ACA-99] Viewer actions (#203)

* "toggle favorite" action

* copy and move actions

* move actions to the "more" menu
This commit is contained in:
Denys Vuika
2018-02-27 15:30:24 +00:00
committed by GitHub
parent 0b5dc47de9
commit 3a55411f40
5 changed files with 60 additions and 16 deletions

View File

@@ -26,7 +26,7 @@
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { AlfrescoApiService, UserPreferencesService, ObjectUtils } from '@alfresco/adf-core';
import { MinimalNodeEntryEntity } from 'alfresco-js-api';
import { Node, MinimalNodeEntity } from 'alfresco-js-api';
import { ContentManagementService } from '../../common/services/content-management.service';
@Component({
@@ -39,7 +39,7 @@ import { ContentManagementService } from '../../common/services/content-manageme
})
export class PreviewComponent implements OnInit {
node: MinimalNodeEntryEntity;
node: Node;
previewLocation: string = null;
routesSkipNavigation = [ 'shared', 'recent-files', 'favorites' ];
navigateSource: string = null;
@@ -51,6 +51,8 @@ export class PreviewComponent implements OnInit {
nextNodeId: string;
navigateMultiple = false;
selectedEntities: MinimalNodeEntity[] = [];
constructor(private router: Router,
private route: ActivatedRoute,
private apiService: AlfrescoApiService,
@@ -93,8 +95,10 @@ export class PreviewComponent implements OnInit {
if (id) {
try {
this.node = await this.apiService.nodesApi.getNodeInfo(id, {
include: [ 'allowableOperations']
include: ['allowableOperations']
});
this.selectedEntities = [{ entry: this.node }];
if (this.node && this.node.isFile) {
const nearest = await this.getNearestNodes(this.node.id, this.node.parentId);
@@ -331,4 +335,12 @@ export class PreviewComponent implements OnInit {
} catch {
}
}
canMoveFile(): boolean {
return this.content.canMoveNode(this.node);
}
canCopyFile(): boolean {
return this.content.canCopyNode(this.node);
}
}