show "loading" while loading parent candidates
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
let { project, select = o => {}, task } = $props();
|
let { project, select = o => {}, task } = $props();
|
||||||
let tree = $state({});
|
let tree = $state({});
|
||||||
|
let loading = $state(true);
|
||||||
|
|
||||||
async function loadParentCandidates(){
|
async function loadParentCandidates(){
|
||||||
let url = api(`task/${task.id}/parent_candidates`);
|
let url = api(`task/${task.id}/parent_candidates`);
|
||||||
@@ -14,6 +15,7 @@
|
|||||||
if (res.ok){
|
if (res.ok){
|
||||||
yikes();
|
yikes();
|
||||||
tree = await res.json();
|
tree = await res.json();
|
||||||
|
loading = false;
|
||||||
} else error(res);
|
} else error(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -26,5 +28,11 @@
|
|||||||
<button onclick={ev => select(null)}>{t('abort')}</button>
|
<button onclick={ev => select(null)}>{t('abort')}</button>
|
||||||
</h2>
|
</h2>
|
||||||
{t('project')}: {project.name}
|
{t('project')}: {project.name}
|
||||||
|
{#if loading}
|
||||||
|
<p>
|
||||||
|
{t('loading')}
|
||||||
|
</p>
|
||||||
|
{:else}
|
||||||
<TaskTree {tree} {select} />
|
<TaskTree {tree} {select} />
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
Reference in New Issue
Block a user