aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2024-07-29 12:15:50 +0200
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2024-09-05 04:18:37 +0200
commit029626ba8fbcfd3b05f5db8f9cebb22eebcfcac2 (patch)
tree8ac180e41ab31c2cc0d1cfb30faffc32d83e08b9
parent35f16a3d8a95530b89cb43e4275257eb9b8e64fe (diff)
downloadnextcloud-server-029626ba8fbcfd3b05f5db8f9cebb22eebcfcac2.tar.gz
nextcloud-server-029626ba8fbcfd3b05f5db8f9cebb22eebcfcac2.zip
fix: Set status tooltip to error message on failed actions
When saving, updating and rechecking an storage fails (which is different to the soft-fail when the action itself succeeds but the status check does not) further details are provided in the error message of the response, which is now set as the tooltip. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
-rw-r--r--apps/files_external/js/settings.js15
1 files changed, 9 insertions, 6 deletions
diff --git a/apps/files_external/js/settings.js b/apps/files_external/js/settings.js
index 92b14e9454d..2ece2b56740 100644
--- a/apps/files_external/js/settings.js
+++ b/apps/files_external/js/settings.js
@@ -1238,8 +1238,9 @@ MountConfigListView.prototype = _.extend({
success: function () {
$tr.remove();
},
- error: function () {
- self.updateStatus($tr, StorageConfig.Status.ERROR);
+ error: function (result) {
+ const statusMessage = (result && result.responseJSON) ? result.responseJSON.message : undefined;
+ self.updateStatus($tr, StorageConfig.Status.ERROR, statusMessage);
}
});
}
@@ -1274,11 +1275,12 @@ MountConfigListView.prototype = _.extend({
}
}
},
- error: function() {
+ error: function(result) {
if (concurrentTimer === undefined
|| $tr.data('save-timer') === concurrentTimer
) {
- self.updateStatus($tr, StorageConfig.Status.ERROR);
+ const statusMessage = (result && result.responseJSON) ? result.responseJSON.message : undefined;
+ self.updateStatus($tr, StorageConfig.Status.ERROR, statusMessage);
}
}
});
@@ -1302,8 +1304,9 @@ MountConfigListView.prototype = _.extend({
success: function(result) {
self.updateStatus($tr, result.status, result.statusMessage);
},
- error: function() {
- self.updateStatus($tr, StorageConfig.Status.ERROR);
+ error: function(result) {
+ const statusMessage = (result && result.responseJSON) ? result.responseJSON.message : undefined;
+ self.updateStatus($tr, StorageConfig.Status.ERROR, statusMessage);
}
});
},