From 6a8d6d3fde0ede2e0b976cd5af67a57c0691b1f8 Mon Sep 17 00:00:00 2001 From: Petr Vobornik Date: Wed, 29 Aug 2012 17:35:07 +0200 Subject: Notify success on add, delete and update Notification of success was added to: * details facet: update * association facet and association widget: add, delete items * attribute facet: delete items (notification of add should be handled in entity adder dialog) * sudo rule: add, remove option * dnsrecord: add, update, delete https://fedorahosted.org/freeipa/ticket/2977 --- install/ui/dns.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'install/ui/dns.js') diff --git a/install/ui/dns.js b/install/ui/dns.js index 0803fdd3..33db481b 100644 --- a/install/ui/dns.js +++ b/install/ui/dns.js @@ -384,6 +384,7 @@ IPA.dnszone_details_facet = function(spec, no_init) { that.update_on_success = function(data, text_status, xhr) { that.refresh(); that.on_update.notify(); + that.nofify_update_success(); }; that.update_on_error = function(xhr, text_status, error_thrown) { @@ -1815,6 +1816,7 @@ IPA.dns.record_type_table_widget = function(spec) { that.reload_facet(data); dialog.close(); that.notify_facet_update(); + that.facet.nofify_update_success(); }, function() { that.refresh_facet(); @@ -1872,6 +1874,13 @@ IPA.dns.record_type_table_widget = function(spec) { dialog.on_error = IPA.create_4304_error_handler(dialog); + dialog.get_add_message = function() { + var label = that.entity.metadata.label_singular; + var message = IPA.messages.dialogs.add_confirmation; + message = message.replace('${entity}', label); + return message; + }; + dialog.create_button({ name: 'add', label: IPA.messages.buttons.add, @@ -1887,6 +1896,7 @@ IPA.dns.record_type_table_widget = function(spec) { } dialog.close(); that.notify_facet_update(); + IPA.notify_success(dialog.get_add_message()); }, dialog.on_error); } @@ -1899,10 +1909,8 @@ IPA.dns.record_type_table_widget = function(spec) { dialog.hide_message(); dialog.add( function(data, text_status, xhr) { - var label = that.entity.metadata.label_singular; - var message = IPA.messages.dialogs.add_confirmation; - message = message.replace('${entity}', label); - dialog.show_message(message); + + dialog.show_message(dialog.get_add_message()); if (data.result.result.dnsrecords) { that.reload_facet(data); @@ -2003,6 +2011,7 @@ IPA.dns.record_type_table_widget = function(spec) { that.reload_facet(data); dialog.close(); that.notify_facet_update(); + that.facet.nofify_update_success(); }; command.on_error = function() { that.refresh_facet(); -- cgit