mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-10-01 14:41:32 +00:00
[ACA-3266] Improve version upload component (#5750)
* added new component to compare current and new file version of a node. * update doc * added more tests * updated docs * small fixes * changed with typography * Update version-comparison.component.md * handle hiding the comparison component on demo shell if cancelled/uploaded a new file version * small fixes Co-authored-by: Eugenio Romano <eromano@users.noreply.github.com>
This commit is contained in:
@@ -55,6 +55,10 @@ export class VersionManagerComponent implements OnInit {
|
||||
@Input()
|
||||
showComments = true;
|
||||
|
||||
/** Toggles showing/hiding the version comparison component. */
|
||||
@Input()
|
||||
showVersionComparison = false;
|
||||
|
||||
/** Enable/disable downloading a version of the current node. */
|
||||
@Input()
|
||||
allowDownload = true;
|
||||
@@ -67,6 +71,10 @@ export class VersionManagerComponent implements OnInit {
|
||||
@Output()
|
||||
uploadError: EventEmitter<Node> = new EventEmitter<Node>();
|
||||
|
||||
/** Emitted when an cancelling during upload. */
|
||||
@Output()
|
||||
uploadCancel: EventEmitter<boolean> = new EventEmitter<boolean>();
|
||||
|
||||
@ViewChild('versionList')
|
||||
versionListComponent: VersionListComponent;
|
||||
|
||||
@@ -90,6 +98,7 @@ export class VersionManagerComponent implements OnInit {
|
||||
}
|
||||
|
||||
onUploadSuccess(event: any) {
|
||||
this.showVersionComparison = false;
|
||||
this.newFileVersion = null;
|
||||
this.alfrescoApiService.nodeUpdated.next(event.value.entry);
|
||||
this.versionListComponent.loadVersionHistory();
|
||||
@@ -103,6 +112,9 @@ export class VersionManagerComponent implements OnInit {
|
||||
|
||||
onUploadCancel() {
|
||||
this.uploadState = 'close';
|
||||
this.showVersionComparison = false;
|
||||
this.newFileVersion = null;
|
||||
this.uploadCancel.emit(true);
|
||||
}
|
||||
|
||||
toggleNewVersion() {
|
||||
|
Reference in New Issue
Block a user