pathEl, { timeout: 50 }) })}
- >
-
Output asset
- {#each visibleOutputKinds.length ? visibleOutputKinds : PIPELINE_OUTPUT_KINDS as k}
- {@const isSelected = selected.outputId === k.id}
-
- {/each}
-
- {/if}
+ pathEl, { timeout: 50 }) })}
+ >
+
Output asset
+ {#each visibleOutputKinds.length ? visibleOutputKinds : PIPELINE_OUTPUT_KINDS as k}
+ {@const isSelected = selected.outputId === k.id}
+
+ {/each}
+
{/snippet}
{#snippet bottomSection(close: () => void)}
diff --git a/frontend/src/lib/components/assets/AssetGraph/pipelineAnnotationEdits.test.ts b/frontend/src/lib/components/assets/AssetGraph/pipelineAnnotationEdits.test.ts
index eec4b7a671..a2bfb3327d 100644
--- a/frontend/src/lib/components/assets/AssetGraph/pipelineAnnotationEdits.test.ts
+++ b/frontend/src/lib/components/assets/AssetGraph/pipelineAnnotationEdits.test.ts
@@ -1,8 +1,8 @@
import { describe, expect, it } from 'vitest'
import {
+ addTriggerDirective,
listenToAsset,
removeTriggerDirective,
- scheduleInsteadOfAsset,
stopListeningToAsset
} from './pipelineAnnotationEdits'
@@ -42,10 +42,9 @@ describe('pipeline annotation edits', () => {
)
})
- it('swaps an asset subscription for a schedule, and drops a trigger kind', () => {
- const ts = '// pipeline\n// on datatable://main/orders\nexport function main() {}'
- expect(scheduleInsteadOfAsset(ts, table, false)).toBe(
- '// pipeline\n// on schedule\nexport function main() {}'
+ it('adds a trigger kind once, and drops it', () => {
+ expect(addTriggerDirective('// pipeline\n// on webhook\nx()', 'webhook')).toBe(
+ '// pipeline\n// on webhook\nx()'
)
expect(removeTriggerDirective('// pipeline\n// on kafka\nx()', 'kafka')).toBe(
'// pipeline\nx()'
diff --git a/frontend/src/lib/components/assets/AssetGraph/pipelineAnnotationEdits.ts b/frontend/src/lib/components/assets/AssetGraph/pipelineAnnotationEdits.ts
index dc6d68b10f..d27ca73917 100644
--- a/frontend/src/lib/components/assets/AssetGraph/pipelineAnnotationEdits.ts
+++ b/frontend/src/lib/components/assets/AssetGraph/pipelineAnnotationEdits.ts
@@ -113,16 +113,6 @@ export function stopListeningToAsset(
return out
}
-/** The script runs on a schedule rather than after writes to the asset. */
-export function scheduleInsteadOfAsset(
- content: string,
- asset: { kind: AssetKind; path: string },
- reads: boolean
-): string {
- const out = stopListeningToAsset(content, asset, reads)
- return hasDirective(out, onTrigger('schedule')) ? out : addDirective(out, 'on schedule')
-}
-
/** Adds a `// on