summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Young <ayoung@redhat.com>2011-01-31 19:17:39 -0500
committerEndi S. Dewata <edewata@redhat.com>2011-01-31 20:42:09 -0500
commita7e89190fae68633ecfe0c0d8c5d7702b123c0fd (patch)
tree8522ab90133f155b0664e765bc1a7b01a05699c0
parent41abde260411f79447c8af633523182b9d7ef7d6 (diff)
downloadfreeipa.git-a7e89190fae68633ecfe0c0d8c5d7702b123c0fd.tar.gz
freeipa.git-a7e89190fae68633ecfe0c0d8c5d7702b123c0fd.tar.xz
freeipa.git-a7e89190fae68633ecfe0c0d8c5d7702b123c0fd.zip
association fixes
PLaces custom association facets into the proper facet groups usesthe associators if they are specifiedfor an association
-rw-r--r--install/ui/associate.js3
-rw-r--r--install/ui/entity.js35
2 files changed, 29 insertions, 9 deletions
diff --git a/install/ui/associate.js b/install/ui/associate.js
index 9fc90723..bdb10337 100644
--- a/install/ui/associate.js
+++ b/install/ui/associate.js
@@ -699,8 +699,9 @@ IPA.association_facet = function (spec) {
var relationships = IPA.metadata[that.entity_name].relationships;
var relationship = relationships[that.attribute_member];
- if (!relationship)
+ if (!relationship){
relationship = ['', '', ''];
+ }
/* TODO: I18N and some generic handling of different relationships */
var header_message = '';
diff --git a/install/ui/entity.js b/install/ui/entity.js
index 7f195a14..82af8234 100644
--- a/install/ui/entity.js
+++ b/install/ui/entity.js
@@ -180,13 +180,36 @@ IPA.entity = function (spec) {
that.entity_name, other_entity);
}
- return IPA.association_facet({
- 'name': attribute_member+'_'+other_entity,
+ var association_name= attribute_member+'_'+other_entity;
+
+ //TODO remove from the facets and facets_by_name collections
+ var facet = that.get_facet(association_name);
+ if (facet){
+ facet.facet_group = facet_group;
+ facet.attribute_member = attribute_member;
+ return;
+ }
+
+ var config = that.get_association(other_entity);
+ if (!config){
+ config = that.get_association(association_name);
+ }
+
+ var spec ={
+ 'name': association_name,
'label': label,
'other_entity': other_entity,
'facet_group': facet_group,
'attribute_member': attribute_member
- });
+ };
+
+ if (config){
+ spec.associator = config.associator;
+ }
+
+ facet = IPA.association_facet(spec);
+
+ that.add_facet(facet);
};
that.create_association_facets = function() {
@@ -214,12 +237,8 @@ IPA.entity = function (spec) {
relationship = ['Member', '', 'no_'];
var facet_group = relationship[0];
- var facet = that.create_association_facet(
+ that.create_association_facet(
attribute_member, other_entity, label, facet_group);
-
- if (that.get_facet(facet.name)) continue;
-
- that.add_facet(facet);
}
}
return that;