From 7f652d94c5d22769cebd385ada46a3110b9cb4e3 Mon Sep 17 00:00:00 2001 From: Henrike Date: Tue, 6 Sep 2022 08:07:13 +0200 Subject: [PATCH 1/5] include full year in bar chart --- frontend/src/components/BarChart.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/BarChart.tsx b/frontend/src/components/BarChart.tsx index a3d7f366..e847ec52 100644 --- a/frontend/src/components/BarChart.tsx +++ b/frontend/src/components/BarChart.tsx @@ -12,6 +12,7 @@ export const BarChart = ({ loading }: { loading: boolean }) => { const context = useContext(AuthContext); const today = new Date(); const startDate = new Date(`January 1, ${today.getFullYear()}`); + const endDate = new Date(`December 31, ${today.getFullYear()}`); useEffect(() => { // Whenever the user has saved changes we want to fetch the year's time entries @@ -28,7 +29,7 @@ export const BarChart = ({ loading }: { loading: boolean }) => { const timeEntries = await getTimeEntries( undefined, startDate, - today, + endDate, context ); let activityHours: { [key: string]: { hours: number; name: string } } = {}; From 5fa3c5374005258ad676f51e4f98938cc1b5f7af Mon Sep 17 00:00:00 2001 From: Henrike Date: Tue, 6 Sep 2022 08:09:07 +0200 Subject: [PATCH 2/5] change bar chart heading --- frontend/src/components/BarChart.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/components/BarChart.tsx b/frontend/src/components/BarChart.tsx index e847ec52..d9d2dc37 100644 --- a/frontend/src/components/BarChart.tsx +++ b/frontend/src/components/BarChart.tsx @@ -80,7 +80,7 @@ export const BarChart = ({ loading }: { loading: boolean }) => { return (
-

This year's work

+

Yearly overview

{Object.keys(spentTime).length === 0 ? (
From 1c6b2889ada478dd619069b0d65b38e178a2cdc2 Mon Sep 17 00:00:00 2001 From: Henrike Date: Tue, 6 Sep 2022 08:32:48 +0200 Subject: [PATCH 3/5] adding help page section for bar chart --- frontend/src/pages/Help.tsx | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/frontend/src/pages/Help.tsx b/frontend/src/pages/Help.tsx index 12db8aa5..6b52535a 100644 --- a/frontend/src/pages/Help.tsx +++ b/frontend/src/pages/Help.tsx @@ -7,6 +7,7 @@ import { Cell } from "../components/Cell"; import { IssueActivityPair, FetchedTimeEntry } from "../model"; import { QuickAdd } from "../components/QuickAdd"; import weektravel from "../images/weektravel.png"; +import { BarChart } from "../components/BarChart"; export const Help = () => { const context = React.useContext(AuthContext); @@ -207,6 +208,35 @@ export const Help = () => { onBlurRow={() => {}} />
+

The yearly overview

+

+ The idea of the yearly overview is to show you what you have spent + your time on during the current year. It includes hours logged between + January 1st and December 31st of the current year. +

+

+ The fields of the bar chart are based on activities like "Support" or + "Administration" but do not show different issues or projects. That + means for example that all hours you have logged on "Support" will be + summed up into one single bar section even though they were spent in + different support projects. +

+ +

+ Absence is not included in the bar chart. When the bar chart is + generated, all hours logged during the current year on anything but + Absence are summed up. Then, a percentage for every activity is + calculated based on the total and rounded to two decimals. +

+

+ In sections with very few hours logged, you might not be able to + properly see what activity, hours and percentage they show. Hover over + the section to see the full label text. In rare situations, you might + have logged so few hours on an activity that its percentage would be + rounded down to 0 during calculations. In that case, you will still + see a thin section displayed in the chart. Hover over it to see what + it belongs to. +

Time travelling

Users can navigate across different weeks by using the left and right From b5988184ed3393a7acc24e2f62305f9b6113ba27 Mon Sep 17 00:00:00 2001 From: Henrike Date: Tue, 6 Sep 2022 09:41:41 +0200 Subject: [PATCH 4/5] include Jons suggestions on help page --- frontend/src/pages/Help.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/src/pages/Help.tsx b/frontend/src/pages/Help.tsx index 6b52535a..e412b5fb 100644 --- a/frontend/src/pages/Help.tsx +++ b/frontend/src/pages/Help.tsx @@ -211,14 +211,14 @@ export const Help = () => {

The yearly overview

The idea of the yearly overview is to show you what you have spent - your time on during the current year. It includes hours logged between - January 1st and December 31st of the current year. + your time on between January 1st and December 31st of the current + year.

- The fields of the bar chart are based on activities like "Support" or - "Administration" but do not show different issues or projects. That - means for example that all hours you have logged on "Support" will be - summed up into one single bar section even though they were spent in + The rectangular bars of the chart have labels like "Support" or + "Administration" that correspond to the activities you have reported + hours on. Therefore, all hours you have logged on "Support" will be + summed up into one single rectangle even though they were spent in different support projects.

From 2287286494de32a2a8c9707b864dc01f24e5547e Mon Sep 17 00:00:00 2001 From: Henrike Date: Tue, 6 Sep 2022 10:04:44 +0200 Subject: [PATCH 5/5] small help text corrections --- frontend/src/pages/Help.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/Help.tsx b/frontend/src/pages/Help.tsx index e412b5fb..dc038851 100644 --- a/frontend/src/pages/Help.tsx +++ b/frontend/src/pages/Help.tsx @@ -210,7 +210,7 @@ export const Help = () => {

The yearly overview

- The idea of the yearly overview is to show you what you have spent + The purpose of the yearly overview is to show you what you have spent your time on between January 1st and December 31st of the current year.

@@ -233,7 +233,7 @@ export const Help = () => { properly see what activity, hours and percentage they show. Hover over the section to see the full label text. In rare situations, you might have logged so few hours on an activity that its percentage would be - rounded down to 0 during calculations. In that case, you will still + rounded down to zero during calculations. In that case, you will still see a thin section displayed in the chart. Hover over it to see what it belongs to.