From 8a45ccce75735c82a10e1c2839d42f3531e6929e Mon Sep 17 00:00:00 2001 From: andreasz97 Date: Tue, 17 Sep 2024 16:11:51 +0200 Subject: [PATCH] fix: improving namings --- src/components/report/ProductivitySection.tsx | 6 +++--- src/components/report/ProjectsSection.tsx | 10 +++++----- src/components/report/ReportFilters.tsx | 12 ++++++------ src/pages/Report.tsx | 8 ++++---- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/components/report/ProductivitySection.tsx b/src/components/report/ProductivitySection.tsx index 8d5c72a..2181ac1 100644 --- a/src/components/report/ProductivitySection.tsx +++ b/src/components/report/ProductivitySection.tsx @@ -14,7 +14,7 @@ interface ReportProps { selectedCustomersSig: Signal; selectedProjectsSig: Signal; selectedTasksSig: Signal; - selectedNamesSig: Signal; + selectedUsersSig: Signal; selectedTab: Signal; to: Signal; from: Signal; @@ -26,7 +26,7 @@ export const ProductivitySection = component$( selectedCustomersSig, selectedProjectsSig, selectedTasksSig, - selectedNamesSig, + selectedUsersSig, selectedTab, }) => { const productivityTableRef = useSignal(); @@ -35,7 +35,7 @@ export const ProductivitySection = component$( selectedCustomersSig, selectedProjectsSig, selectedTasksSig, - selectedNamesSig, + selectedUsersSig, from, to, selectedTab diff --git a/src/components/report/ProjectsSection.tsx b/src/components/report/ProjectsSection.tsx index ebeec19..0600927 100644 --- a/src/components/report/ProjectsSection.tsx +++ b/src/components/report/ProjectsSection.tsx @@ -13,7 +13,7 @@ interface ReportProps { selectedCustomersSig: Signal; selectedProjectsSig: Signal; selectedTasksSig: Signal; - selectedNamesSig: Signal; + selectedUsersSig: Signal; selectedTab: Signal; to: Signal; from: Signal; @@ -26,7 +26,7 @@ export const ProjectsSection = component$( selectedCustomersSig, selectedProjectsSig, selectedTasksSig, - selectedNamesSig, + selectedUsersSig, selectedTab, }) => { const projectReportDetailsRef = useSignal(); @@ -38,7 +38,7 @@ export const ProjectsSection = component$( selectedCustomersSig, selectedProjectsSig, selectedTasksSig, - selectedNamesSig, + selectedUsersSig, from, to, selectedTab @@ -48,12 +48,12 @@ export const ProjectsSection = component$( track(() => selectedCustomersSig.value); track(() => selectedProjectsSig.value); track(() => selectedTasksSig.value); - track(() => selectedNamesSig.value); + track(() => selectedUsersSig.value); showProjectsDetails.value = selectedCustomersSig.value.length !== 0 || selectedProjectsSig.value.length !== 0 || selectedTasksSig.value.length !== 0 || - selectedNamesSig.value.length !== 0; + selectedUsersSig.value.length !== 0; }); return ( diff --git a/src/components/report/ReportFilters.tsx b/src/components/report/ReportFilters.tsx index fa78bb8..8e44e47 100644 --- a/src/components/report/ReportFilters.tsx +++ b/src/components/report/ReportFilters.tsx @@ -15,15 +15,15 @@ export const ReportFilters = component$<{ selectedCustomers: Signal; selectedProjects: Signal; selectedTasks: Signal; - selectedNames: Signal; -}>(({ selectedCustomers, selectedProjects, selectedTasks, selectedNames }) => { + selectedUsers: Signal; +}>(({ selectedCustomers, selectedProjects, selectedTasks, selectedUsers }) => { const getUniqueValues = sync$((arr: string[]): string[] => { return [...new Set(arr)]; }); const _selectedProjects = useSignal(selectedProjects.value.map((project) => project.name)); const _selectedTasks = useSignal(selectedTasks.value.map((task) => task.name)); - const _selectedUsers = useSignal(selectedNames.value.map((user) => user.name)); + const _selectedUsers = useSignal(selectedUsers.value.map((user) => user.name)); const taskProjectCustomerSig = useComputed$(async () => { return await getAllTasks(); @@ -150,7 +150,7 @@ export const ReportFilters = component$<{ }); const onChangeUser = $(() => { - selectedNames.value = _selectedUsers.value.map((user) => { + selectedUsers.value = _selectedUsers.value.map((user) => { const value = usersSig.value.find((element) => element.name === user); return ( value ?? { @@ -164,9 +164,9 @@ export const ReportFilters = component$<{ const clearFilters = $(() => { selectedCustomers.value = []; - selectedProjects.value = []; + _selectedProjects.value = []; _selectedTasks.value = []; - selectedNames.value = []; + _selectedUsers.value = []; }); return ( diff --git a/src/pages/Report.tsx b/src/pages/Report.tsx index 30607b2..5eb3d5c 100644 --- a/src/pages/Report.tsx +++ b/src/pages/Report.tsx @@ -18,7 +18,7 @@ export const Report = component$(() => { const selectedCustomersSig = useSignal([]); const selectedProjectsSig = useSignal([]); const selectedTasksSig = useSignal([]); - const selectedNamesSig = useSignal([]); + const selectedUsersSig = useSignal([]); const selectedTab = useSignal('project'); return ( @@ -40,7 +40,7 @@ export const Report = component$(() => { selectedCustomers={selectedCustomersSig} selectedProjects={selectedProjectsSig} selectedTasks={selectedTasksSig} - selectedNames={selectedNamesSig} + selectedUsers={selectedUsersSig} /> {/* TAB Selection */} @@ -95,7 +95,7 @@ export const Report = component$(() => { selectedCustomersSig={selectedCustomersSig} selectedProjectsSig={selectedProjectsSig} selectedTasksSig={selectedTasksSig} - selectedNamesSig={selectedNamesSig} + selectedUsersSig={selectedUsersSig} selectedTab={selectedTab} to={to} from={from} @@ -111,7 +111,7 @@ export const Report = component$(() => { selectedCustomersSig={selectedCustomersSig} selectedProjectsSig={selectedProjectsSig} selectedTasksSig={selectedTasksSig} - selectedNamesSig={selectedNamesSig} + selectedUsersSig={selectedUsersSig} selectedTab={selectedTab} to={to} from={from}