[ADF-2563] Upload new version information dialog (#3235)

* add majorVersion param
move common part in base class

* refactor upload queue

* fix after refactoring

* add comment functionality in versioning
add minor and major option in versioning
add animation in versioning
add new functionality in demo shell

* add animation test

* add missing properties test and base upload class

* fix reload after new version upload [ADF-2582]

* update documentation

* update doc and fix minor style issues

* fix tslint error

* change cachebuster

* ADF-2672 version manager disable buttons

* [ADF-2649] hide show actions in version list

* fix tests
This commit is contained in:
Eugenio Romano
2018-04-26 14:57:55 +01:00
committed by GitHub
parent b2b3625929
commit 8872706eab
37 changed files with 17315 additions and 449 deletions

View File

@@ -17,7 +17,7 @@
import { AlfrescoApiService, ContentService } from '@alfresco/adf-core';
import { Component, Input, OnChanges, ViewEncapsulation, ElementRef } from '@angular/core';
import { VersionsApi, MinimalNodeEntryEntity } from 'alfresco-js-api';
import { VersionsApi, MinimalNodeEntryEntity, VersionEntry } from 'alfresco-js-api';
import { MatDialog } from '@angular/material';
import { ConfirmDialogComponent } from '../dialogs/confirm.dialog';
@@ -33,7 +33,7 @@ import { ConfirmDialogComponent } from '../dialogs/confirm.dialog';
export class VersionListComponent implements OnChanges {
private versionsApi: VersionsApi;
versions: any = [];
versions: VersionEntry[] = [];
isLoading = true;
/** @deprecated in 2.3.0 */
@@ -43,6 +43,7 @@ export class VersionListComponent implements OnChanges {
@Input()
node: MinimalNodeEntryEntity;
/** show/hide comments */
@Input()
showComments = true;
@@ -50,11 +51,14 @@ export class VersionListComponent implements OnChanges {
@Input()
allowDownload = true;
constructor(
private alfrescoApi: AlfrescoApiService,
private contentService: ContentService,
private dialog: MatDialog,
private el: ElementRef) {
/** show/hide version actions */
@Input()
showActions = true;
constructor(private alfrescoApi: AlfrescoApiService,
private contentService: ContentService,
private dialog: MatDialog,
private el: ElementRef) {
this.versionsApi = this.alfrescoApi.versionsApi;
}
@@ -66,10 +70,14 @@ export class VersionListComponent implements OnChanges {
return this.contentService.hasPermission(this.node, 'update');
}
canDelete(): boolean {
return this.contentService.hasPermission(this.node, 'delete');
}
restore(versionId) {
if (this.canUpdate()) {
this.versionsApi
.revertVersion(this.node.id, versionId, { majorVersion: true, comment: ''})
.revertVersion(this.node.id, versionId, { majorVersion: true, comment: '' })
.then(() => this.onVersionRestored());
}
}