From fae658f50566558ebdc579c4451e7307a041b4ee Mon Sep 17 00:00:00 2001 From: Petr Vobornik Date: Mon, 3 Jun 2013 15:14:20 +0200 Subject: Fix regression: missing facet tab group labels Currently there is only empty space between facet tabs and facet title. It's a regression caused by recent refactoring. https://fedorahosted.org/freeipa/ticket/3688 --- install/ui/src/freeipa/entity.js | 23 ++++++++++++++--------- install/ui/src/freeipa/facet.js | 2 +- 2 files changed, 15 insertions(+), 10 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; diff --git a/install/ui/src/freeipa/facet.js b/install/ui/src/freeipa/facet.js index 80e867125..ad53b80f2 100644 --- a/install/ui/src/freeipa/facet.js +++ b/install/ui/src/freeipa/facet.js @@ -909,7 +909,7 @@ exp.facet_header = IPA.facet_header = function(spec) { if (!data) return; var result = data.result.result; if (!that.facet.disable_facet_tabs) { - var pkey = that.facet.pkey; + var pkey = that.facet.get_pkey(); var facet_groups = that.facet.entity.facet_groups.values; for (var i=0; i