|
|
|
|
@ -25,6 +25,24 @@
@@ -25,6 +25,24 @@
|
|
|
|
|
|
|
|
|
|
$effect(() => updateUrl(filter_input)); |
|
|
|
|
|
|
|
|
|
async function do_archive(ex){ |
|
|
|
|
ex.preventDefault(); |
|
|
|
|
var task = dragged; |
|
|
|
|
const url = api(`task/${task.id}`); |
|
|
|
|
const resp = await fetch(url,{ |
|
|
|
|
credentials : 'include', |
|
|
|
|
method : 'PATCH', |
|
|
|
|
body : JSON.stringify({no_index:true}) |
|
|
|
|
}); |
|
|
|
|
delete highlight.archive; |
|
|
|
|
if (resp.ok){ |
|
|
|
|
yikes(); |
|
|
|
|
delete tasks[task.assignee][task.status][task.id] |
|
|
|
|
} else { |
|
|
|
|
error(resp); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function updateUrl(){ |
|
|
|
|
let url = window.location.origin + window.location.pathname; |
|
|
|
|
if (filter_input) url += '?filter=' + encodeURI(filter_input); |
|
|
|
|
@ -149,6 +167,11 @@
@@ -149,6 +167,11 @@
|
|
|
|
|
highlight = {user:user_id,state:state}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function hover_archive(ev){ |
|
|
|
|
ev.preventDefault(); |
|
|
|
|
highlight.archive = true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function openTask(task_id){ |
|
|
|
|
controller.abort(); |
|
|
|
|
router.navigate(`/task/${task_id}/view`) |
|
|
|
|
@ -180,7 +203,7 @@
@@ -180,7 +203,7 @@
|
|
|
|
|
{#each Object.entries(tasks) as [uid,stateList]} |
|
|
|
|
<div class="user">{users[uid]}</div> |
|
|
|
|
{#each Object.entries(project.allowed_states) as [state,name]} |
|
|
|
|
<div class={['state_'+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)} ondragleave={e => delete highlight.user} 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)} |
|
|
|
|
@ -195,5 +218,7 @@
@@ -195,5 +218,7 @@
|
|
|
|
|
{/each} |
|
|
|
|
{/each} |
|
|
|
|
</div> |
|
|
|
|
<div class="archive">{t('archive')}</div> |
|
|
|
|
{/if} |
|
|
|
|
<div class="archive {highlight.archive?'hover':''}" ondragover={hover_archive} ondragleave={e => delete highlight.archive} ondrop={do_archive} > |
|
|
|
|
{t('archive')} |
|
|
|
|
</div> |
|
|
|
|
{/if} |
|
|
|
|
|