diff options
author | Pavel Vomacka <pvomacka@redhat.com> | 2016-06-05 18:03:17 +0200 |
---|---|---|
committer | Petr Vobornik <pvoborni@redhat.com> | 2016-06-09 14:20:02 +0200 |
commit | 5a8ad3e9828c67e8ff9cc9dfc05458003f19c985 (patch) | |
tree | c97956fb4fd244a4fda2dfe2872c7bae56e04da2 /install/ui/src | |
parent | 740099cf0bc2762b6ea329385f6abd542d863c98 (diff) | |
download | freeipa-5a8ad3e9828c67e8ff9cc9dfc05458003f19c985.tar.gz freeipa-5a8ad3e9828c67e8ff9cc9dfc05458003f19c985.tar.xz freeipa-5a8ad3e9828c67e8ff9cc9dfc05458003f19c985.zip |
Add adapter attribute for choosing record
The new attribute of the adapter contains the name of record which will be
extracted from API call result.
Part of: https://fedorahosted.org/freeipa/ticket/5905
Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
Diffstat (limited to 'install/ui/src')
-rw-r--r-- | install/ui/src/freeipa/field.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/install/ui/src/freeipa/field.js b/install/ui/src/freeipa/field.js index fdf925e3d..12ef7f455 100644 --- a/install/ui/src/freeipa/field.js +++ b/install/ui/src/freeipa/field.js @@ -802,6 +802,13 @@ field.Adapter = declare(null, { result_index: 0, /** + * Name of the record which we want to extract from the result. + * Used in dnslocations. + * @type {String} + */ + result_name: 'result', + + /** * Extract record from RPC call response * * Tries to detect if supplied data is RPC call response if so, it @@ -821,10 +828,10 @@ field.Adapter = declare(null, { var dr = data.result; var record = null; if (dr) { - if (IPA.defined(dr.result)) record = dr.result; + if (IPA.defined(dr[this.result_name])) record = dr[this.result_name]; else if (dr.results) { var result = dr.results[this.result_index]; - if (result) record = result.result; + if (result) record = result[this.result_name]; } } return record; |