-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
loading: false
values are lost
#17
Comments
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
I had a go at fixing the bug in brutusin/json-forms today. I did find the bug and it would be possible to fork the library and fix the bug for us, but that would probably be more work than switching to another library as we're planning anyway (datenanfragen/website#561). For the record, here's what I found:
That doesn't seem worth, especially since I'm not exactly confident in the quality of the library after looking at its code (did I mention the glaring XSS vuln that even the simplest automated scanner could spot?). |
For the record, should anyone want to dig into this further, here's how I got a working dev env for brutusin/json-forms: You can't build the library with a modern version of Node. I switched to Node 8 using nvm ( Then, install the dependencies using The library is built using gulp (oh, "fun" memories). I used Here's the MRE test page I used: <!DOCTYPE html>
<html>
<body>
<div id="form"></div>
<button id="submit">Log data</button>
<script type="module">
require('../dist/js/brutusin-json-forms.min.js');
const schema = {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"mybool": {
"type": "boolean",
"default": true
},
"my-bool": {
"type": "boolean",
},
"mybool2": {
"type": "boolean",
},
"my-array": {
"type": "array",
"items": {
"type": "object",
"properties": {
"my-bool": {
"type": "boolean",
}
},
}
},
},
};
const initialData = {
"mybool": true,
"my-bool": false,
"mybool2": true,
"my-array": [
{
"my-bool": false
}
]
};
const BrutusinForms = brutusin['json-forms'];
bf = BrutusinForms.create(schema);
bf.render(document.getElementById('form'), initialData);
document.getElementById('submit').addEventListener('click', () => {
console.log(JSON.stringify(bf.getData(), null, 2));
});
</script>
</body>
</html> I put that into a new folder, switched back to modern Node for that folder and built it using |
E.g. click on the "Edit" link in datenanfragen/data#946
It contains some
"optional": false
s. But they are not picked up by the cjg:Seems to be a bug in
brutusin-json-forms
and not in our code.. But still quite annoying.The text was updated successfully, but these errors were encountered: