mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-24 16:01:42 +00:00
fix refreshFlow loop
This commit is contained in:
@@ -2452,6 +2452,7 @@ async fn test_flow_lock_all(db: Pool<Postgres>) {
|
||||
.modules
|
||||
.into_iter()
|
||||
.for_each(|m| {
|
||||
tracing::error!("Module: {:?}", m.value);
|
||||
assert!(matches!(
|
||||
m.value,
|
||||
windmill_api_client::types::FlowModuleValue::Rawscript {
|
||||
|
||||
+7
-4
@@ -67,12 +67,15 @@
|
||||
}
|
||||
|
||||
async function refreshFlow(x: RunnableByPath) {
|
||||
const schema = (await loadSchema($workspaceStore ?? '', x.path, 'flow')) ?? emptySchema()
|
||||
x.schema = schema
|
||||
if (componentInput?.type == 'runnable') {
|
||||
componentInput.fields = computeFields(schema, false, componentInput.fields)
|
||||
const schema = (await loadSchema($workspaceStore ?? '', x.path, 'flow')) ?? emptySchema()
|
||||
x.schema = schema
|
||||
const nfields = computeFields(schema, false, componentInput.fields)
|
||||
if (!deepEqual(componentInput.fields, nfields)) {
|
||||
componentInput.fields = nfields
|
||||
componentInput = componentInput
|
||||
}
|
||||
}
|
||||
componentInput = componentInput
|
||||
}
|
||||
$: if (
|
||||
componentInput &&
|
||||
|
||||
@@ -30,12 +30,10 @@ export async function loadSchema(path: string, hash?: string): Promise<Schema> {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export async function loadSchemaFlow(path: string): Promise<Schema> {
|
||||
const flow = await FlowService.getFlowByPath({
|
||||
workspace: get(workspaceStore)!,
|
||||
path: path ?? ''
|
||||
})
|
||||
return flow.schema
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user