mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-09-17 14:21:29 +00:00
added functionality to view a previous version (#5913)
This commit is contained in:
@@ -30,6 +30,7 @@ import { PreviewService } from '../../services/preview.service';
|
||||
export class FileViewComponent implements OnInit {
|
||||
|
||||
nodeId: string = null;
|
||||
versionId: string = null;
|
||||
displayEmptyMetadata = false;
|
||||
expanded: boolean;
|
||||
multi = false;
|
||||
@@ -72,6 +73,7 @@ export class FileViewComponent implements OnInit {
|
||||
ngOnInit() {
|
||||
this.route.params.subscribe((params) => {
|
||||
const id = params.nodeId;
|
||||
this.versionId = params.versionId;
|
||||
if (id) {
|
||||
this.nodeApiService.getNode(id).subscribe(
|
||||
(node) => {
|
||||
@@ -92,6 +94,10 @@ export class FileViewComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
onViewVersion(versionId: string) {
|
||||
this.preview.showResource(this.nodeId, versionId);
|
||||
}
|
||||
|
||||
onViewerVisibilityChanged() {
|
||||
const primaryUrl = this.router.parseUrl(this.router.url).root.children[PRIMARY_OUTLET].toString();
|
||||
this.router.navigateByUrl(primaryUrl);
|
||||
|
Reference in New Issue
Block a user