Skip to content

Commit

Permalink
feat(frontend): Add a button tocopy the path of a subflow (#3691)
Browse files Browse the repository at this point in the history
  • Loading branch information
fatonramadani authored May 8, 2024
1 parent 285967a commit 630ae7e
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion frontend/src/lib/components/FlowGraphViewerStep.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@
import FlowPathViewer from './flows/content/FlowPathViewer.svelte'
import SchemaViewer from './SchemaViewer.svelte'
import { scriptPathToHref } from '$lib/scripts'
import { cleanExpr } from '$lib/utils'
import { cleanExpr, copyToClipboard } from '$lib/utils'
import { hubBaseUrlStore } from '$lib/stores'
import { twMerge } from 'tailwind-merge'
import FlowModuleScript from './flows/content/FlowModuleScript.svelte'
import { Copy } from 'lucide-svelte'
export let flow: {
summary: string
Expand Down Expand Up @@ -212,6 +213,23 @@
{/each}
</div>
{:else if stepDetail.value.type == 'flow'}
<div class="text-sm mb-1 flex justify-end flex-row">
<Button
size="xs2"
startIcon={{ icon: Copy }}
color="light"
on:click={() => {
if (typeof stepDetail !== 'string') {
const val = stepDetail?.value
if (val?.type == 'flow') {
copyToClipboard(val.path)
}
}
}}
>
Copy path
</Button>
</div>
<FlowPathViewer noSide path={stepDetail.value.path} />
{/if}
{:else}
Expand Down

0 comments on commit 630ae7e

Please sign in to comment.