From afa5fa00cb9303f25421cb2294538929b659dd3f Mon Sep 17 00:00:00 2001 From: Gisle Aune Date: Sun, 24 Jan 2021 17:10:52 +0100 Subject: [PATCH] added better deadline and date range selectors. --- .../src/components/DateRangeSelect.svelte | 127 ++++++++++++++++++ .../src/components/DeadlineSelect.svelte | 118 ++++++++++++++++ svelte-ui/src/components/ParentEntry.svelte | 2 +- svelte-ui/src/components/ProjectEntry.svelte | 26 ++-- svelte-ui/src/components/TaskEntry.svelte | 53 +++++++- svelte-ui/src/forms/GoalForm.svelte | 6 +- svelte-ui/src/forms/TaskForm.svelte | 5 +- svelte-ui/src/utils/time.ts | 40 ++++++ 8 files changed, 353 insertions(+), 24 deletions(-) create mode 100644 svelte-ui/src/components/DateRangeSelect.svelte create mode 100644 svelte-ui/src/components/DeadlineSelect.svelte diff --git a/svelte-ui/src/components/DateRangeSelect.svelte b/svelte-ui/src/components/DateRangeSelect.svelte new file mode 100644 index 0000000..2b541d3 --- /dev/null +++ b/svelte-ui/src/components/DateRangeSelect.svelte @@ -0,0 +1,127 @@ + + + +
+ + + {#if selected === "custom"} + + + + + {/if} +
\ No newline at end of file diff --git a/svelte-ui/src/components/DeadlineSelect.svelte b/svelte-ui/src/components/DeadlineSelect.svelte new file mode 100644 index 0000000..600b4f3 --- /dev/null +++ b/svelte-ui/src/components/DeadlineSelect.svelte @@ -0,0 +1,118 @@ + + + + +{#if selected === "custom"} + +{/if} \ No newline at end of file diff --git a/svelte-ui/src/components/ParentEntry.svelte b/svelte-ui/src/components/ParentEntry.svelte index 57c0ec6..d5cfe14 100644 --- a/svelte-ui/src/components/ParentEntry.svelte +++ b/svelte-ui/src/components/ParentEntry.svelte @@ -107,7 +107,7 @@ import TimeProgress from "./TimeProgress.svelte"; padding: 0 0.5ch; width: 2ch; padding-top: 0.125em; - color: #333; + color: #444; } div.icon.completed { color: #484; diff --git a/svelte-ui/src/components/ProjectEntry.svelte b/svelte-ui/src/components/ProjectEntry.svelte index 38ef244..ae5c348 100644 --- a/svelte-ui/src/components/ProjectEntry.svelte +++ b/svelte-ui/src/components/ProjectEntry.svelte @@ -26,6 +26,7 @@ let completedTasks: TaskResult[] = []; let onholdTasks: TaskResult[] = []; let failedTasks: TaskResult[] = []; + let nonHiddenTasks: TaskResult[] = []; $: mdAddTask = {name:"task.add", project}; $: mdProjectEdit = {name:"project.edit", project}; @@ -33,25 +34,18 @@ $: { activeTasks = project.tasks.filter(t => t.active); + inactiveTasks = project.tasks.filter(t => !t.active); - if (!hideInactive) { - inactiveTasks = project.tasks.filter(t => !t.active); + todoTasks = inactiveTasks.filter(t => t.statusTag === "to do" || t.statusTag === "idea"); + onholdTasks = inactiveTasks.filter(t => t.statusTag === "on hold"); + completedTasks = inactiveTasks.filter(t => t.statusTag === "completed" || t.statusTag == null); + failedTasks = inactiveTasks.filter(t => t.statusTag === "failed" || t.statusTag === "declined"); - todoTasks = inactiveTasks.filter(t => t.statusTag === "to do" || t.statusTag === "idea"); - completedTasks = inactiveTasks.filter(t => t.statusTag === "completed" || t.statusTag == null); - onholdTasks = inactiveTasks.filter(t => t.statusTag === "on hold" || t.statusTag === "postponed"); - failedTasks = inactiveTasks.filter(t => t.statusTag === "failed" || t.statusTag === "declined" || t.statusTag === "wont do"); - } else { - inactiveTasks = []; - todoTasks = []; - completedTasks = []; - onholdTasks = []; - failedTasks = []; - } + nonHiddenTasks = [...activeTasks, ...todoTasks, ...onholdTasks]; } - + {/if} {#if hideInactive} - + {:else} - + {/if} diff --git a/svelte-ui/src/components/TaskEntry.svelte b/svelte-ui/src/components/TaskEntry.svelte index 5499d29..9d94768 100644 --- a/svelte-ui/src/components/TaskEntry.svelte +++ b/svelte-ui/src/components/TaskEntry.svelte @@ -1,6 +1,10 @@