summaryrefslogtreecommitdiffstats
path: root/install/ui/facet.js
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2012-08-02 17:37:12 +0200
committerMartin Kosek <mkosek@redhat.com>2012-08-14 08:09:43 +0200
commit5d2b0fecd57b18b647ff9f243196cf98ead2d9fd (patch)
tree3a990bedba331edbd7869e34c63213710fbb7df6 /install/ui/facet.js
parent7c99e2d6617a397e4f8f1185032e17b779245181 (diff)
downloadfreeipa.git-5d2b0fecd57b18b647ff9f243196cf98ead2d9fd.tar.gz
freeipa.git-5d2b0fecd57b18b647ff9f243196cf98ead2d9fd.tar.xz
freeipa.git-5d2b0fecd57b18b647ff9f243196cf98ead2d9fd.zip
Attribute facet
Created new type of facet: attribute facet. This facet is similar to association facet but it serves for displaying object's multivalued attributes which behaves like association attributes. It will serve as a basis for displaying group's externalmember attribute. https://fedorahosted.org/freeipa/ticket/2895
Diffstat (limited to 'install/ui/facet.js')
-rw-r--r--install/ui/facet.js16
1 files changed, 15 insertions, 1 deletions
diff --git a/install/ui/facet.js b/install/ui/facet.js
index 3f6d559e..267fc333 100644
--- a/install/ui/facet.js
+++ b/install/ui/facet.js
@@ -747,6 +747,8 @@ IPA.table_facet = function(spec, no_init) {
that.row_disabled_attribute = spec.row_disabled_attribute;
that.details_facet_name = spec.details_facet || 'default';
+ that.table_name = spec.table_name;
+
that.columns = $.ordered_map();
that.get_columns = function() {
@@ -1003,7 +1005,7 @@ IPA.table_facet = function(spec, no_init) {
that.table = IPA.table_widget({
'class': 'content-table',
- name: entity.metadata.primary_key,
+ name: that.table_name || entity.metadata.primary_key,
label: entity.metadata.label,
entity: entity,
pagination: true,
@@ -1125,6 +1127,7 @@ IPA.facet_builder = function(entity) {
that.prepare_methods.nested_search = that.prepare_nested_search_spec;
that.prepare_methods.details = that.prepare_details_spec;
that.prepare_methods.association = that.prepare_association_spec;
+ that.prepare_methods.attribute = that.prepare_attribute_spec;
}
that.build_facets = function() {
@@ -1195,6 +1198,17 @@ IPA.facet_builder = function(entity) {
return spec;
};
+ that.prepare_attribute_spec = function(spec) {
+ spec.title = spec.title || entity.metadata.label_singular;
+ spec.label = spec.label || entity.metadata.label_singular;
+
+ var attr_metadata = IPA.get_entity_param(entity.name, spec.attribute);
+ spec.tab_label = spec.tab_label || attr_metadata.label;
+ spec.factory = spec.factory || IPA.attribute_facet;
+
+ return spec;
+ };
+
that.prepare_association_spec = function(spec) {
spec.entity = entity;