mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-21 16:02:28 +00:00
fix: make submit form order static
This commit is contained in:
@@ -167,7 +167,6 @@
|
||||
(schemaStripped = stripSchema(fields, $stateId))
|
||||
|
||||
function stripSchema(inputs: AppInputs, s: any): Schema {
|
||||
console.log('Strip schema', inputs)
|
||||
if (inputs === undefined) {
|
||||
return emptySchema()
|
||||
}
|
||||
@@ -179,6 +178,8 @@
|
||||
console.warn('Error loading schema')
|
||||
return emptySchema()
|
||||
}
|
||||
// schema.order = Object.keys(fields)
|
||||
// console.log(schema.order)
|
||||
|
||||
// Remove hidden static inputs
|
||||
Object.keys(inputs ?? {}).forEach((key: string) => {
|
||||
|
||||
+6
@@ -40,6 +40,9 @@
|
||||
let { schema } = await getScriptByPath(x.path)
|
||||
if (!deepEqual(x.schema, schema)) {
|
||||
x.schema = schema
|
||||
if (!x.schema.order) {
|
||||
x.schema.order = Object.keys(x.schema.properties ?? {})
|
||||
}
|
||||
fields = computeFields(schema, false, fields)
|
||||
}
|
||||
} catch (e) {
|
||||
@@ -53,6 +56,9 @@
|
||||
const { schema } = (await loadSchema($workspaceStore ?? '', x.path, 'flow')) ?? emptySchema()
|
||||
if (!deepEqual(x.schema, schema)) {
|
||||
x.schema = schema
|
||||
if (!x.schema.order) {
|
||||
x.schema.order = Object.keys(x.schema.properties ?? {})
|
||||
}
|
||||
fields = computeFields(schema, false, fields)
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
+5
-1
@@ -36,7 +36,11 @@
|
||||
path: string,
|
||||
runType: 'script' | 'flow' | 'hubscript'
|
||||
): Promise<{ schema: Schema; summary: string | undefined }> {
|
||||
return loadSchema(workspace, path, runType) ?? emptySchema()
|
||||
const schema = await loadSchema(workspace, path, runType)
|
||||
if (!schema.schema.order) {
|
||||
schema.schema.order = Object.keys(schema.schema.properties ?? {})
|
||||
}
|
||||
return schema ?? { schema: emptySchema(), summary: undefined }
|
||||
}
|
||||
|
||||
async function pickScript(path: string) {
|
||||
|
||||
Reference in New Issue
Block a user