Skip to content

Commit 6d422c9

Browse files
authored
Merge branch 'develop' into feature-2805/convert-skills-data-structure
2 parents ba7714b + 03c2c99 commit 6d422c9

File tree

9 files changed

+58
-35
lines changed

9 files changed

+58
-35
lines changed

server/src/main/java/com/objectcomputing/checkins/services/pulseresponse/PulseResponse.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public class PulseResponse {
7777
protected PulseResponse() {
7878
}
7979

80-
public PulseResponse(UUID id, Integer internalScore, Integer externalScore, LocalDate submissionDate, @Nullable UUID teamMemberId, String internalFeelings, String externalFeelings) {
80+
public PulseResponse(UUID id, Integer internalScore, @Nullable Integer externalScore, LocalDate submissionDate, @Nullable UUID teamMemberId, String internalFeelings, String externalFeelings) {
8181
this.id = id;
8282
this.internalScore = internalScore;
8383
this.externalScore = externalScore;

web-ui/src/components/admin/users/Users.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import AdminMemberCard from '../../member-directory/AdminMemberCard';
1010
import MemberModal from '../../member-directory/MemberModal';
1111
import {
1212
createMember,
13-
reportAllMembersCsv
13+
reportSelectedMembersCsv
1414
} from '../../../api/member';
1515
import { AppContext } from '../../../context/AppContext';
1616
import { UPDATE_MEMBER_PROFILES, UPDATE_TOAST } from '../../../context/actions';
@@ -110,7 +110,8 @@ const Users = () => {
110110
});
111111

112112
const downloadMembers = async () => {
113-
let res = await reportAllMembersCsv(csrf);
113+
const res = await reportSelectedMembersCsv(
114+
normalizedMembers.map((m) => m.id), csrf);
114115
if (res?.error) {
115116
dispatch({
116117
type: UPDATE_TOAST,

web-ui/src/components/pulse/Pulse.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
margin-bottom: 1rem;
2121
padding: 1rem;
2222
}
23+
24+
.title-row {
25+
display: flex;
26+
}
2327
}
2428

2529
:root[data-mui-color-scheme='dark'] {

web-ui/src/components/pulse/Pulse.jsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ const tooltips = [
3030
const propTypes = {
3131
comment: PropTypes.string,
3232
commentRequired: PropTypes.bool,
33+
iconRequired: PropTypes.bool,
3334
score: PropTypes.number,
3435
setComment: PropTypes.func,
3536
setScore: PropTypes.func,
@@ -38,21 +39,25 @@ const propTypes = {
3839
const Pulse = ({
3940
comment,
4041
commentRequired,
42+
iconRequired,
4143
score,
4244
setComment,
4345
setScore,
4446
title
4547
}) => (
4648
<div className="pulse">
47-
<Typography variant="h6">{title}</Typography>
49+
<div className="title-row">
50+
<Typography variant="h6">{title}</Typography>
51+
{iconRequired && <Typography variant="h6" color="red">*</Typography>}
52+
</div>
4853
<div className="icon-row">
4954
{icons.map((sentiment, index) => (
5055
<Tooltip key={`sentiment-${index}`} title={tooltips[index]} arrow>
5156
<IconButton
5257
aria-label="sentiment"
5358
className={index === score ? 'selected' : ''}
5459
data-testid={`score-button-${index}`}
55-
onClick={() => setScore(index)}
60+
onClick={() => setScore(score == index ? null : index)}
5661
sx={{ color: colors[index] }}
5762
>
5863
{sentiment}
@@ -70,7 +75,7 @@ const Pulse = ({
7075
}}
7176
placeholder="Comment"
7277
required={commentRequired}
73-
rows={4}
78+
maxRows={4}
7479
value={comment}
7580
/>
7681
</div>

web-ui/src/components/pulse/__snapshots__/Pulse.test.jsx.snap

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@ exports[`renders correctly 1`] = `
66
<div
77
class="pulse"
88
>
9-
<h6
10-
class="MuiTypography-root MuiTypography-h6 css-2ulfj5-MuiTypography-root"
9+
<div
10+
class="title-row"
1111
>
12-
How are you feeling about work today? (*)
13-
</h6>
12+
<h6
13+
class="MuiTypography-root MuiTypography-h6 css-2ulfj5-MuiTypography-root"
14+
>
15+
How are you feeling about work today? (*)
16+
</h6>
17+
</div>
1418
<div
1519
class="icon-row"
1620
>
@@ -203,7 +207,6 @@ exports[`renders correctly 1`] = `
203207
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputMultiline css-1sqnrkk-MuiInputBase-input-MuiOutlinedInput-input"
204208
id=":r5:"
205209
placeholder="Comment"
206-
rows="4"
207210
style="height: 0px; overflow: hidden;"
208211
>
209212
Just testing

web-ui/src/components/volunteer/VolunteerEvents.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ const VolunteerEvents = ({ forceUpdate = () => {}, onlyMe = false }) => {
258258
<Autocomplete
259259
disableClearable
260260
getOptionLabel={(option) =>
261-
option === 'new' ? 'Create a New Organization' : (relationshipMap[option]?.organizationId && organizationMap[relationshipMap[option].organizationId]?.name) || 'Unknown'
261+
option === 'new' ? 'Create a New Organization' : (relationshipMap[option]?.organizationId && organizationMap[relationshipMap[option].organizationId]?.name) || ''
262262
}
263263
options={['new', ...relationships.filter((rel) => !rel.endDate).map((rel) => rel.id)]} // Use relationship IDs
264264
onChange={(event, value) => {

web-ui/src/pages/PulsePage.jsx

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,9 @@ const PulsePage = () => {
4242
const [year, month, day] = pulse.submissionDate;
4343
setSubmittedToday(
4444
year === now.getFullYear() &&
45-
month === now.getMonth() + 1 &&
46-
day === now.getDate()
45+
month === now.getMonth() + 1 &&
46+
day === now.getDate()
4747
);
48-
49-
setInternalComment(pulse.internalFeelings ?? '');
50-
setExternalComment(pulse.externalFeelings ?? '');
51-
setInternalScore(pulse.internalScore == undefined ?
52-
center : pulse.internalScore - 1);
53-
setExternalScore(pulse.externalScore == undefined ?
54-
center : pulse.externalScore - 1);
5548
}, [pulse]);
5649

5750
const loadTodayPulse = async () => {
@@ -91,7 +84,7 @@ const PulsePage = () => {
9184
const myId = currentUser?.id;
9285
const data = {
9386
externalFeelings: externalComment,
94-
externalScore: externalScore + 1, // converts to 1-based
87+
externalScore: externalScore == null ? null : externalScore + 1, // converts to 1-based
9588
internalFeelings: internalComment,
9689
internalScore: internalScore + 1, // converts to 1-based
9790
submissionDate: today,
@@ -120,10 +113,11 @@ const PulsePage = () => {
120113
<Pulse
121114
key="pulse-internal"
122115
comment={internalComment}
116+
iconRequired={true}
123117
score={internalScore}
124118
setComment={setInternalComment}
125119
setScore={setInternalScore}
126-
title="How are you feeling about work today? (*)"
120+
title="How are you feeling about work today?"
127121
/>
128122
<Pulse
129123
key="pulse-external"
@@ -137,6 +131,7 @@ const PulsePage = () => {
137131
<Button
138132
style={{ marginTop: 0 }}
139133
onClick={submit}
134+
disabled={internalScore == null}
140135
variant="contained">
141136
Submit
142137
</Button>

web-ui/src/pages/PulseReportPage.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,9 @@ const PulseReportPage = () => {
197197
}
198198

199199
frequencies[internalScore - 1].internal++;
200-
frequencies[externalScore - 1].external++;
200+
if (externalScore != null) {
201+
frequencies[externalScore - 1].external++;
202+
}
201203

202204
let memberIdToUse;
203205
if (memberId) {
@@ -256,7 +258,9 @@ const PulseReportPage = () => {
256258
];
257259
for(let day of scoreChartDataPoints) {
258260
day.datapoints.forEach(datapoint => {
259-
externalPieCounts[datapoint.externalScore - 1].value++;
261+
if (datapoint.externalScore != null) {
262+
externalPieCounts[datapoint.externalScore - 1].value++;
263+
}
260264
});
261265
}
262266
// Filter out data with a zero value so that the pie chart does not attempt

web-ui/src/pages/__snapshots__/PulsePage.test.jsx.snap

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,20 @@ exports[`renders correctly 1`] = `
88
<div
99
class="pulse"
1010
>
11-
<h6
12-
class="MuiTypography-root MuiTypography-h6 css-2ulfj5-MuiTypography-root"
11+
<div
12+
class="title-row"
1313
>
14-
How are you feeling about work today? (*)
15-
</h6>
14+
<h6
15+
class="MuiTypography-root MuiTypography-h6 css-2ulfj5-MuiTypography-root"
16+
>
17+
How are you feeling about work today?
18+
</h6>
19+
<h6
20+
class="MuiTypography-root MuiTypography-h6 css-1i2vuon-MuiTypography-root"
21+
>
22+
*
23+
</h6>
24+
</div>
1625
<div
1726
class="icon-row"
1827
>
@@ -205,7 +214,6 @@ exports[`renders correctly 1`] = `
205214
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputMultiline css-1sqnrkk-MuiInputBase-input-MuiOutlinedInput-input"
206215
id=":r5:"
207216
placeholder="Comment"
208-
rows="4"
209217
style="height: 0px; overflow: hidden;"
210218
/>
211219
<textarea
@@ -233,11 +241,15 @@ exports[`renders correctly 1`] = `
233241
<div
234242
class="pulse"
235243
>
236-
<h6
237-
class="MuiTypography-root MuiTypography-h6 css-2ulfj5-MuiTypography-root"
244+
<div
245+
class="title-row"
238246
>
239-
How are you feeling about life outside of work?
240-
</h6>
247+
<h6
248+
class="MuiTypography-root MuiTypography-h6 css-2ulfj5-MuiTypography-root"
249+
>
250+
How are you feeling about life outside of work?
251+
</h6>
252+
</div>
241253
<div
242254
class="icon-row"
243255
>
@@ -430,7 +442,6 @@ exports[`renders correctly 1`] = `
430442
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputMultiline css-1sqnrkk-MuiInputBase-input-MuiOutlinedInput-input"
431443
id=":rb:"
432444
placeholder="Comment"
433-
rows="4"
434445
style="height: 0px; overflow: hidden;"
435446
/>
436447
<textarea

0 commit comments

Comments
 (0)