diff --git a/frontend/src/lib/components/Editor.svelte b/frontend/src/lib/components/Editor.svelte
index b0bae5a0fb..cbba40edc0 100644
--- a/frontend/src/lib/components/Editor.svelte
+++ b/frontend/src/lib/components/Editor.svelte
@@ -366,11 +366,13 @@
if (shouldBindKey) {
editor.addCommand(monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyS, function () {
+ code = getCode()
format()
})
editor.addCommand(monaco.KeyMod.CtrlCmd | monaco.KeyCode.Enter, function () {
if (cmdEnterAction) {
+ code = getCode()
cmdEnterAction()
}
})
diff --git a/frontend/src/lib/components/SimpleEditor.svelte b/frontend/src/lib/components/SimpleEditor.svelte
index fbea79f20b..bb32362a34 100644
--- a/frontend/src/lib/components/SimpleEditor.svelte
+++ b/frontend/src/lib/components/SimpleEditor.svelte
@@ -38,7 +38,7 @@
export let automaticLayout = true
export let extraLib: string = ''
export let extraLibPath: string = ''
- export let shouldBindKey: boolean = true
+ export let shouldBindKey: boolean = false
const dispatch = createEventDispatcher()
diff --git a/frontend/src/lib/components/flows/content/FlowLoop.svelte b/frontend/src/lib/components/flows/content/FlowLoop.svelte
index 5c288c9ff6..2246bc5e01 100644
--- a/frontend/src/lib/components/flows/content/FlowLoop.svelte
+++ b/frontend/src/lib/components/flows/content/FlowLoop.svelte
@@ -36,21 +36,21 @@
- {
- console.log(detail)
- console.log('test')
- editor?.insertAtCursor(detail)
- }}
- >
-
-
+
+
{
+ editor?.insertAtCursor(detail)
+ }}
+ >
+
+
+
Skip failures
('FlowEditorContext')
export let flowModule: FlowModule
+ let editor: SimpleEditor | undefined = undefined
+
$: isSuspendEnabled = Boolean(flowModule.suspend)
$: isStopAfterIfEnabled = Boolean(flowModule.stop_after_if)
+ let pickableProperties: Object = {}
+
+ $: {
+ let indices = $selectedId.split('-').map(Number)
+ if (indices[1]) {
+ indices[1] += 1
+ } else {
+ indices[0] += 1
+ }
+ const props = getStepPropPicker(
+ indices,
+ $flowStore.schema,
+ $flowStateStore,
+ $previewArgs
+ ).pickableProperties
+
+ props['result'] = props['previous_result']
+ delete props['previous_result']
+ props.step = props.step?.slice(0, props.step.length - 1)
+ pickableProperties = props
+ }
@@ -51,20 +82,31 @@
/>
{#if flowModule.stop_after_if}
-
Stop condition expression
-
-
Should skip if stopped
- {:else}
+
Stop condition expression
-
+
+
+
{
+ editor?.insertAtCursor(detail)
+ }}
+ >
+
+
+
+ {:else}
Should skip if stopped
+
Stop condition expression
+
{/if}
diff --git a/frontend/src/lib/components/flows/flowStateUtils.ts b/frontend/src/lib/components/flows/flowStateUtils.ts
index de07781c37..150b12904d 100644
--- a/frontend/src/lib/components/flows/flowStateUtils.ts
+++ b/frontend/src/lib/components/flows/flowStateUtils.ts
@@ -206,7 +206,6 @@ export function getStepPropPicker(
const flowInput = schemaToObject(flowInputSchema, args)
const results = getPreviousResults(flowState.modules, parentIndex)
- console.log(parentIndex)
const lastResult =
parentIndex == 0
? flowInput
@@ -228,7 +227,7 @@ export function getStepPropPicker(
}
const innerResults = getPreviousResults(
- flowState.modules[parentIndex].childFlowModules,
+ flowState.modules[parentIndex]?.childFlowModules,
childIndex
)