Skip to content

Commit

Permalink
fix(frontend): add back script lockfile to script details pae
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenfiszel committed Oct 18, 2024
1 parent 248fdc2 commit 549b11d
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,12 @@
{/if}
{#if flow_json}
<Tab value="raw">Export</Tab>
{:else}
<Tab value="script">Script</Tab>
{/if}
{#if selected == 'flow_step'}
<Tab value="flow_step">Step</Tab>
{/if}
{#if !flow_json && !isOperator}
<Tab value="schema">Schema</Tab>
{/if}

<svelte:fragment slot="content">
<div class="overflow-hidden" style="height:calc(100% - 32px);">
Expand All @@ -47,6 +46,9 @@
<TabContent value="schema" class="flex flex-col flex-1 h-full">
<slot name="schema" />
</TabContent>
<TabContent value="script" class="flex flex-col flex-1 h-full">
<slot name="script" />
</TabContent>
<TabContent value="triggers" class="flex flex-col flex-1 h-full pt-2">
<DetailPageTriggerPanel bind:triggerSelected>
<slot slot="webhooks" name="webhooks" />
Expand Down
11 changes: 9 additions & 2 deletions frontend/src/lib/components/details/DetailPageLayout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,9 @@
<slot slot="emails" name="emails" />
<slot slot="schedules" name="schedules" />
<slot slot="cli" name="cli" />
<slot slot="details" name="details" />
<slot slot="script" name="script" />
<slot slot="save_inputs" name="save_inputs" />
<slot slot="flow_step" name="flow_step" />
<slot slot="schema" name="schema" />
</DetailPageDetailPanel>
</Pane>
</Splitpanes>
Expand All @@ -70,6 +69,10 @@
{#if !isOperator}
<Tab value="triggers">Triggers</Tab>
{/if}
{#if !flow_json}
<Tab value="script">Script</Tab>
{/if}

<svelte:fragment slot="content">
<TabContent value="form" class="flex flex-col flex-1 h-full">
<slot name="form" />
Expand All @@ -82,12 +85,16 @@
<DetailPageTriggerPanel bind:triggerSelected={$selectedTriggerStore}>
<slot slot="webhooks" name="webhooks" />
<slot slot="routes" name="routes" />
<slot slot="script" name="script" />
<slot slot="websockets" name="websockets" />
<slot slot="emails" name="emails" />
<slot slot="schedules" name="schedules" />
<slot slot="cli" name="cli" />
</DetailPageTriggerPanel>
</TabContent>
<TabContent value="script" class="flex flex-col flex-1 h-full">
<slot name="script" />
</TabContent>
</svelte:fragment>
</Tabs>
</div>
Expand Down
24 changes: 12 additions & 12 deletions frontend/src/lib/components/details/DetailPageTriggerPanel.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,38 +17,38 @@

<Tabs bind:selected={triggerSelected}>
<Tab value="webhooks">
<span class="flex flex-row gap-2 items-center">
<Webhook size={14} />
<span class="flex flex-row gap-2 items-center text-xs">
<Webhook size={12} />
Webhooks
</span>
</Tab>
<Tab value="schedules">
<span class="flex flex-row gap-2 items-center">
<CalendarCheck2 size={14} />
<span class="flex flex-row gap-2 items-center text-xs">
<CalendarCheck2 size={12} />
Schedules
</span>
</Tab>
<Tab value="routes">
<span class="flex flex-row gap-2 items-center">
<Route size={14} />
<span class="flex flex-row gap-2 items-center text-xs">
<Route size={12} />
HTTP
</span>
</Tab>
<Tab value="websockets">
<span class="flex flex-row gap-2 items-center">
<Unplug size={14} />
<span class="flex flex-row gap-2 items-center text-xs">
<Unplug size={12} />
Websockets
</span>
</Tab>
<Tab value="emails">
<span class="flex flex-row gap-2 items-center">
<MailIcon size={14} />
<span class="flex flex-row gap-2 items-center text-xs">
<MailIcon size={12} />
Email
</span>
</Tab>
<Tab value="cli">
<span class="flex flex-row gap-2 items-center">
<Terminal size={14} />
<span class="flex flex-row gap-2 items-center text-xs">
<Terminal size={12} />
CLI
</span>
</Tab>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lib/relative_imports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ export function approximateFindPythonRelativePath(code: string) {

// Use match to find all matches in the code
const matches = code.match(regex)
return [...(matches?.entries() ?? [])] || []
return [...(matches?.entries() ?? [])]
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import { enterpriseLicense, hubBaseUrlStore, userStore, workspaceStore } from '$lib/stores'
import { isDeployable, ALL_DEPLOYABLE } from '$lib/utils_deployable'
import SchemaViewer from '$lib/components/SchemaViewer.svelte'
import { onDestroy } from 'svelte'
import HighlightCode from '$lib/components/HighlightCode.svelte'
import {
Expand Down Expand Up @@ -686,17 +685,6 @@
</div>
</div>
</svelte:fragment>
<svelte:fragment slot="schema">
<div class="p-1 relative">
<button
on:click={() => copyToClipboard(JSON.stringify(script?.schema, null, 4))}
class="absolute top-2 right-2"
>
<ClipboardCopy size={14} />
</button>
<Highlight language={json} code={JSON.stringify(script?.schema, null, 4)} />
</div>
</svelte:fragment>
<svelte:fragment slot="save_inputs">
{#if args}
<SavedInputs
Expand Down Expand Up @@ -753,26 +741,14 @@
/>
</div>
</svelte:fragment>
<svelte:fragment slot="details">
<svelte:fragment slot="script">
<div>
<Skeleton {loading} layout={[[20]]} />

<Tabs selected="code">
<Tab value="code" size="xs">Code</Tab>
<Tab value="dependencies" size="xs">Lockfile</Tab>
<Tab value="arguments" size="xs">
<span class="inline-flex items-center gap-1">
Inputs
<Tooltip>
The jsonschema defines the constraints that the payload must respect to be
compatible with the input parameters of this script. The UI form is generated
automatically from the script jsonschema. See
<a href="https://json-schema.org/" class="text-blue-500">
jsonschema documentation
</a>
</Tooltip>
</span>
</Tab>
<Tab value="schema" size="xs">Schema</Tab>
<svelte:fragment slot="content">
<TabContent value="code">
<div class="p-2 w-full overflow-auto">
Expand Down Expand Up @@ -808,9 +784,15 @@
{/if}
</div>
</TabContent>
<TabContent value="arguments">
<div class="p-2">
<SchemaViewer schema={script.schema} />
<TabContent value="schema">
<div class="p-1 relative">
<button
on:click={() => copyToClipboard(JSON.stringify(script?.schema, null, 4))}
class="absolute top-2 right-2"
>
<ClipboardCopy size={14} />
</button>
<Highlight language={json} code={JSON.stringify(script?.schema, null, 4)} />
</div>
</TabContent>
</svelte:fragment>
Expand Down

0 comments on commit 549b11d

Please sign in to comment.