-
Notifications
You must be signed in to change notification settings - Fork 213
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an edit task page to settings. Not fully functional yet but close
- Loading branch information
Showing
3 changed files
with
135 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
app/web_ui/src/routes/(app)/settings/edit_task/+page.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<script lang="ts"> | ||
import AppPage from "../../app_page.svelte" | ||
import EditTask from "../../../(fullscreen)/setup/(setup)/create_task/edit_task.svelte" | ||
import { current_task, load_current_task, current_project } from "$lib/stores" | ||
import { onMount } from "svelte" | ||
import { createKilnError, KilnError } from "$lib/utils/error_handlers" | ||
$: task = $current_task | ||
let loading = false | ||
let error: KilnError | null = null | ||
onMount(async () => { | ||
// refresh on load to be sure we have the latest task | ||
try { | ||
error = null | ||
loading = true | ||
await load_current_task($current_project) | ||
task = $current_task | ||
} catch (e: unknown) { | ||
console.error(e) | ||
error = createKilnError(e) | ||
} finally { | ||
loading = false | ||
} | ||
}) | ||
error = createKilnError("Task not found ASDF") | ||
</script> | ||
|
||
<AppPage title="Edit Task" subtitle={task?.name}> | ||
{#if error} | ||
<div class="text-red-500">{error.getMessage()}</div> | ||
{:else if loading} | ||
<div class="w-full min-h-[50vh] flex justify-center items-center"> | ||
<div class="loading loading-spinner loading-lg"></div> | ||
</div> | ||
{:else if task} | ||
<EditTask {task} /> | ||
{:else} | ||
<div class="text-gray-500 text-lg">Task not found</div> | ||
{/if} | ||
</AppPage> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters