From d500c4babfdd02181932ffdbf20bd3ddabdd8184 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Wed, 5 Dec 2018 22:40:07 +0100 Subject: [PATCH 1/2] Do not show general warning on free space error Fixes #12588 Probably needs more fixing for the other cases. But this is the quick fix I could come up with for now. Signed-off-by: Roeland Jago Douma --- apps/files/js/file-upload.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js index 8d18761acc86b..ed7cd4c2a66d8 100644 --- a/apps/files/js/file-upload.js +++ b/apps/files/js/file-upload.js @@ -1024,7 +1024,7 @@ OC.Uploader.prototype = _.extend({ // target folder does not exist any more OC.Notification.show(t('files', 'Target folder "{dir}" does not exist any more', {dir: upload.getFullPath()} ), {type: 'error'}); self.cancelUploads(); - } else if (status === 507) { + } else if (data.textStatus === 'notenoughspace') { // not enough space OC.Notification.show(t('files', 'Not enough free space'), {type: 'error'}); self.cancelUploads(); From 6d77389fbf2f82cca2daba1c30ff9e4fd05fdc57 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Thu, 6 Dec 2018 12:00:09 +0100 Subject: [PATCH 2/2] Add abort stub in JSUnit Signed-off-by: Morris Jobke --- apps/files/tests/js/fileUploadSpec.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/files/tests/js/fileUploadSpec.js b/apps/files/tests/js/fileUploadSpec.js index ca88461fafbdd..ecf29f979d8f7 100644 --- a/apps/files/tests/js/fileUploadSpec.js +++ b/apps/files/tests/js/fileUploadSpec.js @@ -67,7 +67,8 @@ describe('OC.Upload tests', function() { files: [file], jqXHR: jqXHR, response: sinon.stub().returns(jqXHR), - submit: sinon.stub() + submit: sinon.stub(), + abort: sinon.stub() }; if (uploader.fileUploadParam.add.call( $dummyUploader[0],