summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Vomacka <pvomacka@redhat.com>2016-06-30 14:32:27 +0200
committerPetr Vobornik <pvoborni@redhat.com>2016-07-01 09:39:49 +0200
commitdf56fd3371bd20a2ce8f5d0097e05437b7827e29 (patch)
tree26193bb16cb5d4ceac8d0e7725f4a1043e27f629
parentacf2234ebc8609a35a8f45598d5d817cbdbff121 (diff)
downloadfreeipa-df56fd3371bd20a2ce8f5d0097e05437b7827e29.tar.gz
freeipa-df56fd3371bd20a2ce8f5d0097e05437b7827e29.tar.xz
freeipa-df56fd3371bd20a2ce8f5d0097e05437b7827e29.zip
Change error handling in custom_command_multivalued_widget
The custom_command_multivalued_widget now handles remove and add commands errors correctly and shows error message. Part of: https://fedorahosted.org/freeipa/ticket/5381 add_error Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
-rw-r--r--install/ui/src/freeipa/widget.js14
1 files changed, 11 insertions, 3 deletions
diff --git a/install/ui/src/freeipa/widget.js b/install/ui/src/freeipa/widget.js
index 0972efadb..68ed43f8b 100644
--- a/install/ui/src/freeipa/widget.js
+++ b/install/ui/src/freeipa/widget.js
@@ -1533,8 +1533,13 @@ IPA.custom_command_multivalued_widget = function(spec) {
/**
* Called on error of add command. Override point.
*/
- that.on_error_add = function(data) {
+ that.on_error_add = function(xhr, text_status, error_thrown) {
that.adder_dialog.focus_first_element();
+
+ if (error_thrown.message) {
+ var msg = error_thrown.message;
+ IPA.notify(msg, 'error');
+ }
};
/**
@@ -1548,8 +1553,11 @@ IPA.custom_command_multivalued_widget = function(spec) {
/**
* Called on error of remove command. Override point.
*/
- that.on_error_remove = function(data) {
- IPA.notify(data.result.summary, 'error');
+ that.on_error_remove = function(xhr, text_status, error_thrown) {
+ if (error_thrown.message) {
+ var msg = error_thrown.message;
+ IPA.notify(msg, 'error');
+ }
};
/**