@axium/tasks 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common.d.ts +1 -1
- package/dist/common.js +1 -1
- package/dist/server.js +1 -1
- package/lib/TaskList.svelte +3 -3
- package/package.json +1 -1
- package/routes/tasks/+page.ts +2 -0
- package/routes/tasks/[id]/+page.ts +2 -0
package/dist/common.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { Permission } from '@axium/core';
|
|
|
2
2
|
import type { WithRequired } from 'utilium';
|
|
3
3
|
import * as z from 'zod';
|
|
4
4
|
export declare const TaskInit: z.ZodObject<{
|
|
5
|
-
summary: z.
|
|
5
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
6
6
|
description: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
7
7
|
listId: z.ZodUUID;
|
|
8
8
|
parentId: z.ZodNullable<z.ZodOptional<z.ZodUUID>>;
|
package/dist/common.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as z from 'zod';
|
|
2
2
|
export const TaskInit = z.object({
|
|
3
|
-
summary: z.string().max(100).
|
|
3
|
+
summary: z.string().max(100).optional(),
|
|
4
4
|
description: z.string().max(500).optional().nullable(),
|
|
5
5
|
listId: z.uuid(),
|
|
6
6
|
parentId: z.uuid().optional().nullable(),
|
package/dist/server.js
CHANGED
|
@@ -74,7 +74,7 @@ addRoute({
|
|
|
74
74
|
await checkAuthForItem(event, 'task_lists', listId, Permission.Edit);
|
|
75
75
|
return await database
|
|
76
76
|
.insertInto('tasks')
|
|
77
|
-
.values({ ...init, listId })
|
|
77
|
+
.values({ summary: '', ...init, listId })
|
|
78
78
|
.returningAll()
|
|
79
79
|
.executeTakeFirstOrThrow()
|
|
80
80
|
.catch(withError('Could not update task list'));
|
package/lib/TaskList.svelte
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
{#snippet task_tree(root: Task)}
|
|
15
15
|
<div class="task">
|
|
16
|
-
<label for="task-completed#{root.id}">
|
|
16
|
+
<label for="task-completed#{root.id}" style:cursor="pointer">
|
|
17
17
|
<Icon i="regular/circle{root.completed ? '-check' : ''}" --size="20px" />
|
|
18
18
|
</label>
|
|
19
19
|
<input
|
|
@@ -99,13 +99,13 @@
|
|
|
99
99
|
{#each tasks.filter(task => !task.parentId && !task.completed) as task}
|
|
100
100
|
{@render task_tree(task)}
|
|
101
101
|
{:else}
|
|
102
|
-
<i>No pending tasks.</i>
|
|
102
|
+
<i class="subtle">No pending tasks.</i>
|
|
103
103
|
{/each}
|
|
104
104
|
<h4>Completed</h4>
|
|
105
105
|
{#each tasks.filter(task => !task.parentId && task.completed) as task}
|
|
106
106
|
{@render task_tree(task)}
|
|
107
107
|
{:else}
|
|
108
|
-
<i>No completed tasks.</i>
|
|
108
|
+
<i class="subtle">No completed tasks.</i>
|
|
109
109
|
{/each}
|
|
110
110
|
</div>
|
|
111
111
|
|
package/package.json
CHANGED
package/routes/tasks/+page.ts
CHANGED
|
@@ -4,6 +4,8 @@ import type { Session } from '@axium/core';
|
|
|
4
4
|
import { parseList } from '@axium/tasks/client';
|
|
5
5
|
import type { LoadEvent } from '@sveltejs/kit';
|
|
6
6
|
|
|
7
|
+
export const ssr = false;
|
|
8
|
+
|
|
7
9
|
export async function load({ parent }: LoadEvent) {
|
|
8
10
|
let { session }: { session?: Session } = await parent();
|
|
9
11
|
|
|
@@ -2,6 +2,8 @@ import { fetchAPI } from '@axium/client/requests';
|
|
|
2
2
|
import type { LoadEvent } from '@sveltejs/kit';
|
|
3
3
|
import { parseList } from '@axium/tasks/client';
|
|
4
4
|
|
|
5
|
+
export const ssr = false;
|
|
6
|
+
|
|
5
7
|
export async function load({ params }: LoadEvent) {
|
|
6
8
|
const list = await fetchAPI('GET', 'task_lists/:id', {}, params.id!);
|
|
7
9
|
|