|
|
@ -14,6 +14,7 @@ |
|
|
|
import AcquiredTimeInput from "$lib/components/controls/AcquiredTimeInput.svelte"; |
|
|
|
import RequirementSelect from "$lib/components/controls/RequirementSelect.svelte"; |
|
|
|
import StatInput from "$lib/components/controls/StatInput.svelte"; |
|
|
|
import Checkbox from "$lib/components/layout/Checkbox.svelte"; |
|
|
|
import type Item from "$lib/models/item"; |
|
|
|
import type { ItemInput } from "$lib/models/item"; |
|
|
|
import type { Requirement } from "$lib/models/project"; |
|
|
@ -28,7 +29,6 @@ |
|
|
|
const {reloadItemList} = getItemListContext(); |
|
|
|
const {reloadSprintList} = getSprintListContext(); |
|
|
|
const {reloadItemLists} = getItemMultiListContext(); |
|
|
|
const {page} = getStores(); |
|
|
|
|
|
|
|
let item: ItemInput |
|
|
|
let itemId: number |
|
|
@ -42,6 +42,8 @@ |
|
|
|
let error: string |
|
|
|
let loading: boolean |
|
|
|
let show: boolean |
|
|
|
let addAnother: boolean |
|
|
|
let nameElem: HTMLElement |
|
|
|
|
|
|
|
$: switch ($currentModal.name) { |
|
|
|
case "item.create": |
|
|
@ -161,7 +163,13 @@ |
|
|
|
await reloadSprintList(); |
|
|
|
reloadItemLists(); |
|
|
|
|
|
|
|
closeModal(); |
|
|
|
if (addAnother) { |
|
|
|
item.name = ""; |
|
|
|
item.description = ""; |
|
|
|
nameElem.focus(); |
|
|
|
} else { |
|
|
|
closeModal(); |
|
|
|
} |
|
|
|
} catch(err) { |
|
|
|
if (err.statusCode != null) { |
|
|
|
error = err.statusMessage; |
|
|
@ -179,11 +187,12 @@ |
|
|
|
<Modal wide closable show={show} verb={op} noun="Item" disabled={loading} error={error}> |
|
|
|
<ModalBody> |
|
|
|
<label for="name">Name</label> |
|
|
|
<input name="name" type="text" bind:value={item.name} /> |
|
|
|
<input bind:this={nameElem} name="name" type="text" bind:value={item.name} /> |
|
|
|
<label for="acquiredTime">Acquired</label> |
|
|
|
<AcquiredTimeInput openDate={openedDate} bind:value={item.acquiredTime} /> |
|
|
|
<label for="description">Description</label> |
|
|
|
<textarea name="description" bind:value={item.description} /> |
|
|
|
<Checkbox bind:checked={addAnother} label="Add another." /> |
|
|
|
</ModalBody> |
|
|
|
<ModalBody> |
|
|
|
{#if requirementName != null} |
|
|
|