Entity: allow definition of facet_groups in entity specs

https://fedorahosted.org/freeipa/ticket/3235
This commit is contained in:
Petr Vobornik
2013-04-18 13:53:54 +02:00
parent 2182c93e2f
commit 9255bb481e

View File

@@ -64,6 +64,7 @@ exp.entity = IPA.entity = function(spec) {
that.facets = $.ordered_map();
that.facet_groups = $.ordered_map();
that.facet_group_specs = spec.facet_groups;
that.facet_specs = spec.facets || [];
that.facets_created = false;
@@ -230,6 +231,13 @@ exp.entity_builder =IPA.entity_builder = function(entity) {
var facet = null;
var section = null;
that.default_facet_groups = [
'member',
'settings',
'memberof',
'managedby'
];
that.facet_group = function(spec) {
spec.entity = entity;
if (spec instanceof Object) {
@@ -442,12 +450,7 @@ exp.entity_builder =IPA.entity_builder = function(entity) {
return that.dialog(spec);
};
that.facet_groups([
'member',
'settings',
'memberof',
'managedby'
]);
that.facet_groups(entity.facet_group_specs || that.default_facet_groups);