summaryrefslogtreecommitdiffstats
path: root/install/ui/src/freeipa/netgroup.js
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2013-04-18 12:38:38 +0200
committerPetr Vobornik <pvoborni@redhat.com>2013-05-06 16:22:29 +0200
commit14c276d21865f70e0ff939357b52a9830d32b5ea (patch)
tree9ccf09b0875ddbc43500c6c8bee08f5de8d20afe /install/ui/src/freeipa/netgroup.js
parenta513673f043e37dc0fbad0b698f3f12a6a15a06c (diff)
downloadfreeipa-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/netgroup.js')
-rw-r--r--install/ui/src/freeipa/netgroup.js77
1 files changed, 44 insertions, 33 deletions
diff --git a/install/ui/src/freeipa/netgroup.js b/install/ui/src/freeipa/netgroup.js
index 7c7bb9b8d..776872514 100644
--- a/install/ui/src/freeipa/netgroup.js
+++ b/install/ui/src/freeipa/netgroup.js
@@ -18,51 +18,56 @@
* 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.netgroup = {
+var exp = IPA.netgroup = {
remove_method_priority: IPA.config.default_priority - 1,
enable_priority: IPA.config.default_priority + 1
};
-IPA.netgroup.entity = function(spec) {
-
- var that = IPA.entity(spec);
-
- that.init = function() {
- that.entity_init();
-
- that.builder.facet_groups(['settings', 'member', 'memberof']).
- search_facet({
+var make_spec = function() {
+return {
+ name: 'netgroup',
+ facet_groups: ['settings', 'member', 'memberof'],
+ facets: [
+ {
+ $type: 'search',
columns: [
'cn',
'description'
]
- }).
- details_facet({
+ },
+ {
+ $type: 'details',
$factory: IPA.netgroup.details_facet,
- entity: that,
command_mode: 'info'
- }).
- association_facet({
+ },
+ {
+ $type: 'association',
name: 'memberof_netgroup',
associator: IPA.serial_associator
- }).
- standard_association_facets().
- adder_dialog({
- fields: [
- 'cn',
- {
- $type: 'textarea',
- name: 'description'
- }
- ]
- });
- };
-
- return that;
-};
+ }
+ ],
+ standard_association_facets: true,
+ adder_dialog: {
+ fields: [
+ 'cn',
+ {
+ $type: 'textarea',
+ name: 'description'
+ }
+ ]
+ }
+};};
IPA.netgroup.details_facet = function(spec) {
@@ -302,7 +307,13 @@ IPA.netgroup.details_facet = function(spec) {
return that;
};
-IPA.register('netgroup', IPA.netgroup.entity);
+exp.entity_spec = make_spec();
+exp.register = function() {
+ var e = reg.entity;
+
+ e.register({type: 'netgroup', spec: exp.entity_spec});
+};
+phases.on('registration', exp.register);
return {};
}); \ No newline at end of file