Skip to content

Commit 8df1220

Browse files
authored
Merge branch 'develop' into bugfix-2672/address-test-warnings
2 parents 601be35 + ca9ed5c commit 8df1220

File tree

24 files changed

+347
-177
lines changed

24 files changed

+347
-177
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.5"
10+
version "0.8.6"
1111
group "com.objectcomputing.checkins"
1212

1313
repositories {

server/src/main/java/com/objectcomputing/checkins/services/memberprofile/birthday/BirthDayServicesImpl.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ public BirthDayServicesImpl(MemberProfileServices memberProfileServices) {
2323
public List<BirthDayResponseDTO> findByValue(String[] months, Integer[] daysOfMonth) {
2424
Set<MemberProfile> memberProfiles = memberProfileServices.findByValues(null, null, null, null, null, null, false);
2525
List<MemberProfile> memberProfileAll = new ArrayList<>(memberProfiles);
26+
if (months == null && daysOfMonth == null) {
27+
// If nothing was passed in, get all members without birthdays.
28+
memberProfileAll = memberProfileAll
29+
.stream()
30+
.filter(member -> member.getBirthDate() == null)
31+
.toList();
32+
}
2633
if (months != null) {
2734
for (String month : months) {
2835
if (month != null) {
@@ -66,7 +73,9 @@ private List<BirthDayResponseDTO> profileToBirthDateResponseDto(List<MemberProfi
6673
BirthDayResponseDTO birthDayResponseDTO = new BirthDayResponseDTO();
6774
birthDayResponseDTO.setUserId(member.getId());
6875
birthDayResponseDTO.setName(member.getFirstName() + "" +member.getLastName());
69-
birthDayResponseDTO.setBirthDay(member.getBirthDate().getMonthValue() + "/" +member.getBirthDate().getDayOfMonth());
76+
if (member.getBirthDate() != null) {
77+
birthDayResponseDTO.setBirthDay(member.getBirthDate().getMonthValue() + "/" +member.getBirthDate().getDayOfMonth());
78+
}
7079
birthDays.add(birthDayResponseDTO);
7180
}
7281
}

server/src/main/java/com/objectcomputing/checkins/services/reports/CompensationHistory.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ public class CompensationHistory extends CSVProcessor {
2323
public record Compensation(
2424
UUID memberId,
2525
LocalDate startDate,
26-
float amount
26+
String amount,
27+
String totalComp
2728
) {
2829
}
2930

@@ -45,11 +46,13 @@ protected void loadImpl(MemberProfileRepository memberProfileRepository,
4546
if (date == null) {
4647
LOG.error("Unable to parse date: {}", startDate);
4748
} else {
49+
String value = csvRecord.get("compensation");
4850
Compensation comp = new Compensation(
4951
memberProfile.get().getId(),
5052
date,
51-
Float.parseFloat(csvRecord.get("compensation")
52-
.replaceAll("[^\\d\\.,]", "")));
53+
value == null ? null : value.replaceAll("[^\\d\\.,]", ""),
54+
csvRecord.get("totalComp")
55+
);
5356
history.add(comp);
5457
}
5558
} else {

server/src/test/java/com/objectcomputing/checkins/services/reports/ReportDataControllerTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,10 @@ void validateReportData(JsonNode node, MemberProfile user) {
185185

186186
// Compensation History
187187
ArrayNode comp = (ArrayNode)node.get("compensationHistory");
188-
assertEquals(5, comp.size());
188+
assertEquals(10, comp.size());
189189
assertEquals(memberId, comp.get(0).get("memberId").asText());
190190
assertTrue(comp.get(0).get("amount").asDouble() > 0);
191+
assertFalse(comp.get(9).get("totalComp").asText().isEmpty());
191192

192193
// Current Information
193194
JsonNode curr = node.get("currentInformation");
Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
1-
"emailAddress","startDate","compensation"
2-
"[email protected]","1/1/2024","100000.00"
3-
"[email protected]","1/1/2023","95000.00"
4-
"[email protected]","1/1/2022","90000.00"
5-
"[email protected]","1/1/2021","85000.00"
6-
"[email protected]","1/1/2020","80000.00"
7-
"[email protected]","2/1/2024","100000.00"
8-
"[email protected]","2/1/2023","95000.00"
9-
"[email protected]","2/1/2022","90000.00"
10-
"[email protected]","2/1/2021","85000.00"
11-
"[email protected]","2/1/2020","80000.00"
1+
"emailAddress","startDate","compensation","totalComp"
2+
"[email protected]","1/1/2024","100000.00",
3+
"[email protected]","1/1/2023","95000.00",
4+
"[email protected]","1/1/2022","90000.00",
5+
"[email protected]","1/1/2021","85000.00",
6+
"[email protected]","1/1/2020","80000.00",
7+
"[email protected]","2/1/2024","100000.00",
8+
"[email protected]","2/1/2023","95000.00",
9+
"[email protected]","2/1/2022","90000.00",
10+
"[email protected]","2/1/2021","85000.00",
11+
"[email protected]","2/1/2020","80000.00",
12+
"[email protected]","2024",,"103000.00"
13+
"[email protected]","2023",,"98000.00"
14+
"[email protected]","2022",,"93000.00"
15+
"[email protected]","2021",,"88000.00"
16+
"[email protected]","2020",,"83000.00"
17+
"[email protected]","2024",,"103000.00"
18+
"[email protected]","2023",,"98000.00"
19+
"[email protected]","2022",,"93000.00"
20+
"[email protected]","2021",,"88000.00"
21+
"[email protected]","2020",,"83000.00"

web-ui/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "web-ui",
3-
"version": "0.8.5",
3+
"version": "0.8.6",
44
"private": true,
55
"type": "module",
66
"dependencies": {
@@ -89,7 +89,7 @@
8989
"eslint-plugin-react-hooks": "^4.6.0",
9090
"eslint-plugin-vitest": "^0.5.4",
9191
"globals": "^15.0.0",
92-
"happy-dom": "^15.10.1",
92+
"happy-dom": "^15.10.2",
9393
"jest-fetch-mock": "^3.0.3",
9494
"jsdom": "^24.0.0",
9595
"msw": "^2.2.13",

web-ui/src/api/birthdayanniversary.js

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,28 @@ export const getTodaysCelebrations = async cookie => {
2525

2626
export const getBirthdays = async (months, cookie) => {
2727
const results = [];
28-
for (let month of months) {
28+
if (months) {
29+
for (let month of months) {
30+
const res = await resolve({
31+
url: `${birthdayReportUrl}?month=${month}`,
32+
headers: { 'X-CSRF-Header': cookie, Accept: 'application/json' }
33+
});
34+
if (res.error) {
35+
console.error(res.error);
36+
} else {
37+
results.push(...res.payload.data);
38+
}
39+
}
40+
} else {
2941
const res = await resolve({
30-
url: `${birthdayReportUrl}?month=${month}`,
42+
url: birthdayReportUrl,
3143
headers: { 'X-CSRF-Header': cookie, Accept: 'application/json' }
3244
});
33-
results.push(...res.payload.data);
45+
if (res.error) {
46+
console.error(res.error);
47+
} else {
48+
results.push(...res.payload.data);
49+
}
3450
}
3551
return results;
3652
};

web-ui/src/api/notifications.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { resolve } from './api.js';
33
const emailNotificationURL = '/services/email-notifications';
44
const emailURL = '/services/email';
55
const testEmailURL = import.meta.env.VITE_APP_API_URL
6-
? import.meta.env.VITE_APP_URL + '/feedback/submit?request='
6+
? import.meta.env.VITE_APP_API_URL + '/feedback/submit?request='
77
: 'http://localhost:8080/feedback/submit?request=';
88

99
export const sendReminderNotification = async (

web-ui/src/components/guild-results/EditGuildModal.jsx

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ import {
1111
FormControlLabel,
1212
Modal,
1313
Switch,
14-
TextField
14+
TextField,
15+
Checkbox,
1516
} from '@mui/material';
1617
import Autocomplete from '@mui/material/Autocomplete';
1718
import './EditGuildModal.css';
@@ -166,18 +167,19 @@ const EditGuildModal = ({ guild = {}, open, onSave, onClose, headerText }) => {
166167
value={editedGuild.name ? editedGuild.name : ''}
167168
onChange={e => setGuild({ ...editedGuild, name: e.target.value })}
168169
/>
169-
{guild.id && <FormControlLabel
170-
control={
171-
<Switch
172-
checked={editedGuild.active}
173-
onChange={event => {
174-
const { checked } = event.target;
175-
setGuild({ ...editedGuild, active: checked });
176-
}}
177-
/>
178-
}
170+
{guild.id && (<>
171+
<Checkbox
172+
id="guild-active-input"
179173
label="Active"
180-
/>}
174+
variant="outlined"
175+
className="halfWidth"
176+
checked={editedGuild.active ? editedGuild.active : false}
177+
onChange={event => {
178+
const { checked } = event.target;
179+
setGuild({ ...editedGuild, active: checked });
180+
}}
181+
/> Active
182+
</>)}
181183
</div>
182184
<div>
183185
<FormControlLabel

web-ui/src/components/guild-results/EditGuildModal.spec.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,14 @@ const testGuild = {
3434
guildMembers: [
3535
{ id: 125, name: 'Guild Member' },
3636
{ id: 126, name: 'Other Member' }
37-
]
37+
],
38+
active: true,
3839
};
3940

4041
const emptyGuild = {
4142
name: 'Test Guild',
42-
description: 'A guild used for testing.'
43+
description: 'A guild used for testing.',
44+
active: true,
4345
};
4446

4547
const currentUserProfile = {

0 commit comments

Comments
 (0)