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 project_filter = $state(null);
|
||||
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,
|
||||
start: display(time.start_time),
|
||||
end: display(time.end_time),
|
||||
@@ -52,6 +52,7 @@
|
||||
}
|
||||
|
||||
function calcYearMap(){
|
||||
console.log('calcYearMap called');
|
||||
let result = {
|
||||
months : {},
|
||||
years : {}
|
||||
@@ -123,7 +124,7 @@
|
||||
function match_prj_filter(time){
|
||||
if (!project_filter) return true;
|
||||
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;
|
||||
}
|
||||
@@ -258,7 +259,6 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
{#each sortedTimes as time,line}
|
||||
{#if match_prj_filter(time)}
|
||||
<tr class={selected[time.id]?'selected':''}>
|
||||
{#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)} >
|
||||
@@ -321,7 +321,6 @@
|
||||
</td>
|
||||
{/if}
|
||||
</tr>
|
||||
{/if}
|
||||
{/each}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
Reference in New Issue
Block a user