From 4819f609aee88f574211bc0cd12684ae1b212d78 Mon Sep 17 00:00:00 2001 From: Malte Teichert Date: Wed, 22 May 2024 00:22:55 +0200 Subject: [PATCH] refactor path handling --- TODO.md | 6 +- src/lib/components/atoms/PathListItem.svelte | 112 ++++--------- src/lib/components/sections/Paths.svelte | 64 +++++--- src/lib/index.ts | 22 +-- src/lib/pathHandling.ts | 163 +++++++++++++++++++ src/routes/+layout.svelte | 6 + 6 files changed, 241 insertions(+), 132 deletions(-) create mode 100644 src/lib/pathHandling.ts diff --git a/TODO.md b/TODO.md index 0bd6f6e..7325f70 100644 --- a/TODO.md +++ b/TODO.md @@ -1,6 +1,6 @@ - [x] Add path renaming - [x] Add path sub-page for editing a specific route -- [ ] Check that a path variable can only be included once +- [x] Check that a path variable can only be included once - [ ] Add schema editor component - [ ] Add route-parameters - [ ] path @@ -55,6 +55,10 @@ --- - [ ] Replace prompt, alert and confirms with skeleton-modals + - [x] Create path prompt + - [x] Edit path prompt + - [x] Rename path prompt + - [x] Delete path confirm - [ ] Add extensions --- diff --git a/src/lib/components/atoms/PathListItem.svelte b/src/lib/components/atoms/PathListItem.svelte index 37df66a..9cc9e96 100644 --- a/src/lib/components/atoms/PathListItem.svelte +++ b/src/lib/components/atoms/PathListItem.svelte @@ -1,106 +1,50 @@

{pathName}

Edit - { + renamePath(modalStore, pathName); + }} + > + Rename + + diff --git a/src/lib/components/sections/Paths.svelte b/src/lib/components/sections/Paths.svelte index d898ab4..772d496 100644 --- a/src/lib/components/sections/Paths.svelte +++ b/src/lib/components/sections/Paths.svelte @@ -1,40 +1,44 @@
{/each} - +