diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2024-07-29 12:15:50 +0200 |
---|---|---|
committer | skjnldsv <skjnldsv@protonmail.com> | 2024-09-04 09:46:17 +0200 |
commit | ac1c8c423725712f712593d1cc97813996c92e78 (patch) | |
tree | 23d7214e3a96092c875e9926ac4b30851a912449 | |
parent | 9eeb3cf423ed2a2e4d06d5774905b8c57f1e1f5c (diff) | |
download | nextcloud-server-ac1c8c423725712f712593d1cc97813996c92e78.tar.gz nextcloud-server-ac1c8c423725712f712593d1cc97813996c92e78.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.js | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/apps/files_external/js/settings.js b/apps/files_external/js/settings.js index 7b571e834e5..475387cbfa2 100644 --- a/apps/files_external/js/settings.js +++ b/apps/files_external/js/settings.js @@ -1234,8 +1234,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); } }); } @@ -1270,11 +1271,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); } } }); @@ -1298,8 +1300,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); } }); }, |