summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--install/ui/src/freeipa/entity.js23
-rw-r--r--install/ui/src/freeipa/facet.js2
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<facet_groups.length; i++) {