diff options
author | Pavel Vomacka <pvomacka@redhat.com> | 2016-10-05 10:27:19 +0200 |
---|---|---|
committer | Martin Basti <mbasti@redhat.com> | 2017-03-14 10:40:10 +0100 |
commit | 6d1374f7f82d144b8aa361e9e637c5388f8f7edb (patch) | |
tree | cab6dbbab46f3c83e588485f660f164e4b850a71 /install/ui/src/freeipa | |
parent | 93a7f4c88db159664664bd82d1d00e5e0033ac22 (diff) | |
download | freeipa-6d1374f7f82d144b8aa361e9e637c5388f8f7edb.tar.gz freeipa-6d1374f7f82d144b8aa361e9e637c5388f8f7edb.tar.xz freeipa-6d1374f7f82d144b8aa361e9e637c5388f8f7edb.zip |
Added optional option in refreshing after modifying association table
The 'refresh_option' of association field takes string. This string has to
correspond with field name on details page. In case that the field is present
the value of the field is passed to command as option in following format:
{fieldname: field_value}
Part of: https://fedorahosted.org/freeipa/ticket/5426
Reviewed-By: Martin Basti <mbasti@redhat.com>
Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
Diffstat (limited to 'install/ui/src/freeipa')
-rw-r--r-- | install/ui/src/freeipa/association.js | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/install/ui/src/freeipa/association.js b/install/ui/src/freeipa/association.js index 7954ddc4e..04b375a94 100644 --- a/install/ui/src/freeipa/association.js +++ b/install/ui/src/freeipa/association.js @@ -838,6 +838,15 @@ IPA.association_table_field = function (spec) { var that = IPA.field(spec); + /** + * In case that facet has a state attribute set this is the way how to user + * that attribute in refresh command as option in format: + * {attributename: attributevalue}. + * + * @property {String} + */ + that.refresh_attribute = spec.refresh_attribute || ''; + that.load = function(data) { that.values = that.adapter.load(data); that.widget.update(that.values); @@ -865,14 +874,19 @@ IPA.association_table_field = function (spec) { } var pkey = that.facet.get_pkey(); - rpc.command({ + var command = rpc.command({ entity: that.entity.name, method: 'show', args: [pkey], options: { all: true, rights: true }, on_success: on_success, on_error: on_error - }).execute(); + }); + + var additional_option = that.facet.state[that.refresh_attribute]; + if (additional_option) command.set_option(that.refresh_attribute, additional_option); + + command.execute(); }; that.widgets_created = function() { |