WebUI: Add possibility to turn of autoload when details.load is called

When field on details facet has set 'autoload_value' to false, then it won't
be loaded using that.load method of details facet. That means that field
might stay unchanged even that loading of data was performed.

Part of: https://pagure.io/freeipa/issue/6601

Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
This commit is contained in:
Pavel Vomacka 2017-03-07 21:28:32 +01:00 committed by David Kupka
parent 0c7ca279c7
commit 6be32edde0
2 changed files with 10 additions and 1 deletions

View File

@ -743,7 +743,8 @@ exp.details_facet = IPA.details_facet = function(spec, no_init) {
var fields = that.fields.get_fields();
for (var i=0; i<fields.length; i++) {
var field = fields[i];
field.load(data);
if (field.autoload_value) field.load(data);
}
that.policies.post_load(data);
that.post_load.notify([data], that);

View File

@ -195,6 +195,14 @@ field.field = IPA.field = function(spec) {
*/
that.required = spec.required;
/**
* Turns off loading value from command output on details pages.
* Used in certmap_match.
* @property {boolean}
*/
that.autoload_value = spec.autoload_value === undefined ? true :
spec.autoload_value;
/**
* read_only is set when widget is created
* @readonly