mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2026-08-10 04:58:03 -05:00
webui: fix detection of RPC command
old detection did not work with the static version used for test and demonstration purposes. https://fedorahosted.org/freeipa/ticket/4357 Reviewed-By: Endi Sukma Dewata <edewata@redhat.com>
This commit is contained in:
@@ -775,8 +775,8 @@ field.Adapter = declare(null, {
|
||||
get_record: function(data) {
|
||||
|
||||
// detection if it's result or raw RPC command response
|
||||
// all raw responses should contain `version` and `principal`
|
||||
if (!data.version || !data.principal) {
|
||||
// each RPC response should define properties as follows
|
||||
if (data.id === undefined || data.result === undefined || data.error === undefined) {
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
@@ -229,10 +229,10 @@ var get_visible_rows = function(section) {
|
||||
|
||||
|
||||
test("Testing type target.", function() {
|
||||
var data = {};
|
||||
data.result = {};
|
||||
data.result.result = {
|
||||
type: 'hostgroup'
|
||||
var data = {
|
||||
id: null,
|
||||
error: null,
|
||||
result: { result: { type: 'hostgroup'} }
|
||||
};
|
||||
|
||||
target_facet.load(data);
|
||||
@@ -266,10 +266,10 @@ test("Testing type target.", function() {
|
||||
|
||||
test("Testing general target.", function() {
|
||||
|
||||
var data = {};
|
||||
data.result = {};
|
||||
data.result.result = {
|
||||
extratargetfilter: 'somevalue'
|
||||
var data = {
|
||||
id: null,
|
||||
error: null,
|
||||
result: { result: { extratargetfilter: 'hostgroup'} }
|
||||
};
|
||||
|
||||
target_facet.load(data);
|
||||
|
||||
Reference in New Issue
Block a user