mirror of
https://github.com/umap-project/umap.git
synced 2025-04-29 03:42:37 +02:00
fix: do not modify schema while iterating on it
This commit is contained in:
parent
815ff046ff
commit
6793a6bdc7
1 changed files with 5 additions and 4 deletions
|
@ -142,13 +142,14 @@ export class MutatingForm extends Form {
|
||||||
slugKey: 'PropertyInput',
|
slugKey: 'PropertyInput',
|
||||||
labelKey: 'PropertyInput',
|
labelKey: 'PropertyInput',
|
||||||
}
|
}
|
||||||
for (const [key, schema] of Object.entries(SCHEMA)) {
|
for (const [key, definition] of Object.entries(SCHEMA)) {
|
||||||
if (schema.type === Boolean) {
|
const schema = Utils.CopyJSON(definition)
|
||||||
|
if (definition.type === Boolean) {
|
||||||
if (schema.nullable) schema.handler = 'NullableChoices'
|
if (schema.nullable) schema.handler = 'NullableChoices'
|
||||||
else schema.handler = 'Switch'
|
else schema.handler = 'Switch'
|
||||||
} else if (schema.type === 'Text') {
|
} else if (definition.type === 'Text') {
|
||||||
schema.handler = 'Textarea'
|
schema.handler = 'Textarea'
|
||||||
} else if (schema.type === Number) {
|
} else if (definition.type === Number) {
|
||||||
if (schema.step) schema.handler = 'Range'
|
if (schema.step) schema.handler = 'Range'
|
||||||
else schema.handler = 'IntInput'
|
else schema.handler = 'IntInput'
|
||||||
} else if (schema.choices) {
|
} else if (schema.choices) {
|
||||||
|
|
Loading…
Reference in a new issue