mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
committed by
Eugenio Romano
parent
53d96679ea
commit
e39a2b149b
@@ -149,7 +149,7 @@ describe('UploadBase', () => {
|
||||
|
||||
});
|
||||
|
||||
describe('filesize', () => {
|
||||
describe('fileSize', () => {
|
||||
|
||||
const files: File[] = [
|
||||
<File> { name: 'bigFile.png', size: 1000 },
|
||||
@@ -353,7 +353,7 @@ describe('UploadBase', () => {
|
||||
let addToQueueSpy;
|
||||
|
||||
const files: File[] = [
|
||||
<File> { name: 'process.pbmn' }
|
||||
<File> { name: 'process.bpmn' }
|
||||
];
|
||||
|
||||
beforeEach(() => {
|
||||
|
@@ -27,7 +27,7 @@ describe('FileUploadingDialogComponent', () => {
|
||||
let uploadService: UploadService;
|
||||
let component: FileUploadingDialogComponent;
|
||||
let emitter: EventEmitter<any>;
|
||||
let filelist: FileModel[];
|
||||
let fileList: FileModel[];
|
||||
|
||||
setupTestBed({
|
||||
imports: [
|
||||
@@ -48,7 +48,7 @@ describe('FileUploadingDialogComponent', () => {
|
||||
uploadService.clearQueue();
|
||||
|
||||
emitter = new EventEmitter();
|
||||
filelist = [
|
||||
fileList = [
|
||||
new FileModel(<File> { name: 'fake-name', size: 10 }),
|
||||
new FileModel(<File> { name: 'fake-name2', size: 10 })
|
||||
];
|
||||
@@ -65,14 +65,14 @@ describe('FileUploadingDialogComponent', () => {
|
||||
});
|
||||
|
||||
it('should open dialog when uploading list is not empty', () => {
|
||||
uploadService.addToQueue(...filelist);
|
||||
uploadService.addToQueue(...fileList);
|
||||
uploadService.uploadFilesInTheQueue(emitter);
|
||||
|
||||
expect(component.isDialogActive).toBe(true);
|
||||
});
|
||||
|
||||
it('should update uploading file list', () => {
|
||||
uploadService.addToQueue(...filelist);
|
||||
uploadService.addToQueue(...fileList);
|
||||
uploadService.uploadFilesInTheQueue(emitter);
|
||||
|
||||
expect(component.filesUploadingList.length).toBe(2);
|
||||
@@ -204,7 +204,7 @@ describe('FileUploadingDialogComponent', () => {
|
||||
});
|
||||
|
||||
it('should reset upload queue', () => {
|
||||
uploadService.addToQueue(...filelist);
|
||||
uploadService.addToQueue(...fileList);
|
||||
uploadService.uploadFilesInTheQueue(emitter);
|
||||
component.close();
|
||||
|
||||
|
@@ -54,7 +54,7 @@ export class FileUploadingDialogComponent implements OnInit, OnDestroy {
|
||||
private errorSubscription: Subscription;
|
||||
|
||||
constructor(private uploadService: UploadService,
|
||||
private changeDetecor: ChangeDetectorRef) {
|
||||
private changeDetector: ChangeDetectorRef) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -73,18 +73,18 @@ export class FileUploadingDialogComponent implements OnInit, OnDestroy {
|
||||
)
|
||||
.subscribe((event: (FileUploadDeleteEvent | FileUploadCompleteEvent)) => {
|
||||
this.totalCompleted = event.totalComplete;
|
||||
this.changeDetecor.detectChanges();
|
||||
this.changeDetector.detectChanges();
|
||||
});
|
||||
|
||||
this.errorSubscription = this.uploadService.fileUploadError
|
||||
.subscribe((event: FileUploadErrorEvent) => {
|
||||
this.totalErrors = event.totalError;
|
||||
this.changeDetecor.detectChanges();
|
||||
this.changeDetector.detectChanges();
|
||||
});
|
||||
|
||||
this.fileUploadSubscription = this.uploadService
|
||||
.fileUpload.subscribe(() => {
|
||||
this.changeDetecor.detectChanges();
|
||||
this.changeDetector.detectChanges();
|
||||
});
|
||||
|
||||
this.uploadService.fileDeleted.subscribe((objId) => {
|
||||
@@ -94,7 +94,7 @@ export class FileUploadingDialogComponent implements OnInit, OnDestroy {
|
||||
});
|
||||
if (file) {
|
||||
file.status = FileUploadStatus.Cancelled;
|
||||
this.changeDetecor.detectChanges();
|
||||
this.changeDetector.detectChanges();
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -112,7 +112,7 @@ export class FileUploadingDialogComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
/**
|
||||
* Cancel uploads and hide confiramtion
|
||||
* Cancel uploads and hide confirmation
|
||||
*/
|
||||
cancelAllUploads() {
|
||||
this.toggleConfirmation();
|
||||
@@ -125,7 +125,7 @@ export class FileUploadingDialogComponent implements OnInit, OnDestroy {
|
||||
*/
|
||||
toggleMinimized(): void {
|
||||
this.isDialogMinimized = !this.isDialogMinimized;
|
||||
this.changeDetecor.detectChanges();
|
||||
this.changeDetector.detectChanges();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -139,7 +139,7 @@ export class FileUploadingDialogComponent implements OnInit, OnDestroy {
|
||||
this.isDialogActive = false;
|
||||
this.isDialogMinimized = false;
|
||||
this.uploadService.clearQueue();
|
||||
this.changeDetecor.detectChanges();
|
||||
this.changeDetector.detectChanges();
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
|
@@ -249,7 +249,7 @@ describe('FileUploadingListComponent', () => {
|
||||
expect(component.isUploadCancelled()).toBe(false);
|
||||
});
|
||||
|
||||
it('should return false when there is at leat one file in progress', () => {
|
||||
it('should return false when there is at least one file in progress', () => {
|
||||
component.files = <any> [
|
||||
{ status: FileUploadStatus.Progress },
|
||||
{ status: FileUploadStatus.Error },
|
||||
@@ -259,7 +259,7 @@ describe('FileUploadingListComponent', () => {
|
||||
expect(component.isUploadCancelled()).toBe(false);
|
||||
});
|
||||
|
||||
it('should return false when there is at leat one file in pendding', () => {
|
||||
it('should return false when there is at least one file in pending', () => {
|
||||
component.files = <any> [
|
||||
{ status: FileUploadStatus.Pending },
|
||||
{ status: FileUploadStatus.Error },
|
||||
|
@@ -215,7 +215,7 @@ describe('UploadButtonComponent', () => {
|
||||
expect(compiled.querySelector('#uploadFolder-label-static').textContent).toEqual('test-text');
|
||||
});
|
||||
|
||||
describe('filesize', () => {
|
||||
describe('fileSize', () => {
|
||||
|
||||
const files: File[] = [
|
||||
<File> { name: 'bigFile.png', size: 1000 },
|
||||
|
@@ -84,7 +84,7 @@ export class UploadDragAreaComponent extends UploadBase implements NodePermissio
|
||||
*/
|
||||
onFolderEntityDropped(folder: any): void {
|
||||
if (!this.disabled && folder.isDirectory) {
|
||||
FileUtils.flattern(folder).then(filesInfo => {
|
||||
FileUtils.flatten(folder).then(filesInfo => {
|
||||
this.uploadFilesInfo(filesInfo);
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user