From f74392126de1e4871d953fd5de7057c99fa30574 Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Fri, 5 Dec 2014 18:00:40 -0500 Subject: [PATCH] 3781: Do not portray "stopped" state as an error if it was reached by clicking Pause. --- .../app/assets/javascripts/upload_to_collection.js | 7 ++++++- .../workbench/app/views/collections/_show_upload.html.erb | 8 ++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/apps/workbench/app/assets/javascripts/upload_to_collection.js b/apps/workbench/app/assets/javascripts/upload_to_collection.js index 4ca5df68a1..7c31c6dd0c 100644 --- a/apps/workbench/app/assets/javascripts/upload_to_collection.js +++ b/apps/workbench/app/assets/javascripts/upload_to_collection.js @@ -330,6 +330,7 @@ function UploadToCollection($scope, $filter, $q, $timeout, return _deferred.promise(); } function stop() { + that.state = 'Stopped'; for (var i=0; i<$scope.uploadQueue.length; i++) $scope.uploadQueue[i].stop(); } @@ -358,7 +359,11 @@ function UploadToCollection($scope, $filter, $q, $timeout, return onQueueResolve(); } function onQueueReject(reason) { - that.state = 'Failed'; + if (that.state !== 'Stopped') { + that.state = 'Error'; + } + // (else it's not really an error, just a consequence of stop()) + that.stateReason = ( (reason.textStatus || 'Error') + (reason.xhr && reason.xhr.options diff --git a/apps/workbench/app/views/collections/_show_upload.html.erb b/apps/workbench/app/views/collections/_show_upload.html.erb index 0e1f760941..be6cf77598 100644 --- a/apps/workbench/app/views/collections/_show_upload.html.erb +++ b/apps/workbench/app/views/collections/_show_upload.html.erb @@ -23,11 +23,15 @@
{{uploader.stateReason}} + >   {{uploader.stateReason}}
{{uploader.stateReason}} + >   {{uploader.stateReason}} +
+
  Paused. Click the Start button to resume uploading.
-- 2.30.2