summaryrefslogtreecommitdiffstats
path: root/install/ui/src/freeipa/host.js
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2013-04-15 19:23:15 +0200
committerPetr Vobornik <pvoborni@redhat.com>2013-05-06 16:22:26 +0200
commit49b7f4c06e17b91372decf33b812a7fbbfa01ff4 (patch)
tree5fc871af96dec687a36e0986c0c3b829ce9de3b5 /install/ui/src/freeipa/host.js
parent849ece00e32747238c819eb7d3ac70f0bdc90833 (diff)
downloadfreeipa-49b7f4c06e17b91372decf33b812a7fbbfa01ff4.tar.gz
freeipa-49b7f4c06e17b91372decf33b812a7fbbfa01ff4.tar.xz
freeipa-49b7f4c06e17b91372decf33b812a7fbbfa01ff4.zip
Replace IPA.widget_factories and IPA_field_factories with registry
https://fedorahosted.org/freeipa/ticket/3235
Diffstat (limited to 'install/ui/src/freeipa/host.js')
-rw-r--r--install/ui/src/freeipa/host.js45
1 files changed, 28 insertions, 17 deletions
diff --git a/install/ui/src/freeipa/host.js b/install/ui/src/freeipa/host.js
index c3fee99ac..fa7ca2c55 100644
--- a/install/ui/src/freeipa/host.js
+++ b/install/ui/src/freeipa/host.js
@@ -19,8 +19,17 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-define(['./ipa', './jquery', './text', './details', './search', './association',
- './entity', './certificate'], function(IPA, $, text) {
+define(['./ipa',
+ './jquery',
+ './phases',
+ './reg',
+ './text',
+ './details',
+ './search',
+ './association',
+ './entity',
+ './certificate'],
+ function(IPA, $, phases, reg, text) {
IPA.host = {};
@@ -415,9 +424,6 @@ IPA.host_fqdn_field = function(spec) {
return that;
};
-IPA.field_factories['host_fqdn'] = IPA.host_fqdn_field;
-IPA.widget_factories['host_fqdn'] = IPA.host_fqdn_widget;
-
IPA.host_adder_dialog = function(spec) {
spec = spec || {};
@@ -507,9 +513,6 @@ IPA.dnszone_select_widget = function(spec) {
return that;
};
-IPA.field_factories['dnszone_select'] = IPA.field;
-IPA.widget_factories['dnszone_select'] = IPA.dnszone_select_widget;
-
IPA.host_dnsrecord_entity_link_field = function(spec){
var that = IPA.link_field(spec);
@@ -525,9 +528,6 @@ IPA.host_dnsrecord_entity_link_field = function(spec){
return that;
};
-IPA.field_factories['host_dnsrecord_entity_link'] = IPA.host_dnsrecord_entity_link_field;
-IPA.widget_factories['host_dnsrecord_entity_link'] = IPA.link_widget;
-
IPA.force_host_add_checkbox_widget = function(spec) {
var metadata = IPA.get_command_option('host_add', spec.name);
spec.label = metadata.label;
@@ -535,9 +535,6 @@ IPA.force_host_add_checkbox_widget = function(spec) {
return IPA.checkbox_widget(spec);
};
-IPA.widget_factories['force_host_add_checkbox'] = IPA.force_host_add_checkbox_widget;
-IPA.field_factories['force_host_add_checkbox'] = IPA.checkbox_field;
-
IPA.host.enrollment_policy = function(spec) {
var that = IPA.facet_policy();
@@ -788,9 +785,6 @@ IPA.host_password_widget = function(spec) {
return that;
};
-IPA.widget_factories['host_password'] = IPA.host_password_widget;
-IPA.field_factories['host_password'] = IPA.field;
-
IPA.host.set_otp_dialog = function(spec) {
spec = spec || {};
@@ -967,5 +961,22 @@ IPA.host.certificate_policy = function(spec) {
IPA.register('host', IPA.host.entity);
+phases.on('registration', function() {
+ var w = reg.widget;
+ var f = reg.field;
+
+ f.register('host_fqdn', IPA.host_fqdn_field);
+ w.register('host_fqdn', IPA.host_fqdn_widget);
+ f.register('dnszone_select', IPA.field);
+ w.register('dnszone_select', IPA.dnszone_select_widget);
+ f.register('host_dnsrecord_entity_link', IPA.host_dnsrecord_entity_link_field);
+ w.register('host_dnsrecord_entity_link', IPA.link_widget);
+ f.register('force_host_add_checkbox', IPA.checkbox_field);
+ w.register('force_host_add_checkbox', IPA.force_host_add_checkbox_widget);
+ f.register('host_password', IPA.field);
+ w.register('host_password', IPA.host_password_widget);
+});
+
+
return {};
});