From d7b39304e5744743d897198d95a9f693bd402fa6 Mon Sep 17 00:00:00 2001 From: Guilhem Date: Mon, 7 Oct 2024 19:13:44 +0200 Subject: [PATCH] feat(frontend) change path picker --- frontend/src/lib/components/Path.svelte | 292 +++++++++++++----------- 1 file changed, 153 insertions(+), 139 deletions(-) diff --git a/frontend/src/lib/components/Path.svelte b/frontend/src/lib/components/Path.svelte index 0b0314d696..b1451cd999 100644 --- a/frontend/src/lib/components/Path.svelte +++ b/frontend/src/lib/components/Path.svelte @@ -24,8 +24,6 @@ import ToggleButtonGroup from './common/toggleButton-v2/ToggleButtonGroup.svelte' import FolderEditor from './FolderEditor.svelte' import { random_adj } from './random_positive_adjetive' - import Required from './Required.svelte' - import Tooltip from './Tooltip.svelte' import { Eye, Folder, Plus, SearchCode, User } from 'lucide-svelte' type PathKind = @@ -195,7 +193,10 @@ async function pathExists(path: string, kind: PathKind): Promise { if (kind == 'flow') { - return await FlowService.existsFlowByPath({ workspace: $workspaceStore!, path: path }) + return await FlowService.existsFlowByPath({ + workspace: $workspaceStore!, + path: path + }) } else if (kind == 'script') { return await ScriptService.existsScriptByPath({ workspace: $workspaceStore!, @@ -212,9 +213,15 @@ path: path }) } else if (kind == 'schedule') { - return await ScheduleService.existsSchedule({ workspace: $workspaceStore!, path: path }) + return await ScheduleService.existsSchedule({ + workspace: $workspaceStore!, + path: path + }) } else if (kind == 'app') { - return await AppService.existsApp({ workspace: $workspaceStore!, path: path }) + return await AppService.existsApp({ + workspace: $workspaceStore!, + path: path + }) } else if (kind == 'http_trigger') { return await HttpTriggerService.existsHttpTrigger({ workspace: $workspaceStore!, @@ -292,6 +299,7 @@ ) + -
-
+
+ +
+
+ + Full path + + { + currentTarget.select() + }} + /> + +
+
{error}
+
+ + +
+ {#if meta != undefined} -
- - {#if !hideUser} -
-   - - { - setDirty() - const kind = e.detail - if (meta) { - if (kind === 'folder') { - meta.owner = folders?.[0]?.name ?? '' - } else if (kind === 'group') { - meta.owner = 'all' - } else { - meta.owner = $userStore?.username?.split('@')[0] ?? '' - } + + {#if !hideUser} + +
+ { + setDirty() + const kind = e.detail + if (meta) { + if (kind === 'folder') { + meta.owner = folders?.[0]?.name ?? '' + } else if (kind === 'group') { + meta.owner = 'all' + } else { + meta.owner = $userStore?.username?.split('@')[0] ?? '' } - }} - > - - - - -
- {/if} - {#if meta.ownerKind === 'user'} - - {:else if meta.ownerKind === 'folder'} - - {/if} -
-