mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-3095] ability to intercept, pause and resume upload process (#3416)
* prevent and resume upload process * upload fixes and confirmation dialog demo * ability to toggle the upload confirmation demo * fix tests * unit tests * docs update * remove deprecation * fix test name
This commit is contained in:
committed by
Eugenio Romano
parent
64a8c66103
commit
54e80e7863
@@ -98,7 +98,7 @@ export class UploadService {
|
||||
* Finds all the files in the queue that are not yet uploaded and uploads them into the directory folder.
|
||||
* @param emitter (Deprecated) Emitter to invoke on file status change
|
||||
*/
|
||||
uploadFilesInTheQueue(emitter: EventEmitter<any>): void {
|
||||
uploadFilesInTheQueue(emitter?: EventEmitter<any>): void {
|
||||
if (!this.activeTask) {
|
||||
let file = this.queue.find(currentFile => currentFile.status === FileUploadStatus.Pending);
|
||||
if (file) {
|
||||
@@ -200,15 +200,21 @@ export class UploadService {
|
||||
})
|
||||
.on('abort', () => {
|
||||
this.onUploadAborted(file);
|
||||
emitter.emit({ value: 'File aborted' });
|
||||
if (emitter) {
|
||||
emitter.emit({ value: 'File aborted' });
|
||||
}
|
||||
})
|
||||
.on('error', err => {
|
||||
this.onUploadError(file, err);
|
||||
emitter.emit({ value: 'Error file uploaded' });
|
||||
if (emitter) {
|
||||
emitter.emit({ value: 'Error file uploaded' });
|
||||
}
|
||||
})
|
||||
.on('success', data => {
|
||||
this.onUploadComplete(file, data);
|
||||
emitter.emit({ value: data });
|
||||
if (emitter) {
|
||||
emitter.emit({ value: data });
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
throw err;
|
||||
|
Reference in New Issue
Block a user