Remove Schedule Poll Panel

This commit is contained in:
Guilhem
2024-10-15 22:17:10 +02:00
parent b578824c54
commit 9b2b974424
6 changed files with 2 additions and 105 deletions
@@ -1,51 +0,0 @@
<script lang="ts">
import FlowModuleComponent from '$lib/components/flows/content/FlowModuleComponent.svelte'
import Label from '$lib/components/Label.svelte'
import type { TriggerContext } from '$lib/components/triggers'
import PrimarySchedule from '$lib/components/PrimarySchedule.svelte'
import { getContext } from 'svelte'
import ScheduleEditor from '$lib/components/ScheduleEditor.svelte'
export let path: string
export let isFlow: boolean
export let setScheduleEnabled: (path: string, enabled: boolean) => void = () => {}
const { triggerModule, primarySchedule } = getContext<TriggerContext>('TriggerContext')
let scheduleEditor: ScheduleEditor
</script>
<ScheduleEditor on:update={() => {}} bind:this={scheduleEditor} />
<div class="flex flex-col gap-8">
{#if $triggerModule}
<Label label="Schedule">
{#if $primarySchedule}
<PrimarySchedule
{scheduleEditor}
schedule={$primarySchedule}
can_write={true}
{path}
{isFlow}
{setScheduleEnabled}
/>
{:else}
<div> No schedule poll triggers </div>
{/if}
</Label>
<Label label="Script">
<FlowModuleComponent
previousModule={undefined}
noEditor={false}
bind:flowModule={$triggerModule}
failureModule={false}
preprocessorModule={false}
scriptKind={'script'}
scriptTemplate={'script'}
enableAi={false}
/>
</Label>
{:else}
<div> No schedule poll triggers </div>
{/if}
</div>
@@ -12,7 +12,6 @@
import { initFlowStepWarnings } from '../utils'
import { dfs } from '../dfs'
import FlowPreprocessorModule from './FlowPreprocessorModule.svelte'
import FlowShedulePole from './FlowShedulePole.svelte'
export let noEditor = false
export let enableAi = false
export let newFlow = false
@@ -71,8 +70,6 @@
<FlowPreprocessorModule {noEditor} />
{:else if $selectedId === 'triggers'}
<FlowTriggers {noEditor} {newFlow} />
{:else if $selectedId === 'schedulePoll'}
<FlowShedulePole />
{:else}
{@const dup = checkDup($flowStore.value.modules)}
{#if dup}
@@ -1,11 +0,0 @@
<script lang="ts">
import SchedulePollPanel from '$lib/components/details/SchedulePollPanel.svelte'
import { getContext } from 'svelte'
import type { FlowEditorContext } from '../types'
const { pathStore } = getContext<FlowEditorContext>('FlowEditorContext')
</script>
<div class="p-4">
<SchedulePollPanel isFlow={true} path={$pathStore ?? ''} />
</div>
@@ -10,14 +10,11 @@
import FlowCard from '../common/FlowCard.svelte'
import { getContext } from 'svelte'
import type { FlowEditorContext } from '../types'
import SchedulePollPanel from '$lib/components/details/SchedulePollPanel.svelte'
import type { TriggerContext } from '$lib/components/triggers'
export let noEditor: boolean
export let newFlow = false
let path = ''
const { pathStore, selectedTrigger } = getContext<FlowEditorContext>('FlowEditorContext')
const { triggerModule } = getContext<TriggerContext>('TriggerContext')
$: path = $pathStore
</script>
@@ -75,12 +72,6 @@
/>
</div>
{/if}
{#if $selectedTrigger === 'schedule_poll' && triggerModule}
<div class="p-4">
<SchedulePollPanel isFlow={true} path={path ?? ''} />
</div>
{/if}
</svelte:fragment>
</Tabs>
</div>
@@ -1,18 +1,6 @@
<script lang="ts">
import BarsStaggered from '$lib/components/icons/BarsStaggered.svelte'
import {
CheckCircle2,
ChevronRight,
Code,
GitBranch,
Repeat,
Square,
Zap,
Calendar,
Mail,
Webhook,
Route
} from 'lucide-svelte'
import { CheckCircle2, ChevronRight, Code, GitBranch, Repeat, Square, Zap } from 'lucide-svelte'
import { createEventDispatcher } from 'svelte'
import { twMerge } from 'tailwind-merge'
@@ -64,22 +52,6 @@
{:else if label === 'Branch to all'}
<GitBranch size={14} />
Branch to all
{:else if label === 'Schedule'}
<Calendar size={14} />
Schedule
{:else if label === 'Schedule poll'}
<Repeat size={14} />
Schedule poll
<ChevronRight size={12} class="ml-auto" color="#4c566a" />
{:else if label === 'Http route'}
<Route size={14} />
Http route
{:else if label === 'Webhook'}
<Webhook size={14} />
Webhook
{:else if label === 'Email'}
<Mail size={14} />
Email
{/if}
</span>
{#if returnIcon && selected}
+1 -2
View File
@@ -1,4 +1,4 @@
import type { HttpTrigger, Schedule, FlowModule } from '$lib/gen'
import type { HttpTrigger, Schedule } from '$lib/gen'
import type { Writable } from 'svelte/store'
export type ScheduleTrigger = {
@@ -15,5 +15,4 @@ export type TriggerContext = {
schedule: Writable<ScheduleTrigger>
primarySchedule: Writable<Schedule | undefined | boolean>
schedules: Writable<Schedule[] | undefined>
triggerModule: Writable<FlowModule | undefined>
}