implemented editing of 'show closed tasks' setting in project
This commit is contained in:
@@ -20,6 +20,11 @@
|
||||
if (ids) update({new_member:+ids.pop()});
|
||||
}
|
||||
|
||||
function changeClosed(){
|
||||
update({show_closed:project.show_closed});
|
||||
loadTasks();
|
||||
}
|
||||
|
||||
async function dropMember(member){
|
||||
update({drop_member:member.user.id});
|
||||
}
|
||||
@@ -38,12 +43,18 @@
|
||||
|
||||
async function loadTasks(){
|
||||
const url = `${location.protocol}//${location.host.replace('5173','8080')}/api/task/list`;
|
||||
const data = {
|
||||
project_id:+id,
|
||||
show_closed:project.show_closed
|
||||
}
|
||||
const resp = await fetch(url,{
|
||||
credentials:'include',
|
||||
method:'POST',
|
||||
body:JSON.stringify({project_id:+id})
|
||||
body:JSON.stringify(data)
|
||||
});
|
||||
if (resp.ok){
|
||||
tasks = {};
|
||||
estimated_time.sum = 0;
|
||||
tasks = await resp.json();
|
||||
error = null;
|
||||
} else {
|
||||
@@ -125,7 +136,7 @@
|
||||
<th>{t('tasks')}</th>
|
||||
<td class="tasks">
|
||||
{#if tasks}
|
||||
<TaskList {tasks} {estimated_time} />
|
||||
<TaskList {tasks} {estimated_time} show_closed={project.show_closed} />
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
@@ -136,5 +147,13 @@
|
||||
<fieldset class="project settings">
|
||||
<legend>{t('settings')}</legend>
|
||||
<MemberEditor members={project.members} {updatePermission} {addMember} {dropMember} />
|
||||
<fieldset>
|
||||
<legend>{t('miscellaneous_settings')}</legend>
|
||||
<label>
|
||||
<input type="checkbox" bind:checked={project.show_closed} onchange={changeClosed} />
|
||||
{t('display_closed_tasks')}
|
||||
</label>
|
||||
</fieldset>
|
||||
<button onclick={() => showSettings = false}>{t('close_settings')}</button>
|
||||
</fieldset>
|
||||
{/if}
|
||||
Reference in New Issue
Block a user