From de32e7b508662cd331f4783dfa6ace9e2ef2ba15 Mon Sep 17 00:00:00 2001 From: Michael Kimberlin Date: Wed, 11 Dec 2024 17:05:18 -0600 Subject: [PATCH 1/4] Fixed pulse report chart --- web-ui/src/pages/PulseReportPage.jsx | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/web-ui/src/pages/PulseReportPage.jsx b/web-ui/src/pages/PulseReportPage.jsx index f7152f8310..108051804e 100644 --- a/web-ui/src/pages/PulseReportPage.jsx +++ b/web-ui/src/pages/PulseReportPage.jsx @@ -145,7 +145,7 @@ const PulseReportPage = () => { // This creates data in the format that recharts needs from pulse data. useEffect(() => { const averageData = {}; // key is member id - const lineChartData = []; + const lineChartDataPoints = []; const frequencies = []; for (let i = 1; i <= 5; i++) { frequencies.push({ score: i, internal: 0, external: 0 }); @@ -162,11 +162,16 @@ const PulseReportPage = () => { const [year, month, day] = submissionDate; const monthPadded = month.toString().padStart(2, '0'); const dayPadded = day.toString().padStart(2, '0'); - lineChartData.push({ - date: `${year}-${monthPadded}-${dayPadded}`, - internal: internalScore, - external: externalScore - }); + const date = `${year}-${monthPadded}-${dayPadded}`; + const found = lineChartDataPoints.find(points => points.date === date) + if(found) { + found?.datapoints?.push(pulse); + } else { + lineChartDataPoints.push({ + date, + datapoints: [pulse] + }); + } frequencies[internalScore - 1].internal++; frequencies[externalScore - 1].external++; @@ -200,7 +205,13 @@ const PulseReportPage = () => { } } - setLineChartData(lineChartData); + setLineChartData(lineChartDataPoints.map(day => ( + { + date: day.date, + internal: day.datapoints.reduce((acc, current) => acc + current.internalScore, 0)/day.datapoints.length, + external: day.datapoints.reduce((acc, current) => acc + current.externalScore, 0)/day.datapoints.length + } + ))); setBarChartData(frequencies); for (const memberId of Object.keys(averageData)) { From 146b6d22e641c7fdbd55464a2dfaf39657859ef4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Dec 2024 23:07:31 +0000 Subject: [PATCH 2/4] Bump nanoid from 3.3.7 to 3.3.8 in /web-ui Bumps [nanoid](https://github.com/ai/nanoid) from 3.3.7 to 3.3.8. - [Release notes](https://github.com/ai/nanoid/releases) - [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md) - [Commits](https://github.com/ai/nanoid/compare/3.3.7...3.3.8) --- updated-dependencies: - dependency-name: nanoid dependency-type: indirect ... Signed-off-by: dependabot[bot] --- web-ui/yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web-ui/yarn.lock b/web-ui/yarn.lock index 71412512c9..51d7dff66c 100644 --- a/web-ui/yarn.lock +++ b/web-ui/yarn.lock @@ -6094,9 +6094,9 @@ mute-stream@^2.0.0: integrity sha512-WWdIxpyjEn+FhQJQQv9aQAYlHoNVdzIzUySNV1gHUPDSdZJ3yZn7pAAbQcV7B56Mvu881q9FZV+0Vx2xC44VWA== nanoid@^3.3.7: - version "3.3.7" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.7.tgz#d0c301a691bc8d54efa0a2226ccf3fe2fd656bd8" - integrity sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g== + version "3.3.8" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.8.tgz#b1be3030bee36aaff18bacb375e5cce521684baf" + integrity sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w== natural-compare@^1.4.0: version "1.4.0" From 729900603f5aa3649f02b4ba9b013410b4d8432a Mon Sep 17 00:00:00 2001 From: Michael Kimberlin Date: Thu, 12 Dec 2024 09:56:21 -0600 Subject: [PATCH 3/4] Bump version --- server/build.gradle | 2 +- web-ui/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server/build.gradle b/server/build.gradle index 8c70f18a6f..634e67ba74 100755 --- a/server/build.gradle +++ b/server/build.gradle @@ -7,7 +7,7 @@ plugins { id "jacoco" } -version "0.8.10" +version "0.8.11" group "com.objectcomputing.checkins" repositories { diff --git a/web-ui/package.json b/web-ui/package.json index db08625fcc..32ee428d5e 100644 --- a/web-ui/package.json +++ b/web-ui/package.json @@ -1,6 +1,6 @@ { "name": "web-ui", - "version": "0.8.10", + "version": "0.8.11", "private": true, "type": "module", "dependencies": { From b401698e56b128a159c6b045b18a3537644180a2 Mon Sep 17 00:00:00 2001 From: Chad Elliott Date: Mon, 16 Dec 2024 09:13:41 -0600 Subject: [PATCH 4/4] #2790 - Added a bar chart per day showing the number of responses. --- web-ui/src/pages/PulseReportPage.jsx | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/web-ui/src/pages/PulseReportPage.jsx b/web-ui/src/pages/PulseReportPage.jsx index 108051804e..b329cc47d4 100644 --- a/web-ui/src/pages/PulseReportPage.jsx +++ b/web-ui/src/pages/PulseReportPage.jsx @@ -7,7 +7,7 @@ import { CartesianGrid, Legend, Line, - LineChart, + ComposedChart, ResponsiveContainer, Tooltip, XAxis, @@ -48,7 +48,7 @@ import './PulseReportPage.css'; // Recharts doesn't support using CSS variables, so we can't // easily use color variables defined in variables.css. const ociDarkBlue = '#2c519e'; -//const ociLightBlue = '#76c8d4'; // not currently used +const ociLightBlue = '#76c8d4'; // const ociOrange = '#f8b576'; // too light const orange = '#b26801'; @@ -209,7 +209,8 @@ const PulseReportPage = () => { { date: day.date, internal: day.datapoints.reduce((acc, current) => acc + current.internalScore, 0)/day.datapoints.length, - external: day.datapoints.reduce((acc, current) => acc + current.externalScore, 0)/day.datapoints.length + external: day.datapoints.reduce((acc, current) => acc + current.externalScore, 0)/day.datapoints.length, + responses: day.datapoints.length, } ))); setBarChartData(frequencies); @@ -436,7 +437,7 @@ const PulseReportPage = () => { /> - + { { stroke={orange} type="monotone" /> - + +