Skip to content

Commit 94d49ae

Browse files
committed
move enable button to info form
1 parent fe93105 commit 94d49ae

File tree

6 files changed

+39
-27
lines changed

6 files changed

+39
-27
lines changed

i18n/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1509,7 +1509,6 @@
15091509
"no_results_description": "Try a synonym or more general keyword",
15101510
"no_shared_albums_message": "Create an album to share photos and videos with people in your network",
15111511
"no_uploads_in_progress": "No uploads in progress",
1512-
"no_workflows_yet": "No workflows yet",
15131512
"not_allowed": "Not allowed",
15141513
"not_available": "N/A",
15151514
"not_in_any_album": "Not in any album",
@@ -2276,6 +2275,7 @@
22762275
"workflow_delete_prompt": "Are you sure you want to delete this workflow?",
22772276
"workflow_deleted": "Workflow deleted",
22782277
"workflow_description": "Workflow description",
2278+
"workflow_info": "Workflow info",
22792279
"workflow_json": "Workflow JSON",
22802280
"workflow_json_help": "Edit the workflow configuration in JSON format. Changes will sync to the visual builder.",
22812281
"workflow_name": "Workflow name",

pnpm-lock.yaml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Loading

web/src/lib/components/workflows/WorkflowPickerField.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
2525
let pickerMetadata = $state<AlbumResponseDto | PersonResponseDto | AlbumResponseDto[] | PersonResponseDto[]>();
2626
27-
// Fetch metadata for existing picker values (albums/people)
2827
$effect(() => {
2928
if (!value) {
3029
pickerMetadata = undefined;

web/src/routes/(user)/utilities/workflows/+page.svelte

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<script lang="ts">
22
import { goto } from '$app/navigation';
3+
import emptyWorkflows from '$lib/assets/empty-workflows.svg';
34
import UserPageLayout from '$lib/components/layouts/user-page-layout.svelte';
5+
import EmptyPlaceholder from '$lib/components/shared-components/empty-placeholder.svelte';
46
import { AppRoute } from '$lib/constants';
57
import type { WorkflowPayload } from '$lib/services/workflow.service';
68
import { handleError } from '$lib/utils/handle-error';
@@ -187,17 +189,13 @@
187189
<section class="flex place-content-center sm:mx-4">
188190
<section class="w-full pb-28 sm:w-5/6 md:w-4xl">
189191
{#if workflows.length === 0}
190-
<div class="flex flex-col items-center justify-center gap-4 py-20">
191-
<Icon icon={mdiPlay} size="64" class="text-immich-primary dark:text-immich-dark-primary" />
192-
<h2 class="text-2xl font-semibold">{$t('no_workflows_yet')}</h2>
193-
<p class="text-center text-sm text-muted">
194-
{$t('workflows_help_text')}
195-
</p>
196-
<Button shape="round" color="primary" onclick={handleCreateWorkflow}>
197-
<Icon icon={mdiPlus} size="18" />
198-
{$t('create_first_workflow')}
199-
</Button>
200-
</div>
192+
<EmptyPlaceholder
193+
title={$t('create_first_workflow')}
194+
text={$t('workflows_help_text')}
195+
onClick={() => {}}
196+
src={emptyWorkflows}
197+
class="mt-10 mx-auto"
198+
/>
201199
{:else}
202200
<div class="my-6 grid gap-6">
203201
{#each workflows as workflow (workflow.id)}

web/src/routes/(user)/utilities/workflows/[workflowId]/+page.svelte

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -370,19 +370,38 @@
370370
<div class="flex place-items-start gap-3">
371371
<Icon icon={mdiInformationOutline} size="20" class="mt-1" />
372372
<div class="flex flex-col">
373-
<CardTitle>Basic information</CardTitle>
374-
<CardDescription>Describing the workflow</CardDescription>
373+
<CardTitle>
374+
{$t('workflow_info')}
375+
</CardTitle>
375376
</div>
376377
</div>
377378
</CardHeader>
378379

379380
<CardBody>
380-
<VStack gap={6}>
381-
<Field class="text-sm" label={$t('name')} for="workflow-name" required>
381+
<VStack gap={4}>
382+
<div
383+
class="relative overflow-hidden border p-4 w-full rounded-xl"
384+
class:bg-primary-50={editWorkflow.enabled}
385+
>
386+
<Field
387+
label={editWorkflow.enabled ? $t('enabled') : $t('disabled')}
388+
for="workflow-enabled"
389+
color={editWorkflow.enabled ? 'primary' : 'secondary'}
390+
>
391+
<Switch id="workflow-enabled" bind:checked={editWorkflow.enabled} />
392+
</Field>
393+
</div>
394+
395+
<Field label={$t('name')} for="workflow-name" required>
382396
<Input id="workflow-name" placeholder={$t('workflow_name')} bind:value={name} />
383397
</Field>
384-
<Field class="text-sm" label={$t('description')} for="workflow-description">
385-
<Textarea id="workflow-description" placeholder={$t('workflow_description')} bind:value={description} />
398+
<Field label={$t('description')} for="workflow-description">
399+
<Textarea
400+
id="workflow-description"
401+
grow
402+
placeholder={$t('workflow_description')}
403+
bind:value={description}
404+
/>
386405
</Field>
387406
</VStack>
388407
</CardBody>
@@ -559,7 +578,7 @@
559578

560579
<ControlAppBar onClose={() => goto(AppRoute.WORKFLOWS)} backIcon={mdiArrowLeft} tailwindClasses="fixed! top-0! w-full">
561580
{#snippet leading()}
562-
<p>{data.meta.title}</p>
581+
<Text>{data.meta.title}</Text>
563582
{/snippet}
564583

565584
{#snippet trailing()}
@@ -588,11 +607,6 @@
588607
</Button>
589608
</HStack>
590609

591-
<HStack gap={2}>
592-
<Text class="text-sm">{editWorkflow.enabled ? 'ON' : 'OFF'}</Text>
593-
<Switch bind:checked={editWorkflow.enabled} />
594-
</HStack>
595-
596610
<Button leadingIcon={mdiContentSave} size="small" color="primary" onclick={updateWorkflow} disabled={!hasChanges}>
597611
{$t('save')}
598612
</Button>

0 commit comments

Comments
 (0)