summaryrefslogtreecommitdiffstats
path: root/install/ui/src/freeipa/serverconfig.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/serverconfig.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/serverconfig.js')
-rw-r--r--install/ui/src/freeipa/serverconfig.js44
1 files changed, 26 insertions, 18 deletions
diff --git a/install/ui/src/freeipa/serverconfig.js b/install/ui/src/freeipa/serverconfig.js
index 2838bc840..97aac5413 100644
--- a/install/ui/src/freeipa/serverconfig.js
+++ b/install/ui/src/freeipa/serverconfig.js
@@ -19,21 +19,26 @@
* 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.serverconfig = {};
+var exp = IPA.serverconfig = {};
-IPA.serverconfig.entity = function(spec) {
-
- spec = spec || {};
- spec.defines_key = false;
- var that = IPA.entity(spec);
-
- that.init = function() {
- that.entity_init();
-
- that.builder.details_facet({
+var make_spec = function() {
+return {
+ name: 'config',
+ defines_key: false,
+ facets: [
+ {
+ $type: 'details',
title: IPA.metadata.objects.config.label,
sections: [
{
@@ -110,13 +115,16 @@ IPA.serverconfig.entity = function(spec) {
}
],
needs_update: true
- });
- };
+ }
+ ]
+};};
- return that;
+exp.entity_spec = make_spec();
+exp.register = function() {
+ var e = reg.entity;
+ e.register({type: 'config', spec: exp.entity_spec});
};
-
-IPA.register('config', IPA.serverconfig.entity);
+phases.on('registration', exp.register);
return {};
});