Commit 6a6e709f authored by Cédric Le Ninivin's avatar Cédric Le Ninivin Committed by Titouan Soulard

erp5_json_form: react jsonschema form gadget use typeof to be compatible with firefox 68

parent 68ee2dab
...@@ -28,7 +28,7 @@ function makeUiSchema(schema, uiSchema, visited) { ...@@ -28,7 +28,7 @@ function makeUiSchema(schema, uiSchema, visited) {
for (const [key, value] of Object.entries(schema.properties)) { for (const [key, value] of Object.entries(schema.properties)) {
uiSchema[key] = {}; uiSchema[key] = {};
if (value.default && !(value.default instanceof Object)) { if (value.default && !(value.default instanceof Object)) {
if (value?.type === 'string' && value.const === undefined) { if (typeof(value) === 'string' && value.const === undefined) {
uiSchema[key]['ui:placeholder'] = value.default; uiSchema[key]['ui:placeholder'] = value.default;
} }
if (value.const === undefined) { if (value.const === undefined) {
...@@ -43,7 +43,7 @@ function makeUiSchema(schema, uiSchema, visited) { ...@@ -43,7 +43,7 @@ function makeUiSchema(schema, uiSchema, visited) {
if (value.textarea) { if (value.textarea) {
uiSchema[key]["ui:widget"] = "textarea" uiSchema[key]["ui:widget"] = "textarea"
} }
if (value?.type === 'object') { if (typeof(value) === 'object') {
makeUiSchema(value, uiSchema[key], visited); makeUiSchema(value, uiSchema[key], visited);
} }
for (const oneOf of value.oneOf || []) { for (const oneOf of value.oneOf || []) {
......
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