summaryrefslogtreecommitdiffstats
path: root/install/ui/dns.js
diff options
context:
space:
mode:
authorPetr Voborník <pvoborni@redhat.com>2012-02-23 11:26:05 +0100
committerPetr Vobornik <pvoborni@redhat.com>2012-02-29 12:59:13 +0100
commitcf60e7e71e800bbbe5eb42039a375782af17c379 (patch)
treef22167fada58ed5bc75b7f1dfc73b7efc298ebff /install/ui/dns.js
parent525bf04da56829ac2b7b6e086a7a2d965727ce02 (diff)
downloadfreeipa-cf60e7e71e800bbbe5eb42039a375782af17c379.tar.gz
freeipa-cf60e7e71e800bbbe5eb42039a375782af17c379.tar.xz
freeipa-cf60e7e71e800bbbe5eb42039a375782af17c379.zip
Fixed DNS record add handling of 4304 error
Fixed hanling of 4304 error in DNS record add. Code which handled this error in host-add was generalized and moved to IPA. DNS record add both in adder dialog and dns record table are using this generalized version. https://fedorahosted.org/freeipa/ticket/2349
Diffstat (limited to 'install/ui/dns.js')
-rw-r--r--install/ui/dns.js19
1 files changed, 17 insertions, 2 deletions
diff --git a/install/ui/dns.js b/install/ui/dns.js
index ddd9da03b..42002192f 100644
--- a/install/ui/dns.js
+++ b/install/ui/dns.js
@@ -982,11 +982,14 @@ IPA.dns.record_entity = function(spec) {
IPA.dns.record_adder_dialog = function(spec) {
spec = spec || {};
+ spec.retry = spec.retry !== undefined ? spec.retry : false;
IPA.dns.record_prepare_spec(spec, IPA.dns.record_prepare_editor_for_type);
var that = IPA.entity_adder_dialog(spec);
+ that.on_error = IPA.create_4304_error_handler(that);
+
return that;
};
@@ -1621,6 +1624,7 @@ IPA.dns.record_type_table_widget = function(spec) {
entity: that.entity,
fields: [],
widgets: [],
+ retry: false,
title: title.replace('${entity}', label)
};
@@ -1635,6 +1639,8 @@ IPA.dns.record_type_table_widget = function(spec) {
var cancel_button = dialog.buttons.get('cancel');
dialog.buttons.empty();
+ dialog.on_error = IPA.create_4304_error_handler(dialog);
+
dialog.create_button({
name: 'add',
label: IPA.messages.buttons.add,
@@ -1642,7 +1648,12 @@ IPA.dns.record_type_table_widget = function(spec) {
dialog.hide_message();
dialog.add(
function(data, text_status, xhr) {
- that.reload_facet(data);
+
+ if (data.result.result.dnsrecords) {
+ that.reload_facet(data);
+ } else {
+ that.refresh_facet();
+ }
dialog.close();
},
dialog.on_error);
@@ -1661,7 +1672,11 @@ IPA.dns.record_type_table_widget = function(spec) {
message = message.replace('${entity}', label);
dialog.show_message(message);
- that.reload_facet(data);
+ if (data.result.result.dnsrecords) {
+ that.reload_facet(data);
+ } else {
+ that.refresh_facet();
+ }
dialog.reset();
},
dialog.on_error);