mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
added functionality to view a previous version (#5913)
This commit is contained in:
@@ -19,6 +19,7 @@ import { Component, Inject, ViewEncapsulation } from '@angular/core';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { MinimalNodeEntryEntity } from '@alfresco/js-api';
|
||||
import { MatSnackBar } from '@angular/material/snack-bar';
|
||||
import { PreviewService } from '../../services/preview.service';
|
||||
|
||||
@Component({
|
||||
templateUrl: './version-manager-dialog-adapter.component.html',
|
||||
@@ -34,7 +35,8 @@ export class VersionManagerDialogAdapterComponent {
|
||||
readOnly = false;
|
||||
showVersionComparison = false;
|
||||
|
||||
constructor(@Inject(MAT_DIALOG_DATA) data: any,
|
||||
constructor(private previewService: PreviewService,
|
||||
@Inject(MAT_DIALOG_DATA) data: any,
|
||||
private snackBar: MatSnackBar,
|
||||
private containingDialog?: MatDialogRef<VersionManagerDialogAdapterComponent>) {
|
||||
this.contentEntry = data.contentEntry;
|
||||
@@ -51,6 +53,11 @@ export class VersionManagerDialogAdapterComponent {
|
||||
this.containingDialog.close();
|
||||
}
|
||||
|
||||
onViewVersion(versionId: string) {
|
||||
this.previewService.showResource(this.contentEntry.id, versionId);
|
||||
this.close();
|
||||
}
|
||||
|
||||
hideVersionComparison(isCancelled: boolean | Node) {
|
||||
if (isCancelled) {
|
||||
this.showVersionComparison = false;
|
||||
|
Reference in New Issue
Block a user