You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
900 B
39 lines
900 B
<script lang="ts">
|
|
import type Project from "../models/project";
|
|
import type { TaskResult } from "../models/task";
|
|
import TaskEntry from "./TaskEntry.svelte";
|
|
import projectStore from "../stores/project";
|
|
|
|
export let project: Project;
|
|
export let tasks: TaskResult[];
|
|
export let showAllOptions: boolean;
|
|
export let header: string;
|
|
|
|
let sortedTasks: TaskResult[] = [];
|
|
|
|
$: sortedTasks = tasks.sort((a,b) => a.createdTime.localeCompare(b.createdTime))
|
|
</script>
|
|
|
|
{#if tasks.length > 0}
|
|
<h3>{header}</h3>
|
|
{#each sortedTasks as task (task.id)}
|
|
<TaskEntry
|
|
showAllOptions={showAllOptions}
|
|
task={task} project={project}
|
|
actualProject={$projectStore.projects.find(p => p.id === task.projectId)}
|
|
/>
|
|
{/each}
|
|
{/if}
|
|
|
|
<style>
|
|
h3:empty {
|
|
display: none;
|
|
}
|
|
|
|
h3 {
|
|
padding: 0;
|
|
margin: 0;
|
|
margin-top: 0.5em;
|
|
font-weight: 100;
|
|
}
|
|
</style>
|