diff options
Diffstat (limited to 'install/ui/src/freeipa/entity.js')
-rw-r--r-- | install/ui/src/freeipa/entity.js | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/install/ui/src/freeipa/entity.js b/install/ui/src/freeipa/entity.js index 1896f9077..22efd47af 100644 --- a/install/ui/src/freeipa/entity.js +++ b/install/ui/src/freeipa/entity.js @@ -240,18 +240,23 @@ exp.entity_builder =IPA.entity_builder = function(entity) { ]; that.facet_group = function(spec) { - spec.entity = entity; - if (spec instanceof Object) { - var factory = spec.$factory || IPA.facet_group; - facet_group = factory(spec); - } else { - facet_group = IPA.facet_group({ name: spec }); - } - if (facet_group.label == undefined) { - facet_group.label = text.get('@i18n:facet_groups.'+facet_group.name); + if (typeof spec === 'string') { + spec = { name: spec }; } + var preop = function(spec) { + + spec.entity = entity; + spec.label = spec.label || '@i18n:facet_groups.'+spec.name; + return spec; + }; + + var facet_group = builder.build('', spec, {}, { + $factory: IPA.facet_group, + $pre_ops: [preop] + }); + entity.add_facet_group(facet_group); return that; |