summaryrefslogtreecommitdiffstats
path: root/install/static
diff options
context:
space:
mode:
authorAdam Young <ayoung@redhat.com>2010-12-04 00:29:05 -0500
committerEndi Sukma Dewata <edewata@redhat.com>2010-12-06 12:52:47 -0500
commit10f3c0825bfdffa6035e78066001eb3bdc759143 (patch)
treee1a2ddef0846e12275cd661752217e461a204b7c /install/static
parent37f48c0019c64f20bfc24b021442b643eaf86aab (diff)
downloadfreeipa-10f3c0825bfdffa6035e78066001eb3bdc759143.tar.gz
freeipa-10f3c0825bfdffa6035e78066001eb3bdc759143.tar.xz
freeipa-10f3c0825bfdffa6035e78066001eb3bdc759143.zip
entity i18n
Updated the user,group,host, hostgroup, netgroup, service, and all policy entities to use the newer framework functions, in order to replaced the old array style definitions which did not support i18n. update a few of the newer framerwork functions to get the lables from the meta data. Fixed the unit tests which were expecting a details facet for users, no longer automatically created
Diffstat (limited to 'install/static')
-rw-r--r--install/static/details.js4
-rw-r--r--install/static/group.js37
-rw-r--r--install/static/host.js29
-rw-r--r--install/static/hostgroup.js65
-rw-r--r--install/static/netgroup.js66
-rw-r--r--install/static/policy.js222
-rw-r--r--install/static/search.js7
-rw-r--r--install/static/service.js6
-rw-r--r--install/static/test/entity_tests.js9
-rw-r--r--install/static/user.js146
-rwxr-xr-xinstall/static/widget.js10
11 files changed, 375 insertions, 226 deletions
diff --git a/install/static/details.js b/install/static/details.js
index a3f1b2a5c..5e3cd8d62 100644
--- a/install/static/details.js
+++ b/install/static/details.js
@@ -338,7 +338,7 @@ function ipa_details_list_section(spec){
}
};
- // Deprecated: Used for backward compatibility only.
+ // This is to allow declarative style programming for details
function input(spec){
that.create_field(spec);
return that;
@@ -349,7 +349,7 @@ function ipa_details_list_section(spec){
return that;
}
-// Deprecated: Used for backward compatibility only.
+// shorthand notation used for declarative definitions of details pages
function ipa_stanza(spec) {
return ipa_details_list_section(spec);
}
diff --git a/install/static/group.js b/install/static/group.js
index b44463439..8c2087f66 100644
--- a/install/static/group.js
+++ b/install/static/group.js
@@ -89,10 +89,14 @@ function ipa_group_add_dialog(spec) {
that.add_dialog_init();
- that.add_field(ipa_text_widget({name:'cn', label:'Name', undo: false}));
- that.add_field(ipa_text_widget({name:'description', label:'Description', undo: false}));
- that.add_field(ipa_checkbox_widget({name:'posix', label:'Is this a POSIX group?', undo: false}));
- that.add_field(ipa_text_widget({name:'gidnumber', label:'GID', undo: false}));
+ that.add_field(ipa_text_widget({name:'cn', entity_name:'group',
+ undo: false}));
+ that.add_field(ipa_text_widget({name:'description',
+ entity_name:'group', undo: false}));
+ that.add_field(ipa_checkbox_widget({name:'posix', entity_name:'group',
+ undo: false}));
+ that.add_field(ipa_text_widget({name:'gidnumber', entity_name:'group',
+ undo: false}));
};
return that;
@@ -105,11 +109,9 @@ function ipa_group_search_facet(spec) {
var that = ipa_search_facet(spec);
that.init = function() {
-
- that.create_column({name:'cn', label:'Name'});
- that.create_column({name:'gidnumber', label:'GID'});
- that.create_column({name:'description', label:'Description'});
-
+ that.create_column({name:'cn'});
+ that.create_column({name:'gidnumber'});
+ that.create_column({name:'description'});
that.search_facet_init();
};
@@ -130,20 +132,9 @@ function ipa_group_details_facet(spec) {
});
that.add_section(section);
- section.create_field({
- name: 'cn',
- label: 'Group Name'
- });
-
- section.create_field({
- name: 'description',
- label: 'Description'
- });
-
- section.create_field({
- name: 'gidnumber',
- label: 'Group ID'
- });
+ section.create_field({name: 'cn' });
+ section.create_field({name: 'description'});
+ section.create_field({name: 'gidnumber' });
that.details_facet_init();
};
diff --git a/install/static/host.js b/install/static/host.js
index 484b64771..4a60bbccd 100644
--- a/install/static/host.js
+++ b/install/static/host.js
@@ -87,7 +87,7 @@ function ipa_host_add_dialog(spec) {
that.add_field(ipa_text_widget({
'name': 'fqdn',
- 'label': 'Name',
+ entity_name:'host',
'size': 40,
'undo': false
}));
@@ -104,10 +104,11 @@ function ipa_host_search_facet(spec) {
that.init = function() {
- that.create_column({name:'fqdn', label:'Name'});
- that.create_column({name:'description', label:'Description'});
- that.create_column({name:'enrolled', label:'Enrolled?'});
- that.create_column({name:'manages', label:'Manages?'});
+ that.create_column({name:'fqdn'});
+ that.create_column({name:'description'});
+ //TODO use the value of this field to set enrollment status
+ that.create_column({name:'krblastpwdchange', label:'Enrolled?'});
+ that.create_column({name:'nshostlocation'});
that.search_facet_init();
};
@@ -129,25 +130,16 @@ function ipa_host_details_facet(spec) {
});
that.add_section(section);
- section.create_field({
- 'name': 'fqdn',
- 'label': 'Fully Qualified Domain Name'
- });
-
- section.create_field({
- 'name': 'krbprincipalname',
- 'label': 'Kerberos Principal'
- });
+ section.create_field({'name': 'fqdn'});
+ section.create_field({'name': 'krbprincipalname'});
+ //TODO add this to the host plugin
section.create_field({
'name': 'serverhostname',
'label': 'Server Host Name'
});
- section.create_field({
- 'name': 'description',
- 'label': 'Description'
- });
+ section.create_field({'name': 'description'});
section = ipa_details_list_section({
'name': 'enrollment',
@@ -155,6 +147,7 @@ function ipa_host_details_facet(spec) {
});
that.add_section(section);
+ //TODO add label to messages
section.add_field(host_provisioning_status_widget({
'name': 'provisioning_status',
'label': 'Status',
diff --git a/install/static/hostgroup.js b/install/static/hostgroup.js
index eb7f8b5c0..99be72599 100644
--- a/install/static/hostgroup.js
+++ b/install/static/hostgroup.js
@@ -20,23 +20,48 @@
/* REQUIRES: ipa.js, details.js, search.js, add.js, entity.js */
-ipa_entity_set_search_definition('hostgroup', [
- ['cn', 'Name', null],
- ['description', 'Description', null]
-]);
-
-ipa_entity_set_add_definition('hostgroup', [
- 'dialog-add-hostgroup', 'Add New Hostgroup', [
- ['cn', 'Name', null],
- ['description', 'Description', null]
- ]
-]);
-
-ipa_entity_set_details_definition('hostgroup', [
- ipa_stanza({name:'identity', label:'Hostgroup Details'}).
- input({name:'cn', label:'Name'}).
- input({name: 'description', label:'Description'})
-]);
-
-ipa_entity_set_association_definition('hostgroup', {
-});
+
+IPA.add_entity( function() {
+ var that = ipa_entity({
+ 'name': 'hostgroup'
+ });
+ that.init = function() {
+ var search_facet = ipa_search_facet({
+ name: 'search',
+ label: 'Search',
+ entity_name: that.name
+ });
+ search_facet.create_column({name:'cn'});
+ search_facet.create_column({name:'description'});
+ that.add_facet(search_facet);
+
+ that.add_facet(function() {
+ var that = ipa_details_facet({name:'details',label:'Details'});
+ that.add_section(
+ ipa_stanza({name:'identity', label:'Hostgroup Details'}).
+ input({name:'cn'}).
+ input({name: 'description'}));
+ return that;
+ }());
+
+
+ var dialog = ipa_add_dialog({
+ name: 'add',
+ title: 'Add Hostgroup',
+ entity_name:'hostgroup'
+ });
+
+ that.add_dialog(dialog);
+ dialog.init();
+ dialog.add_field(ipa_text_widget({ name: 'cn',
+ entity_name:'hostgroup'}));
+ dialog.add_field(ipa_text_widget({ name: 'description',
+ entity_name:'hostgroup' }));
+ that.create_association_facets();
+ that.entity_init();
+ }
+ return that;
+}());
+
+
+
diff --git a/install/static/netgroup.js b/install/static/netgroup.js
index 0341ed78a..b0b2ede33 100644
--- a/install/static/netgroup.js
+++ b/install/static/netgroup.js
@@ -20,24 +20,48 @@
/* REQUIRES: ipa.js, details.js, search.js, add.js, entity.js */
-ipa_entity_set_search_definition('netgroup', [
- ['cn', 'Name', null],
- ['description', 'Description', null]
-]);
-
-ipa_entity_set_add_definition('netgroup', [
- 'dialog-add-netgroup', 'Add New Netgroup', [
- ['cn', 'Name', null],
- ['description', 'Description', null]
- ]
-]);
-
-ipa_entity_set_details_definition('netgroup', [
- ipa_stanza({name:'identity', label:'Netgroup Details'}).
- input({name:'cn', label:'Name'}).
- input({name:'description', label:'Description'}).
- input({name:'nisdomainname', label:'NIS Domain'})
-]);
-
-ipa_entity_set_association_definition('netgroup', {
-});
+IPA.add_entity( function() {
+ var that = ipa_entity({
+ 'name': 'netgroup'
+ });
+ that.init = function() {
+ var search_facet = ipa_search_facet({
+ name: 'search',
+ label: 'Search',
+ entity_name: that.name
+ });
+ search_facet.create_column({name:'cn'});
+ search_facet.create_column({name:'description'});
+ that.add_facet(search_facet);
+
+ that.add_facet(function() {
+ var that = ipa_details_facet({name:'details',label:'Details'});
+ that.add_section(
+ ipa_stanza({name:'identity', label:'Netgroup Details'}).
+ input({name:'cn'}).
+ input({name: 'description'}).
+ input({name:'nisdomainname'}));
+ return that;
+ }());
+
+
+ var dialog = ipa_add_dialog({
+ name: 'add',
+ title: 'Add Netgroup',
+ entity_name:'netgroup'
+ });
+
+ that.add_dialog(dialog);
+ dialog.init();
+ dialog.add_field(ipa_text_widget({ name: 'cn',
+ entity_name:'netgroup'}));
+ dialog.add_field(ipa_text_widget({ name: 'description',
+ entity_name:'netgroup' }));
+ that.create_association_facets();
+ that.entity_init();
+ }
+ return that;
+}());
+
+
+
diff --git a/install/static/policy.js b/install/static/policy.js
index 18c4ef550..9b62a18f4 100644
--- a/install/static/policy.js
+++ b/install/static/policy.js
@@ -21,46 +21,72 @@
/* REQUIRES: ipa.js, details.js, search.js, add.js, entity.js */
/* DNS */
-ipa_entity_set_search_definition('dnszone', [
- ['idnsname', 'Zone Name', null]
-]);
+IPA.add_entity(function (){
+ var that = ipa_entity({
+ name: 'dnszone'
+ });
-ipa_entity_set_add_definition('dnszone', [
- 'dialog-add-dns', 'Add New Zone', [
- ['idnsname', 'Name', null],
- ['idnssoamname', 'Authoritative name server'],
- ['idnssoarname','administrator e-mail address']
- ]
-]);
+ that.init = function() {
+ var search_facet = ipa_search_facet({
+ name: 'search',
+ label: 'Search',
+ entity_name: that.name
+ });
+ search_facet.create_column({name:'idnsname'});
+ that.add_facet(search_facet);
+
+ that.add_facet(function() {
+ var that = ipa_details_facet({name:'details',label:'Details'});
+ that.add_section(
+ ipa_stanza({name:'identity', label:'DNS Zone Details'}).
+ input({name:'idnsname'}).
+ input({name:'idnszoneactive'}).
+ input({name:'idnssoamname'}).
+ input({name:'idnssoarname'}).
+ input({name:'idnssoaserial'}).
+ input({name:'idnssoarefresh'}).
+ input({name:'idnssoaretry'}).
+ input({name:'idnssoaexpire'}).
+ input({name:'idnssoaminimum'}).
+ input({name:'dnsttl'}).
+ input({name:'dnsclass'}).
+ input({name:'idnsallowdynupdate'}).
+ input({name:'idnsupdatepolicy'}));
+
+ return that;
+ }());
+
+ that.add_facet( ipa_records_facet({
+ 'name': 'records',
+ 'label': IPA.metadata.dnsrecord.label
+ }));
-ipa_entity_set_details_definition('dnszone', [
- ipa_stanza({name:'identity', label:'DNS Zone Details'}).
- input({name:'idnsname', label:'DNS Name'}).
- input({name:'idnszoneactive', label:'Zone Active'}).
- input({name:'idnssoamname', label:'Authoritative name server'}).
- input({name:'idnssoarname', label:'administrator e-mail address'}).
- input({name:'idnssoaserial', label:'SOA serial'}).
- input({name:'idnssoarefresh', label:'SOA refresh'}).
- input({name:'idnssoaretry', label:'SOA retry'}).
- input({name:'idnssoaexpire', label:'SOA expire'}).
- input({name:'idnssoaminimum', label:'SOA minimum'}).
- input({name:'dnsttl', label:'SOA time to live'}).
- input({name:'dnsclass', label:'SOA class'}).
- input({name:'idnsallowdynupdate', label:'allow dynamic update?'}).
- input({name:'idnsupdatepolicy', label:'BIND update policy'})
-]);
+ var dialog = ipa_add_dialog({
+ name: 'add',
+ title: 'Add DNS Zone',
+ entity_name:'dnszone'
+ });
+
+ that.add_dialog(dialog);
+ dialog.init();
+
+ dialog.add_field(ipa_text_widget({ name: 'idnsname',
+ entity_name:'dnszone'}));
+ dialog.add_field(ipa_text_widget({ name: 'idnssoamname',
+ entity_name:'dnszone'}));
+ dialog.add_field(ipa_text_widget({ name: 'idnssoarname',
+ entity_name:'dnszone'}));
+
+ that.create_association_facets();
+ that.entity_init();
+ }
-ipa_entity_set_association_definition('dnszone', {
-});
+
+ return that;
+}());
-ipa_entity_set_facet_definition('dnszone', [
- ipa_records_facet({
- 'name': 'records',
- 'label': 'Records'
- })]
-);
function ipa_records_facet(spec){
@@ -256,7 +282,6 @@ function ipa_records_facet(spec){
};
function create(container) {
-// that.setup_views(container);
}
function setup(container){
@@ -322,9 +347,6 @@ function ipa_records_facet(spec){
'click': function(){delete_records(records_table);}
}).appendTo(action_controls);
-
-
-
div.append('<span class="records-buttons"></span>');
var records_results = $('<div/>', {
@@ -349,8 +371,9 @@ function ipa_records_facet(spec){
}
})
));
- tr.append($('<th>Resource</th>'));
- tr.append($('<th>Record Type</th>'));
+ tr.append($('<th/>',{
+ text: ipa_get_param_info("dnsrecord", "idnsname").label }));
+ tr.append($('<th>Record Type</th>'));
tr.append($('<th>Data</th>'));
refresh();
@@ -472,50 +495,97 @@ function ipa_records_facet(spec){
/**Automount*/
-ipa_entity_set_search_definition('automountlocation', [
- ['cn', 'Name', null]
-]);
+IPA.add_entity(function (){
+ var that = ipa_entity({
+ name: 'automountlocation'
+ });
-ipa_entity_set_add_definition('automountlocation', [
- 'dialog-add-location', 'Add New Location', [
- ['cn', 'Name', null]
- ]
-]);
-ipa_entity_set_details_definition('automountlocation', [
- ipa_stanza({name:'identity', label:'Automount Location Details'}).
- input({name:'cn', label:'Automount Location'})
-]);
+ var search_facet = ipa_search_facet({
+ name: 'search',
+ label: 'Search',
+ entity_name: that.name
+ });
+ that.init = function() {
+ search_facet.create_column({name:'cn'});
+ that.add_facet(search_facet);
+
+
+ that.add_facet(function() {
+ var that = ipa_details_facet({name:'details',label:'Details'});
+ that.add_section(
+ ipa_stanza({name:'identity', label:'Automount Location Details'}).
+ input({name:'cn'}));
+ return that;
+ }());
+
+ var dialog = ipa_add_dialog({
+ name: 'add',
+ title: 'Add Automount Location',
+ entity_name:'automountlocation'
+ });
-ipa_entity_set_association_definition('automountlocation', {
-});
+ that.add_dialog(dialog);
+ dialog.init();
+ dialog.add_field(ipa_text_widget({ name: 'cn',
+ entity_name:'automountlocation'}));
+ that.create_association_facets();
+ that.entity_init();
+
+ }
+ return that;
+}());
/**pwpolicy*/
-ipa_entity_set_search_definition('pwpolicy', [
- ['cn', 'Name', null]
-]);
+IPA.add_entity(function (){
+ var that = ipa_entity({
+ name: 'pwpolicy'
+ });
-ipa_entity_set_add_definition('pwpolicy', [
- 'dialog-add-dns', 'Add New Location', [
- ['cn', 'Name', null]
- ]
-]);
-ipa_entity_set_details_definition('pwpolicy', [
- ipa_stanza({name:'identity', label:'Password Policy'}).
- input({name:'krbmaxpwdlife',label:'Max Password Life'}).
- input({name:'krbminpwdlife',label:'Min Password Life'}).
- input({name:'krbpwdhistorylength',label:'Password History Length'}).
- input({name:'krbpwdmindiffchars',
- label:'Min Different Characters'}).
- input({name:'krbpwdminlength', label:'Password Minimum Length'})
-]);
+ var search_facet = ipa_search_facet({
+ name: 'search',
+ label: 'Search',
+ entity_name: that.name
+ });
+ that.init = function() {
+ search_facet.create_column({name:'cn'});
+ that.add_facet(search_facet);
+
+
+ that.add_facet(function() {
+ var that = ipa_details_facet({name:'details',label:'Details'});
+ that.add_section(
+
+ ipa_stanza({name:'identity', label:'Password Policy'}).
+ input({name:'krbmaxpwdlife'}).
+ input({name:'krbminpwdlife'}).
+ input({name:'krbpwdhistorylength'}).
+ input({name:'krbpwdmindiffchars'}).
+ input({name:'krbpwdminlength'}));
+ return that;
+ }());
+
+ var dialog = ipa_add_dialog({
+ name: 'add',
+ title: 'Add Password Policy',
+ entity_name:'pwpolicy'
+ });
+
+ that.add_dialog(dialog);
+ dialog.init();
+ dialog.add_field(ipa_text_widget({ name: 'cn',
+ entity_name:'pwpolicy'}));
+ that.create_association_facets();
+ that.entity_init();
+
+ }
+ return that;
+}());
-ipa_entity_set_association_definition('pwpolicy', {
-});
/**
@@ -525,9 +595,9 @@ ipa_entity_set_association_definition('pwpolicy', {
ipa_entity_set_details_definition('krbtpolicy', [
ipa_stanza({name:'identity', label:'Krbtpolicy Location Details'}).
- input({name:'cn', label:'Krbtpolicy Location'}).
- input({name:'krbmaxrenewableage', label:'Max Renewable Age'}).
- input({name:'krbmaxticketlife', label:'Max Ticket Life'})
+ input({name:'cn'}).
+ input({name:'krbmaxrenewableage'}).
+ input({name:'krbmaxticketlife'})
]);
IPA.get_entity('krbtpolicy').default_facet = 'details';
diff --git a/install/static/search.js b/install/static/search.js
index f267c701a..a9f71b9ac 100644
--- a/install/static/search.js
+++ b/install/static/search.js
@@ -285,6 +285,13 @@ function ipa_search_facet(spec) {
};
that.create_column = function(spec) {
+ if (!spec.label){
+ var param_info = ipa_get_param_info(this.entity_name, spec.name);
+ if (param_info){
+ spec.label = param_info.label;
+ }
+ }
+
var column = ipa_column(spec);
that.add_column(column);
return column;
diff --git a/install/static/service.js b/install/static/service.js
index 5d9e21ad1..218e6af7f 100644
--- a/install/static/service.js
+++ b/install/static/service.js
@@ -80,7 +80,6 @@ function ipa_service_add_dialog(spec) {
that.add_field(ipa_widget({
name: 'krbprincipalname',
- label: 'Principal'
}));
that.add_field(ipa_text_widget({
@@ -159,7 +158,7 @@ function ipa_service_search_facet(spec) {
that.init = function() {
- that.create_column({name:'krbprincipalname', label:'Principal'});
+ that.create_column({name:'krbprincipalname'});
that.search_facet_init();
};
@@ -181,8 +180,7 @@ function ipa_service_details_facet(spec) {
that.add_section(section);
section.create_field({
- name: 'krbprincipalname',
- label: 'Principal'
+ name: 'krbprincipalname'
});
section.create_field({
diff --git a/install/static/test/entity_tests.js b/install/static/test/entity_tests.js
index 504775eb1..45834ac3c 100644
--- a/install/static/test/entity_tests.js
+++ b/install/static/test/entity_tests.js
@@ -109,8 +109,12 @@ test('Testing ipa_facet_setup_views().', function() {
var views = ul.children();
+ /*5 Views:
+ one for each of 3 associations
+ one for search
+ a blank one for the action controls*/
equals(
- views.length, 6,
+ views.length, 5,
'Checking number of views'
);
@@ -142,7 +146,8 @@ test('Testing ipa_facet_setup_views().', function() {
var search_facets = $('li.search-facet', action_panel);
equals(search_facets.length,1,'one search facet in action panel');
var entity_facets = $('li.entity-facet', action_panel);
- equals(entity_facets.length,4,'4 entity facets in action panel');
+ /*No longer automatically adding details, so ony the assoc. facets */
+ equals(entity_facets.length,3,'3 entity facets in action panel');
for ( var entity_facet = entity_facets.first();
diff --git a/install/static/user.js b/install/static/user.js
index 21619ec53..8eb412062 100644
--- a/install/static/user.js
+++ b/install/static/user.js
@@ -20,71 +20,99 @@
/* REQUIRES: ipa.js, details.js, search.js, add.js, entity.js */
-ipa_entity_set_search_definition('user', [
- ['cn', 'Name', null],
- ['uid', 'Login', null],
- ['uidnumber', 'UID', null],
- ['mail', 'EMAIL', null],
- ['telephonenumber', 'Phone', null],
- ['title', 'Job Title', null]
-]);
-
-ipa_entity_set_add_definition('user', [
- 'dialog-add-user', 'Add New User', [
- ['uid', 'Login', null],
- ['givenname', 'First Name', null],
- ['sn', 'Last Name', null]
- ]
-]);
-
-
-ipa_entity_set_details_definition('user', [
- ipa_stanza({name:'identity', label:'Identity Details'}).
- input({name:'title', label: 'Title'}).
- input({name:'givenname'}).
- input({name:'sn'}).
- input({name:'cn', label:'Full Name'}).
- input({name:'displayname', label:'Display Name'}).
- input({name:'initials', label:'Initials'}),
- ipa_stanza({name:'account', label:'Account Details'}).
- input({name:'nsaccountlock', label:'Account Status',
- load:user_status_load}).
- input({name:'uid'}).
- input({name:'userpassword',
- load: user_password_load}).
- input({name:'uidnumber'}).
- input({name:'gidnumber', label:'GID'}).
- input({name:'loginshell'}).
- input({name:'homedirectory'}),
- ipa_stanza({name:'contact', label:'Contact Details'}).
- input({name:'mail'}).
- input({name:'telephonenumber'}).
- input({name:'pager'}).
- input({name:'mobile'}).
- input({name:'facsimiletelephonenumber'}),
- ipa_stanza({name:'address', label:'Mailing Address'}).
- input({name:'street'}).
- input({name:'location', label:'City'}).
- input({name:'state', label:'State', load:user_state_load}).
- input({name:'postalcode', label:'ZIP'}),
- ipa_stanza({name:'employee', label:'Employee Information'}).
- input({name:'ou', label:'Org. Unit'}).
- input({name:'manager', label:'Manager'}),
- ipa_stanza({name:'misc', label:'Misc. Information'}).
- input({name:'carlicense', label:'Car License'})
-]);
+function ipa_user(){
+ var that = ipa_entity({
+ name: 'user'
+ });
+ that.init = function() {
+ var search_facet = ipa_search_facet({
+ 'name': 'search',
+ 'label': 'Search',
+ entity_name: that.name
+ });
+ search_facet.create_column({name:'cn'});
+ search_facet.create_column({name:'uid'});
+ search_facet.create_column({name:'uidnumber'});
+ search_facet.create_column({name:'mail'});
+ search_facet.create_column({name:'telephonenumber'});
+ search_facet.create_column({name:'title'});
+ that.add_facet(search_facet);
+
+
+ that.add_facet(details_facet({name:'details',label:'Details'}));
+
+ var dialog = ipa_add_dialog({
+ 'name': 'add',
+ 'title': 'Add User'
+ });
+
+ that.add_dialog(dialog);
+ dialog.init();
+ dialog.add_field(ipa_text_widget({ name: 'uid',entity_name:'user' }));
+ dialog.add_field(ipa_text_widget({ name: 'givenname',
+ entity_name:'user' }));
+ dialog.add_field(ipa_text_widget({ name: 'sn',entity_name:'user' }));
+
+ /*eventually, we need to call
+ entity.create_association_facets();
+ but we are currently defining the associator using the global
+ function after the registration of the entity */
+
+
+ that.entity_init();
+ }
+
+ function details_facet(spec) {
+ spec = spec || {};
+ var that = ipa_details_facet(spec);
+
+ var sections =[
+ ipa_stanza({name:'identity', label:'Identity Details'}).
+ input({name:'title'}).
+ input({name:'givenname'}).
+ input({name:'sn'}).
+ input({name:'cn'}).
+ input({name:'displayname'}).
+ input({name:'initials'}),
+ ipa_stanza({name:'account', label:'Account Details'}).
+ input({name:'nsaccountlock', load:user_status_load}).
+ input({name:'uid'}).
+ input({name:'userpassword', load: user_password_load}).
+ input({name:'uidnumber'}).
+ input({name:'gidnumber'}).
+ input({name:'loginshell'}).
+ input({name:'homedirectory'}),
+ ipa_stanza({name:'contact', label:'Contact Details'}).
+ input({name:'mail'}).
+ input({name:'telephonenumber'}).
+ input({name:'pager'}).
+ input({name:'mobile'}).
+ input({name:'facsimiletelephonenumber'}),
+ ipa_stanza({name:'address', label:'Mailing Address'}).
+ input({name:'street'}).
+ input({name:'location'}).
+ input({name:'state', load:user_state_load}).
+ input({name:'postalcode'}),
+ ipa_stanza({name:'employee', label:'Employee Information'}).
+ input({name:'ou', label:'Org. Unit'}).
+ input({name:'manager'}),
+ ipa_stanza({name:'misc', label:'Misc. Information'}).
+ input({name:'carlicense'})
+ ];
+ for (var i = 0; i < sections.length; i += 1){
+ that.add_section(sections[i]);
+ }
+ return that;
+ }
+ return that;
+}
+IPA.add_entity(ipa_user());
ipa_entity_set_association_definition('user', {
'group': { associator: 'serial' },
'netgroup': { associator: 'serial' },
- 'rolegroup': { associator: 'serial' },
- 'taskgroup': { associator: 'serial' }
});
-
-
-
-
/* ATTRIBUTE CALLBACKS */
diff --git a/install/static/widget.js b/install/static/widget.js
index 429773ef0..02759992e 100755
--- a/install/static/widget.js
+++ b/install/static/widget.js
@@ -28,10 +28,18 @@ function ipa_widget(spec) {
that.id = spec.id;
that.name = spec.name;
- that.label = spec.label;
+ that.label = spec.label ;
that.read_only = spec.read_only;
that._entity_name = spec.entity_name;
+ if (spec.entity_name && ! spec.label){
+ var param_info = ipa_get_param_info(spec.entity_name, spec.name);
+ if (param_info){
+ that.label = param_info.label;
+ }
+ }
+
+
that.width = spec.width;
that.height = spec.height;