Skip to content

Commit

Permalink
Remove excessive padding
Browse files Browse the repository at this point in the history
  • Loading branch information
Guilhem-lm committed Dec 11, 2024
1 parent a861bfe commit 2a44cf3
Showing 1 changed file with 120 additions and 122 deletions.
242 changes: 120 additions & 122 deletions frontend/src/lib/components/triggers/TriggersEditor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -27,133 +27,131 @@
</script>

<FlowCard {noEditor} title="Triggers">
<div class="pt-4">
{#if !$simplifiedPoll}
<Tabs bind:selected={$selectedTrigger}>
<Tab value="webhooks" selectedClass="text-primary font-semibold">Webhooks</Tab>
<Tab value="schedules" selectedClass="text-primary text-sm font-semibold">Schedules</Tab>
<Tab value="routes" selectedClass="text-primary text-sm font-semibold">Routes</Tab>
<Tab value="websockets" selectedClass="text-primary text-sm font-semibold">Websockets</Tab>
<Tab value="kafka" selectedClass="text-primary text-sm font-semibold">Kafka</Tab>
<Tab value="emails" selectedClass="text-primary text-sm font-semibold">Email</Tab>
{#if isFlow}
<Tab value="scheduledPoll" selectedClass="text-primary text-sm font-semibold"
>Scheduled Poll</Tab
>
{/if}
{#if !$simplifiedPoll}
<Tabs bind:selected={$selectedTrigger}>
<Tab value="webhooks" selectedClass="text-primary font-semibold">Webhooks</Tab>
<Tab value="schedules" selectedClass="text-primary text-sm font-semibold">Schedules</Tab>
<Tab value="routes" selectedClass="text-primary text-sm font-semibold">Routes</Tab>
<Tab value="websockets" selectedClass="text-primary text-sm font-semibold">Websockets</Tab>
<Tab value="kafka" selectedClass="text-primary text-sm font-semibold">Kafka</Tab>
<Tab value="emails" selectedClass="text-primary text-sm font-semibold">Email</Tab>
{#if isFlow}
<Tab value="scheduledPoll" selectedClass="text-primary text-sm font-semibold"
>Scheduled Poll</Tab
>
{/if}

<svelte:fragment slot="content">
{#if $selectedTrigger === 'webhooks'}
<div class="p-4">
<WebhooksPanel
on:applyArgs
on:addPreprocessor
on:refreshCaptures
scopes={isFlow ? [`run:flow/${currentPath}`] : [`run:script/${currentPath}`]}
path={currentPath}
{isFlow}
args={{}}
token=""
{newItem}
isEditor={true}
{canHavePreprocessor}
{hasPreprocessor}
/>
</div>
{/if}
<svelte:fragment slot="content">
{#if $selectedTrigger === 'webhooks'}
<div class="p-4">
<WebhooksPanel
on:applyArgs
on:addPreprocessor
on:refreshCaptures
scopes={isFlow ? [`run:flow/${currentPath}`] : [`run:script/${currentPath}`]}
path={currentPath}
{isFlow}
args={{}}
token=""
{newItem}
isEditor={true}
{canHavePreprocessor}
{hasPreprocessor}
/>
</div>
{/if}

{#if $selectedTrigger === 'emails'}
<div class="p-4">
<EmailTriggerPanel
on:applyArgs
on:addPreprocessor
on:refreshCaptures
token=""
scopes={isFlow ? [`run:flow/${currentPath}`] : [`run:script/${currentPath}`]}
path={currentPath}
{isFlow}
isEditor={true}
{canHavePreprocessor}
{hasPreprocessor}
/>
</div>
{/if}
{#if $selectedTrigger === 'emails'}
<div class="p-4">
<EmailTriggerPanel
on:applyArgs
on:addPreprocessor
on:refreshCaptures
token=""
scopes={isFlow ? [`run:flow/${currentPath}`] : [`run:script/${currentPath}`]}
path={currentPath}
{isFlow}
isEditor={true}
{canHavePreprocessor}
{hasPreprocessor}
/>
</div>
{/if}

{#if $selectedTrigger === 'routes'}
<div class="p-4">
<RoutesPanel
on:applyArgs
on:refreshCaptures
on:addPreprocessor
{newItem}
path={currentPath}
{isFlow}
isEditor={true}
/>
</div>
{/if}
{#if $selectedTrigger === 'routes'}
<div class="p-4">
<RoutesPanel
on:applyArgs
on:refreshCaptures
on:addPreprocessor
{newItem}
path={currentPath}
{isFlow}
isEditor={true}
/>
</div>
{/if}

{#if $selectedTrigger === 'websockets'}
<div class="p-4">
<WebsocketTriggersPanel
on:applyArgs
on:addPreprocessor
on:refreshCaptures
{newItem}
path={currentPath}
{isFlow}
isEditor={true}
{canHavePreprocessor}
{hasPreprocessor}
/>
</div>
{/if}
{#if $selectedTrigger === 'websockets'}
<div class="p-4">
<WebsocketTriggersPanel
on:applyArgs
on:addPreprocessor
on:refreshCaptures
{newItem}
path={currentPath}
{isFlow}
isEditor={true}
{canHavePreprocessor}
{hasPreprocessor}
/>
</div>
{/if}

{#if $selectedTrigger === 'kafka'}
<div class="p-4">
<KafkaTriggersPanel
on:applyArgs
on:addPreprocessor
on:refreshCaptures
{newItem}
path={currentPath}
{isFlow}
isEditor={true}
{canHavePreprocessor}
{hasPreprocessor}
/>
</div>
{/if}
{#if $selectedTrigger === 'kafka'}
<div class="p-4">
<KafkaTriggersPanel
on:applyArgs
on:addPreprocessor
on:refreshCaptures
{newItem}
path={currentPath}
{isFlow}
isEditor={true}
{canHavePreprocessor}
{hasPreprocessor}
/>
</div>
{/if}

{#if $selectedTrigger === 'schedules'}
<div class="p-4">
<RunPageSchedules
{schema}
{isFlow}
path={initialPath}
{newItem}
can_write={canWrite(currentPath, {}, $userStore)}
/>
</div>
{/if}
{#if $selectedTrigger === 'schedules'}
<div class="p-4">
<RunPageSchedules
{schema}
{isFlow}
path={initialPath}
{newItem}
can_write={canWrite(currentPath, {}, $userStore)}
/>
</div>
{/if}

{#if $selectedTrigger === 'scheduledPoll'}
<div class="p-4">
<ScheduledPollPanel />
</div>
{/if}
</svelte:fragment>
</Tabs>
{:else}
<div class="px-4 pb-2">
<RunPageSchedules
{schema}
{isFlow}
path={initialPath}
{newItem}
can_write={canWrite(currentPath, {}, $userStore)}
/>
</div>
{/if}
</div>
{#if $selectedTrigger === 'scheduledPoll'}
<div class="p-4">
<ScheduledPollPanel />
</div>
{/if}
</svelte:fragment>
</Tabs>
{:else}
<div class="px-4 pb-2">
<RunPageSchedules
{schema}
{isFlow}
path={initialPath}
{newItem}
can_write={canWrite(currentPath, {}, $userStore)}
/>
</div>
{/if}
</FlowCard>

0 comments on commit 2a44cf3

Please sign in to comment.