-
Notifications
You must be signed in to change notification settings - Fork 589
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: flow history picker for flow status + load last flow state
- Loading branch information
1 parent
6d9edc8
commit 611d5e8
Showing
13 changed files
with
280 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<script lang="ts"> | ||
import { HistoryIcon } from 'lucide-svelte' | ||
import { createEventDispatcher } from 'svelte' | ||
import PopoverV2 from '$lib/components/meltComponents/Popover.svelte' | ||
import HistoricInputs from './HistoricInputs.svelte' | ||
import { workspaceStore } from '$lib/stores' | ||
import { JobService } from '$lib/gen' | ||
export let path: string | ||
export let selected: string | undefined = undefined | ||
const dispatch = createEventDispatcher() | ||
async function loadInitial() { | ||
let jobs = await JobService.listJobs({ | ||
workspace: $workspaceStore!, | ||
scriptPathExact: path, | ||
jobKinds: ['flow', 'flowpreview'].join(','), | ||
page: 1, | ||
perPage: 1 | ||
}) | ||
if (jobs.length > 0) { | ||
dispatch('select', { jobId: jobs[0].id, initial: true }) | ||
} | ||
} | ||
$: $workspaceStore && loadInitial() | ||
</script> | ||
|
||
<PopoverV2 closeButton={false}> | ||
<svelte:fragment slot="trigger"> | ||
<HistoryIcon size={14} /> | ||
</svelte:fragment> | ||
<svelte:fragment slot="content"> | ||
<div class="p-2 h-[400px] overflow-hidden w-80 border shadow-sm"> | ||
<HistoricInputs | ||
on:select={(e) => { | ||
if (e.detail) { | ||
dispatch('select', { jobId: e.detail?.jobId, initial: false }) | ||
} else { | ||
dispatch('unselect') | ||
} | ||
}} | ||
{selected} | ||
runnableId={path} | ||
runnableType={'FlowPath'} | ||
/> | ||
</div> | ||
</svelte:fragment> | ||
</PopoverV2> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.