mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
[ACA-99] Viewer actions (#203)
* "toggle favorite" action * copy and move actions * move actions to the "more" menu
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user