fix: use the multichoices for ttl in remote data form

This commit is contained in:
David Larlet 2025-04-04 11:19:48 -04:00 committed by Yohan Boniface
parent 90bbc72320
commit 862f19ee43

View file

@ -130,15 +130,7 @@ export class MutatingForm extends Form {
} }
for (const [key, defaults] of Object.entries(SCHEMA)) { for (const [key, defaults] of Object.entries(SCHEMA)) {
const properties = Object.assign({}, defaults) const properties = Object.assign({}, defaults)
if (properties.type === Boolean) { if (properties.type === Array) {
if (properties.nullable) properties.handler = 'NullableChoices'
else properties.handler = 'Switch'
} else if (properties.type === 'Text') {
properties.handler = 'Textarea'
} else if (properties.type === Number) {
if (properties.step) properties.handler = 'Range'
else properties.handler = 'IntInput'
} else if (properties.type === Array) {
properties.handler = 'CheckBoxes' properties.handler = 'CheckBoxes'
} else if (properties.choices) { } else if (properties.choices) {
const text_length = properties.choices.reduce( const text_length = properties.choices.reduce(
@ -153,6 +145,14 @@ export class MutatingForm extends Form {
properties.handler = 'Select' properties.handler = 'Select'
properties.selectOptions = properties.choices properties.selectOptions = properties.choices
} }
} else if (properties.type === Boolean) {
if (properties.nullable) properties.handler = 'NullableChoices'
else properties.handler = 'Switch'
} else if (properties.type === 'Text') {
properties.handler = 'Textarea'
} else if (properties.type === Number) {
if (properties.step) properties.handler = 'Range'
else properties.handler = 'IntInput'
} else { } else {
switch (key) { switch (key) {
case 'color': case 'color':