fix refreshFlow loop

This commit is contained in:
Ruben Fiszel
2023-04-16 00:40:54 +02:00
parent 618be52aa3
commit 7c58c3cd0c
3 changed files with 8 additions and 6 deletions
+1
View File
@@ -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 {
@@ -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 &&
-2
View File
@@ -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
}