summaryrefslogtreecommitdiffstats
path: root/install/ui/src/freeipa/idrange.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/idrange.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/idrange.js')
-rw-r--r--install/ui/src/freeipa/idrange.js206
1 files changed, 108 insertions, 98 deletions
diff --git a/install/ui/src/freeipa/idrange.js b/install/ui/src/freeipa/idrange.js
index f7e195a24..7e419e574 100644
--- a/install/ui/src/freeipa/idrange.js
+++ b/install/ui/src/freeipa/idrange.js
@@ -18,27 +18,34 @@
* 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.idrange = {};
+var exp = IPA.idrange = {};
-IPA.idrange.entity = function(spec) {
-
- var that = IPA.entity(spec);
-
- that.init = function() {
- that.entity_init();
-
- that.builder.search_facet({
+var make_spec = function() {
+return {
+ name: 'idrange',
+ facets: [
+ {
+ $type: 'search',
columns: [
'cn',
'ipabaseid',
'ipaidrangesize',
'iparangetype'
]
- }).
- details_facet({
+ },
+ {
+ $type: 'details',
sections: [
{
name: 'details',
@@ -73,93 +80,96 @@ IPA.idrange.entity = function(spec) {
]
}
]
- }).
- adder_dialog({
- fields: [
- {
- name: 'cn',
- widget: 'idrange.cn'
- },
- {
- name: 'ipabaseid',
- label: '@i18n:objects.idrange.ipabaseid',
- tooltip: '@mo-param:idrange:ipabaseid:label',
- widget: 'idrange.ipabaseid'
- },
- {
- name: 'ipaidrangesize',
- label: '@i18n:objects.idrange.ipaidrangesize',
- tooltip: '@mo-param:idrange:ipaidrangesize:label',
- widget: 'idrange.ipaidrangesize'
- },
- {
- name: 'ipabaserid',
- label: '@i18n:objects.idrange.ipabaserid',
- tooltip: '@mo-param:idrange:ipabaserid:label',
- widget: 'idrange.ipabaserid'
- },
- {
- name: 'ipasecondarybaserid',
- label: '@i18n:objects.idrange.ipasecondarybaserid',
- tooltip: '@mo-param:idrange:ipasecondarybaserid:label',
- widget: 'type.ipasecondarybaserid'
- },
- {
- name: 'ipanttrusteddomainsid',
- label: '@i18n:objects.idrange.ipanttrusteddomainsid',
- tooltip: '@mo-param:idrange:ipanttrusteddomainsid:label',
- widget: 'type.ipanttrusteddomainsid'
- }
- ],
- widgets: [
- {
- $type: 'details_table_section_nc',
- name: 'idrange',
- widgets: [
- 'cn',
- 'ipabaseid',
- 'ipaidrangesize',
- 'ipabaserid'
- ]
- },
- {
- $type: 'multiple_choice_section',
- name: 'type',
- label: '@i18n:objects.idrange.type',
- choices: [
- {
- name: 'local',
- label: '@i18n:objects.idrange.type_local',
- fields: ['ipasecondarybaserid'],
- required: ['ipasecondarybaserid'],
- enabled: true
- },
- {
- name: 'ad',
- label: '@i18n:objects.idrange.type_ad',
- fields: ['ipanttrusteddomainsid'],
- required: ['ipanttrusteddomainsid']
- }
- ],
- widgets: [
- 'ipasecondarybaserid',
- 'ipanttrusteddomainsid'
- ]
- }
- ],
- policies: [
- {
- $factory: IPA.multiple_choice_section_policy,
- widget: 'type'
- }
- ]
- });
- };
+ }
+ ],
+ adder_dialog: {
+ fields: [
+ {
+ name: 'cn',
+ widget: 'idrange.cn'
+ },
+ {
+ name: 'ipabaseid',
+ label: '@i18n:objects.idrange.ipabaseid',
+ tooltip: '@mo-param:idrange:ipabaseid:label',
+ widget: 'idrange.ipabaseid'
+ },
+ {
+ name: 'ipaidrangesize',
+ label: '@i18n:objects.idrange.ipaidrangesize',
+ tooltip: '@mo-param:idrange:ipaidrangesize:label',
+ widget: 'idrange.ipaidrangesize'
+ },
+ {
+ name: 'ipabaserid',
+ label: '@i18n:objects.idrange.ipabaserid',
+ tooltip: '@mo-param:idrange:ipabaserid:label',
+ widget: 'idrange.ipabaserid'
+ },
+ {
+ name: 'ipasecondarybaserid',
+ label: '@i18n:objects.idrange.ipasecondarybaserid',
+ tooltip: '@mo-param:idrange:ipasecondarybaserid:label',
+ widget: 'type.ipasecondarybaserid'
+ },
+ {
+ name: 'ipanttrusteddomainsid',
+ label: '@i18n:objects.idrange.ipanttrusteddomainsid',
+ tooltip: '@mo-param:idrange:ipanttrusteddomainsid:label',
+ widget: 'type.ipanttrusteddomainsid'
+ }
+ ],
+ widgets: [
+ {
+ $type: 'details_table_section_nc',
+ name: 'idrange',
+ widgets: [
+ 'cn',
+ 'ipabaseid',
+ 'ipaidrangesize',
+ 'ipabaserid'
+ ]
+ },
+ {
+ $type: 'multiple_choice_section',
+ name: 'type',
+ label: '@i18n:objects.idrange.type',
+ choices: [
+ {
+ name: 'local',
+ label: '@i18n:objects.idrange.type_local',
+ fields: ['ipasecondarybaserid'],
+ required: ['ipasecondarybaserid'],
+ enabled: true
+ },
+ {
+ name: 'ad',
+ label: '@i18n:objects.idrange.type_ad',
+ fields: ['ipanttrusteddomainsid'],
+ required: ['ipanttrusteddomainsid']
+ }
+ ],
+ widgets: [
+ 'ipasecondarybaserid',
+ 'ipanttrusteddomainsid'
+ ]
+ }
+ ],
+ policies: [
+ {
+ $factory: IPA.multiple_choice_section_policy,
+ widget: 'type'
+ }
+ ]
+ }
+};};
- return that;
+exp.entity_spec = make_spec();
+exp.register = function() {
+ var e = reg.entity;
+ e.register({type: 'idrange', spec: exp.entity_spec});
};
-
-IPA.register('idrange', IPA.idrange.entity);
+phases.on('registration', exp.register);
return {};
}); \ No newline at end of file