implemented bugfix: selecting times by project id broke layout
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -20,7 +20,7 @@
|
|||||||
let projects = {};
|
let projects = {};
|
||||||
let project_filter = $state(null);
|
let project_filter = $state(null);
|
||||||
if (router.hasQueryParam('project')) project_filter = router.getQueryParam('project');
|
if (router.hasQueryParam('project')) project_filter = router.getQueryParam('project');
|
||||||
let sortedTimes = $derived.by(() => Object.values(times).map(time => ({
|
let sortedTimes = $derived.by(() => Object.values(times).filter(match_prj_filter).map(time => ({
|
||||||
...time,
|
...time,
|
||||||
start: display(time.start_time),
|
start: display(time.start_time),
|
||||||
end: display(time.end_time),
|
end: display(time.end_time),
|
||||||
@@ -52,6 +52,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function calcYearMap(){
|
function calcYearMap(){
|
||||||
|
console.log('calcYearMap called');
|
||||||
let result = {
|
let result = {
|
||||||
months : {},
|
months : {},
|
||||||
years : {}
|
years : {}
|
||||||
@@ -123,7 +124,7 @@
|
|||||||
function match_prj_filter(time){
|
function match_prj_filter(time){
|
||||||
if (!project_filter) return true;
|
if (!project_filter) return true;
|
||||||
for (var tid of time.task_ids){
|
for (var tid of time.task_ids){
|
||||||
if (project_filter == tasks[tid].project_id) return true;
|
if (tasks[tid] && project_filter == tasks[tid].project_id) return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -258,7 +259,6 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{#each sortedTimes as time,line}
|
{#each sortedTimes as time,line}
|
||||||
{#if match_prj_filter(time)}
|
|
||||||
<tr class={selected[time.id]?'selected':''}>
|
<tr class={selected[time.id]?'selected':''}>
|
||||||
{#if timeMap.years[line]}
|
{#if timeMap.years[line]}
|
||||||
<td class="year" rowspan={timeMap.years[line]} onclick={e => toggleRange(time.start.substring(0,4))} title={time.start.substring(0,4)} >
|
<td class="year" rowspan={timeMap.years[line]} onclick={e => toggleRange(time.start.substring(0,4))} title={time.start.substring(0,4)} >
|
||||||
@@ -321,7 +321,6 @@
|
|||||||
</td>
|
</td>
|
||||||
{/if}
|
{/if}
|
||||||
</tr>
|
</tr>
|
||||||
{/if}
|
|
||||||
{/each}
|
{/each}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
Reference in New Issue
Block a user