From 2e6e0698865e7d530c6ebf87a12e46f990ac1d87 Mon Sep 17 00:00:00 2001 From: Pavel Vomacka Date: Wed, 5 Oct 2016 11:52:10 +0200 Subject: [PATCH] Extend _show command after _find command in table facets Allow pagination to table facets which needs to call _show on all rows with additional parameter. 'show_command_additional_attr' can be set to any attribute from result of _find command. This attribute is taken with its value and added to options of _each command for each row. Part of: https://fedorahosted.org/freeipa/ticket/5426 Reviewed-By: Martin Basti Reviewed-By: Petr Vobornik --- install/ui/src/freeipa/facet.js | 42 +++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/install/ui/src/freeipa/facet.js b/install/ui/src/freeipa/facet.js index ab5af1ff9..bbd47b6f9 100644 --- a/install/ui/src/freeipa/facet.js +++ b/install/ui/src/freeipa/facet.js @@ -1846,6 +1846,14 @@ exp.table_facet = IPA.table_facet = function(spec, no_init) { */ that.search_all_entries = spec.search_all_entries; + /** + * Attribute from *_find command which will be used in batch *_show command + * which is called for each row. + * + * @property {String} + */ + that.show_command_additional_attr = spec.show_command_additional_attr || null; + /** * Member resolution(no_member: true ) in rpc request is skipped by default * to improve performance of getting data. @@ -2144,7 +2152,7 @@ exp.table_facet = IPA.table_facet = function(spec, no_init) { // get the complete records that.get_records( - records_map.keys, + records_map, function(data, text_status, xhr) { var results = data.result.results; for (var i=0; i