Compare commits

...

4 Commits

Author SHA1 Message Date
StephanRichter 6193b727bd Merge branch 'module/projects' into dev
Build Docker Image / Docker-Build (push) Successful in 3m5s
Build Docker Image / Clean-Registry (push) Successful in 3s
2026-05-07 18:26:44 +02:00
StephanRichter f35882c967 bugfix: moving of tasks in tree now works as intended
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
2026-05-07 18:26:37 +02:00
StephanRichter 1d1520534c Merge branch 'module/notes' into dev
Build Docker Image / Docker-Build (push) Successful in 3m7s
Build Docker Image / Clean-Registry (push) Successful in 2s
2026-05-06 09:26:13 +02:00
StephanRichter fe57749d9c improving note lsit
Build Docker Image / Docker-Build (push) Successful in 2m39s
Build Docker Image / Clean-Registry (push) Successful in 3s
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
2026-05-06 09:25:45 +02:00
7 changed files with 30 additions and 75 deletions
+2 -1
View File
@@ -33,6 +33,7 @@
authors = {...authors, ...data.authors};
loader.offset += loader.limit;
loader.active = false;
console.log({authors});
yikes();
if (Object.keys(data.notes).length) onscroll(null); // when notes were received, check whether they fill up the page
@@ -78,4 +79,4 @@
</svelte:head>
<svelte:window {onscroll} />
<List {notes} />
<List {notes} {authors} />
+1
View File
@@ -64,6 +64,7 @@
<legend class="entity" onclick={() => goToEntity(note)}>{title(note)}</legend>
{/if}
<legend class="time">
{#if !module} {authors[note.user_id].name} {/if}
{note.timestamp.replace('T',' ')}
{#if user.id == note.user_id}
<button class="symbol" onclick={() => drop(note.id)}></button>
+2 -6
View File
@@ -2,7 +2,7 @@
import { onMount } from 'svelte';
import { useTinyRouter } from 'svelte-tiny-router';
import { api, get } from '../../urls.svelte.js';
import { api, get, post } from '../../urls.svelte.js';
import { error, yikes } from '../../warn.svelte';
import { t } from '../../translations.svelte.js';
import { user } from '../../user.svelte.js';
@@ -104,11 +104,7 @@
async function saveTask(){
const url = api('task/add');
const resp = await fetch(url,{
credentials : 'include',
method : 'POST',
body : JSON.stringify(task)
});
const resp = await post(url,task);
if (resp.ok) {
localStorage.removeItem(`task/${task.id}/description`);
if (!assignee) { // if assignee is set, this form was opened within an external context. hence we don`t want to navigate somewhere else!
+6 -23
View File
@@ -3,7 +3,7 @@
import { useTinyRouter } from 'svelte-tiny-router';
import { dragged } from './dragndrop.svelte';
import { api } from '../../urls.svelte';
import { api, drop, patch, post } from '../../urls.svelte';
import { error, yikes } from '../../warn.svelte';
import { t } from '../../translations.svelte';
import { timetrack } from '../../user.svelte';
@@ -47,10 +47,7 @@
async function deleteTask(){
if (confirm(t('confirm_delete',{element:task.name}))){
const url = api(`task/${task.id}`);
const resp = await fetch(url,{
credentials : 'include',
method : 'DELETE'
});
const resp = await drop(url);
if (resp.ok){
deleted = true;
} else {
@@ -70,11 +67,7 @@
ev.stopPropagation();
if (dragged.element.id == task.id) return;
const url = api(`task/${dragged.element.id}`);
const resp = await fetch(url,{
credentials : 'include',
method : 'PATCH',
body : JSON.stringify({ parent_task_id : task.id})
});
const resp = await patch(url, { parent_task_id : task.id});
if (resp.ok) {
yikes();
} else {
@@ -90,11 +83,7 @@
show_closed : show_closed
};
if (task.show_closed) data.show_closed = true;
const resp = await fetch(url,{
credentials : 'include',
method : 'POST',
body : JSON.stringify(data)
});
const resp = await post(url,data);
if (resp.ok){
children = await resp.json();
yikes();
@@ -112,11 +101,7 @@
async function patchTask(changeset){
const url = api(`task/${task.id}`);
const resp = await fetch(url,{
credentials : 'include',
method : 'PATCH',
body : JSON.stringify(changeset)
});
const resp = await patch(url,changeset);
if (resp.ok){
task = await resp.json();
return true;
@@ -145,9 +130,7 @@
if (children && lastEvent && lastEvent.task) {
if (lastEvent.event == 'delete' || lastEvent.task.parent_task_id != task.id){
delete children[lastEvent.task.id];
} else {
children[lastEvent.task.id] = lastEvent.task;
}
} else children[lastEvent.task.id] = lastEvent.task;
}
});
+8 -18
View File
@@ -2,7 +2,7 @@
import { onMount } from 'svelte';
import { useTinyRouter } from 'svelte-tiny-router';
import { api } from '../../urls.svelte';
import { api, get, patch, post } from '../../urls.svelte';
import { error, yikes } from '../../warn.svelte';
import { t } from '../../translations.svelte';
@@ -17,7 +17,7 @@
async function add(new_task_id){
let url = api(`task/${new_task_id}`);
let resp = await fetch(url,{ credentials : 'include' });
let resp = await get(url);
if (resp.ok){
yikes();
let newTask = await resp.json();
@@ -27,7 +27,7 @@
}
task.required_tasks_ids.push(new_task_id);
requiredTasks[new_task_id] = newTask;
await patch();
await update();
delete candidates[new_task_id];
} else {
error(resp);
@@ -59,17 +59,11 @@
async function loadTasks(){
if (!task || !task.required_tasks_ids || !task.required_tasks_ids.length) return;
const url = api('task/list');
const res = await fetch(url,{
credentials : 'include',
method : 'POST',
body : JSON.stringify({ids:task.required_tasks_ids})
});
const res = await post(url,{ids:task.required_tasks_ids});
if (res.ok){
yikes();
requiredTasks = await res.json();
} else {
error(resp);
}
} else error(resp);
}
function oninput(){
@@ -84,19 +78,15 @@
return false;
}
async function patch(){
async function update(){
const url = api(`task/${task.id}`);
const resp = await fetch(url,{
credentials : 'include',
method : 'PATCH',
body : JSON.stringify({required_tasks_ids:task.required_tasks_ids})
});
const resp = await patch(url,{required_tasks_ids:task.required_tasks_ids});
if (!resp.ok) error(resp);
}
async function unlink(required_task){
task.required_tasks_ids = task.required_tasks_ids.filter(item => item != required_task.id);
patch();
update();
delete requiredTasks[required_task.id];
}
+1 -1
View File
@@ -8,7 +8,7 @@
</script>
<ul>
{#each sortedTasks as task}
{#each sortedTasks as task (task.id)}
<ListTask {states} {task} {lastEvent} siblings={tasks} {est_time} show_closed={show_closed || task.show_closed} />
{/each}
</ul>
+10 -26
View File
@@ -2,7 +2,7 @@
import { onDestroy } from 'svelte';
import { useTinyRouter } from 'svelte-tiny-router';
import { api, eventStream } from '../../urls.svelte';
import { api, eventStream, get, patch, post } from '../../urls.svelte';
import { error, yikes } from '../../warn.svelte';
import { t } from '../../translations.svelte';
import { timetrack } from '../../user.svelte.js';
@@ -99,32 +99,24 @@
parent_task_id : +task.id,
show_closed : show_closed
};
const resp = await fetch(url,{
credentials : 'include',
method : 'POST',
body:JSON.stringify(data)
});
const resp = await post(url,data);
if (resp.ok){
yikes();
children = await resp.json();
} else {
error(resp);
}
} else error(resp);
}
async function loadParent(){
const url = api(`task/${task.parent_task_id}`);
const resp = await fetch(url,{credentials:'include'});
const resp = await get(url);
if (resp.ok){
task.parent = await resp.json();
} else {
error(resp);
}
} else error(resp);
}
async function loadTask(){
const url = api(`task/${id}`);
const resp = await fetch(url,{credentials:'include'});
const resp = await get(url);
if (resp.ok){
yikes();
task = await resp.json();
@@ -132,20 +124,16 @@
loadChildren();
if (task.project_id) loadProject();
if (task.parent_task_id) loadParent();
} else {
error(resp);
}
} else error(resp);
}
async function loadProject(){
const url = api(`project/${task.project_id}`);
const resp = await fetch(url,{credentials:'include'});
const resp = await get(url);
if (resp.ok){
project = await resp.json();
yikes();
} else {
error(await resp.text());
}
} else error(await resp.text());
}
function showClosed(){
@@ -169,11 +157,7 @@
async function update(data){
const url = api(`task/${id}`);
const resp = await fetch(url,{
credentials : 'include',
method : 'PATCH',
body : JSON.stringify(data)
});
const resp = await patch(url,data);
if (resp.ok){
yikes();
let json = await resp.json();