nits schedule UX

This commit is contained in:
Ruben Fiszel
2024-10-16 19:19:24 +02:00
parent dd606b5e87
commit 53e028bfa0
4 changed files with 37 additions and 23 deletions
+1 -1
View File
@@ -222,7 +222,7 @@
<Label label="Timezone" class="font-semibold" primary>
{#if disabled}
<div>
<Badge><span class="text-primary-inverse">{timezone}</span></Badge>
<Badge><span class="text-primary dark:text-primary-inverse">{timezone}</span></Badge>
</div>
{:else}
<Select
@@ -186,15 +186,17 @@
{/if}
<!-- svelte-ignore a11y-autofocus -->
<Label label="Summary" class="font-semibold" primary>
<input
autofocus
type="text"
placeholder="Short summary to be displayed when listed"
class="text-sm w-full"
bind:value={$primarySchedule.summary}
/>
</Label>
<div class="mt-5">
<Label label="Summary" class="font-semibold" primary>
<input
autofocus
type="text"
placeholder="Short summary to be displayed when listed"
class="text-sm w-full"
bind:value={$primarySchedule.summary}
/>
</Label>
</div>
</div>
<CronInput bind:schedule={$primarySchedule.cron} bind:timezone={$primarySchedule.timezone} />
<SchemaForm {schema} bind:args={$primarySchedule.args} />
@@ -233,7 +235,7 @@
>
Set Primary Schedule
</Button>
{#if initialPrimarySchedule != false && !newItem}
{#if initialPrimarySchedule != undefined && initialPrimarySchedule != false && !newItem}
<Button on:click={save} color="dark" size="md" startIcon={{ icon: Save }}>
Apply changes now
</Button>
@@ -244,6 +246,14 @@
{/if}
</div>
<Label label="Summary" class="font-semibold" primary>
<input
type="text"
disabled
placeholder="Short summary to be displayed when listed"
class="text-sm w-full"
/>
</Label>
<CronInput schedule={''} disabled timezone={Intl.DateTimeFormat().resolvedOptions().timeZone} />
<SchemaForm disabled {schema} />
+1 -1
View File
@@ -1,5 +1,5 @@
//regex that match path starting with u/ or f/ and with at least 2 /
const pathRegex = /\b(u|f)\/[^\/]+\/[^\/]+\b/g
const pathRegex = /\b(u|f)\/[^\/\s]+\/[^\/\s]+\b/g
export function processMessage(message: string): string {
return message.replaceAll(pathRegex, (path) => {
@@ -48,16 +48,20 @@
/>
<div class="flex flex-col gap-4">
{#if !newItem && ($userStore?.is_admin || $userStore?.is_super_admin)}
<Button
on:click={() => routeEditor?.openNew(isFlow, path)}
variant="border"
color="light"
size="xs"
startIcon={{ icon: RouteIcon }}
>
New Route
</Button>
{#if !newItem}
{#if $userStore?.is_admin || $userStore?.is_super_admin}
<Button
on:click={() => routeEditor?.openNew(isFlow, path)}
variant="border"
color="light"
size="xs"
startIcon={{ icon: RouteIcon }}
>
New Route
</Button>
{:else}
<Alert title="Only workspace admins can create routes" type="warning" size="xs" />
{/if}
{/if}
{#if httpTriggers}
@@ -93,7 +97,7 @@
{#if newItem}
<Alert title="Triggers disabled" type="warning" size="xs">
Deploy the {isFlow ? 'flow' : 'script'} to enable http routes triggers.
Deploy the {isFlow ? 'flow' : 'script'} to add http routes.
</Alert>
{/if}
</div>