Closed satra closed 2 months ago
i'm not sure what the piece of code that i changed is doing, hence i need to study the implications a bit. in the meantime, this did not seem to break things (on initial eval).
Hi @satra, here is my 2 cents. From what I understand, your recent changes help with dropdowns and checkboxes accepting multiple options, but I encountered a new issue. When saving the response to this form:
The expected output should be:
"value": {
"first_name": "a",
"middle_name": "b",
"last_name": "ccccc"
}
However, the actual output is:
"value": {
"first_name": "a"
}
This is my first time touching the code of rephoschema
and I don't have a bigger picture of the code, but it seems that removing the if block entirely it resolves the problem without introducing new issues. Here's the block I'm referring to:
if (_.isObject(val) && !_.isArray(val) && !val.hasOwnProperty('unitCode') && !(val instanceof Blob)) {
const sectionItemKey = Object.keys(val)[0];
const sectionItemValue = Object.values(val)[0];
exportVal = sectionItemValue;
usedList.push(sectionItemKey);
isAboutUrl = sectionItemKey;
}
thanks @fabiocat93 - i think we have arrived at the same conclusion for now.
and the example you shared provides a clue to what should perhaps replace that block. i'll take a look. thank you.
closing in favor of #335
this PR attempts to fix the multiple choice selection issue that @ibevers faced.
i'm going to leave this as draft.
@ibevers - you'll need to add a github workflow and config in your repo like the nimh-minimal protocol to be able to use this committish for your UI.