working on user-defined project states and task states
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -6,7 +6,6 @@
|
||||
|
||||
import CompanySelector from '../../Components/CompanySelector.svelte';
|
||||
import MarkdownEditor from '../../Components/MarkdownEditor.svelte';
|
||||
import Settings from './Settings.svelte';
|
||||
import Tags from '../tags/TagList.svelte';
|
||||
|
||||
let error = $state(null);
|
||||
|
||||
@@ -56,11 +56,12 @@
|
||||
let task = dragged;
|
||||
dragged = null;
|
||||
highlight = {};
|
||||
console.log(state);
|
||||
//console.log(`dropped ${task.name} (of ${task.assignee} /state: ${task.status}) → (uid: ${user_id}/state: ${state})`);
|
||||
|
||||
if (task.assignee == user_id && task.status == state) return; // no change
|
||||
let patch = {members:{},status:+state}
|
||||
patch.members[user_id] = 'ASSIGNEE';
|
||||
|
||||
//console.log('sending patch:',patch)
|
||||
const url = api(`task/${task.id}`);
|
||||
const resp = await fetch(url,{
|
||||
credentials : 'include',
|
||||
@@ -68,12 +69,14 @@
|
||||
body : JSON.stringify(patch)
|
||||
});
|
||||
if (resp.ok){
|
||||
//console.log('task tree before update:',tasks);
|
||||
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;
|
||||
task.assignee = user_id;
|
||||
task.status = {code:state,name:states[state]};
|
||||
task.status = state;
|
||||
//console.log('task tree after update:',tasks);
|
||||
error = null;
|
||||
} else {
|
||||
error = await resp.text();
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
<script>
|
||||
import {t} from '../../translations.svelte.js';
|
||||
|
||||
let { settings = $bindable() } = $props();
|
||||
|
||||
</script>
|
||||
<fieldset>
|
||||
<legend>{t('settings')}</legend>
|
||||
</fieldset>
|
||||
@@ -63,6 +63,7 @@
|
||||
const resp = await fetch(url,{credentials:'include'});
|
||||
if (resp.ok){
|
||||
project = await resp.json();
|
||||
console.log(project);
|
||||
error = null;
|
||||
loadTasks();
|
||||
} else {
|
||||
@@ -185,6 +186,21 @@
|
||||
<MemberEditor members={project.members} {updatePermission} {addMember} {dropMember} {getCandidates} />
|
||||
</td>
|
||||
</tr>
|
||||
{#if project.allowed_states}
|
||||
{#each Object.keys(project.allowed_states) as key,idx}
|
||||
<tr>
|
||||
<th>
|
||||
{#if !idx}
|
||||
{t('allowed_states')}:
|
||||
{/if}
|
||||
{key}
|
||||
</th>
|
||||
<td>
|
||||
{project.allowed_states[key]}
|
||||
</td>
|
||||
</tr>
|
||||
{/each}
|
||||
{/if}
|
||||
{/if}
|
||||
{#if estimated_time.sum}
|
||||
<tr>
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
"add_subtask": "Unteraufgabe hinzufügen",
|
||||
"add_task": "Aufgabe hinzufügen",
|
||||
"advertisement" : "Umbrella ist ein Produkt von {producer}.",
|
||||
"allowed_states": "zulässige Status",
|
||||
"amount": "Menge",
|
||||
|
||||
"bank_account": "Bankverbindung",
|
||||
@@ -161,6 +162,7 @@
|
||||
"pos": "Pos",
|
||||
"position": "Position",
|
||||
"positions": "Positionen",
|
||||
"postpone": "autschieben",
|
||||
"price": "Preis",
|
||||
"processing_code": "Code wird verarbeitet…",
|
||||
"project": "Projekt",
|
||||
|
||||
Reference in New Issue
Block a user