Skip to content

Commit fd0edcb

Browse files
committed
feat(frontend): Add a button tocopy the path of a subflow
1 parent ee2a193 commit fd0edcb

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

frontend/src/lib/components/FlowGraphViewerStep.svelte

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@
1010
import FlowPathViewer from './flows/content/FlowPathViewer.svelte'
1111
import SchemaViewer from './SchemaViewer.svelte'
1212
import { scriptPathToHref } from '$lib/scripts'
13-
import { cleanExpr } from '$lib/utils'
13+
import { cleanExpr, copyToClipboard } from '$lib/utils'
1414
import { hubBaseUrlStore } from '$lib/stores'
1515
1616
import { twMerge } from 'tailwind-merge'
1717
import FlowModuleScript from './flows/content/FlowModuleScript.svelte'
18+
import { Copy } from 'lucide-svelte'
1819
1920
export let flow: {
2021
summary: string
@@ -212,6 +213,23 @@
212213
{/each}
213214
</div>
214215
{:else if stepDetail.value.type == 'flow'}
216+
<div class="text-sm mb-1 flex justify-end flex-row">
217+
<Button
218+
size="xs2"
219+
startIcon={{ icon: Copy }}
220+
color="light"
221+
on:click={() => {
222+
if (typeof stepDetail !== 'string') {
223+
const val = stepDetail?.value
224+
if (val?.type == 'flow') {
225+
copyToClipboard(val.path)
226+
}
227+
}
228+
}}
229+
>
230+
Copy path
231+
</Button>
232+
</div>
215233
<FlowPathViewer noSide path={stepDetail.value.path} />
216234
{/if}
217235
{:else}

0 commit comments

Comments
 (0)