Skip to content

Commit

Permalink
Merge branch 'develop' into feature-2751/post-approved-kudos-to-slack
Browse files Browse the repository at this point in the history
  • Loading branch information
mkimberlin authored Dec 17, 2024
2 parents 94c6d41 + ed83bb9 commit 52643a9
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 17 deletions.
2 changes: 1 addition & 1 deletion server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
id "jacoco"
}

version "0.8.10"
version "0.8.11"
group "com.objectcomputing.checkins"

repositories {
Expand Down
2 changes: 1 addition & 1 deletion web-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "web-ui",
"version": "0.8.10",
"version": "0.8.11",
"private": true,
"type": "module",
"dependencies": {
Expand Down
42 changes: 30 additions & 12 deletions web-ui/src/pages/PulseReportPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
CartesianGrid,
Legend,
Line,
LineChart,
ComposedChart,
ResponsiveContainer,
Tooltip,
XAxis,
Expand Down Expand Up @@ -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';

Expand Down Expand Up @@ -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 });
Expand All @@ -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++;
Expand Down Expand Up @@ -200,7 +205,14 @@ 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,
responses: day.datapoints.length,
}
)));
setBarChartData(frequencies);

for (const memberId of Object.keys(averageData)) {
Expand Down Expand Up @@ -425,7 +437,7 @@ const PulseReportPage = () => {
/>
<CardContent>
<ResponsiveContainer width="100%" aspect={3.0}>
<LineChart data={lineChartData} height={300}>
<ComposedChart data={lineChartData} height={300}>
<CartesianGrid strokeDasharray="3 3" />
<XAxis
angle={-90}
Expand All @@ -438,18 +450,24 @@ const PulseReportPage = () => {
<Tooltip />
<Legend />
<Line
type="monotone"
dataKey="internal"
stroke={ociDarkBlue}
dot={false}
type="monotone"
/>
<Line
dataKey="external"
dot={false}
stroke={orange}
type="monotone"
/>
</LineChart>
<Bar
dataKey="responses"
barSize={20}
fill={ociLightBlue}
type="monotone"
/>
</ComposedChart>
</ResponsiveContainer>
</CardContent>
</Card>
Expand Down
6 changes: 3 additions & 3 deletions web-ui/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 52643a9

Please sign in to comment.