mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-19 00:02:03 +00:00
fix: improve schema form handling of inconsistent order and properties
This commit is contained in:
@@ -175,9 +175,11 @@
|
||||
.forEach((x) => {
|
||||
n[x] = schema.properties[x]
|
||||
})
|
||||
schema.properties = n
|
||||
if (!deepEqual(schema.properties, n)) {
|
||||
schema.properties = n
|
||||
}
|
||||
}
|
||||
let nkeys = Object.keys(schema.properties ?? {})
|
||||
let nkeys = [...new Set(Object.keys(schema.properties ?? {}))]
|
||||
|
||||
if (!deepEqual(keys, nkeys)) {
|
||||
keys = nkeys
|
||||
@@ -221,20 +223,10 @@
|
||||
args = {}
|
||||
}
|
||||
})
|
||||
$effect.pre(() => {
|
||||
const newKeys = [
|
||||
...new Set(
|
||||
(Array.isArray(schema?.order)
|
||||
? schema?.order
|
||||
: Object.keys(schema?.properties ?? {})) as string[]
|
||||
)
|
||||
]
|
||||
|
||||
if (!deepEqual(keys, newKeys)) {
|
||||
keys = newKeys
|
||||
}
|
||||
})
|
||||
$effect.pre(() => {
|
||||
schema.order
|
||||
Object.keys(schema.properties ?? {})
|
||||
schema && (untrack(() => reorder()), (hidden = {}))
|
||||
})
|
||||
$effect.pre(() => {
|
||||
|
||||
Reference in New Issue
Block a user