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/group.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/group.js')
-rw-r--r-- | install/ui/src/freeipa/group.js | 140 |
1 files changed, 73 insertions, 67 deletions
diff --git a/install/ui/src/freeipa/group.js b/install/ui/src/freeipa/group.js index a3297bd3a..0408d0bc9 100644 --- a/install/ui/src/freeipa/group.js +++ b/install/ui/src/freeipa/group.js @@ -33,21 +33,20 @@ define([ var exp = IPA.group = {}; -IPA.group.entity = function(spec) { - - var that = IPA.entity(spec); - - that.init = function() { - that.entity_init(); - - that.builder.search_facet({ +var make_spec = function() { +return { + name: 'group', + facets: [ + { + $type: 'search', columns: [ 'cn', 'gidnumber', 'description' ] - }). - details_facet({ + }, + { + $type: 'details', sections: [ { name: 'details', @@ -84,8 +83,9 @@ IPA.group.entity = function(spec) { IPA.object_class_evaluator ] } - }). - association_facet({ + }, + { + $type: 'association', name: 'member_user', columns:[ 'uid', @@ -105,11 +105,13 @@ IPA.group.entity = function(spec) { width: '100px' } ] - }). - association_facet({ + }, + { + $type: 'association', name: 'member_group' - }). - attribute_facet({ + }, + { + $type: 'attribute', name: 'member_external', attribute: 'ipaexternalmember', tab_label: 'External', @@ -120,69 +122,71 @@ IPA.group.entity = function(spec) { label: '@mc-opt:group_add_member:ipaexternalmember:label' } ] - - }). - association_facet({ + }, + { + $type: 'association', name: 'memberof_group', associator: IPA.serial_associator - }). - association_facet({ + }, + { + $type: 'association', name: 'memberof_netgroup', associator: IPA.serial_associator - }). - association_facet({ + }, + { + $type: 'association', name: 'memberof_role', associator: IPA.serial_associator - }). - association_facet({ + }, + { + $type: 'association', name: 'memberof_hbacrule', associator: IPA.serial_associator, add_method: 'add_user', remove_method: 'remove_user' - }). - association_facet({ + }, + { + $type: 'association', name: 'memberof_sudorule', associator: IPA.serial_associator, add_method: 'add_user', remove_method: 'remove_user' - }). - standard_association_facets(). - adder_dialog({ - $factory: IPA.group_adder_dialog, - fields: [ - 'cn', - { - $type: 'textarea', - name: 'description' - }, - { - $type: 'radio', - name: 'type', - label: '@i18n:objects.group.type', - flags: ['no_command'], - default_value: 'posix', - options: [ - { - value: 'normal', - label: '@i18n:objects.group.normal' - }, - { - value: 'external', - label: '@i18n:objects.group.external' - }, - { - value: 'posix', - label: '@i18n:objects.group.posix' - } - ] - }, - 'gidnumber' - ] - }); - }; - - return that; -}; + } + ], + standard_association_facets: true, + adder_dialog: { + $factory: IPA.group_adder_dialog, + fields: [ + 'cn', + { + $type: 'textarea', + name: 'description' + }, + { + $type: 'radio', + name: 'type', + label: '@i18n:objects.group.type', + flags: ['no_command'], + default_value: 'posix', + options: [ + { + value: 'normal', + label: '@i18n:objects.group.normal' + }, + { + value: 'external', + label: '@i18n:objects.group.external' + }, + { + value: 'posix', + label: '@i18n:objects.group.posix' + } + ] + }, + 'gidnumber' + ] + } +};}; IPA.group_adder_dialog = function(spec) { @@ -262,11 +266,13 @@ IPA.group.make_external_action = function(spec) { return that; }; -IPA.register('group', IPA.group.entity); - +exp.entity_spec = make_spec(); exp.register = function() { + var e = reg.entity; var a = reg.action; + e.register({ type: 'group', spec: exp.entity_spec }); + a.register('make_posix', exp.make_posix_action); a.register('make_external', exp.make_external_action); }; |