mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
added functionality to view a previous version (#5913)
This commit is contained in:
@@ -108,7 +108,8 @@
|
||||
<mat-card>
|
||||
<mat-card-content>
|
||||
<adf-version-manager [node]="node"
|
||||
(uploadError)="onUploadError($event)">
|
||||
(uploadError)="onUploadError($event)"
|
||||
(viewVersion)="onViewVersion($event)">
|
||||
</adf-version-manager>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
@@ -318,6 +319,7 @@
|
||||
<adf-viewer
|
||||
[blobFile]="content"
|
||||
[nodeId]="nodeId"
|
||||
[versionId]="versionId"
|
||||
[showRightSidebar]="showRightSidebar"
|
||||
[showLeftSidebar]="showLeftSidebar"
|
||||
[allowGoBack]="allowGoBack"
|
||||
|
@@ -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