Browse Source

fix wrapping in task status numbers, check mark as active by default if a log would bring it at or past the target.

main
Gisle Aune 4 years ago
parent
commit
c43b180106
  1. 2
      svelte-ui/src/components/TaskEntry.svelte
  2. 27
      svelte-ui/src/forms/LogAddForm.svelte
  3. 2
      svelte-ui/src/forms/TaskDeleteForm.svelte

2
svelte-ui/src/components/TaskEntry.svelte

@ -36,7 +36,7 @@
</div>
{:else}
<div class="icon">
{task.completedAmount} / {task.itemAmount}
{task.completedAmount}&nbsp;/&nbsp;{task.itemAmount}
</div>
{/if}
<div class="name">{task.name}</div>

27
svelte-ui/src/forms/LogAddForm.svelte

@ -7,25 +7,25 @@ import logStore from "../stores/logs";
import projectStore, { fpProjectStore } from "../stores/project";
import { formatFormTime } from "../utils/time";
let loggedTime = formatFormTime(new Date);
let taskName = "";
let description = "";
let markInactive = false;
let error = null;
function onSubmit() {
const md = $modalStore;
if (md.name !== "log.add") {
throw new Error("Wrong form");
}
const task = md.task;
let loggedTime = formatFormTime(new Date);
let description = "";
let markInactive = task.completedAmount >= (task.itemAmount - 1);
let error = null;
function onSubmit() {
stuffLogClient.createLog({
taskId: md.task.id,
taskId: task.id,
loggedTime: new Date(loggedTime).toISOString(),
description,
}).then(() => {
if (markInactive) {
return stuffLogClient.updateTask(md.task.id, {active: false})
return stuffLogClient.updateTask(task.id, {active: false})
}
}).then(() => {
modalStore.close();
@ -43,19 +43,12 @@ import logStore from "../stores/logs";
function onClose() {
modalStore.close();
}
$: {
const md = $modalStore;
if (md.name === "log.add") {
taskName = md.task.name;
}
}
</script>
<Modal show title="Add Log" error={error} closable on:close={onClose}>
<form on:submit|preventDefault={onSubmit}>
<label for="taskName">Task</label>
<input disabled name="taskName" type="text" bind:value={taskName} />
<input disabled name="taskName" type="text" bind:value={task.name} />
<label for="loggedTime">Logged Time</label>
<input name="loggedTime" type="datetime-local" bind:value={loggedTime} />

2
svelte-ui/src/forms/TaskDeleteForm.svelte

@ -55,6 +55,6 @@
<hr />
<button type="submit">Delete1 Task</button>
<button type="submit">Delete Task</button>
</form>
</Modal>
Loading…
Cancel
Save