diff --git a/src/lib/ui/Tasks/TaskView.svelte b/src/lib/ui/Tasks/TaskView.svelte new file mode 100644 index 0000000..18174f9 --- /dev/null +++ b/src/lib/ui/Tasks/TaskView.svelte @@ -0,0 +1,171 @@ + + +{@render description(task.type.prefix, task.taskId, task.description)} +{@render details( + task.status, + task.priority, + task.openDate, + task.closeDate, + parent, + children, + )} +{@render checklist(task.checklist)} +{@render body(task.body, task.bodyHistory)} +{@render integrations(task.integrations)} + + + +{#snippet description( + prefix: NonNullable, + taskId: NonNullable, + description: Task["description"], +)} +

+ {prefix + taskId} + + {description} +

+{/snippet} + +{#snippet details( + status: Task["status"], + priority: Task["priority"], + opened: Task["openDate"], + closed: Task["closeDate"], + parent: { + prefix: Task["type"]["prefix"]; + taskId: Task["taskId"]; + description: Task["description"]; + }, + children: Array< + { + prefix: Task["type"]["prefix"]; + taskId: Task["taskId"]; + description: Task["description"]; + status: Task["status"]; + } + >, +)} +
+
+ Status: + {status ?? "--"} +
+
+ Priority: + {priority ?? "--"} +
+ +
+ Opened: + {opened ?? "--"} +
+
+ Closed: + {closed ?? "--"} +
+
+ Parent: + { + !Object.values(parent).some(value => value === null) + ? `${parent.prefix}${parent.taskId} | ${parent.description}` + : "--" + } +
+
+

Children

+ + + {#each children as child (child.taskId)} + + + + + + {/each} + +
{child.prefix + child.taskId}{child.description}{child.status}
+
+
+{/snippet} + +{#snippet body(body: Task["body"], history: Task["bodyHistory"])} +
+

Body

+

{body}

+ {#if history} +

History

+

{history}

+ {/if} +
+
+

Updates

+

+ { + task.updateChain + ? JSON.stringify(task.updateChain) + : "--" + } +

+
+{/snippet} + +{#snippet checklist(checklist: Task["checklist"])} +
+

Checklist

+

+ {checklist ? JSON.stringify(checklist) : "--"} +

+
+{/snippet} + +{#snippet integrations(integrations: Task["integrations"])} +
+

Integrations

+

+ {integrations ? JSON.stringify(integrations) : "--"} +

+
+{/snippet} +