summaryrefslogtreecommitdiffstats
path: root/install/ui/details.js
diff options
context:
space:
mode:
authorAdam Young <ayoung@redhat.com>2011-05-06 17:04:09 -0400
committerAdam Young <ayoung@redhat.com>2011-05-26 14:53:40 -0400
commit1636d649264348526012b1f699284ad728e8a43d (patch)
treed65f7427070871b8a50ab3dbf4b8bfab65530da6 /install/ui/details.js
parent5288bdb79ae7602cb72a735fad0c8b6e62a48df0 (diff)
downloadfreeipa-1636d649264348526012b1f699284ad728e8a43d.tar.gz
freeipa-1636d649264348526012b1f699284ad728e8a43d.tar.xz
freeipa-1636d649264348526012b1f699284ad728e8a43d.zip
automount UI
automount implemented using standard facets and containing_entity pkey generation sample data fixtures for automount. messages for automount and HBAC. modified form of the search facet used to nest the automount entities Add works for nested entities. Delete works for all but keys. Since the API for this is going to change, I'm not going to fix it pre-checkin. All the places the PKEY prefix is needed uses a single function. Added breadcrumb trail into title. update ipa_init sample data add redirect logic for pages without pkeys. add and delete link to appropriate entities for nested search facet. Using on demand entities. Fixed breadcrumbs.
Diffstat (limited to 'install/ui/details.js')
-rw-r--r--install/ui/details.js41
1 files changed, 30 insertions, 11 deletions
diff --git a/install/ui/details.js b/install/ui/details.js
index ee5b55545..a62b97fbd 100644
--- a/install/ui/details.js
+++ b/install/ui/details.js
@@ -310,13 +310,26 @@ IPA.details_facet = function(spec) {
}
};
- that.get_primary_key = function() {
- var pkey_name = IPA.metadata.objects[that.entity_name].primary_key;
- if (that.record[pkey_name] instanceof Array){
- return that.record[pkey_name][0];
+ /* the primary key used for show and update is built as an array.
+ for most entities, this will be a single element long, but for some
+ it requires the containing entities primary keys as well.*/
+ that.get_primary_key = function(from_url) {
+
+ var pkey = IPA.get_entity(that.entity_name).get_primary_key_prefix();
+
+ if (from_url){
+ pkey.push(that.pkey);
}else{
- return that.record[pkey_name];
+ var pkey_name = IPA.metadata.objects[that.entity_name].primary_key;
+ var pkey_val = that.record[pkey_name];
+ if (pkey_val instanceof Array){
+ pkey.push( pkey_val[0]);
+ }else{
+ pkey.push(pkey_val);
+ }
}
+
+ return pkey;
};
that.create_header = function(container) {
@@ -577,9 +590,7 @@ IPA.details_facet = function(spec) {
}
}
- var pkey = that.get_primary_key();
-
- var args = pkey ? [pkey] : [];
+ var args = that.get_primary_key();
var command = IPA.command({
entity: entity_name,
@@ -597,7 +608,7 @@ IPA.details_facet = function(spec) {
that.refresh = function() {
- that.pkey = $.bbq.getState(that.entity_name + '-pkey', true) ;
+ that.pkey = $.bbq.getState(that.entity_name + '-pkey', true) || '';
var command = IPA.command({
entity: that.entity_name,
@@ -609,9 +620,17 @@ IPA.details_facet = function(spec) {
IPA.details_refresh_devel_hook(that.entity_name,command,that.pkey);
}
-
if (that.pkey){
- command.args = [that.pkey];
+ command.args = that.get_primary_key(true);
+ }else if (that.entity.redirect_facet) {
+ var current_entity = that.entity;
+ while (current_entity.containing_entity){
+ current_entity = current_entity.containing_entity;
+ }
+ IPA.nav.show_page(
+ current_entity.name,
+ that.entity.redirect_facet);
+ return;
}
command.on_success = function(data, text_status, xhr) {