[ADF-2672] version manager fixes (#3169)

* fix app config, add extra flags for version manager

* add docs and tests

* update i18n strings

* rename "id" to "nodeId"

* automatically detect permissions

* restore 'id' and mark as deprecated
This commit is contained in:
Denys Vuika
2018-04-11 17:34:45 +01:00
committed by Eugenio Romano
parent 8b4af90b46
commit aba9f41af1
16 changed files with 117 additions and 89 deletions

View File

@@ -18,7 +18,7 @@
import { Component, Input, ViewEncapsulation, ViewChild, Output, EventEmitter } from '@angular/core';
import { MinimalNodeEntryEntity } from 'alfresco-js-api';
import { VersionListComponent } from './version-list.component';
import { AppConfigService } from '@alfresco/adf-core';
import { AppConfigService, ContentService } from '@alfresco/adf-core';
@Component({
selector: 'adf-version-manager',
@@ -31,9 +31,6 @@ export class VersionManagerComponent {
@Input()
node: MinimalNodeEntryEntity;
@Input()
allowDelete = true;
@Input()
showComments = true;
@@ -49,8 +46,9 @@ export class VersionManagerComponent {
@ViewChild('versionList')
versionListComponent: VersionListComponent;
constructor(config: AppConfigService) {
this.allowDelete = config.get('adf-version-manager.allowDelete', true);
constructor(
config: AppConfigService,
private contentService: ContentService) {
this.showComments = config.get('adf-version-manager.allowComments', true);
this.allowDownload = config.get('adf-version-manager.allowDownload', true);
}
@@ -60,7 +58,7 @@ export class VersionManagerComponent {
this.uploadSuccess.emit(event);
}
onUploadError(event): any {
this.uploadError.emit(event);
canUpdate(): boolean {
return this.contentService.hasPermission(this.node, 'update');
}
}