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.
58 lines
2.4 KiB
58 lines
2.4 KiB
<script lang="ts">
|
|
import type Sprint from "$lib/models/sprint";
|
|
import { SprintKind } from "$lib/models/sprint";
|
|
import Amount from "../common/Amount.svelte";
|
|
import AmountRow from "../common/AmountRow.svelte";
|
|
import BurndownChart from "../common/BurndownChart.svelte";
|
|
import LabeledProgress from "../common/LabeledProgress.svelte";
|
|
import LabeledProgressRow from "../common/LabeledProgressRow.svelte";
|
|
import Markdown from "../common/Markdown.svelte";
|
|
import ItemSubSection from "../project/ItemSubSection.svelte";
|
|
|
|
export let sprint: Sprint
|
|
export let compact: boolean = false;
|
|
|
|
let timeRange: [Date, Date];
|
|
|
|
$: if (sprint.isTimed) {
|
|
timeRange = [new Date(sprint.fromTime), new Date(sprint.toTime)];
|
|
} else {
|
|
timeRange = void(0);
|
|
}
|
|
</script>
|
|
<Markdown source={sprint.description} />
|
|
{#if sprint.kind === SprintKind.Items}
|
|
<LabeledProgress timeRange={timeRange} green name={sprint.aggregateName || "Items"} count={sprint.itemsAcquired} target={sprint.itemsRequired} />
|
|
{:else}
|
|
<LabeledProgress timeRange={timeRange} name={sprint.aggregateName} count={sprint.aggregateAcquired} target={sprint.aggregateRequired} weighted={!sprint.isUnweighted} />
|
|
{/if}
|
|
{#if !sprint.isCoarse}
|
|
<LabeledProgressRow>
|
|
{#each (sprint.progress||[]) as stat (stat.id)}
|
|
<LabeledProgress compact timeRange={timeRange} name={stat.name} count={stat.acquired} target={stat.required} />
|
|
{/each}
|
|
</LabeledProgressRow>
|
|
{/if}
|
|
{#if sprint.kind !== SprintKind.Items && sprint.aggregateBurndown != null && sprint.aggregateBurndown.length > 0}
|
|
<BurndownChart data={sprint.aggregateBurndown} from={sprint.fromTime} to={sprint.toTime} milestone={sprint.aggregateRequired} />
|
|
{/if}
|
|
{#if sprint.kind === SprintKind.Items && sprint.itemBurndown != null && sprint.itemBurndown.length > 0}
|
|
<BurndownChart green data={sprint.itemBurndown} from={sprint.fromTime} to={sprint.toTime} milestone={sprint.itemsRequired} />
|
|
{/if}
|
|
{#if sprint.kind === SprintKind.Items}
|
|
{#each (sprint.items||[]) as item (item.id)}
|
|
{#if !compact || !item.acquiredTime}
|
|
<ItemSubSection compact={compact} hideStats={compact} item={item} />
|
|
{/if}
|
|
{/each}
|
|
{:else}
|
|
{#if compact}
|
|
<AmountRow>
|
|
<Amount label="Acquired Items" value={(sprint.items||[]).length} />
|
|
</AmountRow>
|
|
{:else}
|
|
{#each (sprint.items||[]) as item (item.id)}
|
|
<ItemSubSection compact item={item} />
|
|
{/each}
|
|
{/if}
|
|
{/if}
|