diff --git a/frontend/src/lib/components/Toggle.svelte b/frontend/src/lib/components/Toggle.svelte
index 5c39f8760c..02b1edd8c9 100644
--- a/frontend/src/lib/components/Toggle.svelte
+++ b/frontend/src/lib/components/Toggle.svelte
@@ -1,23 +1,20 @@
diff --git a/frontend/src/lib/components/flows/FlowSettings.svelte b/frontend/src/lib/components/flows/FlowSettings.svelte
index 419b396d40..aabde27a63 100644
--- a/frontend/src/lib/components/flows/FlowSettings.svelte
+++ b/frontend/src/lib/components/flows/FlowSettings.svelte
@@ -165,8 +165,8 @@
diff --git a/frontend/src/lib/components/flows/flowStore.ts b/frontend/src/lib/components/flows/flowStore.ts
index 1faa6b0b43..39ba2bff04 100644
--- a/frontend/src/lib/components/flows/flowStore.ts
+++ b/frontend/src/lib/components/flows/flowStore.ts
@@ -55,6 +55,7 @@ export function codeToStaticTemplate(code?: string): string | undefined {
}
return undefined
}
+
export function flattenForloopFlows(flow: Flow): Flow {
let newFlow: Flow = JSON.parse(JSON.stringify(flow))
const mod = newFlow.value.modules[1]?.value
diff --git a/frontend/src/lib/components/flows/utils.ts b/frontend/src/lib/components/flows/utils.ts
index e8214bbc37..5024fa80ca 100644
--- a/frontend/src/lib/components/flows/utils.ts
+++ b/frontend/src/lib/components/flows/utils.ts
@@ -1,5 +1,5 @@
import type { Schema } from '$lib/common'
-import type { FlowModuleValue, InputTransform, Flow, FlowModule, RawScript } from '$lib/gen'
+import type { Flow, FlowModule, FlowModuleValue, InputTransform, RawScript } from '$lib/gen'
import { inferArgs } from '$lib/infer'
import { loadSchema } from '$lib/scripts'
import { emptySchema, getScriptByPath, schemaToObject } from '$lib/utils'
@@ -22,7 +22,6 @@ export function flowToMode(flow: Flow | any, mode: FlowMode): Flow {
})
if (mode == 'pull') {
-
const triggerModule = newFlow.value.modules[0]
const oldModules = newFlow.value.modules.slice(1)
@@ -49,7 +48,6 @@ export function flowToMode(flow: Flow | any, mode: FlowMode): Flow {
return newFlow
}
-
export function getTypeAsString(arg: any): string {
if (arg === null) {
return 'null'
@@ -60,7 +58,6 @@ export function getTypeAsString(arg: any): string {
return typeof arg
}
-
export async function getFirstStepSchema(flow: Flow): Promise
{
const [firstModule] = flow.value.modules
if (firstModule.value.type === 'rawscript') {
@@ -116,8 +113,7 @@ export async function loadSchemaFromModule(module: FlowModule): Promise<{
let input_transform = module.input_transform
if (
- JSON.stringify(keys.sort()) !==
- JSON.stringify(Object.keys(module.input_transform).sort())
+ JSON.stringify(keys.sort()) !== JSON.stringify(Object.keys(module.input_transform).sort())
) {
input_transform = keys.reduce((accu, key) => {
let nv = module.input_transform[key] ?? {
@@ -128,6 +124,7 @@ export async function loadSchemaFromModule(module: FlowModule): Promise<{
return accu
}, {})
}
+
return {
input_transform: input_transform,
schema: schema ?? emptySchema()
@@ -162,11 +159,12 @@ export function getCodeInjectionExpr(code: string, isRaw: boolean): string {
expr = `JSON.parse(${expr})`
}
return `import { previous_result, flow_input, step, variable, resource, params } from 'windmill'
+
${expr}`
}
export function getDefaultExpr(i: number, key: string = 'myfield', previousExpr?: string) {
- const expr = previousExpr ? `\`${previousExpr}\`` : `previous_result.${key}`
+ const expr = previousExpr ?? `previous_result.${key}`
return `import { previous_result, flow_input, step, variable, resource, params } from 'windmill@${i}'
${expr}`
@@ -182,16 +180,18 @@ export function getPickableProperties(
const flowInputAsObject = schemaToObject(schema, args)
const flowInput =
mode === 'pull' && i >= 1
- ? Object.assign(Object.assign(
- {
- _value: 'The current value of the iteration as an object',
- _index: 'The current index of the iteration as a number'
- },
- flowInputAsObject), previewResults[0])
-
+ ? Object.assign(
+ Object.assign(
+ {
+ _value: 'The current value of the iteration as an object',
+ _index: 'The current index of the iteration as a number'
+ },
+ flowInputAsObject
+ ),
+ previewResults[0]
+ )
: flowInputAsObject
-
let previous_result
if (i === 0 || (i == 1 && mode == 'pull')) {
previous_result = flowInput
diff --git a/frontend/src/lib/components/propertyPicker/ClickablePropertyPicker.svelte b/frontend/src/lib/components/propertyPicker/ClickablePropertyPicker.svelte
new file mode 100644
index 0000000000..d8f4b921cd
--- /dev/null
+++ b/frontend/src/lib/components/propertyPicker/ClickablePropertyPicker.svelte
@@ -0,0 +1,52 @@
+
+
+{#if !disabled}
+
+
+
+
+
+ {#if isOpen}
+
+
{
+ isOpen = false
+ dispatch('select', event.detail)
+ }}
+ />
+
+ {/if}
+
+{:else}
+
+{/if}
+
+
diff --git a/frontend/src/lib/components/propertyPicker/OverlayPropertyPicker.svelte b/frontend/src/lib/components/propertyPicker/OverlayPropertyPicker.svelte
index dd989ed240..bf48ad4948 100644
--- a/frontend/src/lib/components/propertyPicker/OverlayPropertyPicker.svelte
+++ b/frontend/src/lib/components/propertyPicker/OverlayPropertyPicker.svelte
@@ -39,7 +39,7 @@
{#if !disabled}
-
+
diff --git a/frontend/src/lib/infer.ts b/frontend/src/lib/infer.ts
index 48cb7e5d1f..d1a839a834 100644
--- a/frontend/src/lib/infer.ts
+++ b/frontend/src/lib/infer.ts
@@ -1,5 +1,5 @@
-import type { Schema, SchemaProperty } from './common.js'
import { ScriptService, type MainArgSignature } from '$lib/gen'
+import type { Schema, SchemaProperty } from './common.js'
export async function inferArgs(
language: 'python3' | 'deno',
@@ -38,7 +38,10 @@ export async function inferArgs(
}
}
-function argSigToJsonSchemaType(t: string | { resource: string } | { list: string }, s: SchemaProperty): void {
+function argSigToJsonSchemaType(
+ t: string | { resource: string } | { list: string },
+ s: SchemaProperty
+): void {
if (t === 'int') {
s.type = 'integer'
} else if (t === 'float') {
diff --git a/frontend/src/routes/groups.svelte b/frontend/src/routes/groups.svelte
index 62aa5416ae..1766df258f 100644
--- a/frontend/src/routes/groups.svelte
+++ b/frontend/src/routes/groups.svelte
@@ -7,20 +7,21 @@