diff options
author | Petr Vobornik <pvoborni@redhat.com> | 2013-04-18 12:38:38 +0200 |
---|---|---|
committer | Petr Vobornik <pvoborni@redhat.com> | 2013-05-06 16:22:29 +0200 |
commit | 14c276d21865f70e0ff939357b52a9830d32b5ea (patch) | |
tree | 9ccf09b0875ddbc43500c6c8bee08f5de8d20afe /install/ui/src/freeipa/hostgroup.js | |
parent | a513673f043e37dc0fbad0b698f3f12a6a15a06c (diff) | |
download | freeipa-14c276d21865f70e0ff939357b52a9830d32b5ea.tar.gz freeipa-14c276d21865f70e0ff939357b52a9830d32b5ea.tar.xz freeipa-14c276d21865f70e0ff939357b52a9830d32b5ea.zip |
Convert definitions of entities to spec objects
https://fedorahosted.org/freeipa/ticket/3235
Diffstat (limited to 'install/ui/src/freeipa/hostgroup.js')
-rw-r--r-- | install/ui/src/freeipa/hostgroup.js | 90 |
1 files changed, 53 insertions, 37 deletions
diff --git a/install/ui/src/freeipa/hostgroup.js b/install/ui/src/freeipa/hostgroup.js index 5059d2ba4..f0d664280 100644 --- a/install/ui/src/freeipa/hostgroup.js +++ b/install/ui/src/freeipa/hostgroup.js @@ -1,5 +1,6 @@ /* Authors: * Pavel Zuna <pzuna@redhat.com> + * Petr Vobornik <pvoborni@redhat.com> * * Copyright (C) 2010 Red Hat * see file 'COPYING' for use and warranty information @@ -18,25 +19,32 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -define(['./ipa', './jquery', './details', './search', './association', - './entity'], function(IPA, $) { +define([ + './ipa', + './jquery', + './phases', + './reg', + './details', + './search', + './association', + './entity'], + function(IPA, $, phases, reg) { -IPA.hostgroup = {}; +var exp = IPA.hostgroup = {}; -IPA.hostgroup.entity = function(spec) { - - var that = IPA.entity(spec); - - that.init = function() { - that.entity_init(); - - that.builder.search_facet({ +var make_spec = function() { +return { + name: 'hostgroup', + facets: [ + { + $type: 'search', columns: [ 'cn', 'description' ] - }). - details_facet({ + }, + { + $type: 'details', sections: [ { name: 'identity', @@ -50,43 +58,51 @@ IPA.hostgroup.entity = function(spec) { ] } ] - }). - association_facet({ + }, + { + $type: 'association', name: 'memberof_hostgroup', associator: IPA.serial_associator - }). - association_facet({ + }, + { + $type: 'association', name: 'memberof_netgroup', associator: IPA.serial_associator - }). - association_facet({ + }, + { + $type: 'association', name: 'memberof_hbacrule', associator: IPA.serial_associator, add_method: 'add_host', remove_method: 'remove_host' - }). - association_facet({ + }, + { + $type: 'association', name: 'memberof_sudorule', associator: IPA.serial_associator, add_method: 'add_host', remove_method: 'remove_host' - }). - standard_association_facets(). - adder_dialog({ - fields: [ - 'cn', - { - $type: 'textarea', - name: 'description' - } - ] - }); - }; + } + ], + standard_association_facets: true, + adder_dialog: { + fields: [ + 'cn', + { + $type: 'textarea', + name: 'description' + } + ] + } +};}; - return that; -}; -IPA.register('hostgroup', IPA.hostgroup.entity); +exp.entity_spec = make_spec(); +exp.register = function() { + var e = reg.entity; + e.register({type: 'hostgroup', spec: exp.entity_spec}); +}; +phases.on('registration', exp.register); -return {}; +return exp; });
\ No newline at end of file |