From a5918fbd136d1b597e30629f66a3d69d567737f3 Mon Sep 17 00:00:00 2001 From: Pavel Vomacka Date: Fri, 26 Aug 2016 12:50:00 +0200 Subject: [PATCH] Add support for additional options taken from table facet Sometimes the entity_show command must be called with options which are gathered from result of entity_find command. These options needs to be passed as arguments in URL which points to details page. This functionality is implemented to table facet. There is new property 'additional_navigation_arguments' which is prepared for array of attributes which will be passed to URL. Part of: https://fedorahosted.org/freeipa/ticket/6238 Reviewed-By: Petr Vobornik --- install/ui/src/freeipa/facet.js | 49 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/install/ui/src/freeipa/facet.js b/install/ui/src/freeipa/facet.js index 4553c5c65e6c334ed451e9c2f1a89ddc455d71c3..06eca189fa2c7b125fdfbd964e6192ddf709b2c8 100644 --- a/install/ui/src/freeipa/facet.js +++ b/install/ui/src/freeipa/facet.js @@ -1819,6 +1819,15 @@ exp.table_facet = IPA.table_facet = function(spec, no_init) { var that = IPA.facet(spec, no_init); /** + * Names of additional row attributes which will be send to another facet + * during navigation as URL parameters. + * + * @property {Array} + */ + that.additional_navigation_arguments = spec.additional_navigation_arguments; + + + /** * Entity of data displayed in the table * @property {entity.entity} */ @@ -2268,6 +2277,38 @@ exp.table_facet = IPA.table_facet = function(spec, no_init) { /** + * Extract data from command response and return them. + * + * @param pkey {string} primary key of row which is chosen + * @param attrs {Array} names of attributes which will be extracted + */ + that.get_row_attribute_values = function(key, attrs) { + var result = that.data.result.result; + var options = {}; + var row; + + if (result) { + for (var i=0, l=result.length; i