diff options
author | Endi S. Dewata <edewata@redhat.com> | 2011-04-11 20:22:38 -0500 |
---|---|---|
committer | Endi Sukma Dewata <edewata@people01.fedoraproject.org> | 2011-04-14 23:05:09 +0000 |
commit | e3ec1fb7efb12c3669855b6c388f196c268680ee (patch) | |
tree | 9a582745ccbb71444fe20aa668f461dbd47329f8 /install/ui/ipa.js | |
parent | 805b94f22d42eddee42ed8772aca89036edb8399 (diff) | |
download | freeipa-e3ec1fb7efb12c3669855b6c388f196c268680ee.tar.gz freeipa-e3ec1fb7efb12c3669855b6c388f196c268680ee.tar.xz freeipa-e3ec1fb7efb12c3669855b6c388f196c268680ee.zip |
Entitlement registration.
The entitlement facet will show buttons according to the entitlement
status. If it's unregistered, the facet will show a Register button.
If it's registered, the facet will show a Consume button.
Diffstat (limited to 'install/ui/ipa.js')
-rw-r--r-- | install/ui/ipa.js | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/install/ui/ipa.js b/install/ui/ipa.js index 7ffac51ad..a4fbec401 100644 --- a/install/ui/ipa.js +++ b/install/ui/ipa.js @@ -252,6 +252,8 @@ IPA.command = function(spec) { that.on_success = spec.on_success; that.on_error = spec.on_error; + that.retry = typeof spec.retry == 'undefined' ? true : spec.retry; + that.get_command = function() { return (that.entity ? that.entity+'_' : '') + that.method; }; @@ -352,14 +354,19 @@ IPA.command = function(spec) { if (!error_thrown.title) { error_thrown.title = 'AJAX Error: '+error_thrown.name; } - dialog_open.call(this, xhr, text_status, error_thrown); + + if (that.retry) { + dialog_open.call(this, xhr, text_status, error_thrown); + + } else if (that.on_error) { + that.on_error.call(this, xhr, text_status, error_thrown); + } } function success_handler(data, text_status, xhr) { - IPA.hide_activity_icon(); - if (!data) { + IPA.hide_activity_icon(); var error_thrown = { title: 'HTTP Error '+xhr.status, url: this.url, @@ -368,12 +375,14 @@ IPA.command = function(spec) { dialog_open.call(this, xhr, text_status, error_thrown); } else if (data.error) { + // error_handler() calls IPA.hide_activity_icon() error_handler.call(this, xhr, text_status, /* error_thrown */ { title: 'IPA Error '+data.error.code, message: data.error.message }); } else if (that.on_success) { + IPA.hide_activity_icon(); that.on_success.call(this, data, text_status, xhr); } } |