|
|
|
@ -8,6 +8,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
import MarkdownEditor from '../../Components/MarkdownEditor.svelte'; |
|
|
|
import MarkdownEditor from '../../Components/MarkdownEditor.svelte'; |
|
|
|
import MemberEditor from '../../Components/MemberEditor.svelte'; |
|
|
|
import MemberEditor from '../../Components/MemberEditor.svelte'; |
|
|
|
|
|
|
|
import Tags from '../tags/TagList.svelte'; |
|
|
|
|
|
|
|
|
|
|
|
let { project_id = null, parent_task_id } = $props(); |
|
|
|
let { project_id = null, parent_task_id } = $props(); |
|
|
|
let error = $state(null); |
|
|
|
let error = $state(null); |
|
|
|
@ -17,12 +18,13 @@ |
|
|
|
let task = $state({ |
|
|
|
let task = $state({ |
|
|
|
name : '', |
|
|
|
name : '', |
|
|
|
description : { source : '', rendered : '' }, |
|
|
|
description : { source : '', rendered : '' }, |
|
|
|
members : {}, |
|
|
|
|
|
|
|
estimated_time: null, |
|
|
|
|
|
|
|
start_date: null, |
|
|
|
|
|
|
|
due_date: null, |
|
|
|
due_date: null, |
|
|
|
|
|
|
|
estimated_time: null, |
|
|
|
|
|
|
|
no_index: false, |
|
|
|
|
|
|
|
members : {}, |
|
|
|
show_closed: false, |
|
|
|
show_closed: false, |
|
|
|
no_index: false |
|
|
|
start_date: null, |
|
|
|
|
|
|
|
tags: [] |
|
|
|
}); |
|
|
|
}); |
|
|
|
let router = useTinyRouter(); |
|
|
|
let router = useTinyRouter(); |
|
|
|
|
|
|
|
|
|
|
|
@ -38,6 +40,7 @@ |
|
|
|
async function load(){ |
|
|
|
async function load(){ |
|
|
|
if (parent_task_id) await loadParent(); |
|
|
|
if (parent_task_id) await loadParent(); |
|
|
|
if (project_id) loadProject(); |
|
|
|
if (project_id) loadProject(); |
|
|
|
|
|
|
|
loadTags(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async function loadParent(){ |
|
|
|
async function loadParent(){ |
|
|
|
@ -68,6 +71,16 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function loadTags(){ |
|
|
|
|
|
|
|
let url = null; |
|
|
|
|
|
|
|
if (project_id) url = api(`tags/project/${project_id}`); |
|
|
|
|
|
|
|
if (parent_task_id) url = api(`tags/task/${parent_task_id}`); |
|
|
|
|
|
|
|
if (url) { |
|
|
|
|
|
|
|
const resp = await fetch(url,{credentials:'include'}); |
|
|
|
|
|
|
|
if (resp.ok) task.tags = await resp.json(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async function getCandidates(text){ |
|
|
|
async function getCandidates(text){ |
|
|
|
const origin = parent_task ? parent_task.members : project.members; |
|
|
|
const origin = parent_task ? parent_task.members : project.members; |
|
|
|
const candidates = Object.values(origin) |
|
|
|
const candidates = Object.values(origin) |
|
|
|
@ -154,6 +167,14 @@ |
|
|
|
<MarkdownEditor bind:value={task.description} simple={true} /> |
|
|
|
<MarkdownEditor bind:value={task.description} simple={true} /> |
|
|
|
</td> |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
</tr> |
|
|
|
|
|
|
|
<tr> |
|
|
|
|
|
|
|
<th> |
|
|
|
|
|
|
|
{t('tags')} |
|
|
|
|
|
|
|
</th> |
|
|
|
|
|
|
|
<td> |
|
|
|
|
|
|
|
<Tags module="task" bind:tags={task.tags} /> |
|
|
|
|
|
|
|
</td> |
|
|
|
|
|
|
|
</tr> |
|
|
|
{#if extendedSettings} |
|
|
|
{#if extendedSettings} |
|
|
|
<tr> |
|
|
|
<tr> |
|
|
|
<th> |
|
|
|
<th> |
|
|
|
|