working on user-defined states
This commit is contained in:
@@ -56,7 +56,8 @@
|
||||
let task = dragged;
|
||||
dragged = null;
|
||||
highlight = {};
|
||||
if (task.assignee == user_id && task.status.code == state) return; // no change
|
||||
console.log(state);
|
||||
if (task.assignee == user_id && task.status == state) return; // no change
|
||||
let patch = {members:{},status:+state}
|
||||
patch.members[user_id] = 'ASSIGNEE';
|
||||
|
||||
@@ -67,7 +68,7 @@
|
||||
body : JSON.stringify(patch)
|
||||
});
|
||||
if (resp.ok){
|
||||
delete tasks[task.assignee][task.status.code][task.id]
|
||||
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;
|
||||
@@ -147,7 +148,7 @@
|
||||
var json = await resp.json();
|
||||
for (var task_id of Object.keys(json)) {
|
||||
let task = json[task_id];
|
||||
let state = task.status.code;
|
||||
let state = task.status;
|
||||
let owner = null;
|
||||
let assignee = null;
|
||||
for (var user_id of Object.keys(task.members)){
|
||||
@@ -198,7 +199,7 @@
|
||||
{#each Object.entries(tasks) as [uid,stateList]}
|
||||
<div class="user">{users[uid]}</div>
|
||||
{#each Object.entries(states) as [state,name]}
|
||||
<div class={[state, highlight.user == uid && highlight.state == state ? 'highlight':'']} ondragover={ev => hover(ev,uid,state)} ondrop={ev => drop(uid,state)} >
|
||||
<div class={['state_'+state, highlight.user == uid && highlight.state == state ? 'highlight':'']} ondragover={ev => hover(ev,uid,state)} ondrop={ev => drop(uid,state)} >
|
||||
{#if stateList[state]}
|
||||
{#each Object.values(stateList[state]).sort((a,b) => a.name.localeCompare(b.name)) as task}
|
||||
{#if !filter || task.name.toLowerCase().includes(filter) || (task.tags && task.tags.filter(tag => tag.toLowerCase().includes(filter)).length)}
|
||||
|
||||
Reference in New Issue
Block a user