code review fixes

this version includes using spec for detail_facets
This commit is contained in:
Adam Young
2011-03-31 15:32:29 -04:00
parent ef57ee0d93
commit 6948c0813d
19 changed files with 124 additions and 142 deletions

View File

@@ -38,13 +38,13 @@ IPA.entity_factories.permission = function() {
}, },
{ {
factory: IPA.target_section, factory: IPA.target_section,
section: 'target', name: 'target',
label: IPA.messages.objects.permission.target, label: IPA.messages.objects.permission.target,
undo: false undo: false
}]}). }]}).
details_facet([ details_facet({sections:[
{ {
section:'identity', name:'identity',
fields: [{ fields: [{
factory: IPA.text_widget, factory: IPA.text_widget,
name: 'cn', name: 'cn',
@@ -52,15 +52,15 @@ IPA.entity_factories.permission = function() {
}] }]
}, },
{ {
section:'rights', name:'rights',
factory:IPA.rights_section factory:IPA.rights_section
}, },
{ {
section:'target', name:'target',
factory:IPA.target_section, factory:IPA.target_section,
label: IPA.messages.objects.permission.target label: IPA.messages.objects.permission.target
}]). }]}).
standard_associations(). standard_association_facets().
build(); build();
}; };
@@ -71,12 +71,13 @@ IPA.entity_factories.privilege = function() {
search_facet({ search_facet({
columns:['cn','description'], columns:['cn','description'],
add_fields:['cn', 'description']}). add_fields:['cn', 'description']}).
details_facet([ details_facet({
{ sections:
section:'identity', [{
name:'identity',
label: IPA.messages.details.identity, label: IPA.messages.details.identity,
fields:['cn','description'] fields:['cn','description']
}]). }]}).
association_facet({ association_facet({
name: 'member_role', name: 'member_role',
add_method: 'add_privilege', add_method: 'add_privilege',
@@ -88,7 +89,7 @@ IPA.entity_factories.privilege = function() {
add_method: 'add_permission', add_method: 'add_permission',
remove_method: 'remove_permission' remove_method: 'remove_permission'
}). }).
standard_associations(). standard_association_facets().
build(); build();
}; };
@@ -100,17 +101,17 @@ IPA.entity_factories.role = function() {
search_facet({ search_facet({
columns:['cn','description'], columns:['cn','description'],
add_fields:['cn', 'description']}). add_fields:['cn', 'description']}).
details_facet([ details_facet({sections:[
{ {
section:'identity', name:'identity',
label:IPA.messages.objects.role.identity, label:IPA.messages.objects.role.identity,
fields:['cn','description']}]). fields:['cn','description']}]}).
association_facet({ association_facet({
name: 'memberof_privilege', name: 'memberof_privilege',
add_method: 'add_privilege', add_method: 'add_privilege',
remove_method: 'remove_privilege' remove_method: 'remove_privilege'
}). }).
standard_associations(). standard_association_facets().
build(); build();
}; };
@@ -127,9 +128,9 @@ IPA.entity_factories.selfservice = function() {
name:'attrs', name:'attrs',
undo: false undo: false
}]}). }]}).
details_facet([ details_facet({
{ sections:[{
section:'general', name:'general',
label: IPA.messages.details.general, label: IPA.messages.details.general,
fields: [ fields: [
'aciname', 'aciname',
@@ -137,7 +138,7 @@ IPA.entity_factories.selfservice = function() {
factory:IPA.attributes_widget, factory:IPA.attributes_widget,
object_type:'user', object_type:'user',
name:'attrs' name:'attrs'
}]}]). }]}]}).
build(); build();
}; };
@@ -163,9 +164,9 @@ IPA.entity_factories.delegation = function() {
name: 'attrs', object_type: 'user', name: 'attrs', object_type: 'user',
join: true, undo: false join: true, undo: false
}]}). }]}).
details_facet([ details_facet({sections:[
{ {
section:'general', name:'general',
label: IPA.messages.details.general, label: IPA.messages.details.general,
fields:[ fields:[
'aciname', 'aciname',
@@ -182,8 +183,8 @@ IPA.entity_factories.delegation = function() {
factory:IPA.attributes_widget, factory:IPA.attributes_widget,
name: 'attrs', object_type: 'user', name: 'attrs', object_type: 'user',
join: true join: true
}]}]). }]}]}).
standard_associations(). standard_association_facets().
build(); build();
}; };

