* feature(frontend): Flow rework WIP * feature(frontend): Right panel behavior done * feature(frontend): Split panel working * feature(frontend): Flows working * feature(frontend): Add inputs + adapt style + remove duplicate library * feature(frontend): remove old implementation * feature(frontend): revert package-lock * feature(frontend): revert old FlowBuilder component * feature(frontend): Fix margins + add remove button on the minimap * feature(frontend): Fix wording * feature(frontend): add PR UI comments * feature(frontend): Display the module title * feature(frontend): Previews working * feature(frontend): Fix schedule load + update * feature(frontend): fix build * feature(frontend): UI fix * fix just this step * feature(frontend): for loop iterator and skip failures * just this step * script helpers Co-authored-by: Ruben Fiszel <ruben@rubenfiszel.com>
80 lines
2.3 KiB
Svelte
80 lines
2.3 KiB
Svelte
<script lang="ts">
|
|
import { RawScript, Script } from '$lib/gen'
|
|
|
|
import { faCode, faRepeat } from '@fortawesome/free-solid-svg-icons'
|
|
import { createEventDispatcher } from 'svelte'
|
|
import FlowScriptPicker from '../pickers/FlowScriptPicker.svelte'
|
|
import PickHubScript from '../pickers/PickHubScript.svelte'
|
|
import PickScript from '../pickers/PickScript.svelte'
|
|
|
|
export let shouldDisableLoopCreation: boolean = false
|
|
export let shouldDisableTriggerScripts: boolean = false
|
|
const dispatch = createEventDispatcher()
|
|
</script>
|
|
|
|
<div class="space-y-4 p-4">
|
|
{#if !shouldDisableTriggerScripts}
|
|
<div class="text-sm font-bold">Scripts</div>
|
|
{/if}
|
|
|
|
<div class="grid sm:grid-col-2 lg:grid-cols-3 gap-4">
|
|
<PickScript kind={Script.kind.SCRIPT} on:pick />
|
|
<PickHubScript kind={Script.kind.SCRIPT} on:pick />
|
|
|
|
<FlowScriptPicker
|
|
label={`Create a for-loop here`}
|
|
disabled={shouldDisableLoopCreation}
|
|
icon={faRepeat}
|
|
iconColor="text-blue-500"
|
|
on:click={() => dispatch('loop')}
|
|
/>
|
|
|
|
<FlowScriptPicker
|
|
label={`New PostgreSQL query`}
|
|
icon={faCode}
|
|
iconColor="text-blue-800"
|
|
on:click={() =>
|
|
dispatch('new', { language: RawScript.language.DENO, kind: 'script', subkind: 'pgsql' })}
|
|
/>
|
|
|
|
<FlowScriptPicker
|
|
label="New Python script (3.10)"
|
|
icon={faCode}
|
|
iconColor="text-green-500"
|
|
on:click={() =>
|
|
dispatch('new', { language: RawScript.language.PYTHON3, kind: 'script', subkind: 'flow' })}
|
|
/>
|
|
|
|
<FlowScriptPicker
|
|
label="New Typescript script (Deno)"
|
|
icon={faCode}
|
|
iconColor="text-blue-800"
|
|
on:click={() =>
|
|
dispatch('new', { language: RawScript.language.DENO, kind: 'script', subkind: 'flow' })}
|
|
/>
|
|
|
|
<FlowScriptPicker
|
|
label="New Go script"
|
|
icon={faCode}
|
|
iconColor="text-blue-700"
|
|
on:click={() =>
|
|
dispatch('new', { language: RawScript.language.GO, kind: 'script', subkind: 'flow' })}
|
|
/>
|
|
</div>
|
|
|
|
{#if !shouldDisableTriggerScripts}
|
|
<div class="text-sm font-bold">Trigger scripts</div>
|
|
|
|
<div class="grid sm:grid-col-1 md:grid-col-2 lg:grid-cols-3 gap-4">
|
|
<PickScript kind={Script.kind.TRIGGER} on:pick />
|
|
<PickHubScript kind={Script.kind.TRIGGER} on:pick />
|
|
<FlowScriptPicker
|
|
label="New Typescript script (Deno)"
|
|
icon={faCode}
|
|
iconColor="text-blue-800"
|
|
on:click={() => dispatch('new', { language: RawScript.language.DENO, kind: 'trigger' })}
|
|
/>
|
|
</div>
|
|
{/if}
|
|
</div>
|