mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-05 08:02:18 +00:00
improve schema reordering
This commit is contained in:
@@ -94,7 +94,25 @@
|
||||
resourceTypes = await getResourceTypes()
|
||||
}
|
||||
|
||||
reorder()
|
||||
loadResourceTypes()
|
||||
|
||||
function reorder() {
|
||||
if (schema?.order && Array.isArray(schema.order)) {
|
||||
const n = {}
|
||||
|
||||
;(schema.order as string[]).forEach((x) => {
|
||||
n[x] = schema.properties[x]
|
||||
})
|
||||
|
||||
Object.keys(schema.properties ?? {})
|
||||
.filter((x) => !schema.order?.includes(x))
|
||||
.forEach((x) => {
|
||||
n[x] = schema.properties[x]
|
||||
})
|
||||
schema.properties = n
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="w-full {clazz} {flexWrap ? 'flex flex-row flex-wrap gap-x-6 ' : ''}">
|
||||
|
||||
@@ -87,10 +87,12 @@
|
||||
resourceTypes = await getResourceTypes()
|
||||
}
|
||||
|
||||
reorder()
|
||||
loadResourceTypes()
|
||||
|
||||
$: schema && reorder()
|
||||
|
||||
function reorder() {
|
||||
console.log('reodering')
|
||||
if (schema?.order && Array.isArray(schema.order)) {
|
||||
const n = {}
|
||||
|
||||
@@ -104,6 +106,7 @@
|
||||
n[x] = schema.properties[x]
|
||||
})
|
||||
schema.properties = n
|
||||
keys = Object.keys(schema.properties ?? {})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user