Commit 894e2d5c authored by Ayush Tiwari's avatar Ayush Tiwari

bt5_config: Input and output data for the gadget field should be same

parent 4ebad852
import json import json
# Load the JSON value for item_path_list # Load the JSON value for item_path_list
item_path_list = json.loads(item_path_list) item_path_list = [l[0] for l in json.loads(item_path_list)]
context.log(item_path_list)
kwargs = { kwargs = {
'checkNeeded': check_needed, 'checkNeeded': check_needed,
......
...@@ -3,6 +3,4 @@ import json ...@@ -3,6 +3,4 @@ import json
# Get the path list which has been changed/modified in Business Manager # Get the path list which has been changed/modified in Business Manager
changed_path_list = context.getParentValue().rebuildBusinessManager(context)[1] changed_path_list = context.getParentValue().rebuildBusinessManager(context)[1]
return json.dumps({ return json.dumps(changed_path_list)
'item_path_list': changed_path_list,
})
...@@ -86,13 +86,15 @@ ...@@ -86,13 +86,15 @@
rJS(window) rJS(window)
.declareMethod('render', function (options) { .declareMethod('render', function (options) {
var parameter_dict = JSON.parse(options.value), var item_path_list = JSON.parse(options.couscous),
item_path_list = parameter_dict.item_path_list,
html_tree = buildTreeHTML('tree', convertPathListToTree(item_path_list)), html_tree = buildTreeHTML('tree', convertPathListToTree(item_path_list)),
state_dict = { state_dict = {
key: options.key key: options.key,
value: options.value,
couscous: options.couscous
}; };
this.item_path_list = item_path_list;
this.element.innerHTML = html_tree; this.element.innerHTML = html_tree;
return this.changeState(state_dict); return this.changeState(state_dict);
}) })
...@@ -165,13 +167,17 @@ ...@@ -165,13 +167,17 @@
// Filter all paths except for those 'Unchanged' // Filter all paths except for those 'Unchanged'
for (i = 0; i < checkedInputList.length; ++i) { for (i = 0; i < checkedInputList.length; ++i) {
nextLabelElement = checkedInputList[i].nextElementSibling; nextLabelElement = checkedInputList[i].nextElementSibling;
var path_state = [];
if (nextLabelElement.className !== "Unchanged") { if (nextLabelElement.className !== "Unchanged") {
path_list.push(nextLabelElement.dataset.path); path_state.push(nextLabelElement.dataset.path);
path_state.push(nextLabelElement.className);
path_list.push(path_state);
} }
} }
this.state.value = JSON.stringify(path_list);
result[this.state.key] = this.state.value;
result[this.state.key] = JSON.stringify(path_list); return result
return result;
}); });
}(rJS, jIO, Handlebars, RSVP, window)); }(rJS, jIO, Handlebars, RSVP, window));
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment