Commit 0f7979cc authored by Jérome Perrin's avatar Jérome Perrin

GUI: re-enable expandable fields

parent 3ff6cfe3
...@@ -130,7 +130,7 @@ ...@@ -130,7 +130,7 @@
default_value = properties_dict[sub_title].default; default_value = properties_dict[sub_title].default;
// find previous value if any // find previous value if any
if (gadget.props.options.value[prop_name]) { if (gadget.props.options.value && gadget.props.options.value[prop_name]) {
if (gadget.props.options.value[prop_name][sub_title] || if (gadget.props.options.value[prop_name][sub_title] ||
gadget.props.options.value[prop_name][sub_title] === "") { gadget.props.options.value[prop_name][sub_title] === "") {
previous_value = gadget.props.options.value[prop_name][sub_title]; previous_value = gadget.props.options.value[prop_name][sub_title];
...@@ -204,7 +204,15 @@ ...@@ -204,7 +204,15 @@
} }
} }
function handleSelectChange() { //evt) { function handleSelectChange() {
try {
return _handleSelectChange.bind(this)();
} catch (e) {
console.log("ERROR in handleSelectChange", e);
console.log(e.stack);
}
}
function _handleSelectChange() { //evt) {
console.log("UPDATING FIELDS DUE TO SELECTION CHANGE"); console.log("UPDATING FIELDS DUE TO SELECTION CHANGE");
var gadget = this, oneOf_list, i, var gadget = this, oneOf_list, i,
prop_name = gadget.props.definition.property_def.title, prop_name = gadget.props.definition.property_def.title,
...@@ -676,9 +684,9 @@ ...@@ -676,9 +684,9 @@
} }
console.log("thr r " + promise_list.length + " subgadget promises"); console.log("thr r " + promise_list.length + " subgadget promises");
return RSVP.all(promise_list); return RSVP.all(promise_list);
}) }).push(function() {
.push(function () { // XXX return is required so that we see errors, but it blocks everything
waitForListFieldSelection(gadget); /* return */ waitForListFieldSelection(gadget);
}); });
}); });
}(window, rJS, RSVP, Handlebars, initGadgetMixin, loopEventListener)); }(window, rJS, RSVP, Handlebars, initGadgetMixin, loopEventListener));
...@@ -42,7 +42,13 @@ ...@@ -42,7 +42,13 @@
property_id ) property_id )
}) })
); );
// use expandable field if we have a oneOf in the schema
if (property_definition.oneOf) {
property_definition = {
allOf: [{properties: property_definition.properties},
{ oneOf: property_definition.oneOf} ] };
return gadget.declareGadget("../expandable_field/index.html");
}
if (property_definition.type === "object") { if (property_definition.type === "object") {
// Create a recursive fieldset for this key. // Create a recursive fieldset for this key.
return gadget.declareGadget("../fieldset/index.html"); return gadget.declareGadget("../fieldset/index.html");
......
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