Skip to content

Commit 52643a9

Browse files
authored
Merge branch 'develop' into feature-2751/post-approved-kudos-to-slack
2 parents 94c6d41 + ed83bb9 commit 52643a9

File tree

4 files changed

+35
-17
lines changed

4 files changed

+35
-17
lines changed

server/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ plugins {
77
id "jacoco"
88
}
99

10-
version "0.8.10"
10+
version "0.8.11"
1111
group "com.objectcomputing.checkins"
1212

1313
repositories {

web-ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "web-ui",
3-
"version": "0.8.10",
3+
"version": "0.8.11",
44
"private": true,
55
"type": "module",
66
"dependencies": {

web-ui/src/pages/PulseReportPage.jsx

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
CartesianGrid,
88
Legend,
99
Line,
10-
LineChart,
10+
ComposedChart,
1111
ResponsiveContainer,
1212
Tooltip,
1313
XAxis,
@@ -48,7 +48,7 @@ import './PulseReportPage.css';
4848
// Recharts doesn't support using CSS variables, so we can't
4949
// easily use color variables defined in variables.css.
5050
const ociDarkBlue = '#2c519e';
51-
//const ociLightBlue = '#76c8d4'; // not currently used
51+
const ociLightBlue = '#76c8d4';
5252
// const ociOrange = '#f8b576'; // too light
5353
const orange = '#b26801';
5454

@@ -145,7 +145,7 @@ const PulseReportPage = () => {
145145
// This creates data in the format that recharts needs from pulse data.
146146
useEffect(() => {
147147
const averageData = {}; // key is member id
148-
const lineChartData = [];
148+
const lineChartDataPoints = [];
149149
const frequencies = [];
150150
for (let i = 1; i <= 5; i++) {
151151
frequencies.push({ score: i, internal: 0, external: 0 });
@@ -162,11 +162,16 @@ const PulseReportPage = () => {
162162
const [year, month, day] = submissionDate;
163163
const monthPadded = month.toString().padStart(2, '0');
164164
const dayPadded = day.toString().padStart(2, '0');
165-
lineChartData.push({
166-
date: `${year}-${monthPadded}-${dayPadded}`,
167-
internal: internalScore,
168-
external: externalScore
169-
});
165+
const date = `${year}-${monthPadded}-${dayPadded}`;
166+
const found = lineChartDataPoints.find(points => points.date === date)
167+
if(found) {
168+
found?.datapoints?.push(pulse);
169+
} else {
170+
lineChartDataPoints.push({
171+
date,
172+
datapoints: [pulse]
173+
});
174+
}
170175

171176
frequencies[internalScore - 1].internal++;
172177
frequencies[externalScore - 1].external++;
@@ -200,7 +205,14 @@ const PulseReportPage = () => {
200205
}
201206
}
202207

203-
setLineChartData(lineChartData);
208+
setLineChartData(lineChartDataPoints.map(day => (
209+
{
210+
date: day.date,
211+
internal: day.datapoints.reduce((acc, current) => acc + current.internalScore, 0)/day.datapoints.length,
212+
external: day.datapoints.reduce((acc, current) => acc + current.externalScore, 0)/day.datapoints.length,
213+
responses: day.datapoints.length,
214+
}
215+
)));
204216
setBarChartData(frequencies);
205217

206218
for (const memberId of Object.keys(averageData)) {
@@ -425,7 +437,7 @@ const PulseReportPage = () => {
425437
/>
426438
<CardContent>
427439
<ResponsiveContainer width="100%" aspect={3.0}>
428-
<LineChart data={lineChartData} height={300}>
440+
<ComposedChart data={lineChartData} height={300}>
429441
<CartesianGrid strokeDasharray="3 3" />
430442
<XAxis
431443
angle={-90}
@@ -438,18 +450,24 @@ const PulseReportPage = () => {
438450
<Tooltip />
439451
<Legend />
440452
<Line
441-
type="monotone"
442453
dataKey="internal"
443454
stroke={ociDarkBlue}
444455
dot={false}
456+
type="monotone"
445457
/>
446458
<Line
447459
dataKey="external"
448460
dot={false}
449461
stroke={orange}
450462
type="monotone"
451463
/>
452-
</LineChart>
464+
<Bar
465+
dataKey="responses"
466+
barSize={20}
467+
fill={ociLightBlue}
468+
type="monotone"
469+
/>
470+
</ComposedChart>
453471
</ResponsiveContainer>
454472
</CardContent>
455473
</Card>

web-ui/yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6094,9 +6094,9 @@ mute-stream@^2.0.0:
60946094
integrity sha512-WWdIxpyjEn+FhQJQQv9aQAYlHoNVdzIzUySNV1gHUPDSdZJ3yZn7pAAbQcV7B56Mvu881q9FZV+0Vx2xC44VWA==
60956095

60966096
nanoid@^3.3.7:
6097-
version "3.3.7"
6098-
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.7.tgz#d0c301a691bc8d54efa0a2226ccf3fe2fd656bd8"
6099-
integrity sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==
6097+
version "3.3.8"
6098+
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.8.tgz#b1be3030bee36aaff18bacb375e5cce521684baf"
6099+
integrity sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==
61006100

61016101
natural-compare@^1.4.0:
61026102
version "1.4.0"

0 commit comments

Comments
 (0)