View File

@@ -33,12 +33,12 @@ IPA.entity_factories.automountlocation = function() {
columns:['cn'], columns:['cn'],
add_fields:['cn'] add_fields:['cn']
}). }).
details_facet([{ details_facet({sections:[{
section:'identity', name:'identity',
label: IPA.messages.objects.automountlocation.identity, label: IPA.messages.objects.automountlocation.identity,
fields:['cn'] fields:['cn']
}]). }]}).
standard_associations(). standard_association_facets().
build(); build();
}; };

View File

@@ -579,8 +579,8 @@ IPA.details_refresh = function() {
options: { 'all': true, 'rights': true } options: { 'all': true, 'rights': true }
}); });
if (IPA.refresh_devel_hook){ if (IPA.details_refresh_devel_hook){
IPA.refresh_devel_hook(that.entity_name,command,that.pkey); IPA.details_refresh_devel_hook(that.entity_name,command,that.pkey);
} }

View File

@@ -4,7 +4,7 @@ if (window.location.protocol == 'file:') {
IPA.json_url = "test/data"; IPA.json_url = "test/data";
IPA.use_static_files = true; IPA.use_static_files = true;
IPA.refresh_devel_hook = function(entity_name,command,pkey){ IPA.details_refresh_devel_hook = function(entity_name,command,pkey){
if ((entity_name === 'host')||(entity_name === 'permission')){ if ((entity_name === 'host')||(entity_name === 'permission')){
command.name = entity_name+'_show_'+pkey; command.name = entity_name+'_show_'+pkey;
command.method = entity_name+'_show'; command.method = entity_name+'_show';

View File

@@ -32,8 +32,8 @@ IPA.entity_factories.dnszone = function() {
columns:['idnsname'], columns:['idnsname'],
add_fields: ['idnsname','idnssoamname','idnssoarname'] add_fields: ['idnsname','idnssoamname','idnssoarname']
}). }).
details_facet([{ details_facet({sections:[{
section:'identity', name:'identity',
fields:[ fields:[
'idnsname', 'idnsname',
'idnszoneactive', 'idnszoneactive',
@@ -47,12 +47,12 @@ IPA.entity_factories.dnszone = function() {
'dnsttl', 'dnsttl',
'dnsclass', 'dnsclass',
'idnsallowdynupdate', 'idnsallowdynupdate',
'idnsupdatepolicy']}]). 'idnsupdatepolicy']}]}).
facet(IPA.records_facet({ facet(IPA.records_facet({
'name': 'records', 'name': 'records',
'label': IPA.metadata.objects.dnsrecord.label 'label': IPA.metadata.objects.dnsrecord.label
})). })).
standard_associations(). standard_association_facets().
build(); build();
}; };

View File

@@ -530,22 +530,16 @@ IPA. facet_create_action_panel = function(container) {
IPA.entity_builder = function(){ IPA.entity_builder = function(){
var that = {}; var that = {};
var entity_name ;
var entity = null; var entity = null;
var current_facet = null; var current_facet = null;
function section(spec){ function section(spec){
var current_section = null; var current_section = null;
spec.entity_name = entity_name; spec.entity_name = entity.name;
if (spec.section){ if (!spec.label){
spec.name = spec.section; var obj_messages = IPA.messages.objects[entity.name];
if (!spec.label){ spec.label = obj_messages[spec.name];
var obj_messages = IPA.messages.objects[entity_name];
spec.label = obj_messages[spec.section];
}
} }
if (spec.factory){ if (spec.factory){
@@ -553,7 +547,7 @@ IPA.entity_builder = function(){
}else{ }else{
current_section = IPA.details_list_section(spec); current_section = IPA.details_list_section(spec);
} }
current_facet.add_section(current_section);
var fields = spec.fields; var fields = spec.fields;
if (fields){ if (fields){
var i; var i;
@@ -561,23 +555,20 @@ IPA.entity_builder = function(){
for (i =0; i < fields.length; i += 1){ for (i =0; i < fields.length; i += 1){
field = fields[i]; field = fields[i];
if (field instanceof Object){ if (field instanceof Object){
field.entity_name = entity_name; field.entity_name = entity.name;
current_section.add_field(field.factory(field)); current_section.add_field(field.factory(field));
}else{ }else{
field = IPA.text_widget({ field = IPA.text_widget({
name:field, name:field,
entity_name:entity_name entity_name:entity.name
}); });
current_section.add_field(field); current_section.add_field(field);
} }
} }
} }
current_facet.add_section(current_section);
} }
that.entity = function(name){ that.entity = function(name){
entity_name = name;
that.entity_name = name;
entity = IPA.entity({name: name}); entity = IPA.entity({name: name});
return that; return that;
}; };
@@ -587,8 +578,11 @@ IPA.entity_builder = function(){
return that; return that;
}; };
that.details_facet = function (sections){ that.details_facet = function (spec){
current_facet =IPA.details_facet({entity_name:entity_name}); var sections = spec.sections;
spec.sections = null;
spec.entity_name = entity.name;
current_facet =IPA.details_facet(spec);
entity.facet(current_facet); entity.facet(current_facet);
var i; var i;
@@ -599,10 +593,6 @@ IPA.entity_builder = function(){
return that; return that;
}; };
that.get_current_facet = function(){
return current_facet;
};
that.facet = function (facet){ that.facet = function (facet){
current_facet = facet; current_facet = facet;
entity.facet(facet); entity.facet(facet);
@@ -611,11 +601,9 @@ IPA.entity_builder = function(){
that.search_facet = function (spec){ that.search_facet = function (spec){
current_facet = IPA.search_facet({ current_facet = IPA.search_facet({
entity_name:that.entity_name, entity_name:entity.name,
search_all: spec.search_all || false search_all: spec.search_all || false
}); });
//once everything usese this mechanism, inline the init code
current_facet.init();
var columns = spec.columns; var columns = spec.columns;
var i; var i;
@@ -630,7 +618,7 @@ IPA.entity_builder = function(){
IPA.add_dialog({ IPA.add_dialog({
'name': 'add', 'name': 'add',
'title': IPA.messages.objects.user.add, 'title': IPA.messages.objects.user.add,
entity_name: entity_name entity_name: entity.name
}); });
current_facet.dialog(current_dialog); current_facet.dialog(current_dialog);
@@ -653,7 +641,7 @@ IPA.entity_builder = function(){
field.section = null; field.section = null;
current_dialog.add_section(factory(field)); current_dialog.add_section(factory(field));
}else{ }else{
field.entity_name = entity_name; field.entity_name = entity.name;
factory = field.factory; factory = field.factory;
current_dialog.field(factory(field)); current_dialog.field(factory(field));
} }
@@ -661,19 +649,18 @@ IPA.entity_builder = function(){
current_dialog.text(add_fields[i]); current_dialog.text(add_fields[i]);
} }
} }
entity.facet(current_facet); entity.facet(current_facet);
return that; return that;
}; };
that.association_facet = function(spec){ that.association_facet = function(spec){
spec.entity_name = entity_name; spec.entity_name = entity.name;
entity.facet(IPA.association_facet(spec)); entity.facet(IPA.association_facet(spec));
return that; return that;
}; };
that.standard_associations = function(){ that.standard_association_facets = function(){
entity.standard_associations(); entity.standard_associations();
return that; return that;
}; };

View File

@@ -42,11 +42,11 @@ IPA.entity_factories.group = function () {
}, },
'gidnumber'] 'gidnumber']
}). }).
details_facet( details_facet({sections:
[{ [{
section:'details', name:'details',
fields:['cn','description','gidnumber'] fields:['cn','description','gidnumber']
}]). }]}).
facet( IPA.association_facet({ facet( IPA.association_facet({
'name': 'member_user', 'name': 'member_user',
columns:[ columns:[
@@ -85,6 +85,6 @@ IPA.entity_factories.group = function () {
name: 'memberof_role', name: 'memberof_role',
associator: IPA.serial_associator associator: IPA.serial_associator
}). }).
standard_associations(). standard_association_facets().
build(); build();
}; };

View File

@@ -54,10 +54,10 @@ IPA.entity_factories.hbacsvc = function () {
search_facet({ search_facet({
columns:['cn','description'], columns:['cn','description'],
add_fields:['cn','description']}). add_fields:['cn','description']}).
details_facet([{ details_facet({sections:[{
section : 'general', name: 'general',
label: IPA.messages.details.general, label: IPA.messages.details.general,
fields:[ 'cn', 'description']}]). fields:[ 'cn', 'description']}]}).
build(); build();
}; };
@@ -68,14 +68,14 @@ IPA.entity_factories.hbacsvcgroup = function () {
search_facet({ search_facet({
columns:['cn', 'description'], columns:['cn', 'description'],
add_fields:['cn', 'description']}). add_fields:['cn', 'description']}).
details_facet([ details_facet({sections:[
{ {
section: 'general', name: 'general',
label: IPA.messages.details.general, label: IPA.messages.details.general,
fields:['cn','description'] fields:['cn','description']
}, },
{ {
section: 'services', name: 'services',
label: IPA.messages.objects.hbacsvcgroup.services, label: IPA.messages.objects.hbacsvcgroup.services,
fields:[{ fields:[{
factory: IPA.hbacsvcgroup_member_hbacsvc_table_widget, factory: IPA.hbacsvcgroup_member_hbacsvc_table_widget,
@@ -84,7 +84,7 @@ IPA.entity_factories.hbacsvcgroup = function () {
other_entity: 'hbacsvc', other_entity: 'hbacsvc',
save_values: false save_values: false
}] }]
}]). }]}).
build(); build();
}; };

View File

@@ -36,9 +36,9 @@ IPA.entity_factories.host = function () {
}], }],
add_fields: ['fqdn', {factory:IPA.force_host_add_checkbox_widget}] add_fields: ['fqdn', {factory:IPA.force_host_add_checkbox_widget}]
}). }).
details_facet([ details_facet({sections:[
{ {
section:'details', name:'details',
fields: [ fields: [
'fqdn', 'fqdn',
'krbprincipalname', 'krbprincipalname',
@@ -51,7 +51,7 @@ IPA.entity_factories.host = function () {
'description' ] 'description' ]
}, },
{ {
section:'enrollment', name:'enrollment',
fields:[ fields:[
{ {
factory: IPA.host_provisioning_status_widget, factory: IPA.host_provisioning_status_widget,
@@ -61,7 +61,7 @@ IPA.entity_factories.host = function () {
] ]
}, },
{ {
section :'certificate', name:'certificate',
fields:[ fields:[
{ {
factory: IPA.host_certificate_status_widget, factory: IPA.host_certificate_status_widget,
@@ -69,7 +69,7 @@ IPA.entity_factories.host = function () {
label: IPA.messages.objects.host.status label: IPA.messages.objects.host.status
} }
] ]
}]). }]}).
facet(IPA.host_managedby_host_facet({ facet(IPA.host_managedby_host_facet({
name: 'managedby_host' name: 'managedby_host'
})). })).
@@ -85,7 +85,7 @@ IPA.entity_factories.host = function () {
name: 'memberof_role', name: 'memberof_role',
associator: IPA.serial_associator associator: IPA.serial_associator
}). }).
standard_associations(). standard_association_facets().
build(); build();
}; };

