diff options
author | Ana Krivokapic <akrivoka@redhat.com> | 2013-05-15 17:33:21 +0200 |
---|---|---|
committer | Petr Vobornik <pvoborni@redhat.com> | 2013-05-17 12:31:14 +0200 |
commit | 8d07054e1b2ff8680c225e7cd847eb885e7246a4 (patch) | |
tree | c49188aabdeffe3ba493e972a349290ae9ba2d92 /install/ui/src/freeipa/association.js | |
parent | 5b58348cd316dd817672cb81358ed557c28e09d3 (diff) | |
download | freeipa.git-8d07054e1b2ff8680c225e7cd847eb885e7246a4.tar.gz freeipa.git-8d07054e1b2ff8680c225e7cd847eb885e7246a4.tar.xz freeipa.git-8d07054e1b2ff8680c225e7cd847eb885e7246a4.zip |
Do not display success message on failure in web UI
https://fedorahosted.org/freeipa/ticket/3591
Diffstat (limited to 'install/ui/src/freeipa/association.js')
-rw-r--r-- | install/ui/src/freeipa/association.js | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/install/ui/src/freeipa/association.js b/install/ui/src/freeipa/association.js index 71ee71d4..2921849d 100644 --- a/install/ui/src/freeipa/association.js +++ b/install/ui/src/freeipa/association.js @@ -1025,10 +1025,22 @@ IPA.association_facet = function (spec, no_init) { other_entity: that.other_entity, values: dialog.get_selected_values(), method: that.add_method, - on_success: function() { + on_success: function(data) { that.refresh(); dialog.close(); - IPA.notify_success('@i18n:association.added'); + var succeeded = data.result.completed; + + if (!succeeded) { + succeeded = 0; + for (var i = 0; i< data.result.results.length; i++) { + if (data.result.results[i].completed === 1) { + succeeded++; + } + } + } + + var msg = text.get('@i18n:association.added').replace('${count}', succeeded); + IPA.notify_success(msg); }, on_error: function() { that.refresh(); @@ -1077,9 +1089,22 @@ IPA.association_facet = function (spec, no_init) { other_entity: that.other_entity, values: values, method: that.remove_method, - on_success: function() { + on_success: function(data) { that.refresh(); - IPA.notify_success('@i18n:association.removed'); + + var succeeded = data.result.completed; + + if (!succeeded) { + succeeded = 0; + for (var i = 0; i< data.result.results.length; i++) { + if (data.result.results[i].completed === 1) { + succeeded++; + } + } + } + + var msg = text.get('@i18n:association.removed').replace('${count}', succeeded); + IPA.notify_success(msg); }, on_error: function() { that.refresh(); |