summaryrefslogtreecommitdiffstats
path: root/install/ui
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2013-04-16 12:59:38 +0200
committerPetr Vobornik <pvoborni@redhat.com>2013-05-06 16:22:26 +0200
commite100ba7e2b14b74ed548ee0dd6ba1093b17dd795 (patch)
tree6b675d9643a74b717ecb70e0c642405818311472 /install/ui
parent1221fca6628450c6cd3031b377c7426fa4b1b0ad (diff)
downloadfreeipa-e100ba7e2b14b74ed548ee0dd6ba1093b17dd795.tar.gz
freeipa-e100ba7e2b14b74ed548ee0dd6ba1093b17dd795.tar.xz
freeipa-e100ba7e2b14b74ed548ee0dd6ba1093b17dd795.zip
Replace build logic in widget and field builder by new builder
https://fedorahosted.org/freeipa/ticket/3235
Diffstat (limited to 'install/ui')
-rw-r--r--install/ui/src/freeipa/aci.js66
-rw-r--r--install/ui/src/freeipa/automember.js20
-rw-r--r--install/ui/src/freeipa/automount.js6
-rwxr-xr-xinstall/ui/src/freeipa/certificate.js4
-rw-r--r--install/ui/src/freeipa/dns.js78
-rw-r--r--install/ui/src/freeipa/entitle.js2
-rw-r--r--install/ui/src/freeipa/facet.js6
-rw-r--r--install/ui/src/freeipa/field.js66
-rw-r--r--install/ui/src/freeipa/group.js8
-rw-r--r--install/ui/src/freeipa/hbac.js44
-rw-r--r--install/ui/src/freeipa/host.js28
-rw-r--r--install/ui/src/freeipa/hostgroup.js4
-rw-r--r--install/ui/src/freeipa/idrange.js4
-rw-r--r--install/ui/src/freeipa/ipa.js6
-rw-r--r--install/ui/src/freeipa/netgroup.js28
-rw-r--r--install/ui/src/freeipa/policy.js4
-rw-r--r--install/ui/src/freeipa/realmdomains.js2
-rw-r--r--install/ui/src/freeipa/selinux.js30
-rw-r--r--install/ui/src/freeipa/serverconfig.js12
-rw-r--r--install/ui/src/freeipa/service.js20
-rw-r--r--install/ui/src/freeipa/sudo.js68
-rw-r--r--install/ui/src/freeipa/trust.js20
-rw-r--r--install/ui/src/freeipa/user.js24
-rw-r--r--install/ui/src/freeipa/widget.js84
-rw-r--r--install/ui/test/aci_tests.js12
-rw-r--r--install/ui/test/details_tests.js22
26 files changed, 314 insertions, 354 deletions
diff --git a/install/ui/src/freeipa/aci.js b/install/ui/src/freeipa/aci.js
index c43e615fe..d7d952e5c 100644
--- a/install/ui/src/freeipa/aci.js
+++ b/install/ui/src/freeipa/aci.js
@@ -52,12 +52,12 @@ IPA.aci.permission_entity = function(spec) {
widget: 'identity.cn'
},
{
- type: 'rights',
+ $type: 'rights',
name: 'permissions',
widget: 'rights.permissions'
},
{
- type: 'select',
+ $type: 'select',
name: 'target',
widget: 'target.target',
enabled: false
@@ -68,7 +68,7 @@ IPA.aci.permission_entity = function(spec) {
enabled: false
},
{
- type: 'entity_select',
+ $type: 'entity_select',
name: 'memberof',
widget: 'target.memberof',
enabled: false
@@ -79,13 +79,13 @@ IPA.aci.permission_entity = function(spec) {
enabled: false
},
{
- type: 'entity_select',
+ $type: 'entity_select',
name: 'targetgroup',
widget: 'target.targetgroup',
enabled: false
},
{
- type: 'select',
+ $type: 'select',
name: 'type',
widget: 'target.type',
enabled: false
@@ -98,14 +98,14 @@ IPA.aci.permission_entity = function(spec) {
{
name: 'attrs_multi',
param: 'attrs',
- type: 'multivalued',
+ $type: 'multivalued',
widget: 'target.attrs_multi',
enabled: false
}
],
widgets: [
{
- type: 'details_table_section',
+ $type: 'details_table_section',
name: 'identity',
label: '@i18n:objects.permission.identity',
widgets: [
@@ -113,18 +113,18 @@ IPA.aci.permission_entity = function(spec) {
]
},
{
- type: 'details_table_section',
+ $type: 'details_table_section',
name: 'rights',
label: '@i18n:objects.permission.rights',
widgets: [
{
- type: 'rights',
+ $type: 'rights',
name: 'permissions'
}
]
},
{
- type: 'permission_target',
+ $type: 'permission_target',
container_factory: IPA.details_table_section,
label: '@i18n:objects.permission.target',
name: 'target',
@@ -147,12 +147,12 @@ IPA.aci.permission_entity = function(spec) {
widget: 'general.cn'
},
{
- type: 'rights',
+ $type: 'rights',
name: 'permissions',
widget: 'general.permissions'
},
{
- type: 'select',
+ $type: 'select',
name: 'target',
widget: 'target.target',
enabled: false
@@ -163,7 +163,7 @@ IPA.aci.permission_entity = function(spec) {
enabled: false
},
{
- type: 'entity_select',
+ $type: 'entity_select',
name: 'memberof',
widget: 'target.memberof',
enabled: false
@@ -174,13 +174,13 @@ IPA.aci.permission_entity = function(spec) {
enabled: false
},
{
- type: 'entity_select',
+ $type: 'entity_select',
name: 'targetgroup',
widget: 'target.targetgroup',
enabled: false
},
{
- type: 'select',
+ $type: 'select',
name: 'type',
widget: 'target.type',
enabled: false
@@ -192,7 +192,7 @@ IPA.aci.permission_entity = function(spec) {
},
{
name: 'attrs_multi',
- type: 'multivalued',
+ $type: 'multivalued',
param: 'attrs',
widget: 'target.attrs_multi',
enabled: false
@@ -200,18 +200,18 @@ IPA.aci.permission_entity = function(spec) {
],
widgets: [
{
- type: 'details_table_section_nc',
+ $type: 'details_table_section_nc',
name: 'general',
widgets: [
'cn',
{
- type: 'rights',
+ $type: 'rights',
name: 'permissions'
}
]
},
{
- type: 'permission_target',
+ $type: 'permission_target',
name:'target',
show_target: true
}
@@ -258,7 +258,7 @@ IPA.aci.privilege_entity = function(spec) {
fields: [
'cn',
{
- type: 'textarea',
+ $type: 'textarea',
name: 'description'
}
]
@@ -283,7 +283,7 @@ IPA.aci.privilege_entity = function(spec) {
fields: [
'cn',
{
- type: 'textarea',
+ $type: 'textarea',
name: 'description'
}
]
@@ -315,7 +315,7 @@ IPA.aci.role_entity = function(spec) {
fields: [
'cn',
{
- type: 'textarea',
+ $type: 'textarea',
name: 'description'
}
]
@@ -333,7 +333,7 @@ IPA.aci.role_entity = function(spec) {
fields: [
'cn',
{
- type: 'textarea',
+ $type: 'textarea',
name: 'description'
}
]
@@ -363,7 +363,7 @@ IPA.aci.selfservice_entity = function(spec) {
fields: [
'aciname',
{
- type: 'attributes',
+ $type: 'attributes',
object_type: 'user',
name: 'attrs'
}
@@ -375,7 +375,7 @@ IPA.aci.selfservice_entity = function(spec) {
fields: [
'aciname',
{
- type: 'attributes',
+ $type: 'attributes',
object_type: 'user',
name: 'attrs'
}
@@ -408,25 +408,25 @@ IPA.aci.delegation_entity = function(spec) {
fields: [
'aciname',
{
- type: 'checkboxes',
+ $type: 'checkboxes',
name: 'permissions',
required: true,
options: IPA.create_options(['read', 'write'])
},
{
- type: 'entity_select',
+ $type: 'entity_select',
name: 'group',
other_entity: that.group_entity,
other_field: 'cn'
},
{
- type: 'entity_select',
+ $type: 'entity_select',
name: 'memberof',
other_entity: that.group_entity,
other_field: 'cn'
},
{
- type: 'attributes',
+ $type: 'attributes',
name: 'attrs',
object_type: 'user'
}
@@ -439,24 +439,24 @@ IPA.aci.delegation_entity = function(spec) {
fields: [
'aciname',
{
- type: 'checkboxes',
+ $type: 'checkboxes',
name: 'permissions',
options: IPA.create_options(['read', 'write'])
},
{
- type: 'entity_select',
+ $type: 'entity_select',
name: 'group',
other_entity: that.group_entity,
other_field: 'cn'
},
{
- type: 'entity_select',
+ $type: 'entity_select',
name: 'memberof',
other_entity: that.group_entity,
other_field: 'cn'
},
{
- type: 'attributes',
+ $type: 'attributes',
name: 'attrs',
object_type: 'user'
}
diff --git a/install/ui/src/freeipa/automember.js b/install/ui/src/freeipa/automember.js
index 26ef533e4..25af15d14 100644
--- a/install/ui/src/freeipa/automember.js
+++ b/install/ui/src/freeipa/automember.js
@@ -108,7 +108,7 @@ IPA.automember.entity = function(spec) {
title: '@i18n:objects.automember.add_rule',
fields: [
{
- type: 'entity_select',
+ $type: 'entity_select',
name: 'cn',
other_entity: 'group',
other_field: 'cn'
@@ -229,17 +229,17 @@ IPA.automember.rule_details_facet = function(spec) {
widget: 'general.cn'
},
{
- type: 'textarea',
+ $type: 'textarea',
name: 'description',
widget: 'general.description'
},
{
- type: 'automember_condition',
+ $type: 'automember_condition',
name: 'automemberinclusiveregex',
widget: 'inclusive.automemberinclusiveregex'
},
{
- type: 'automember_condition',
+ $type: 'automember_condition',
name: 'automemberexclusiveregex',
widget: 'exclusive.automemberexclusiveregex'
}
@@ -247,7 +247,7 @@ IPA.automember.rule_details_facet = function(spec) {
spec.widgets = [
{
- type: 'details_table_section',
+ $type: 'details_table_section',
name: 'general',
label: '@i18n:details.general',
widgets: [
@@ -255,7 +255,7 @@ IPA.automember.rule_details_facet = function(spec) {
name: 'cn'
},
{
- type: 'textarea',
+ $type: 'textarea',
name: 'description'
}
]
@@ -266,7 +266,7 @@ IPA.automember.rule_details_facet = function(spec) {
label: '@i18n:objects.automember.inclusive',
widgets: [
{
- type: 'automember_condition',
+ $type: 'automember_condition',
name: 'automemberinclusiveregex',
group_type: spec.group_type,
add_command: 'add_condition',
@@ -276,7 +276,7 @@ IPA.automember.rule_details_facet = function(spec) {
fields: [
{
name: 'key',
- type: 'select',
+ $type: 'select',
options: IPA.automember.get_condition_attributes(spec.group_type),
label: '@i18n:objects.automember.attribute'
},
@@ -295,7 +295,7 @@ IPA.automember.rule_details_facet = function(spec) {
label: '@i18n:objects.automember.exclusive',
widgets: [
{
- type: 'automember_condition',
+ $type: 'automember_condition',
name: 'automemberexclusiveregex',
group_type: spec.group_type,
add_command: 'add_condition',
@@ -305,7 +305,7 @@ IPA.automember.rule_details_facet = function(spec) {
fields: [
{
name: 'key',
- type: 'select',
+ $type: 'select',
options: IPA.automember.get_condition_attributes(spec.group_type),
label: '@i18n:objects.automember.attribute'
},
diff --git a/install/ui/src/freeipa/automount.js b/install/ui/src/freeipa/automount.js
index ab8ac791f..eb63266b4 100644
--- a/install/ui/src/freeipa/automount.js
+++ b/install/ui/src/freeipa/automount.js
@@ -94,7 +94,7 @@ IPA.automount.map_entity = function(spec) {
fields: [
'automountmapname',
{
- type: 'textarea',
+ $type: 'textarea',
name: 'description'
}
]
@@ -108,7 +108,7 @@ IPA.automount.map_entity = function(spec) {
name: 'general',
fields: [
{
- type: 'radio',
+ $type: 'radio',
name: 'method',
enabled: false, //don't use value in add command
label: '@i18n:objects.automountmap.map_type',
@@ -125,7 +125,7 @@ IPA.automount.map_entity = function(spec) {
},
'automountmapname',
{
- type: 'textarea',
+ $type: 'textarea',
name: 'description'
}
]
diff --git a/install/ui/src/freeipa/certificate.js b/install/ui/src/freeipa/certificate.js
index a46fd46e9..6965509f6 100755
--- a/install/ui/src/freeipa/certificate.js
+++ b/install/ui/src/freeipa/certificate.js
@@ -1159,11 +1159,11 @@ IPA.cert.entity = function(spec) {
'sha1_fingerprint',
'md5_fingerprint',
{
- type: 'revocation_reason',
+ $type: 'revocation_reason',
name: 'revocation_reason'
},
{
- type: 'textarea',
+ $type: 'textarea',
name: 'certificate',
style: {
width: '550px',
diff --git a/install/ui/src/freeipa/dns.js b/install/ui/src/freeipa/dns.js
index 6ecba1dbf..ee78acf09 100644
--- a/install/ui/src/freeipa/dns.js
+++ b/install/ui/src/freeipa/dns.js
@@ -64,16 +64,16 @@ IPA.dns.config_entity = function(spec) {
label: '@i18n:objects.dnsconfig.options',
fields: [
{
- type: 'checkbox',
+ $type: 'checkbox',
name: 'idnsallowsyncptr'
},
{
- type: 'multivalued',
+ $type: 'multivalued',
name: 'idnsforwarders',
validators: [IPA.dnsforwarder_validator()]
},
{
- type: 'radio',
+ $type: 'radio',
name: 'idnsforwardpolicy',
default_value: 'first',
options: [
@@ -162,14 +162,14 @@ IPA.dns.zone_entity = function(spec) {
'idnssoaminimum',
'dnsttl',
{
- type: 'combobox',
+ $type: 'combobox',
name: 'dnsclass',
options: [
'IN', 'CS', 'CH', 'HS'
]
},
{
- type: 'radio',
+ $type: 'radio',
name: 'idnsallowdynupdate',
options: [
{ value: 'TRUE', label: '@i18n:true' },
@@ -177,11 +177,11 @@ IPA.dns.zone_entity = function(spec) {
]
},
{
- type: 'textarea',
+ $type: 'textarea',
name: 'idnsupdatepolicy'
},
{
- type: 'netaddr',
+ $type: 'netaddr',
name: 'idnsallowquery',
validators: [
IPA.network_validator({
@@ -191,7 +191,7 @@ IPA.dns.zone_entity = function(spec) {
})]
},
{
- type: 'netaddr',
+ $type: 'netaddr',
name: 'idnsallowtransfer',
validators: [
IPA.network_validator({
@@ -201,12 +201,12 @@ IPA.dns.zone_entity = function(spec) {
})]
},
{
- type: 'multivalued',
+ $type: 'multivalued',
name: 'idnsforwarders',
validators: [IPA.dnsforwarder_validator()]
},
{
- type: 'radio',
+ $type: 'radio',
name: 'idnsforwardpolicy',
default_value: 'first',
options: [
@@ -225,7 +225,7 @@ IPA.dns.zone_entity = function(spec) {
]
},
{
- type: 'checkbox',
+ $type: 'checkbox',
name: 'idnsallowsyncptr'
}
]
@@ -293,13 +293,13 @@ IPA.dns.zone_entity = function(spec) {
name: 'name',
fields: [
{
- type: 'dnszone_name',
+ $type: 'dnszone_name',
name: 'idnsname',
required: false,
radio_name: 'dnszone_name_type'
},
{
- type: 'dnszone_name',
+ $type: 'dnszone_name',
name: 'name_from_ip',
radio_name: 'dnszone_name_type',
validators: [IPA.network_validator()]
@@ -315,7 +315,7 @@ IPA.dns.zone_entity = function(spec) {
required: false
},
{
- type: 'force_dnszone_add_checkbox',
+ $type: 'force_dnszone_add_checkbox',
name: 'force',
metadata: IPA.get_command_option('dnszone_add', 'force')
}
@@ -795,7 +795,7 @@ IPA.dns.get_record_metadata = function() {
validators: [IPA.ip_v4_address_validator()]
},
{
- type: 'checkbox',
+ $type: 'checkbox',
name: 'a_extra_create_reverse'
}
],
@@ -814,7 +814,7 @@ IPA.dns.get_record_metadata = function() {
validators: [IPA.ip_v6_address_validator()]
},
{
- type: 'checkbox',
+ $type: 'checkbox',
name: 'aaaa_extra_create_reverse'
}
],
@@ -848,7 +848,7 @@ IPA.dns.get_record_metadata = function() {
'cert_part_algorithm',
{
name: 'cert_part_certificate_or_crl',
- type: 'textarea'
+ $type: 'textarea'
}
],
columns: ['cert_part_type','cert_part_key_tag','cert_part_algorithm']
@@ -875,7 +875,7 @@ IPA.dns.get_record_metadata = function() {
'ds_part_digest_type',
{
name: 'ds_part_digest',
- type: 'textarea'
+ $type: 'textarea'
}
],
columns: ['ds_part_key_tag', 'ds_part_algorithm',
@@ -889,7 +889,7 @@ IPA.dns.get_record_metadata = function() {
'key_part_algorithm',
{
name: 'key_part_public_key',
- type: 'textarea'
+ $type: 'textarea'
}
],
columns: ['key_part_flags', 'key_part_protocol',
@@ -912,7 +912,7 @@ IPA.dns.get_record_metadata = function() {
{
name: 'loc_part_lat_dir',
options: IPA.create_options(['N','S']),
- type: 'radio',
+ $type: 'radio',
widget_opt: {
default_value: 'N'
}
@@ -923,7 +923,7 @@ IPA.dns.get_record_metadata = function() {
{
name: 'loc_part_lon_dir',
options: IPA.create_options(['E','W']),
- type: 'radio',
+ $type: 'radio',
widget_opt: {
default_value: 'E'
}
@@ -950,7 +950,7 @@ IPA.dns.get_record_metadata = function() {
'naptr_part_preference',
{
name: 'naptr_part_flags',
- type: 'select',
+ $type: 'select',
options: IPA.create_options(['S', 'A', 'U', 'P'])
},
'naptr_part_service',
@@ -982,7 +982,7 @@ IPA.dns.get_record_metadata = function() {
// 'DS', 'HIP', 'IPSECKEY', 'KEY', 'KX', 'LOC', 'MX', 'NAPTR',
// 'NS', 'NSEC','NSEC3', 'NSEC3PARAM', 'PTR', 'RRSIG', 'RP',
// 'SIG', 'SPF', 'SRV', 'SSHFP', 'TA', 'TKEY', 'TSIG', 'TXT']),
-// type: 'select'
+// $type: 'select'
// }
],
adder_attributes: [],
@@ -1001,7 +1001,7 @@ IPA.dns.get_record_metadata = function() {
attributes: [
{
name: 'rrsig_part_type_covered',
- type: 'select',
+ $type: 'select',
options: IPA.create_options(['SOA', 'A', 'AAAA', 'A6', 'AFSDB',
'APL', 'CERT', 'CNAME', 'DHCID', 'DLV', 'DNAME',
'DNSKEY', 'DS', 'HIP', 'IPSECKEY', 'KEY', 'KX',
@@ -1018,7 +1018,7 @@ IPA.dns.get_record_metadata = function() {
'rrsig_part_signers_name',
{
name: 'rrsig_part_signature',
- type: 'textarea'
+ $type: 'textarea'
}
],
adder_attributes: [],
@@ -1029,7 +1029,7 @@ IPA.dns.get_record_metadata = function() {
attributes: [
{
name: 'sig_part_type_covered',
- type: 'select',
+ $type: 'select',
options: IPA.create_options(['SOA', 'A', 'AAAA', 'A6', 'AFSDB',
'APL', 'CERT', 'CNAME', 'DHCID', 'DLV', 'DNAME',
'DNSKEY', 'DS', 'HIP', 'IPSECKEY', 'KEY', 'KX',
@@ -1046,7 +1046,7 @@ IPA.dns.get_record_metadata = function() {
'sig_part_signers_name',
{
name: 'sig_part_signature',
- type: 'textarea'
+ $type: 'textarea'
}
],
adder_attributes: [],
@@ -1071,7 +1071,7 @@ IPA.dns.get_record_metadata = function() {
'sshfp_part_fp_type',
{
name: 'sshfp_part_fingerprint',
- type: 'textarea'
+ $type: 'textarea'
}
],
adder_attributes: [],
@@ -1158,7 +1158,7 @@ IPA.dns.record_entity = function(spec) {
disable_breadcrumb: false,
fields: [
{
- type: 'dnsrecord_host_link',
+ $type: 'dnsrecord_host_link',
name: 'idnsname',
other_entity: 'host',
widget: 'identity.idnsname'
@@ -1168,10 +1168,10 @@ IPA.dns.record_entity = function(spec) {
{
name: 'identity',
label: '@i18n:details.identity',
- type: 'details_table_section',
+ $type: 'details_table_section',
widgets: [
{
- type: 'dnsrecord_host_link',
+ $type: 'dnsrecord_host_link',
name: 'idnsname',
other_entity: 'host',
label: IPA.get_entity_param(
@@ -1190,7 +1190,7 @@ IPA.dns.record_entity = function(spec) {
},
{
name: 'record_type',
- type: 'dnsrecord_type',
+ $type: 'dnsrecord_type',
flags: ['no_command'],
widget: 'general.record_type'
}
@@ -1198,11 +1198,11 @@ IPA.dns.record_entity = function(spec) {
widgets: [
{
name: 'general',
- type: 'details_table_section_nc',
+ $type: 'details_table_section_nc',
widgets: [
'idnsname',
{
- type: 'dnsrecord_type',
+ $type: 'dnsrecord_type',
name: 'record_type',
label: '@i18n:objects.dnsrecord.type'
}
@@ -1338,7 +1338,7 @@ IPA.dns.record_prepare_editor_for_type = function(type, fields, widgets, update)
var section = {
name: type.name,
- type: 'details_table_section_nc',
+ $type: 'details_table_section_nc',
widgets: []
};
widgets.push(section);
@@ -1393,14 +1393,14 @@ IPA.dns.record_prepare_details_spec = function(spec, type_prepare_method) {
var standard_record_section = {
name: 'standard_types',
- type: 'details_table_section',
+ $type: 'details_table_section',
label: '@i18n:objects.dnsrecord.standard',
widgets: []
};
var other_record_section = {
name: 'other_types',
- type: 'details_table_section',
+ $type: 'details_table_section',
label: '@i18n:objects.dnsrecord.other',
widgets: []
};
@@ -1432,7 +1432,7 @@ IPA.dns.record_prepare_details_for_type = function(type, fields, container) {
var type_widget = {
name: type.name,
- type: 'dnsrecord_type_table',
+ $type: 'dnsrecord_type_table',
record_type: type.name,
value_attribute: 'dnsdata',
dnstype: dnstype,
@@ -1443,7 +1443,7 @@ IPA.dns.record_prepare_details_for_type = function(type, fields, container) {
var field = {
name: type.name,
- type: 'dnsrecord_type_table',
+ $type: 'dnsrecord_type_table',
dnstype: dnstype,
label: dnstype,
widget: container.name+'.'+type.name
diff --git a/install/ui/src/freeipa/entitle.js b/install/ui/src/freeipa/entitle.js
index 402c4cf69..6612d1a8b 100644
--- a/install/ui/src/freeipa/entitle.js
+++ b/install/ui/src/freeipa/entitle.js
@@ -125,7 +125,7 @@ IPA.entitle.entity = function(spec) {
{
name: 'password',
label: IPA.get_command_option('entitle_register', 'password').label,
- type: 'password'
+ $type: 'password'
}
/* currently not supported
, {
diff --git a/install/ui/src/freeipa/facet.js b/install/ui/src/freeipa/facet.js
index 3e4474580..bc306fae4 100644
--- a/install/ui/src/freeipa/facet.js
+++ b/install/ui/src/freeipa/facet.js
@@ -2187,16 +2187,16 @@ exp.action_list_widget = IPA.action_list_widget = function(spec) {
spec.widgets = spec.widgets || [
{
- type: 'html',
+ $type: 'html',
css_class: 'separator'
},
{
- type: 'select',
+ $type: 'select',
name: 'action',
undo: false
},
{
- type: 'button',
+ $type: 'button',
name: 'apply',
label: '@i18n:actions.apply'
}
diff --git a/install/ui/src/freeipa/field.js b/install/ui/src/freeipa/field.js
index fb315765f..25576a93a 100644
--- a/install/ui/src/freeipa/field.js
+++ b/install/ui/src/freeipa/field.js
@@ -24,6 +24,7 @@
define([
'dojo/_base/array',
+ 'dojo/_base/lang',
'./builder',
'./ipa',
'./jquery',
@@ -31,7 +32,7 @@ define([
'./phases',
'./reg',
'./text'],
- function(array, builder, IPA, $, navigation, phases, reg, text) {
+ function(array, lang, builder, IPA, $, navigation, phases, reg, text) {
var exp = {};
@@ -878,66 +879,49 @@ IPA.field_builder = function(spec) {
var that = IPA.object();
- that.default_factory = spec.default_factory || IPA.field;
that.container = spec.container;
that.field_options = spec.field_options || {};
- that.get_field_factory = function(spec) {
-
- var factory;
- if (spec.$factory) {
- factory = spec.$factory;
- } else if(spec.type) {
- factory = reg.field.get(spec.type);
- factory = factory ? factory.factory : undefined;
- }
-
- if (!factory) {
- factory = that.default_factory;
- }
-
- return factory;
- };
that.build_field = function(spec, container) {
- container = container || that.container;
-
- if(!(spec instanceof Object)) {
- spec = { name: spec };
- }
-
- if(that.field_options) {
- $.extend(spec, that.field_options);
- }
-
- var factory = that.get_field_factory(spec);
-
- var field = factory(spec);
-
- if(container) {
- container.add_field(field);
- }
-
+ var context = lang.mixin({}, that.field_options);
+ context.container = container || that.container;
+ var field = builder.build('field', spec, context);
return field;
};
that.build_fields = function(specs, container) {
- container = container || that.container;
-
- for(var i=0; i<specs.length; i++) {
- that.build_field(specs[i], container);
- }
+ return that.build_field(specs, container);
};
return that;
};
+
+exp.pre_op = function(spec, context) {
+
+ if (context.facet) spec.facet = context.facet;
+ if (context.entity) spec.entity = context.entity;
+ if (context.undo !== undefined) spec.undo = context.undo;
+ return spec;
+};
+
+exp.post_op = function(obj, spec, context) {
+
+ if (context.container) context.container.add_field(obj);
+ return obj;
+};
+
// New builder and registry
exp.builder = builder.get('field');
exp.builder.factory = IPA.field;
+exp.builder.string_mode = 'property';
+exp.builder.string_property = 'name';
reg.set('field', exp.builder.registry);
+exp.builder.pre_ops.push(exp.pre_op);
+exp.builder.post_ops.push(exp.post_op);
exp.register = function() {
var f = reg.field;
diff --git a/install/ui/src/freeipa/group.js b/install/ui/src/freeipa/group.js
index f3b17c4ca..b04c32d87 100644
--- a/install/ui/src/freeipa/group.js
+++ b/install/ui/src/freeipa/group.js
@@ -46,11 +46,11 @@ IPA.group.entity = function(spec) {
fields: [
'cn',
{
- type: 'textarea',
+ $type: 'textarea',
name: 'description'
},
{
- type: 'value_map',
+ $type: 'value_map',
name: 'external',
param: 'objectclass',
label: '@i18n:objects.group.type',
@@ -144,11 +144,11 @@ IPA.group.entity = function(spec) {
fields: [
'cn',
{
- type: 'textarea',
+ $type: 'textarea',
name: 'description'
},
{
- type: 'radio',
+ $type: 'radio',
name: 'type',
label: '@i18n:objects.group.type',
flags: ['no_command'],
diff --git a/install/ui/src/freeipa/hbac.js b/install/ui/src/freeipa/hbac.js
index 8cbbbe08e..d59f96d09 100644
--- a/install/ui/src/freeipa/hbac.js
+++ b/install/ui/src/freeipa/hbac.js
@@ -116,7 +116,7 @@ IPA.hbac.service_entity = function(spec) {
fields: [
'cn',
{
- type: 'textarea',
+ $type: 'textarea',
name: 'description'
}
]
@@ -147,7 +147,7 @@ IPA.hbac.service_entity = function(spec) {
fields: [
'cn',
{
- type: 'textarea',
+ $type: 'textarea',
name: 'description'
}
]
@@ -178,7 +178,7 @@ IPA.hbac.service_group_entity = function(spec) {
fields: [
'cn',
{
- type: 'textarea',
+ $type: 'textarea',
name: 'description'
}
]
@@ -208,7 +208,7 @@ IPA.hbac.service_group_entity = function(spec) {
fields: [
'cn',
{
- type: 'textarea',
+ $type: 'textarea',
name: 'description'
}
]
@@ -233,7 +233,7 @@ IPA.hbacrule_details_facet = function(spec) {
widget: 'general.cn'
},
{
- type: 'textarea',
+ $type: 'textarea',
name: 'description',
widget: 'general.description'
}
@@ -241,7 +241,7 @@ IPA.hbacrule_details_facet = function(spec) {
spec.widgets = [
{
- type: 'details_table_section',
+ $type: 'details_table_section',
name: 'general',
label: '@i18n:details.general',
widgets: [
@@ -249,7 +249,7 @@ IPA.hbacrule_details_facet = function(spec) {
name: 'cn'
},
{
- type: 'textarea',
+ $type: 'textarea',
name: 'description'
}
]
@@ -262,18 +262,18 @@ IPA.hbacrule_details_facet = function(spec) {
spec.fields.push(
{
- type: 'radio',
+ $type: 'radio',
name: 'usercategory',
widget: 'user.rule.usercategory'
},
{
- type: 'rule_association_table',
+ $type: 'rule_association_table',
name: 'memberuser_user',
widget: 'user.rule.memberuser_user',
priority: IPA.hbac.remove_method_priority
},
{
- type: 'rule_association_table',
+ $type: 'rule_association_table',
name: 'memberuser_group',
widget: 'user.rule.memberuser_group',
priority: IPA.hbac.remove_method_priority
@@ -302,7 +302,7 @@ IPA.hbacrule_details_facet = function(spec) {
],
widgets: [
{
- type: 'rule_association_table',
+ $type: 'rule_association_table',
id: entity_name+'-memberuser_user',
name: 'memberuser_user',
add_method: 'add_user',
@@ -311,7 +311,7 @@ IPA.hbacrule_details_facet = function(spec) {
remove_title: '@i18n:association.remove.member'
},
{
- type: 'rule_association_table',
+ $type: 'rule_association_table',
id: entity_name+'-memberuser_group',
name: 'memberuser_group',
add_method: 'add_user',
@@ -331,18 +331,18 @@ IPA.hbacrule_details_facet = function(spec) {
spec.fields.push(
{
- type: 'radio',
+ $type: 'radio',
name: 'hostcategory',
widget: 'host.rule.hostcategory'
},
{
- type: 'rule_association_table',
+ $type: 'rule_association_table',
name: 'memberhost_host',
widget: 'host.rule.memberhost_host',
priority: IPA.hbac.remove_method_priority
},
{
- type: 'rule_association_table',
+ $type: 'rule_association_table',
name: 'memberhost_hostgroup',
widget: 'host.rule.memberhost_hostgroup',
priority: IPA.hbac.remove_method_priority
@@ -375,7 +375,7 @@ IPA.hbacrule_details_facet = function(spec) {
],
widgets: [
{
- type: 'rule_association_table',
+ $type: 'rule_association_table',
id: entity_name+'-memberuser_user',
name: 'memberhost_host',
add_method: 'add_host',
@@ -384,7 +384,7 @@ IPA.hbacrule_details_facet = function(spec) {
remove_title: '@i18n:association.remove.member'
},
{
- type: 'rule_association_table',
+ $type: 'rule_association_table',
id: entity_name+'-memberuser_group',
name: 'memberhost_hostgroup',
add_method: 'add_host',
@@ -404,18 +404,18 @@ IPA.hbacrule_details_facet = function(spec) {
spec.fields.push(
{
- type: 'radio',
+ $type: 'radio',
name: 'servicecategory',
widget: 'service.rule.servicecategory'
},
{
- type: 'rule_association_table',
+ $type: 'rule_association_table',
name: 'memberservice_hbacsvc',
widget: 'service.rule.memberservice_hbacsvc',
priority: IPA.hbac.remove_method_priority
},
{
- type: 'rule_association_table',
+ $type: 'rule_association_table',
name: 'memberservice_hbacsvcgroup',
widget: 'service.rule.memberservice_hbacsvcgroup',
priority: IPA.hbac.remove_method_priority
@@ -442,7 +442,7 @@ IPA.hbacrule_details_facet = function(spec) {
],
widgets: [
{
- type: 'rule_association_table',
+ $type: 'rule_association_table',
id: entity_name+'-memberuser_user',
name: 'memberservice_hbacsvc',
add_method: 'add_service',
@@ -451,7 +451,7 @@ IPA.hbacrule_details_facet = function(spec) {
remove_title: '@i18n:association.remove.member'
},
{
- type: 'rule_association_table',
+ $type: 'rule_association_table',
id: entity_name+'-memberuser_group',
name: 'memberservice_hbacsvcgroup',
add_method: 'add_service',
diff --git a/install/ui/src/freeipa/host.js b/install/ui/src/freeipa/host.js
index fa7ca2c55..e7d3920ec 100644
--- a/install/ui/src/freeipa/host.js
+++ b/install/ui/src/freeipa/host.js
@@ -75,13 +75,13 @@ IPA.host.entity = function(spec) {
name: 'details',
fields: [
{
- type: 'host_dnsrecord_entity_link',
+ $type: 'host_dnsrecord_entity_link',
name: 'fqdn',
other_entity: 'dnsrecord'
},
'krbprincipalname',
{
- type: 'textarea',
+ $type: 'textarea',
name: 'description'
},
'l',
@@ -89,18 +89,18 @@ IPA.host.entity = function(spec) {
'nshardwareplatform',
'nsosversion',
{
- type: 'sshkeys',
+ $type: 'sshkeys',
name: 'ipasshpubkey',
label: '@i18n:objects.sshkeystore.keys'
},
{
- type: 'multivalued',
+ $type: 'multivalued',
name: 'macaddress',
flags: ['w_if_no_aci']
},
{
name: 'ipakrbokasdelegate',
- type: 'checkbox',
+ $type: 'checkbox',
acl_param: 'krbticketflags'
}
]
@@ -119,7 +119,7 @@ IPA.host.entity = function(spec) {
label: '@i18n:objects.host.keytab'
},
{
- type: 'host_password',
+ $type: 'host_password',
name: 'has_password',
label: '@i18n:objects.host.password'
}
@@ -137,7 +137,7 @@ IPA.host.entity = function(spec) {
},
fields: [
{
- type: 'certificate_status',
+ $type: 'certificate_status',
name: 'certificate_status',
label: '@i18n:objects.host.status'
}
@@ -219,7 +219,7 @@ IPA.host.entity = function(spec) {
name: 'fqdn',
fields: [
{
- type: 'host_fqdn',
+ $type: 'host_fqdn',
name: 'fqdn',
required: true
}
@@ -234,7 +234,7 @@ IPA.host.entity = function(spec) {
metadata: IPA.get_command_option('host_add', 'ip_address')
},
{
- type: 'force_host_add_checkbox',
+ $type: 'force_host_add_checkbox',
name: 'force',
metadata: IPA.get_command_option('host_add', 'force')
}
@@ -271,13 +271,13 @@ IPA.host_fqdn_widget = function(spec) {
spec.widgets = [
{
- type: 'text',
+ $type: 'text',
name: 'hostname',
label: '@i18n:objects.service.host',
required: true
},
{
- type: 'dnszone_select',
+ $type: 'dnszone_select',
name: 'dnszone',
label: IPA.metadata.objects.dnszone.label_singular,
editable: true,
@@ -466,7 +466,7 @@ IPA.host_deleter_dialog = function(spec) {
var metadata = IPA.get_command_option('host_del', 'updatedns');
that.updatedns = $('<input/>', {
- type: 'checkbox',
+ $type: 'checkbox',
name: 'updatedns',
title: metadata.doc
}).appendTo(that.container);
@@ -795,13 +795,13 @@ IPA.host.set_otp_dialog = function(spec) {
{
name: 'password1',
label: '@i18n:password.new_password',
- type: 'password',
+ $type: 'password',
required: true
},
{
name: 'password2',
label: '@i18n:password.verify_password',
- type: 'password',
+ $type: 'password',
required: true,
validators: [IPA.same_password_validator({
other_field: 'password1'
diff --git a/install/ui/src/freeipa/hostgroup.js b/install/ui/src/freeipa/hostgroup.js
index af9e48bba..5059d2ba4 100644
--- a/install/ui/src/freeipa/hostgroup.js
+++ b/install/ui/src/freeipa/hostgroup.js
@@ -44,7 +44,7 @@ IPA.hostgroup.entity = function(spec) {
fields: [
'cn',
{
- type: 'textarea',
+ $type: 'textarea',
name: 'description'
}
]
@@ -76,7 +76,7 @@ IPA.hostgroup.entity = function(spec) {
fields: [
'cn',
{
- type: 'textarea',
+ $type: 'textarea',
name: 'description'
}
]
diff --git a/install/ui/src/freeipa/idrange.js b/install/ui/src/freeipa/idrange.js
index cfc58396a..f2eb4a8ba 100644
--- a/install/ui/src/freeipa/idrange.js
+++ b/install/ui/src/freeipa/idrange.js
@@ -113,7 +113,7 @@ IPA.idrange.entity = function(spec) {
],
widgets: [
{
- type: 'details_table_section_nc',
+ $type: 'details_table_section_nc',
name: 'idrange',
widgets: [
'cn',
@@ -123,7 +123,7 @@ IPA.idrange.entity = function(spec) {
]
},
{
- type: 'multiple_choice_section',
+ $type: 'multiple_choice_section',
name: 'type',
label: '@i18n:objects.idrange.type',
choices: [
diff --git a/install/ui/src/freeipa/ipa.js b/install/ui/src/freeipa/ipa.js
index 7598aee82..a9481615e 100644
--- a/install/ui/src/freeipa/ipa.js
+++ b/install/ui/src/freeipa/ipa.js
@@ -1475,7 +1475,7 @@ IPA.unauthorized_dialog = function(spec) {
},
{
name: 'password',
- type: 'password',
+ $type: 'password',
label: text.get('@i18n:login.password', "Password")
}
]
@@ -1491,13 +1491,13 @@ IPA.unauthorized_dialog = function(spec) {
},
{
name: 'new_password',
- type: 'password',
+ $type: 'password',
required: true,
label: text.get('@i18n:password.new_password)', "New Password")
},
{
name: 'verify_password',
- type: 'password',
+ $type: 'password',
required: true,
label: text.get('@i18n:password.verify_password', "Verify Password"),
validators: [IPA.same_password_validator({
diff --git a/install/ui/src/freeipa/netgroup.js b/install/ui/src/freeipa/netgroup.js
index 4e4238fbf..2a6378777 100644
--- a/install/ui/src/freeipa/netgroup.js
+++ b/install/ui/src/freeipa/netgroup.js
@@ -54,7 +54,7 @@ IPA.netgroup.entity = function(spec) {
fields: [
'cn',
{
- type: 'textarea',
+ $type: 'textarea',
name: 'description'
}
]
@@ -78,7 +78,7 @@ IPA.netgroup.details_facet = function(spec) {
widget: 'identity.cn'
},
{
- type: 'textarea',
+ $type: 'textarea',
name: 'description',
widget: 'identity.description'
},
@@ -90,7 +90,7 @@ IPA.netgroup.details_facet = function(spec) {
spec.widgets = [
{
- type: 'details_table_section',
+ $type: 'details_table_section',
name: 'identity',
label: '@i18n:details.general',
widgets: [
@@ -98,7 +98,7 @@ IPA.netgroup.details_facet = function(spec) {
name: 'cn'
},
{
- type: 'textarea',
+ $type: 'textarea',
name: 'description'
},
{
@@ -115,18 +115,18 @@ IPA.netgroup.details_facet = function(spec) {
spec.fields.push(
{
- type: 'radio',
+ $type: 'radio',
name: 'usercategory',
widget: 'user.rule.usercategory'
},
{
- type: 'rule_association_table',
+ $type: 'rule_association_table',
name: 'memberuser_user',
widget: 'user.rule.memberuser_user',
priority: IPA.netgroup.remove_method_priority
},
{
- type: 'rule_association_table',
+ $type: 'rule_association_table',
name: 'memberuser_group',
widget: 'user.rule.memberuser_group',
priority: IPA.netgroup.remove_method_priority
@@ -155,7 +155,7 @@ IPA.netgroup.details_facet = function(spec) {
],
widgets: [
{
- type: 'rule_association_table',
+ $type: 'rule_association_table',
id: entity_name+'-memberuser_user',
name: 'memberuser_user',
add_method: 'add_member',
@@ -171,7 +171,7 @@ IPA.netgroup.details_facet = function(spec) {
]
},
{
- type: 'rule_association_table',
+ $type: 'rule_association_table',
id: entity_name+'-memberuser_group',
name: 'memberuser_group',
add_method: 'add_member',
@@ -198,19 +198,19 @@ IPA.netgroup.details_facet = function(spec) {
spec.fields.push(
{
- type: 'radio',
+ $type: 'radio',
name: 'hostcategory',
widget: 'host.rule.hostcategory'
},
{
- type: 'rule_association_table',
+ $type: 'rule_association_table',
name: 'memberhost_host',
widget: 'host.rule.memberhost_host',
priority: IPA.netgroup.remove_method_priority,
external: 'externalhost'
},
{
- type: 'rule_association_table',
+ $type: 'rule_association_table',
name: 'memberhost_hostgroup',
widget: 'host.rule.memberhost_hostgroup',
priority: IPA.netgroup.remove_method_priority
@@ -243,7 +243,7 @@ IPA.netgroup.details_facet = function(spec) {
],
widgets: [
{
- type: 'rule_association_table',
+ $type: 'rule_association_table',
id: entity_name+'-memberhost_host',
name: 'memberhost_host',
add_method: 'add_member',
@@ -266,7 +266,7 @@ IPA.netgroup.details_facet = function(spec) {
]
},
{
- type: 'rule_association_table',
+ $type: 'rule_association_table',
id: entity_name+'-memberhost_hostgroup',
name: 'memberhost_hostgroup',
add_method: 'add_member',
diff --git a/install/ui/src/freeipa/policy.js b/install/ui/src/freeipa/policy.js
index 5161a4541..c0ea20335 100644
--- a/install/ui/src/freeipa/policy.js
+++ b/install/ui/src/freeipa/policy.js
@@ -40,7 +40,7 @@ IPA.pwpolicy.entity = function(spec) {
name : 'identity',
fields:[
{
- type: 'link',
+ $type: 'link',
name: 'cn',
other_entity: 'group'
},
@@ -68,7 +68,7 @@ IPA.pwpolicy.entity = function(spec) {
adder_dialog({
fields: [
{
- type: 'entity_select',
+ $type: 'entity_select',
name: 'cn',
other_entity: 'group',
other_field: 'cn',
diff --git a/install/ui/src/freeipa/realmdomains.js b/install/ui/src/freeipa/realmdomains.js
index f0188cd53..c5914a284 100644
--- a/install/ui/src/freeipa/realmdomains.js
+++ b/install/ui/src/freeipa/realmdomains.js
@@ -41,7 +41,7 @@ define(['./ipa', './jquery', './details', './entity'], function (IPA, $) {
fields: [
{
name: 'associateddomain',
- type: 'multivalued'
+ $type: 'multivalued'
}
]
}
diff --git a/install/ui/src/freeipa/selinux.js b/install/ui/src/freeipa/selinux.js
index ee84c3548..f6af458eb 100644
--- a/install/ui/src/freeipa/selinux.js
+++ b/install/ui/src/freeipa/selinux.js
@@ -112,7 +112,7 @@ IPA.selinux_details_facet = function(spec) {
widget: 'general.cn'
},
{
- type: 'textarea',
+ $type: 'textarea',
name: 'description',
widget: 'general.description'
},
@@ -121,7 +121,7 @@ IPA.selinux_details_facet = function(spec) {
widget: 'general.ipaselinuxuser'
},
{
- type: 'entity_select',
+ $type: 'entity_select',
name: 'seealso',
widget: 'general.seealso'
}
@@ -129,7 +129,7 @@ IPA.selinux_details_facet = function(spec) {
spec.widgets = [
{
- type: 'details_table_section',
+ $type: 'details_table_section',
name: 'general',
label: '@i18n:details.general',
widgets: [
@@ -137,7 +137,7 @@ IPA.selinux_details_facet = function(spec) {
name: 'cn'
},
{
- type: 'textarea',
+ $type: 'textarea',
name: 'description'
},
{
@@ -145,7 +145,7 @@ IPA.selinux_details_facet = function(spec) {
widget: 'general.ipaselinuxuser'
},
{
- type: 'entity_select',
+ $type: 'entity_select',
name: 'seealso',
other_entity: 'hbacrule',
other_field: 'cn'
@@ -160,18 +160,18 @@ IPA.selinux_details_facet = function(spec) {
spec.fields.push(
{
- type: 'radio',
+ $type: 'radio',
name: 'usercategory',
widget: 'user.rule.usercategory'
},
{
- type: 'rule_association_table',
+ $type: 'rule_association_table',
name: 'memberuser_user',
widget: 'user.rule.memberuser_user',
priority: IPA.selinux.remove_method_priority
},
{
- type: 'rule_association_table',
+ $type: 'rule_association_table',
name: 'memberuser_group',
widget: 'user.rule.memberuser_group',
priority: IPA.selinux.remove_method_priority
@@ -200,7 +200,7 @@ IPA.selinux_details_facet = function(spec) {
],
widgets: [
{
- type: 'rule_association_table',
+ $type: 'rule_association_table',
id: entity_name+'-memberuser_user',
name: 'memberuser_user',
add_method: 'add_user',
@@ -209,7 +209,7 @@ IPA.selinux_details_facet = function(spec) {
remove_title: '@i18n:association.remove.member'
},
{
- type: 'rule_association_table',
+ $type: 'rule_association_table',
id: entity_name+'-memberuser_group',
name: 'memberuser_group',
add_method: 'add_user',
@@ -229,18 +229,18 @@ IPA.selinux_details_facet = function(spec) {
spec.fields.push(
{
- type: 'radio',
+ $type: 'radio',
name: 'hostcategory',
widget: 'host.rule.hostcategory'
},
{
- type: 'rule_association_table',
+ $type: 'rule_association_table',
name: 'memberhost_host',
widget: 'host.rule.memberhost_host',
priority: IPA.selinux.remove_method_priority
},
{
- type: 'rule_association_table',
+ $type: 'rule_association_table',
name: 'memberhost_hostgroup',
widget: 'host.rule.memberhost_hostgroup',
priority: IPA.selinux.remove_method_priority
@@ -273,7 +273,7 @@ IPA.selinux_details_facet = function(spec) {
],
widgets: [
{
- type: 'rule_association_table',
+ $type: 'rule_association_table',
id: entity_name+'-memberuser_user',
name: 'memberhost_host',
add_method: 'add_host',
@@ -282,7 +282,7 @@ IPA.selinux_details_facet = function(spec) {
remove_title: '@i18n:association.remove.member'
},
{
- type: 'rule_association_table',
+ $type: 'rule_association_table',
id: entity_name+'-memberuser_group',
name: 'memberhost_hostgroup',
add_method: 'add_host',
diff --git a/install/ui/src/freeipa/serverconfig.js b/install/ui/src/freeipa/serverconfig.js
index 7e423dc66..2838bc840 100644
--- a/install/ui/src/freeipa/serverconfig.js
+++ b/install/ui/src/freeipa/serverconfig.js
@@ -51,7 +51,7 @@ IPA.serverconfig.entity = function(spec) {
'ipausersearchfields',
'ipadefaultemaildomain',
{
- type: 'entity_select',
+ $type: 'entity_select',
name: 'ipadefaultprimarygroup',
other_entity: 'group',
other_field: 'cn'
@@ -62,18 +62,18 @@ IPA.serverconfig.entity = function(spec) {
'ipapwdexpadvnotify',
{
name: 'ipaconfigstring',
- type: 'checkboxes',
+ $type: 'checkboxes',
options: IPA.create_options([
'AllowLMhash', 'AllowNThash',
'KDC:Disable Last Success', 'KDC:Disable Lockout'
])
},
{
- type: 'checkbox',
+ $type: 'checkbox',
name: 'ipamigrationenabled'
},
{
- type: 'multivalued',
+ $type: 'multivalued',
name: 'ipauserobjectclasses'
}
]
@@ -84,7 +84,7 @@ IPA.serverconfig.entity = function(spec) {
fields: [
'ipagroupsearchfields',
{
- type: 'multivalued',
+ $type: 'multivalued',
name: 'ipagroupobjectclasses'
}
]
@@ -103,7 +103,7 @@ IPA.serverconfig.entity = function(spec) {
fields: [
{
name: 'ipakrbauthzdata',
- type: 'checkboxes',
+ $type: 'checkboxes',
options: IPA.create_options(['MS-PAC', 'PAD', 'nfs:NONE'])
}
]
diff --git a/install/ui/src/freeipa/service.js b/install/ui/src/freeipa/service.js
index 69165c91f..f5e942d64 100644
--- a/install/ui/src/freeipa/service.js
+++ b/install/ui/src/freeipa/service.js
@@ -67,20 +67,20 @@ IPA.service.entity = function(spec) {
fields: [
'krbprincipalname',
{
- type: 'service_name',
+ $type: 'service_name',
name: 'service',
label: '@i18n:objects.service.service',
read_only: true
},
{
- type: 'service_host',
+ $type: 'service_host',
name: 'host',
label: '@i18n:objects.service.host',
read_only: true
},
{
name: 'ipakrbauthzdata',
- type: 'radio',
+ $type: 'radio',
layout: 'vertical',
options: [
{
@@ -109,7 +109,7 @@ IPA.service.entity = function(spec) {
},
{
name: 'ipakrbokasdelegate',
- type: 'checkbox',
+ $type: 'checkbox',
acl_param: 'krbticketflags'
}
]
@@ -123,7 +123,7 @@ IPA.service.entity = function(spec) {
},
fields: [
{
- type: 'service_provisioning_status',
+ $type: 'service_provisioning_status',
name: 'has_keytab',
label: '@i18n:objects.service.status'
}
@@ -141,7 +141,7 @@ IPA.service.entity = function(spec) {
},
fields: [
{
- type: 'certificate_status',
+ $type: 'certificate_status',
name: 'certificate_status',
label: '@i18n:objects.service.status'
}
@@ -180,7 +180,7 @@ IPA.service.entity = function(spec) {
{
fields: [
{
- type: 'combobox',
+ $type: 'combobox',
name: 'service',
label: '@i18n:objects.service.service',
options: [
@@ -201,7 +201,7 @@ IPA.service.entity = function(spec) {
z_index: 2
},
{
- type: 'entity_select',
+ $type: 'entity_select',
name: 'host',
other_entity: 'host',
other_field: 'fqdn',
@@ -210,7 +210,7 @@ IPA.service.entity = function(spec) {
z_index: 1
},
{
- type: 'checkbox',
+ $type: 'checkbox',
name: 'force',
metadata: IPA.get_command_option('service_add', 'force')
}
@@ -248,7 +248,7 @@ IPA.service_adder_dialog = function(spec) {
//fields definition and create custom field with two associated
//widgets - 'service' and 'host' with this dialog's save logic.
that.builder.build_field({
- type: 'field',
+ $type: 'field',
name: 'krbprincipalname',
required: false
});
diff --git a/install/ui/src/freeipa/sudo.js b/install/ui/src/freeipa/sudo.js
index e9cf6a607..6df1cc2b6 100644
--- a/install/ui/src/freeipa/sudo.js
+++ b/install/ui/src/freeipa/sudo.js
@@ -114,7 +114,7 @@ IPA.sudo.command_entity = function(spec) {
fields: [
'sudocmd',
{
- type: 'textarea',
+ $type: 'textarea',
name: 'description'
}
]
@@ -145,7 +145,7 @@ IPA.sudo.command_entity = function(spec) {
fields: [
'sudocmd',
{
- type: 'textarea',
+ $type: 'textarea',
name: 'description'
}
]
@@ -176,7 +176,7 @@ IPA.sudo.command_group_entity = function(spec) {
fields: [
'cn',
{
- type: 'textarea',
+ $type: 'textarea',
name: 'description'
}
]
@@ -206,7 +206,7 @@ IPA.sudo.command_group_entity = function(spec) {
fields: [
'cn',
{
- type: 'textarea',
+ $type: 'textarea',
name: 'description'
}
]
@@ -231,7 +231,7 @@ IPA.sudorule_details_facet = function(spec) {
widget: 'general.cn'
},
{
- type: 'textarea',
+ $type: 'textarea',
name: 'description',
widget: 'general.description'
}
@@ -239,7 +239,7 @@ IPA.sudorule_details_facet = function(spec) {
spec.widgets = [
{
- type: 'details_table_section',
+ $type: 'details_table_section',
name: 'general',
label: '@i18n:details.general',
widgets: [
@@ -247,7 +247,7 @@ IPA.sudorule_details_facet = function(spec) {
name: 'cn'
},
{
- type: 'textarea',
+ $type: 'textarea',
name: 'description'
}
]
@@ -280,19 +280,19 @@ IPA.sudorule_details_facet = function(spec) {
spec.fields.push(
{
- type: 'radio',
+ $type: 'radio',
name: 'usercategory',
widget: 'user.rule.usercategory'
},
{
- type: 'rule_association_table',
+ $type: 'rule_association_table',
name: 'memberuser_user',
widget: 'user.rule.memberuser_user',
external: 'externaluser',
priority: IPA.sudo.remove_method_priority
},
{
- type: 'rule_association_table',
+ $type: 'rule_association_table',
name: 'memberuser_group',
widget: 'user.rule.memberuser_group',
priority: IPA.sudo.remove_method_priority
@@ -325,7 +325,7 @@ IPA.sudorule_details_facet = function(spec) {
],
widgets: [
{
- type: 'rule_association_table',
+ $type: 'rule_association_table',
id: entity_name+'-memberuser_user',
name: 'memberuser_user',
add_method: 'add_user',
@@ -335,7 +335,7 @@ IPA.sudorule_details_facet = function(spec) {
remove_title: '@i18n:association.remove.member'
},
{
- type: 'rule_association_table',
+ $type: 'rule_association_table',
id: entity_name+'-memberuser_group',
name: 'memberuser_group',
add_method: 'add_user',
@@ -355,19 +355,19 @@ IPA.sudorule_details_facet = function(spec) {
spec.fields.push(
{
- type: 'radio',
+ $type: 'radio',
name: 'hostcategory',
widget: 'host.rule.hostcategory'
},
{
- type: 'rule_association_table',
+ $type: 'rule_association_table',
name: 'memberhost_host',
widget: 'host.rule.memberhost_host',
external: 'externalhost',
priority: IPA.sudo.remove_method_priority
},
{
- type: 'rule_association_table',
+ $type: 'rule_association_table',
name: 'memberhost_hostgroup',
widget: 'host.rule.memberhost_hostgroup',
priority: IPA.sudo.remove_method_priority
@@ -400,7 +400,7 @@ IPA.sudorule_details_facet = function(spec) {
],
widgets: [
{
- type: 'rule_association_table',
+ $type: 'rule_association_table',
id: entity_name+'-memberuser_user',
name: 'memberhost_host',
add_method: 'add_host',
@@ -410,7 +410,7 @@ IPA.sudorule_details_facet = function(spec) {
remove_title: '@i18n:association.remove.member'
},
{
- type: 'rule_association_table',
+ $type: 'rule_association_table',
id: entity_name+'-memberuser_group',
name: 'memberhost_hostgroup',
add_method: 'add_host',
@@ -430,30 +430,30 @@ IPA.sudorule_details_facet = function(spec) {
spec.fields.push(
{
- type: 'radio',
+ $type: 'radio',
name: 'cmdcategory',
widget: 'command.rule.cmdcategory'
},
{
- type: 'rule_association_table',
+ $type: 'rule_association_table',
name: 'memberallowcmd_sudocmd',
widget: 'command.rule.memberallowcmd_sudocmd',
priority: IPA.sudo.remove_method_priority
},
{
- type: 'rule_association_table',
+ $type: 'rule_association_table',
name: 'memberallowcmd_sudocmdgroup',
widget: 'command.rule.memberallowcmd_sudocmdgroup',
priority: IPA.sudo.remove_method_priority
},
{
- type: 'rule_association_table',
+ $type: 'rule_association_table',
name: 'memberdenycmd_sudocmd',
widget: 'command.memberdenycmd_sudocmd',
priority: IPA.sudo.remove_method_priority
},
{
- type: 'rule_association_table',
+ $type: 'rule_association_table',
name: 'memberdenycmd_sudocmdgroup',
widget: 'command.memberdenycmd_sudocmdgroup',
priority: IPA.sudo.remove_method_priority
@@ -492,7 +492,7 @@ IPA.sudorule_details_facet = function(spec) {
],
widgets: [
{
- type: 'rule_association_table',
+ $type: 'rule_association_table',
id: entity_name+'-memberallowcmd_sudocmd',
name: 'memberallowcmd_sudocmd',
add_method: 'add_allow_command',
@@ -501,7 +501,7 @@ IPA.sudorule_details_facet = function(spec) {
remove_title: '@i18n:association.remove.memberallowcmd'
},
{
- type: 'rule_association_table',
+ $type: 'rule_association_table',
id: entity_name+'-memberallowcmd_sudocmdgroup',
name: 'memberallowcmd_sudocmdgroup',
add_method: 'add_allow_command',
@@ -518,7 +518,7 @@ IPA.sudorule_details_facet = function(spec) {
description: '@i18n:objects.sudorule.deny'
},
{
- type: 'rule_association_table',
+ $type: 'rule_association_table',
id: entity_name+'-memberdenycmd_sudocmd',
name: 'memberdenycmd_sudocmd',
add_method: 'add_deny_command',
@@ -527,7 +527,7 @@ IPA.sudorule_details_facet = function(spec) {
remove_title: '@i18n:association.remove.memberdenycmd'
},
{
- type: 'rule_association_table',
+ $type: 'rule_association_table',
id: entity_name+'-memberdenycmd_sudocmdgroup',
name: 'memberdenycmd_sudocmdgroup',
add_method: 'add_deny_command',
@@ -545,30 +545,30 @@ IPA.sudorule_details_facet = function(spec) {
spec.fields.push(
{
- type: 'radio',
+ $type: 'radio',
name: 'ipasudorunasusercategory',
widget: 'runas.runas_users.ipasudorunasusercategory'
},
{
- type: 'rule_association_table',
+ $type: 'rule_association_table',
name: 'ipasudorunas_user',
widget: 'runas.runas_users.ipasudorunas_user',
external: 'ipasudorunasextuser',
priority: IPA.sudo.remove_method_priority
},
{
- type: 'rule_association_table',
+ $type: 'rule_association_table',
name: 'ipasudorunas_group',
widget: 'runas.runas_users.ipasudorunas_group',
priority: IPA.sudo.remove_method_priority
},
{
- type: 'radio',
+ $type: 'radio',
name: 'ipasudorunasgroupcategory',
widget: 'runas.runas_groups.ipasudorunasgroupcategory'
},
{
- type: 'rule_association_table',
+ $type: 'rule_association_table',
name: 'ipasudorunasgroup_group',
widget: 'runas.runas_groups.ipasudorunasgroup_group',
external: 'ipasudorunasextgroup',
@@ -596,7 +596,7 @@ IPA.sudorule_details_facet = function(spec) {
],
widgets: [
{
- type: 'rule_association_table',
+ $type: 'rule_association_table',
id: entity_name+'-runasruser_user',
name: 'ipasudorunas_user',
external: 'ipasudorunasextuser',
@@ -606,7 +606,7 @@ IPA.sudorule_details_facet = function(spec) {
remove_title: '@i18n:association.remove.ipasudorunas'
},
{
- type: 'rule_association_table',
+ $type: 'rule_association_table',
id: entity_name+'-runasuser_group',
name: 'ipasudorunas_group',
add_method: 'add_runasuser',
@@ -628,7 +628,7 @@ IPA.sudorule_details_facet = function(spec) {
{ name: 'ipasudorunasgroup_group' }
],
widgets: [{
- type: 'rule_association_table',
+ $type: 'rule_association_table',
id: entity_name+'-runasgroup_group',
name: 'ipasudorunasgroup_group',
external: 'ipasudorunasextgroup',
diff --git a/install/ui/src/freeipa/trust.js b/install/ui/src/freeipa/trust.js
index e47b3b073..145ffc132 100644
--- a/install/ui/src/freeipa/trust.js
+++ b/install/ui/src/freeipa/trust.js
@@ -74,11 +74,11 @@ IPA.trust.entity = function(spec) {
label: '@i18n:objects.trust.blacklists',
fields: [
{
- type: 'multivalued',
+ $type: 'multivalued',
name: 'ipantsidblacklistincoming'
},
{
- type: 'multivalued',
+ $type: 'multivalued',
name: 'ipantsidblacklistoutgoing'
}
// trust status not supported by show command at the moment
@@ -104,19 +104,19 @@ IPA.trust.entity = function(spec) {
widget: 'method.realm_admin'
},
{
- type: 'password',
+ $type: 'password',
name: 'realm_passwd',
label: '@i18n:password.password',
widget: 'method.realm_passwd'
},
{
- type: 'password',
+ $type: 'password',
name: 'trust_secret',
label: '@i18n:password.password',
widget: 'method.trust_secret'
},
{
- type: 'password',
+ $type: 'password',
name: 'trust_secret_verify',
label: '@i18n:password.verify_password',
widget: 'method.trust_secret_verify',
@@ -128,14 +128,14 @@ IPA.trust.entity = function(spec) {
],
widgets: [
{
- type: 'details_table_section_nc',
+ $type: 'details_table_section_nc',
name: 'realm',
widgets: [
'realm_server'
]
},
{
- type: 'multiple_choice_section',
+ $type: 'multiple_choice_section',
name: 'method',
label: '@i18n:objects.trust.establish_using',
choices: [
@@ -158,15 +158,15 @@ IPA.trust.entity = function(spec) {
name: 'realm_admin'
},
{
- type: 'password',
+ $type: 'password',
name: 'realm_passwd'
},
{
- type: 'password',
+ $type: 'password',
name: 'trust_secret'
},
{
- type: 'password',
+ $type: 'password',
name: 'trust_secret_verify'
}
]
diff --git a/install/ui/src/freeipa/user.js b/install/ui/src/freeipa/user.js
index 2a326bb99..4fd4a7804 100644
--- a/install/ui/src/freeipa/user.js
+++ b/install/ui/src/freeipa/user.js
@@ -118,7 +118,7 @@ IPA.user.entity = function(spec) {
'loginshell',
'homedirectory',
{
- type: 'sshkeys',
+ $type: 'sshkeys',
name: 'ipasshpubkey',
label: '@i18n:objects.sshkeystore.keys'
}
@@ -194,11 +194,11 @@ IPA.user.entity = function(spec) {
{
name: 'contact',
fields: [
- { type: 'multivalued', name: 'mail' },
- { type: 'multivalued', name: 'telephonenumber' },
- { type: 'multivalued', name: 'pager' },
- { type: 'multivalued', name: 'mobile' },
- { type: 'multivalued', name: 'facsimiletelephonenumber' }
+ { $type: 'multivalued', name: 'mail' },
+ { $type: 'multivalued', name: 'telephonenumber' },
+ { $type: 'multivalued', name: 'pager' },
+ { $type: 'multivalued', name: 'mobile' },
+ { $type: 'multivalued', name: 'facsimiletelephonenumber' }
]
},
{
@@ -210,7 +210,7 @@ IPA.user.entity = function(spec) {
fields: [
'ou',
{
- type: 'entity_select',
+ $type: 'entity_select',
name: 'manager',
other_entity: 'user',
other_field: 'uid'
@@ -300,12 +300,12 @@ IPA.user.entity = function(spec) {
{
name: 'userpassword',
label: '@i18n:password.new_password',
- type: 'password'
+ $type: 'password'
},
{
name: 'userpassword2',
label: '@i18n:password.verify_password',
- type: 'password'
+ $type: 'password'
}
]
}
@@ -495,19 +495,19 @@ IPA.user_password_dialog = function(spec) {
{
name: 'current_password',
label: '@i18n:password.current_password',
- type: 'password',
+ $type: 'password',
required: true
},
{
name: 'password1',
label: '@i18n:password.new_password',
- type: 'password',
+ $type: 'password',
required: true
},
{
name: 'password2',
label: '@i18n:password.verify_password',
- type: 'password',
+ $type: 'password',
validators: [IPA.same_password_validator({
other_field: 'password1'
})],
diff --git a/install/ui/src/freeipa/widget.js b/install/ui/src/freeipa/widget.js
index c8d0388a2..42f67d3b8 100644
--- a/install/ui/src/freeipa/widget.js
+++ b/install/ui/src/freeipa/widget.js
@@ -23,6 +23,7 @@
define(['dojo/_base/array',
+ 'dojo/_base/lang',
'./builder',
'./ipa',
'./jquery',
@@ -30,7 +31,7 @@ define(['dojo/_base/array',
'./reg',
'./text'
],
- function(array, builder, IPA, $, phases, reg, text) {
+ function(array, lang, builder, IPA, $, phases, reg, text) {
var exp = {};
@@ -3459,7 +3460,6 @@ IPA.widget_container = function(spec) {
spec.new_container_for_child : true;
that.widgets = $.ordered_map();
- that.widget_builder = spec.widget_builder || IPA.widget_builder();
that.add_widget = function(widget) {
that.widgets.put(widget.name, widget);
@@ -3533,61 +3533,20 @@ IPA.widget_builder = function(spec) {
var that = IPA.object();
- that.default_factory = spec.default_factory || IPA.text_widget;
that.container = spec.container;
- that.widget_options = spec.widget_options || {};
-
- that.get_widget_factory = function(spec) {
-
- var factory;
- if (spec.$factory) {
- factory = spec.$factory;
- } else if(spec.type) {
- factory = reg.widget.get(spec.type);
- factory = factory ? factory.factory : undefined;
- }
-
- if (!factory) {
- factory = that.default_factory;
- }
-
- return factory;
- };
+ that.widget_options = spec.widget_options;
that.build_widget = function(spec, container) {
- container = container || that.container;
-
- if(!(spec instanceof Object)) {
- spec = { name: spec };
- }
-
- if(that.widget_options) {
- $.extend(spec, that.widget_options);
- }
-
- var factory = that.get_widget_factory(spec);
-
- var widget = factory(spec);
-
- if(container) {
- container.add_widget(widget);
- }
-
- if(spec.widgets) {
- that.build_widgets(spec.widgets, widget.widgets);
- }
-
+ var context = lang.mixin({}, that.widget_options);
+ context.container = container || that.container;
+ var widget = builder.build('widget', spec, context);
return widget;
};
that.build_widgets = function(specs, container) {
- container = container || that.container;
-
- for(var i=0; i<specs.length; i++) {
- that.build_widget(specs[i], container);
- }
+ return that.build_widget(specs, container);
};
return that;
@@ -3964,9 +3923,36 @@ IPA.value_map_widget = function(spec) {
return that;
};
+exp.pre_op = function(spec, context) {
+
+ if (context.facet) spec.facet = context.facet;
+ if (context.entity) spec.entity = context.entity;
+ return spec;
+};
+
+/**
+ * Enables widget nesting
+ */
+exp.post_op = function(obj, spec, context) {
+
+ if (context.container) context.container.add_widget(obj);
+
+ if (spec.widgets) {
+ var nc = lang.mixin({}, context);
+ nc.container = obj.widgets;
+ builder.build('widget', spec.widgets, nc);
+ }
+ return obj;
+};
+
// New builder and registry
exp.builder = builder.get('widget');
-exp.builder.factory = IPA.widget;
+exp.builder.factory = IPA.text_widget;
+exp.builder.string_mode = 'property';
+exp.builder.string_property = 'name';
+exp.builder.pre_ops.push(exp.pre_op);
+exp.builder.post_ops.push(exp.post_op);
+
reg.set('widget', exp.builder.registry);
exp.register = function() {
diff --git a/install/ui/test/aci_tests.js b/install/ui/test/aci_tests.js
index 3ced0bd47..cc248c928 100644
--- a/install/ui/test/aci_tests.js
+++ b/install/ui/test/aci_tests.js
@@ -54,7 +54,7 @@ module('aci', {
entity: entity,
fields: [
{
- type: 'select',
+ $type: 'select',
name: 'target',
widget: 'target.target',
enabled: false
@@ -65,7 +65,7 @@ module('aci', {
enabled: false
},
{
- type: 'entity_select',
+ $type: 'entity_select',
name: 'memberof',
widget: 'target.memberof',
enabled: false
@@ -76,13 +76,13 @@ module('aci', {
enabled: false
},
{
- type: 'entity_select',
+ $type: 'entity_select',
name: 'targetgroup',
widget: 'target.targetgroup',
enabled: false
},
{
- type: 'select',
+ $type: 'select',
name: 'type',
widget: 'target.type',
enabled: false
@@ -95,14 +95,14 @@ module('aci', {
{
name: 'attrs_multi',
param: 'attrs',
- type: 'multivalued',
+ $type: 'multivalued',
widget: 'target.attrs_multi',
enabled: false
}
],
widgets: [
{
- type: 'permission_target',
+ $type: 'permission_target',
container_factory: IPA.details_table_section,
group_entity: group_entity,
name: 'target',
diff --git a/install/ui/test/details_tests.js b/install/ui/test/details_tests.js
index 521bfa35a..0ad9fb720 100644
--- a/install/ui/test/details_tests.js
+++ b/install/ui/test/details_tests.js
@@ -152,16 +152,6 @@ test("Testing details lifecycle: create, load.", function(){
var update_success_called = false;
var update_failure_called = false;
-
- function save_password(){
- save_called = true;
- return [];
- }
-
- function load_manager(){
- load_called = true;
- }
-
function test_field(spec) {
var that = IPA.field(spec);
@@ -208,27 +198,27 @@ test("Testing details lifecycle: create, load.", function(){
label: 'contact',
fields: [
{
- type: 'test',
+ $type: 'test',
name:'test'
},
{
- type: 'multivalued',
+ $type: 'multivalued',
name:'mail'
},
{
- type: 'multivalued',
+ $type: 'multivalued',
name:'telephonenumber'
},
{
- type: 'multivalued',
+ $type: 'multivalued',
name:'pager'
},
{
- type: 'multivalued',
+ $type: 'multivalued',
name:'mobile'
},
{
- type: 'multivalued',
+ $type: 'multivalued',
name:'facsimiletelephonenumber'
}
]