Merge pull request #9528 from Budibase/fix/qr-field-type-parsing
Parse field type configuration for invalid characters
This commit is contained in:
commit
368e97f124
|
@ -56,7 +56,7 @@ const componentMap = {
|
||||||
"field/link": FormFieldSelect,
|
"field/link": FormFieldSelect,
|
||||||
"field/array": FormFieldSelect,
|
"field/array": FormFieldSelect,
|
||||||
"field/json": FormFieldSelect,
|
"field/json": FormFieldSelect,
|
||||||
"field/barcode/qr": FormFieldSelect,
|
"field/barcodeqr": FormFieldSelect,
|
||||||
// Some validation types are the same as others, so not all types are
|
// Some validation types are the same as others, so not all types are
|
||||||
// explicitly listed here. e.g. options uses string validation
|
// explicitly listed here. e.g. options uses string validation
|
||||||
"validation/string": ValidationEditor,
|
"validation/string": ValidationEditor,
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
const getOptions = (schema, type) => {
|
const getOptions = (schema, type) => {
|
||||||
let entries = Object.entries(schema ?? {})
|
let entries = Object.entries(schema ?? {})
|
||||||
let types = []
|
let types = []
|
||||||
if (type === "field/options" || type === "field/barcode/qr") {
|
if (type === "field/options") {
|
||||||
// allow options to be used on both options and string fields
|
// allow options to be used on both options and string fields
|
||||||
types = [type, "field/string"]
|
types = [type, "field/string"]
|
||||||
} else {
|
} else {
|
||||||
|
@ -35,6 +35,7 @@
|
||||||
types = types.map(type => type.slice(type.indexOf("/") + 1))
|
types = types.map(type => type.slice(type.indexOf("/") + 1))
|
||||||
|
|
||||||
entries = entries.filter(entry => types.includes(entry[1].type))
|
entries = entries.filter(entry => types.includes(entry[1].type))
|
||||||
|
|
||||||
return entries.map(entry => entry[0])
|
return entries.map(entry => entry[0])
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -3241,7 +3241,7 @@
|
||||||
},
|
},
|
||||||
"settings": [
|
"settings": [
|
||||||
{
|
{
|
||||||
"type": "field/barcode/qr",
|
"type": "field/barcodeqr",
|
||||||
"label": "Field",
|
"label": "Field",
|
||||||
"key": "field",
|
"key": "field",
|
||||||
"required": true
|
"required": true
|
||||||
|
|
Loading…
Reference in New Issue