working on user-defined project states and task states

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
2025-08-01 08:49:05 +02:00
parent c57da0a891
commit 2813fed670
5 changed files with 24 additions and 13 deletions

View File

@@ -56,11 +56,12 @@
let task = dragged;
dragged = null;
highlight = {};
console.log(state);
//console.log(`dropped ${task.name} (of ${task.assignee} /state: ${task.status}) → (uid: ${user_id}/state: ${state})`);
if (task.assignee == user_id && task.status == state) return; // no change
let patch = {members:{},status:+state}
patch.members[user_id] = 'ASSIGNEE';
//console.log('sending patch:',patch)
const url = api(`task/${task.id}`);
const resp = await fetch(url,{
credentials : 'include',
@@ -68,12 +69,14 @@
body : JSON.stringify(patch)
});
if (resp.ok){
//console.log('task tree before update:',tasks);
delete tasks[task.assignee][task.status][task.id]
if (!tasks[user_id]) tasks[user_id] = {}
if (!tasks[user_id][state]) tasks[user_id][state] = {}
tasks[user_id][state][task.id] = task;
task.assignee = user_id;
task.status = {code:state,name:states[state]};
task.status = state;
//console.log('task tree after update:',tasks);
error = null;
} else {
error = await resp.text();