View File

@@ -29,16 +29,16 @@ IPA.entity_factories.hostgroup = function() {
entity('hostgroup'). entity('hostgroup').
search_facet({columns:['cn','description'], search_facet({columns:['cn','description'],
add_fields:['cn','description']}). add_fields:['cn','description']}).
details_facet([{ details_facet({sections:[{
section:'identity', name:'identity',
label: IPA.messages.objects.hostgroup.identity, label: IPA.messages.objects.hostgroup.identity,
fields:['cn','description'] fields:['cn','description']
}]). }]}).
association_facet({ association_facet({
name: 'memberof_hostgroup', name: 'memberof_hostgroup',
associator: IPA.serial_associator associator: IPA.serial_associator
}). }).
standard_associations(). standard_association_facets().
build(); build();
}; };

View File

@@ -124,7 +124,6 @@
# To add a set of files, use "+process FileName", "+process Folder\Path\*.js", # To add a set of files, use "+process FileName", "+process Folder\Path\*.js",
# or "+process Folder\Path\*.htm". # or "+process Folder\Path\*.htm".
# #
+process core.js
+process ipa.js +process ipa.js
+process widget.js +process widget.js
+process dialog.js +process dialog.js

View File

@@ -28,13 +28,13 @@ IPA.entity_factories.netgroup = function() {
search_facet({ search_facet({
columns:['cn','description'], columns:['cn','description'],
add_fields:['cn', 'description']}). add_fields:['cn', 'description']}).
details_facet([{ details_facet({sections:[{
section:'identity', name:'identity',
fields:['cn','description','nisdomainname']}]). fields:['cn','description','nisdomainname']}]}).
association_facet({ association_facet({
name: 'memberof_netgroup', name: 'memberof_netgroup',
associator: IPA.serial_associator associator: IPA.serial_associator
}). }).
standard_associations(). standard_association_facets().
build(); build();
}; };

