[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:
Urse Daniel
2020-06-04 15:01:11 +03:00
committed by GitHub
parent 13066a9a32
commit f0df6b3a5f
16 changed files with 317 additions and 7 deletions

View File

@@ -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() {