From 4d60be738ee72358a3eaac95cc2f2dd0bd5ca1b8 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Wed, 18 Jan 2023 09:38:54 +0100 Subject: [PATCH] UX nits on schedule --- frontend/src/lib/components/RunForm.svelte | 75 ++++++------ .../(root)/(logged)/schedules/+page.svelte | 112 +++++++++++------- .../scripts/get/[...hash]/+page.svelte | 5 +- 3 files changed, 107 insertions(+), 85 deletions(-) diff --git a/frontend/src/lib/components/RunForm.svelte b/frontend/src/lib/components/RunForm.svelte index ab644ab8f2..fd91266fe6 100644 --- a/frontend/src/lib/components/RunForm.svelte +++ b/frontend/src/lib/components/RunForm.svelte @@ -123,47 +123,50 @@ {:else}
No schema
{/if} - {#if viewOptions} -
-

Run later

-
-
-
-
+ {#if schedulable} +
+
+
+ {#if viewOptions} +
+
+
+
+
+ +
+
+
+ {/if}
-
- {/if} - {#if schedulable} -
- {#if runnable?.path?.startsWith(`u/${$userStore?.username}`) != true && (runnable?.path?.split('/')?.length ?? 0) > 2}
runAction(scheduledForStr, args, invisible_to_owner)} > - {scheduledForStr ? 'Schedule run to a later time' : buttonText} + {scheduledForStr ? 'Schedule to run later' : buttonText}
diff --git a/frontend/src/routes/(root)/(logged)/schedules/+page.svelte b/frontend/src/routes/(root)/(logged)/schedules/+page.svelte index 37a5c9a922..4e3e67971e 100644 --- a/frontend/src/routes/(root)/(logged)/schedules/+page.svelte +++ b/frontend/src/routes/(root)/(logged)/schedules/+page.svelte @@ -10,6 +10,7 @@ import { faCircle, faEdit, + faList, faPlus, faShare, faToggleOff, @@ -76,7 +77,7 @@ Schedule - Script or Flow + Script/Flow schedule off/on @@ -95,11 +96,14 @@
{is_flow ? 'flow' : 'script'}{script_path}
{is_flow ? 'flow' : 'script'}
{schedule} @@ -145,47 +149,63 @@ >By {edited_by}
the {displayDate(edited_at)}
- { - setScheduleEnabled(path, enabled ? false : true) +
+ + { + setScheduleEnabled(path, enabled ? false : true) + } + }, + { + displayName: 'Delete', + icon: faTrash, + disabled: !canWrite, + action: async () => { + await ScheduleService.deleteSchedule({ + workspace: $workspaceStore ?? '', + path + }) + loadSchedules() + } + }, + { + displayName: 'Edit', + icon: faEdit, + disabled: !canWrite, + action: () => { + scheduleEditor?.openEdit(path, is_flow) + } + }, + { + displayName: 'View Runs', + icon: faList, + href: '/runs/' + path + }, + { + displayName: canWrite ? 'Share' : 'See Permissions', + icon: faShare, + action: () => { + shareModal.openDrawer(path, 'schedule') + } } - }, - { - displayName: 'Delete', - icon: faTrash, - disabled: !canWrite, - action: async () => { - await ScheduleService.deleteSchedule({ - workspace: $workspaceStore ?? '', - path - }) - loadSchedules() - } - }, - { - displayName: 'Edit', - icon: faEdit, - disabled: !canWrite, - action: () => { - scheduleEditor?.openEdit(path, is_flow) - } - }, - { - displayName: canWrite ? 'Share' : 'See Permissions', - icon: faShare, - action: () => { - shareModal.openDrawer(path, 'schedule') - } - } - ]} - /> + ]} + /> +
+ {/each} diff --git a/frontend/src/routes/(root)/(logged)/scripts/get/[...hash]/+page.svelte b/frontend/src/routes/(root)/(logged)/scripts/get/[...hash]/+page.svelte index 283a6a0716..6d4ed2e0a9 100644 --- a/frontend/src/routes/(root)/(logged)/scripts/get/[...hash]/+page.svelte +++ b/frontend/src/routes/(root)/(logged)/scripts/get/[...hash]/+page.svelte @@ -347,7 +347,6 @@
-

Preview

-
+

Webhooks @@ -479,7 +478,7 @@

-
+
{#if can_write}

Danger zone