Merge branch 'main' into dev
This commit is contained in:
@@ -171,7 +171,7 @@ public class Task implements Mappable {
|
||||
case MEMBERS: continue;
|
||||
case NAME: name = json.getString(key); break;
|
||||
case NO_INDEX: noIndex = json.getBoolean(NO_INDEX); break;
|
||||
case PARENT_TASK_ID: parentTaskId = json.getLong(PARENT_TASK_ID); break;
|
||||
case PARENT_TASK_ID: parentTaskId = json.isNull(PARENT_TASK_ID) ? null : json.getLong(PARENT_TASK_ID); break;
|
||||
case PRIORITY: priority = json.getInt(PRIORITY); break;
|
||||
case REQUIRED_TASKS_IDS:
|
||||
requiredTasksIds.clear();
|
||||
|
||||
@@ -140,6 +140,10 @@
|
||||
showSettings = !showSettings;
|
||||
}
|
||||
|
||||
function unlink_parent(){
|
||||
update({parent_task_id:null});
|
||||
}
|
||||
|
||||
async function update(data){
|
||||
const url = api(`task/${id}`);
|
||||
const resp = await fetch(url,{
|
||||
@@ -151,7 +155,11 @@
|
||||
yikes();
|
||||
let old_task = task;
|
||||
task = await resp.json();
|
||||
if (task.parent_id == old_task.parent_id) task.parent = old_task.parent;
|
||||
if (!task.parent_id){
|
||||
task.parent = null;
|
||||
} else {
|
||||
if (task.parent_id == old_task.parent_id) task.parent = old_task.parent;
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
error(resp);
|
||||
@@ -196,6 +204,7 @@
|
||||
<div>{t('parent_task')}</div>
|
||||
<div class="parent">
|
||||
<a href="#" onclick={gotoParent}>{task.parent.name}</a>
|
||||
<button class="symbol" title={t('unlink')} onclick={unlink_parent}></button>
|
||||
</div>
|
||||
{/if}
|
||||
<div>{t('task')}</div>
|
||||
|
||||
Reference in New Issue
Block a user