diff options
author | Endi S. Dewata <edewata@redhat.com> | 2011-06-13 16:18:48 -0500 |
---|---|---|
committer | Adam Young <ayoung@redhat.com> | 2011-06-15 19:46:56 -0400 |
commit | 82fbfbd773fb6b97ad30852c4692148fb9575b39 (patch) | |
tree | e782fbec279e238a4db9fab1bfd9f37e9481b31e | |
parent | 17dccbdeccc037886b7d3335343a967df72555e8 (diff) | |
download | freeipa-82fbfbd773fb6b97ad30852c4692148fb9575b39.tar.gz freeipa-82fbfbd773fb6b97ad30852c4692148fb9575b39.tar.xz freeipa-82fbfbd773fb6b97ad30852c4692148fb9575b39.zip |
Fixed paging for indirect members.
Since ticket #1273 has been fixed, the indirect members can be shown
using the regular association facet which supports paging.
-rw-r--r-- | install/ui/associate.js | 60 | ||||
-rw-r--r-- | install/ui/entity.js | 10 |
2 files changed, 1 insertions, 69 deletions
diff --git a/install/ui/associate.js b/install/ui/associate.js index 3a90f260e..2115e0fe1 100644 --- a/install/ui/associate.js +++ b/install/ui/associate.js @@ -1092,63 +1092,3 @@ IPA.association_facet = function (spec) { return that; }; - -IPA.indirect_association_facet = function (spec) { - - spec = spec || {}; - - spec.page_length = 0; - spec.read_only = true; - - var that = IPA.association_facet(spec); - - that.refresh = function() { - - function on_success(data, text_status, xhr) { - - that.table.empty(); - - var count = data.result.count; - if (count === 0) { - that.table.summary.text(data.result.summary); - return; - } - - var results = data.result.result; - for (var i=0; i<results.length; i++) { - var record = results[i]; - that.table.add_record(record); - } - - if (data.result.truncated) { - var message = IPA.messages.search.truncated; - message = message.replace('${counter}', data.result.count); - that.table.summary.text(message); - } else { - that.table.summary.text(data.result.summary); - } - } - - var options = { - 'all': true - }; - - var pkey = $.bbq.getState(that.entity_name+'-pkey'); - - /* TODO: make a general solution to generate this value */ - var relationship_filter = 'in_' + that.entity_name; - options[relationship_filter] = pkey; - - var command = IPA.command({ - entity: that.other_entity, - method: 'find', - options: options, - on_success: on_success, - on_error: that.on_error - }); - - command.execute(); - }; - - return that; -}; diff --git a/install/ui/entity.js b/install/ui/entity.js index 107c3c4d4..599bd2eec 100644 --- a/install/ui/entity.js +++ b/install/ui/entity.js @@ -812,15 +812,7 @@ IPA.entity_builder = function(){ } } - var factory = spec.factory; - if (!factory) { - if (spec.facet_group == 'memberindirect') { - factory = IPA.indirect_association_facet; - } else { - factory = IPA.association_facet; - } - } - + var factory = spec.factory || IPA.association_facet; facet = factory(spec); entity.add_facet(facet); |