Skip to content

Commit

Permalink
clean
Browse files Browse the repository at this point in the history
  • Loading branch information
Guilhem-lm committed Jan 8, 2025
1 parent 025dc9e commit 9711315
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
2 changes: 2 additions & 0 deletions frontend/src/lib/components/schema/SchemaPickerRow.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
day: 'numeric'
}).format(date)
}
$: hovering ? dispatch('hover', true) : dispatch('hover', false)
</script>

<Row
Expand Down
14 changes: 8 additions & 6 deletions frontend/src/lib/components/triggers/CaptureSection.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,14 @@
color="light"
btnClasses={captureInfo.active ? 'text-blue-500 hover:text-blue-500' : ''}
>
{#if captureInfo.active}
<CircleStop />
{:else}
<CaptureIcon variant="redDot" />
{/if}
{captureInfo.active ? 'Stop' : 'Start capturing'}
<div class="flex flex-row items-center gap-1 w-28 justify-center">
{#if captureInfo.active}
<CircleStop size={14} />
{:else}
<CaptureIcon variant="redDot" size={14} />
{/if}
{captureInfo.active ? 'Stop' : 'Start capturing'}
</div>
</Button>
</AnimatedButton>

Expand Down
13 changes: 10 additions & 3 deletions frontend/src/lib/components/triggers/CaptureTable.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@
export let hideCapturesWhenEmpty = false
export let canEdit = false
export let captureActive = false
let captures: Capture[] = []
let selected: number | undefined = undefined
let hovered: number | undefined = undefined
let testKind: 'preprocessor' | 'main' = 'main'
let hasMore = false
let page = 1
Expand Down Expand Up @@ -74,6 +76,7 @@
let hasAlreadyFailed = false
export async function loadCaptures(refresh?: boolean) {
console.log('dbg: loadCaptures', refresh)
hasMore = false
try {
Expand All @@ -94,6 +97,7 @@
} else {
if (refresh) {
captures = newCaptures
page = 1
} else {
captures = [...captures, ...newCaptures]
}
Expand Down Expand Up @@ -215,16 +219,16 @@
...payload,
...triggerExtra
}
: payload}
: { ...payload }}
{@const captureIcon = captureKindToIcon[capture.trigger_kind]}
<SchemaPickerRow
date={capture.created_at}
{payloadData}
on:updateSchema
on:applyArgs
on:addPreprocessor
on:select={() => handleSelect(capture)}
selected={selected === capture.id}
on:hover={(e) => (hovered = e.detail ? capture.id : undefined)}
>
<svelte:fragment slot="start">
<div class="center-center">
Expand Down Expand Up @@ -268,7 +272,9 @@
{:else}
<Button
size="xs2"
color="dark"
color={hovered === capture.id || selected === capture.id
? 'dark'
: 'light'}
dropdownItems={[
{
label: 'Use as input schema',
Expand All @@ -286,6 +292,7 @@
if (isFlow && testKind === 'main') {
dispatch('testWithArgs', payloadData)
} else {
console.log('dbg: applyArgs from table', payloadData)
dispatch('applyArgs', {
kind: testKind,
args: payloadData
Expand Down

0 comments on commit 9711315

Please sign in to comment.