diff options
author | Adam Young <ayoung@redhat.com> | 2010-09-07 10:08:19 -0400 |
---|---|---|
committer | Adam Young <ayoung@redhat.com> | 2010-09-07 10:08:19 -0400 |
commit | dde15772700da41ec931bb55087fbec6f30fab55 (patch) | |
tree | 890bd7ecd8bb4d906c4b670b772b2a960c50f3c1 /install/static/group.js | |
parent | e93932b3235fc27b31a59c0cb77250acf15d3f31 (diff) | |
download | freeipa-dde15772700da41ec931bb55087fbec6f30fab55.tar.gz freeipa-dde15772700da41ec931bb55087fbec6f30fab55.tar.xz freeipa-dde15772700da41ec931bb55087fbec6f30fab55.zip |
associations
-Refactored the associations code into a set of objects that are configured by the entities
-Added support for associations that can be done in a single rpc
-hostgroup to host and group to user associations working
-Restructed sampledata so that the file is matched automatically by the RPC method name
-The new ipa_cmd/sampledata scheme insists on there being sample data for any commands or the ipa_command fails.
-Added sampledata files for all the calls we make
-renamed several of the sampledata files to match their rpc calls
-Started a pattern of refactoring where all the forms for the entity fall under a single object
Diffstat (limited to 'install/static/group.js')
-rw-r--r-- | install/static/group.js | 59 |
1 files changed, 40 insertions, 19 deletions
diff --git a/install/static/group.js b/install/static/group.js index 981e048b0..8c5491aec 100644 --- a/install/static/group.js +++ b/install/static/group.js @@ -1,10 +1,13 @@ function setupGroup(facet){ - if (facet == "details"){ - setupGroupDetails(); - }else if (facet == "add"){ - setupAddGroup(); + + if (groupForms[facet]){ + groupForms[facet].setup(); + }else if (facet == "details"){ + setupGroupDetails(); + }else if (facet == "add"){ + setupAddGroup(); }else{ - groupSearchForm.setup(); + groupForms.search.setup(); } } @@ -74,33 +77,26 @@ var group_details_list = ['description', 'Description'], ['gidnumber', 'Group ID']]]]; +var groupFacets=['details','users']; + function setupGroupDetails(group){ //re initialize global parse of parameters qs = ipa_parse_qs(); showDetails(); - + setupFacetNavigation('group',qs['pkey'],qs['facet'],groupFacets); ipa_details_init('group'); ipa_details_create(group_details_list, $('#details')); - ipa_details_load(qs['pkey'], on_win, null, "sampledata/groupshow.json"); + ipa_details_load(qs['pkey'], on_win, null); $('h1').text('Managing group: ' + group); } - - -function renderGroupDetails(group) -{ - -} - - function renderGroupDetailColumn(current,cell){ $("<a/>",{ - href:"#tab=group&facet=details&pkey="+current.cn, - html: ""+ current[this.column], - //click: function(){ setupGroupDetails(current.cn)}, + href:"#tab=group&facet=details&pkey="+current.cn, + html: ""+ current[this.column], }).appendTo(cell); } @@ -112,7 +108,32 @@ var groupSearchColumns = [ {title:"Description", column:"description",render: renderSimpleColumn} ]; -var groupSearchForm = new SearchForm("group", "find", groupSearchColumns ,"sampledata/grouplist.json"); +var groupForms = new GroupForms(); + +function GroupForms(){ + + this.userListColumns = [ {title:"user",column:"member_user" }]; + this.obj="group"; + this.users = new AssociationList( + this.obj, + "users", + "assignusers", + this.userListColumns, groupFacets ); + + this.assignusers = new AssociationForm( + this.obj, + "user", + "assignusers", + groupFacets, + "uid", + function(){ + return 'Add Users to group : ' + qs['pkey'] ; + }, + BulkAssociator); + this.search = new SearchForm("group", "find", groupSearchColumns ); + + +} |