mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-2563] Improve versioning functionality (#3335)
* change input with textarea * update file version use now the update content API * provide way to test read only mode version list * fix test * test fix
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { PermissionsEnum } from '@alfresco/adf-core';
|
||||
import { Component, forwardRef, Input, OnChanges, SimpleChanges, ViewEncapsulation, OnInit } from '@angular/core';
|
||||
import { Component, forwardRef, Input, OnChanges, ViewEncapsulation, OnInit } from '@angular/core';
|
||||
import { MinimalNodeEntryEntity } from 'alfresco-js-api';
|
||||
import { UploadButtonComponent } from './upload-button.component';
|
||||
import { FileModel, EXTENDIBLE_COMPONENT } from '@alfresco/adf-core';
|
||||
@@ -36,20 +36,8 @@ export class UploadVersionButtonComponent extends UploadButtonComponent implemen
|
||||
@Input()
|
||||
node: MinimalNodeEntryEntity;
|
||||
|
||||
ngOnChanges(changes: SimpleChanges) {
|
||||
super.ngOnChanges(changes);
|
||||
|
||||
if (changes['acceptedFilesType']) {
|
||||
const message = this.translationService.instant('FILE_UPLOAD.VERSION.MESSAGES.NO_ACCEPTED_FILE_TYPES');
|
||||
this.logService.error(message);
|
||||
}
|
||||
this.acceptedFilesType = '.' + this.node.name.split('.').pop();
|
||||
}
|
||||
|
||||
protected createFileModel(file: File): FileModel {
|
||||
const fileModel = super.createFileModel(file, this.rootFolderId, (file.webkitRelativePath || '').replace(/\/[^\/]*$/, ''));
|
||||
|
||||
fileModel.options.newVersionBaseName = this.node.name;
|
||||
const fileModel = super.createFileModel(file, this.rootFolderId, (file.webkitRelativePath || '').replace(/\/[^\/]*$/, ''), this.node.id);
|
||||
|
||||
if (!this.isFileAcceptable(fileModel)) {
|
||||
const message = this.translationService.instant('FILE_UPLOAD.VERSION.MESSAGES.INCOMPATIBLE_VERSION');
|
||||
|
Reference in New Issue
Block a user