diff --git a/install/ui/src/freeipa/details.js b/install/ui/src/freeipa/details.js index 87b355a63..d1f230527 100644 --- a/install/ui/src/freeipa/details.js +++ b/install/ui/src/freeipa/details.js @@ -538,6 +538,13 @@ exp.details_facet = IPA.details_facet = function(spec, no_init) { */ that.refresh_command_name = spec.refresh_command_name || 'show'; + /** + * Name of url argument which will be added to refresh RPC command as option. + * + * @property {string} + */ + that.refresh_attribute = spec.refresh_attribute || null; + /** * Name of update command * @@ -884,6 +891,23 @@ exp.details_facet = IPA.details_facet = function(spec, no_init) { } }; + /** + * Takes url argument which is named arg_name and its value. Creates object + * from this infromation {arg_name: arg_name_value} and attach it as option + * to command. + * + * @protected + * @param {rpc.command} command + * @param {string} argumnent name + */ + that.add_url_arg_to_command = function(command, arg_name) { + var additional_opt = {}; + command.options = command.options || {}; + + additional_opt[arg_name] = that.state[arg_name]; + $.extend(command.options, additional_opt); + }; + /** * Create update command based on field part of update info * @protected @@ -1034,6 +1058,10 @@ exp.details_facet = IPA.details_facet = function(spec, no_init) { command.args = that.get_pkeys(); } + if (that.refresh_attribute) { + that.add_url_arg_to_command(command, that.refresh_attribute); + } + return command; };