mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[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:
committed by
Eugenio Romano
parent
8b4af90b46
commit
aba9f41af1
@@ -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');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user