improvement: inheriting tags from project and parent tasks

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
2025-07-28 15:22:26 +02:00
parent 4a7547b82e
commit 4e9f15c6a3
3 changed files with 31 additions and 8 deletions

View File

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