From da7e46ba679e6c373681de3b98d806e27a743511 Mon Sep 17 00:00:00 2001 From: Sonia Zorba Date: Mon, 9 Dec 2024 12:30:48 +0100 Subject: [PATCH] Displayed number of tasks under tasks table --- components/src/lib/tasks/FilteredTasksTable.svelte | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/components/src/lib/tasks/FilteredTasksTable.svelte b/components/src/lib/tasks/FilteredTasksTable.svelte index 4221be84..21e697ee 100644 --- a/components/src/lib/tasks/FilteredTasksTable.svelte +++ b/components/src/lib/tasks/FilteredTasksTable.svelte @@ -39,6 +39,9 @@ setup(); } + $: selectedTasksCount = filteredRows.reduce((acc, row) => acc + row.tasks.length, 0); + $: tasksCount = allRows.reduce((acc, row) => acc + row.tasks.length, 0); + $: if ( genericSearch || categoryFilter || @@ -429,6 +432,10 @@ +

+ Showing {selectedTasksCount} of {tasksCount} + {tasksCount === 1 ? 'task' : 'tasks'} +

{/if}