Browse Source

working on kanban filter and tag sorting

module/notes
Stephan Richter 3 months ago
parent
commit
0aa7aa67dc
  1. 8
      frontend/src/routes/project/Kanban.svelte
  2. 2
      frontend/src/routes/tags/TagList.svelte
  3. 1
      translations/src/main/resources/de.json
  4. 6
      web/src/main/resources/web/css/default.css

8
frontend/src/routes/project/Kanban.svelte

@ -19,6 +19,8 @@ @@ -19,6 +19,8 @@
let router = useTinyRouter();
let states = $state(null);
let tasks = $state({});
let filter_input = $state('');
let filter = $derived(filter_input.toLowerCase());
let users = {};
let columns = $derived(states?Object.keys(states).length+1:1);
@ -184,6 +186,10 @@ @@ -184,6 +186,10 @@
{#if ready}
<div class="kanban" style="display: grid; grid-template-columns: {`repeat(${columns}, auto)`}">
<span class="filter">
<input type="text" bind:value={filter_input} />
{t('filter')}
</span>
<div class="head">{t('user')}</div>
{#if states}
{#each Object.entries(states) as [sid,state]}
@ -196,7 +202,9 @@ @@ -196,7 +202,9 @@
<div class={[state, highlight.user == uid && highlight.state == state ? 'highlight':'']} ondragover={ev => hover(ev,uid,state)} 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)}
<Card onclick={() => router.navigate(`/task/${task.id}/view`)} ondragstart={ev => dragged=task} {task} />
{/if}
{/each}
{/if}
<div class="add_task">

2
frontend/src/routes/tags/TagList.svelte

@ -22,6 +22,7 @@ @@ -22,6 +22,7 @@
if (resp.ok){
tag = await resp.text();
tags.push(tag);
tags = tags.sort();
} else {
error = await resp.text();
}
@ -49,6 +50,7 @@ @@ -49,6 +50,7 @@
const resp = await fetch(url,{credentials:'include'});
if (resp.ok) {
tags = await resp.json();
tags = tags.sort();
} else {
error = await resp.text();
}

1
translations/src/main/resources/de.json

@ -70,6 +70,7 @@ @@ -70,6 +70,7 @@
"failed": "fehlgeschlagen",
"files": "Dateien",
"filter": "Filter",
"footer": "Fuß-Text",
"foreign_id": "externe Kennung",
"forgot_pass" : "Password vergessen?",

6
web/src/main/resources/web/css/default.css

@ -198,6 +198,12 @@ textarea{ @@ -198,6 +198,12 @@ textarea{
z-index: 20;
}
.kanban .filter{
position: absolute;
top: 60px;
right: 20px;
}
.project th,
.task th{
text-align: right;

Loading…
Cancel
Save