fix: use the multichoices for ttl in remote data form (#2599)

This commit is contained in:
Yohan Boniface 2025-04-04 18:49:23 +02:00 committed by GitHub
commit 34e4955891
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -130,15 +130,7 @@ export class MutatingForm extends Form {
}
for (const [key, defaults] of Object.entries(SCHEMA)) {
const properties = Object.assign({}, defaults)
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 if (properties.type === Array) {
if (properties.type === Array) {
properties.handler = 'CheckBoxes'
} else if (properties.choices) {
const text_length = properties.choices.reduce(
@ -153,6 +145,14 @@ export class MutatingForm extends Form {
properties.handler = 'Select'
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 {
switch (key) {
case 'color':