View File

@@ -30,13 +30,14 @@ IPA.entity_factories.pwpolicy = function() {
search_facet({ search_facet({
columns:['cn'], columns:['cn'],
add_fields:['cn', 'cospriority']}). add_fields:['cn', 'cospriority']}).
details_facet([ details_facet({
{ sections:[
section : 'identity', {
fields:['krbmaxpwdlife','krbminpwdlife','krbpwdhistorylength', name : 'identity',
'krbpwdmindiffchars','krbpwdminlength'] fields:['krbmaxpwdlife','krbminpwdlife','krbpwdhistorylength',
}]). 'krbpwdmindiffchars','krbpwdminlength']
standard_associations(). }]}).
standard_association_facets().
build(); build();
}; };
@@ -47,9 +48,10 @@ IPA.entity_factories.pwpolicy = function() {
IPA.entity_factories.krbtpolicy = function() { IPA.entity_factories.krbtpolicy = function() {
return IPA.entity_builder(). return IPA.entity_builder().
entity('krbtpolicy'). entity('krbtpolicy').
details_facet([{ details_facet({
section: 'identity', sections:[{
fields:[ 'krbmaxrenewableage','krbmaxticketlife' ] name: 'identity',
}]). fields:[ 'krbmaxrenewableage','krbmaxticketlife' ]
}]}).
build(); build();
}; };

View File

@@ -30,8 +30,10 @@
IPA.entity_factories.config = function(){ IPA.entity_factories.config = function(){
return IPA.entity_builder(). return IPA.entity_builder().
entity('config'). entity('config').
details_facet([{ details_facet({
section: 'ipaserver', sections:
[{
name: 'ipaserver',
label: IPA.messages.objects.config.ipaserver, label: IPA.messages.objects.config.ipaserver,
fields: fields:
[{ [{
@@ -43,6 +45,6 @@ IPA.entity_factories.config = function(){
'ipadefaultprimarygroup','ipagroupsearchfields', 'ipadefaultprimarygroup','ipagroupsearchfields',
'ipahomesrootdir','ipamaxusernamelength', 'ipahomesrootdir','ipamaxusernamelength',
'ipamigrationenabled','ipasearchrecordslimit', 'ipamigrationenabled','ipasearchrecordslimit',
'ipasearchtimelimit','ipausersearchfields']}]). 'ipasearchtimelimit','ipausersearchfields']}]}).
build(); build();
}; };

View File

@@ -36,9 +36,9 @@ IPA.entity_factories.service = function() {
title: IPA.messages.objects.service.add, title: IPA.messages.objects.service.add,
width: '450px' width: '450px'
}))). }))).
details_facet([ details_facet({sections:[
{ {
section: 'details', name: 'details',
fields:['krbprincipalname', fields:['krbprincipalname',
{ {
factory:IPA.service_name_widget, factory:IPA.service_name_widget,
@@ -54,7 +54,7 @@ IPA.entity_factories.service = function() {
}] }]
}, },
{ {
section : 'provisioning', name: 'provisioning',
fields:[{ fields:[{
factory:IPA.service_provisioning_status_widget, factory:IPA.service_provisioning_status_widget,
name: 'provisioning_status', name: 'provisioning_status',
@@ -62,19 +62,20 @@ IPA.entity_factories.service = function() {
}] }]
}, },
{ {
section: 'certificate', name: 'certificate',
fields:[{ fields:[{
factory:IPA.service_certificate_status_widget, factory:IPA.service_certificate_status_widget,
name: 'certificate_status', name: 'certificate_status',
label: IPA.messages.objects.service.status label: IPA.messages.objects.service.status
}] }]
}]). }]}).
facet(IPA.service_managedby_host_facet({ facet(IPA.service_managedby_host_facet({
name: 'managedby_host', name: 'managedby_host',
add_method: 'add_host', add_method: 'add_host',
remove_method: 'remove_host' remove_method: 'remove_host'
})). })).
standard_associations().build(); standard_association_facets().
build();
}; };

