diff --git a/install/ui/src/freeipa/association.js b/install/ui/src/freeipa/association.js index 03a358c60..d786bfd47 100644 --- a/install/ui/src/freeipa/association.js +++ b/install/ui/src/freeipa/association.js @@ -823,9 +823,8 @@ exp.association_facet_pre_op = function(spec, context) { return has_indirect; }; - var entity = context.entity; su.context_entity(spec, context); - spec.entity = entity; + var entity = reg.entity.get(spec.entity); var index = spec.name.lastIndexOf('_'); spec.attribute_member = spec.attribute_member || @@ -1298,8 +1297,8 @@ exp.association_facet = IPA.association_facet = function (spec, no_init) { */ exp.attribute_facet_pre_op = function(spec, context) { - var entity = context.entity; su.context_entity(spec, context); + var entity = reg.entity.get(spec.entity); spec.title = spec.title || entity.metadata.label_singular; spec.label = spec.label || entity.metadata.label_singular; diff --git a/install/ui/src/freeipa/details.js b/install/ui/src/freeipa/details.js index e428dc908..d18788e88 100644 --- a/install/ui/src/freeipa/details.js +++ b/install/ui/src/freeipa/details.js @@ -461,8 +461,8 @@ exp.facet_policies = IPA.facet_policies = function(spec) { */ exp.details_facet_pre_op = function(spec, context) { - var entity = context.entity; su.context_entity(spec, context); + var entity = reg.entity.get(spec.entity); spec.name = spec.name || 'details'; spec.title = spec.title || entity.metadata.label_singular; @@ -2019,7 +2019,8 @@ exp.register = function() { factory: IPA.details_facet, pre_ops: [ exp.details_facet_pre_op - ] + ], + spec: { name: 'details' } }); }; diff --git a/install/ui/src/freeipa/entity.js b/install/ui/src/freeipa/entity.js index eb2d98a55..461873400 100644 --- a/install/ui/src/freeipa/entity.js +++ b/install/ui/src/freeipa/entity.js @@ -299,6 +299,14 @@ exp.entity = IPA.entity = function(spec) { } }; + that.create_facet_type = function(facet_name) { + + // Keep names unique among all facets. + // Facets added later should also follow this pattern but it's not + // enforced. + return that.name + '_' + facet_name; + }; + /** * Get facet with given name. * @@ -315,13 +323,15 @@ exp.entity = IPA.entity = function(spec) { */ that.get_facet = function(name) { - var i, facets; + var i, l, facets; //build all facets on the first time if(!that.facets_created) { - facets = builder.build('facet', that.facet_specs, { entity: that }); - for (i=0; i