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:
@@ -25,7 +25,6 @@ export interface FileUploadOptions {
|
||||
comment?: string;
|
||||
newVersion?: boolean;
|
||||
majorVersion?: boolean;
|
||||
newVersionBaseName?: string;
|
||||
parentId?: string;
|
||||
path?: string;
|
||||
nodeType?: string;
|
||||
@@ -43,20 +42,19 @@ export enum FileUploadStatus {
|
||||
}
|
||||
|
||||
export class FileModel {
|
||||
readonly id: string;
|
||||
readonly name: string;
|
||||
readonly size: number;
|
||||
readonly file: File;
|
||||
|
||||
id: string;
|
||||
status: FileUploadStatus = FileUploadStatus.Pending;
|
||||
progress: FileUploadProgress;
|
||||
options: FileUploadOptions;
|
||||
data: any;
|
||||
|
||||
constructor(file: File, options?: FileUploadOptions) {
|
||||
constructor(file: File, options?: FileUploadOptions, id?: string) {
|
||||
this.file = file;
|
||||
|
||||
this.id = this.generateId();
|
||||
this.id = id;
|
||||
this.name = file.name;
|
||||
this.size = file.size;
|
||||
this.data = null;
|
||||
@@ -72,13 +70,6 @@ export class FileModel {
|
||||
}, options);
|
||||
}
|
||||
|
||||
generateId(): string {
|
||||
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
||||
let r = Math.random() * 16 | 0, v = c === 'x' ? r : (r & 0x3 | 0x8);
|
||||
return v.toString(16);
|
||||
});
|
||||
}
|
||||
|
||||
get extension(): string {
|
||||
return this.name.slice((Math.max(0, this.name.lastIndexOf('.')) || Infinity) + 1);
|
||||
}
|
||||
|
Reference in New Issue
Block a user