View File

@@ -44,14 +44,14 @@ IPA.entity_factories.sudocmd = function () {
search_facet({ search_facet({
columns:['sudocmd','description'], columns:['sudocmd','description'],
add_fields:['sudocmd','description']}). add_fields:['sudocmd','description']}).
details_facet([ details_facet({sections:[
{ {
section : 'general', name: 'general',
label: IPA.messages.details.general, label: IPA.messages.details.general,
fields:['sudocmd','description'] fields:['sudocmd','description']
}, },
{ {
section: 'groups', name: 'groups',
label: IPA.messages.objects.sudocmd.groups, label: IPA.messages.objects.sudocmd.groups,
factory: IPA.details_section, factory: IPA.details_section,
fields:[{ fields:[{
@@ -84,7 +84,7 @@ IPA.entity_factories.sudocmd = function () {
} }
] ]
}] }]
}]). }]}).
build(); build();
}; };
@@ -96,15 +96,15 @@ IPA.entity_factories.sudocmdgroup = function () {
columns:['cn','description'], columns:['cn','description'],
add_fields:['cn','description'] add_fields:['cn','description']
}). }).
details_facet([ details_facet({sections:[
{ {
section: 'general', name: 'general',
label: IPA.messages.dialogs.general, label: IPA.messages.dialogs.general,
fields:['cn','description'] fields:['cn','description']
}, },
{ {
section: 'commands', name: 'commands',
factory: IPA.details_section, factory: IPA.details_section,
fields: [{ fields: [{
factory: IPA.association_table_widget, factory: IPA.association_table_widget,
@@ -136,7 +136,7 @@ IPA.entity_factories.sudocmdgroup = function () {
} }
] ]
}] }]
}]). }]}).
build(); build();
}; };

View File

@@ -29,11 +29,6 @@ module('details', {
"data", "data",
true, true,
function(data, text_status, xhr) { function(data, text_status, xhr) {
IPA.metadata = data.result.results[0];
IPA.messages = data.result.results[1].messages;
IPA.whoami = data.result.results[2].result[0];
IPA.env = data.result.results[3].result;
IPA.dns_enabled = data.result.results[4].result;
}, },
function(xhr, text_status, error_thrown) { function(xhr, text_status, error_thrown) {
ok(false, "ipa_init() failed: "+error_thrown); ok(false, "ipa_init() failed: "+error_thrown);
@@ -181,14 +176,14 @@ test("Testing details lifecycle: create, setup, load.", function(){
var entity = IPA. var entity = IPA.
entity_builder(). entity_builder().
entity('user'). entity('user').
details_facet([ details_facet({sections:[
{ {
section: 'identity', name: 'identity',
label: IPA.messages.details.identity, label: IPA.messages.details.identity,
fields:['title','givenname','sn','cn','displayname', 'initials'] fields:['title','givenname','sn','cn','displayname', 'initials']
}, },
{ {
section: 'contact', name: 'contact',
label:'contact', label:'contact',
fields: fields:
[ {factory: test_widget,name:'test'}, [ {factory: test_widget,name:'test'},
@@ -200,7 +195,7 @@ test("Testing details lifecycle: create, setup, load.", function(){
{factory: IPA.multivalued_text_widget, {factory: IPA.multivalued_text_widget,
name:'facsimiletelephonenumber'}] name:'facsimiletelephonenumber'}]
}, },
]).build(); ]}).build();
entity.init(); entity.init();
var facet = entity.get_facet('details'); var facet = entity.get_facet('details');

View File

@@ -30,11 +30,6 @@ module('entity',{
"data", "data",
true, true,
function(data, text_status, xhr) { function(data, text_status, xhr) {
IPA.metadata = data.result.results[0];
IPA.messages = data.result.results[1].messages;
IPA.whoami = data.result.results[2].result[0];
IPA.env = data.result.results[3].result;
IPA.dns_enabled = data.result.results[4].result;
IPA.entity_factories.user = function(){ IPA.entity_factories.user = function(){
return IPA. return IPA.

View File

@@ -33,21 +33,21 @@ IPA.entity_factories.user = function() {
add_fields: ['uid','givenname','sn'], add_fields: ['uid','givenname','sn'],
search_all: true search_all: true
}). }).
details_facet([ details_facet({sections:[
{ {
section: 'identity', name: 'identity',
label: IPA.messages.details.identity, label: IPA.messages.details.identity,
fields:['title','givenname','sn','cn','displayname', 'initials'] fields:['title','givenname','sn','cn','displayname', 'initials']
}, },
{ {
section: 'account', name: 'account',
fields:[{factory:IPA.user_status_widget,name:'nsaccountlock'}, fields:[{factory:IPA.user_status_widget,name:'nsaccountlock'},
'uid', 'uid',
{factory: IPA.user_password_widget,name:'userpassword'}, {factory: IPA.user_password_widget,name:'userpassword'},
'uidnumber','gidnumber','loginshell','homedirectory'] 'uidnumber','gidnumber','loginshell','homedirectory']
}, },
{ {
section: 'contact', name: 'contact',
fields: fields:
[ {factory: IPA.multivalued_text_widget, name:'mail'}, [ {factory: IPA.multivalued_text_widget, name:'mail'},
{factory: IPA.multivalued_text_widget, name:'telephonenumber'}, {factory: IPA.multivalued_text_widget, name:'telephonenumber'},
@@ -56,17 +56,17 @@ IPA.entity_factories.user = function() {
{factory: IPA.multivalued_text_widget, name:'facsimiletelephonenumber'}] {factory: IPA.multivalued_text_widget, name:'facsimiletelephonenumber'}]
}, },
{ {
section: 'mailing', name: 'mailing',
fields: ['street','l','st','postalcode'] fields: ['street','l','st','postalcode']
}, },
{ {
section: 'employee', name: 'employee',
fields: ['ou','manager'] fields: ['ou','manager']
}, },
{ {
section: 'misc', name: 'misc',
fields:['carlicense'] fields:['carlicense']
}]). }]}).
association_facet({ association_facet({
name: 'memberof_group', name: 'memberof_group',
associator: IPA.serial_associator associator: IPA.serial_associator
@@ -79,7 +79,7 @@ IPA.entity_factories.user = function() {
name: 'memberof_role', name: 'memberof_role',
associator: IPA.serial_associator associator: IPA.serial_associator
}). }).
standard_associations(); standard_association_facets();
var entity = builder.build(); var entity = builder.build();