Skip to content

Commit

Permalink
Merge pull request #2757 from objectcomputing/release/0.8
Browse files Browse the repository at this point in the history
Release v0.8.7 to production
  • Loading branch information
mkimberlin authored Nov 11, 2024
2 parents 29e2c84 + ee61de7 commit dee0ca8
Show file tree
Hide file tree
Showing 19 changed files with 1,140 additions and 1,017 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.6"
version "0.8.7"
group "com.objectcomputing.checkins"

repositories {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ public BirthDayServicesImpl(MemberProfileServices memberProfileServices) {
public List<BirthDayResponseDTO> findByValue(String[] months, Integer[] daysOfMonth) {
Set<MemberProfile> memberProfiles = memberProfileServices.findByValues(null, null, null, null, null, null, false);
List<MemberProfile> memberProfileAll = new ArrayList<>(memberProfiles);
if (months == null && daysOfMonth == null) {
// If nothing was passed in, get all members without birthdays.
memberProfileAll = memberProfileAll
.stream()
.filter(member -> member.getBirthDate() == null)
.toList();
}
if (months != null) {
for (String month : months) {
if (month != null) {
Expand Down Expand Up @@ -66,7 +73,9 @@ private List<BirthDayResponseDTO> profileToBirthDateResponseDto(List<MemberProfi
BirthDayResponseDTO birthDayResponseDTO = new BirthDayResponseDTO();
birthDayResponseDTO.setUserId(member.getId());
birthDayResponseDTO.setName(member.getFirstName() + "" +member.getLastName());
birthDayResponseDTO.setBirthDay(member.getBirthDate().getMonthValue() + "/" +member.getBirthDate().getDayOfMonth());
if (member.getBirthDate() != null) {
birthDayResponseDTO.setBirthDay(member.getBirthDate().getMonthValue() + "/" +member.getBirthDate().getDayOfMonth());
}
birthDays.add(birthDayResponseDTO);
}
}
Expand Down
2 changes: 1 addition & 1 deletion web-ui/.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lts/*
stable/*
6 changes: 3 additions & 3 deletions web-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "web-ui",
"version": "0.8.6",
"version": "0.8.7",
"private": true,
"type": "module",
"dependencies": {
Expand Down Expand Up @@ -76,7 +76,7 @@
]
},
"devDependencies": {
"@ladle/react": "^4.0.3",
"@ladle/react": "^4.1.2",
"@testing-library/jest-dom": "^6.4.5",
"@testing-library/react": "^14.2.2",
"@testing-library/react-hooks": "^8.0.1",
Expand All @@ -92,7 +92,7 @@
"happy-dom": "^15.10.2",
"jest-fetch-mock": "^3.0.3",
"jsdom": "^24.0.0",
"msw": "^2.2.13",
"msw": "^2.6.4",
"prettier": "3.2.5",
"prop-types": "^15.8.1",
"react-test-renderer": "^18.2.0",
Expand Down
2 changes: 1 addition & 1 deletion web-ui/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const theme = extendTheme({
components: {
MuiButtonBase: {
defaultProps: {
disableRipple: !!process.env.VITEST_WORKER_ID, // No more ripple...only when testing.
disableRipple: typeof process !== 'undefined' && !!process.env.VITEST_WORKER_ID, // No more ripple...only when testing.
},
},
MuiCssBaseline: {
Expand Down
22 changes: 19 additions & 3 deletions web-ui/src/api/birthdayanniversary.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,28 @@ export const getTodaysCelebrations = async cookie => {

export const getBirthdays = async (months, cookie) => {
const results = [];
for (let month of months) {
if (months) {
for (let month of months) {
const res = await resolve({
url: `${birthdayReportUrl}?month=${month}`,
headers: { 'X-CSRF-Header': cookie, Accept: 'application/json' }
});
if (res.error) {
console.error(res.error);
} else {
results.push(...res.payload.data);
}
}
} else {
const res = await resolve({
url: `${birthdayReportUrl}?month=${month}`,
url: birthdayReportUrl,
headers: { 'X-CSRF-Header': cookie, Accept: 'application/json' }
});
results.push(...res.payload.data);
if (res.error) {
console.error(res.error);
} else {
results.push(...res.payload.data);
}
}
return results;
};
2 changes: 1 addition & 1 deletion web-ui/src/api/notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { resolve } from './api.js';
const emailNotificationURL = '/services/email-notifications';
const emailURL = '/services/email';
const testEmailURL = import.meta.env.VITE_APP_API_URL
? import.meta.env.VITE_APP_URL + '/feedback/submit?request='
? import.meta.env.VITE_APP_API_URL + '/feedback/submit?request='
: 'http://localhost:8080/feedback/submit?request=';

export const sendReminderNotification = async (
Expand Down
6 changes: 4 additions & 2 deletions web-ui/src/components/guild-results/EditGuildModal.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@ const testGuild = {
guildMembers: [
{ id: 125, name: 'Guild Member' },
{ id: 126, name: 'Other Member' }
]
],
active: true,
};

const emptyGuild = {
name: 'Test Guild',
description: 'A guild used for testing.'
description: 'A guild used for testing.',
active: true,
};

const currentUserProfile = {
Expand Down
4 changes: 2 additions & 2 deletions web-ui/src/components/kudos_dialog/KudosDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { AppContext } from '../../context/AppContext';
import {
selectCsrfToken,
selectCurrentUser,
selectNormalizedTeams,
selectActiveTeams,
selectOrderedCurrentMemberProfiles,
selectProfile
} from '../../context/selectors';
Expand Down Expand Up @@ -65,7 +65,7 @@ const KudosDialog = ({ open, recipient, teamId, onClose }) => {
);

const currentUser = selectCurrentUser(state);
const teams = selectNormalizedTeams(state, '');
const teams = selectActiveTeams(state);
const memberProfiles = selectOrderedCurrentMemberProfiles(state);

const handleSubmit = useCallback(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ import { AppContext } from '../../../context/AppContext';
import {
selectCsrfToken,
selectCurrentMembers,
selectGuilds,
selectActiveGuilds,
selectMappedUserRoles,
selectRoles,
selectSkills,
selectSubordinates,
selectSupervisors,
selectTeamMembersBySupervisorId,
selectTeams
selectActiveTeams,
} from '../../../context/selectors';
import { UPDATE_TOAST } from '../../../context/actions';
import { getMembersByTeam } from '../../../api/team';
Expand Down Expand Up @@ -172,14 +172,14 @@ const MemberSelectorDialog = ({
const getFilterOptions = () => {
switch (filterType) {
case FilterType.TEAM:
const teams = selectTeams(state);
const teams = selectActiveTeams(state);
return {
options: teams,
label: team => team.name,
equals: (team1, team2) => team1.id === team2.id
};
case FilterType.GUILD:
const guilds = selectGuilds(state);
const guilds = selectActiveGuilds(state);
return {
options: guilds,
label: guild => guild.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ const testGuild = {
name: 'Test Guild',
description: 'A guild used for testing.',
guildLeads: [{ id: 124, name: managerProfile.name }],
guildMembers: []
guildMembers: [],
active: true,
};

const initialState = {
Expand Down
6 changes: 3 additions & 3 deletions web-ui/src/components/reviews/TeamReviews.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -647,9 +647,9 @@ const TeamReviews = ({ onBack, periodId }) => {
if (!period.closeDate) return 'No close date was specified.';
if (!period.periodStartDate) return 'No period-start-date was specified.';
if (!period.periodEndDate) return 'No period-end-date was specified.';
if (teamMembers.length === 0) return 'No members were added.';
const haveReviewers = teamMembers.every(
member => getReviewers(member).length > 0
if (assignments.length === 0) return 'No members were added.';
const haveReviewers = assignments.every(
assignment => assignment.reviewerId != null
);
if (!haveReviewers) return 'One or more members have no reviewer.';
return null; // no validation errors
Expand Down
21 changes: 18 additions & 3 deletions web-ui/src/components/team-results/TeamSummaryCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import {
DialogContent,
DialogContentText,
DialogTitle,
Tooltip
Tooltip,
Typography,
} from '@mui/material';
import PropTypes from 'prop-types';
import { updateTeam } from '../../api/team.js';
Expand All @@ -34,7 +35,8 @@ const StyledCard = styled(Card)({
width: '340px',
display: 'flex',
flexDirection: 'column',
justifyContent: 'space-between'
justifyContent: 'space-between',
position: 'relative',
},
[`& .${classes.header}`]: {
width: '100%'
Expand All @@ -46,6 +48,11 @@ const StyledCard = styled(Card)({
}
});

const inactiveStyle = {
'color': 'var(--action-disabled)',
'font-size': '0.75em',
};

const propTypes = {
team: PropTypes.shape({
id: PropTypes.string,
Expand Down Expand Up @@ -101,7 +108,7 @@ const TeamSummaryCard = ({ team, index, onTeamSelect, selectedTeamId }) => {
title: classes.title,
subheader: classes.title
}}
title={team.name + (team.active ? ' (Active)' : ' (Inactive)')}
title={team.name}
subheader={
<Tooltip
open={tooltipIsOpen}
Expand All @@ -116,6 +123,14 @@ const TeamSummaryCard = ({ team, index, onTeamSelect, selectedTeamId }) => {
}
/>
<CardContent>
{!team.active && (
<Typography sx={{ position: 'absolute', top: 10, right: 10,
...inactiveStyle,
}}
>
Inactive
</Typography>
)}
{team.teamMembers == null ? (
<React.Fragment key={`empty-team-${team.name}`}>
<strong>Team Leads: </strong>None Assigned
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`renders correctly 1`] = `
<div>
<div
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation1 MuiCard-root TeamSummaryCard-card css-2bwzc-MuiPaper-root-MuiCard-root"
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation1 MuiCard-root TeamSummaryCard-card css-55zgp6-MuiPaper-root-MuiCard-root"
>
<div
class="MuiCardHeader-root css-185gdzj-MuiCardHeader-root"
Expand All @@ -14,7 +14,7 @@ exports[`renders correctly 1`] = `
<span
class="MuiTypography-root MuiTypography-h5 MuiCardHeader-title TeamSummaryCard-title css-1qvr50w-MuiTypography-root"
>
string (Inactive)
string
</span>
<span
class="MuiTypography-root MuiTypography-body1 MuiCardHeader-subheader TeamSummaryCard-title css-nrdprl-MuiTypography-root"
Expand All @@ -32,6 +32,11 @@ exports[`renders correctly 1`] = `
<div
class="MuiCardContent-root css-46bh2p-MuiCardContent-root"
>
<p
class="MuiTypography-root MuiTypography-body1 css-19pemnp-MuiTypography-root"
>
Inactive
</p>
<strong>
Team Leads:
</strong>
Expand All @@ -52,7 +57,7 @@ exports[`renders correctly 1`] = `
exports[`renders correctly for ADMIN 1`] = `
<div>
<div
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation1 MuiCard-root TeamSummaryCard-card css-2bwzc-MuiPaper-root-MuiCard-root"
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation1 MuiCard-root TeamSummaryCard-card css-55zgp6-MuiPaper-root-MuiCard-root"
>
<div
class="MuiCardHeader-root css-185gdzj-MuiCardHeader-root"
Expand All @@ -63,7 +68,7 @@ exports[`renders correctly for ADMIN 1`] = `
<span
class="MuiTypography-root MuiTypography-h5 MuiCardHeader-title TeamSummaryCard-title css-1qvr50w-MuiTypography-root"
>
string (Inactive)
string
</span>
<span
class="MuiTypography-root MuiTypography-body1 MuiCardHeader-subheader TeamSummaryCard-title css-nrdprl-MuiTypography-root"
Expand All @@ -81,6 +86,11 @@ exports[`renders correctly for ADMIN 1`] = `
<div
class="MuiCardContent-root css-46bh2p-MuiCardContent-root"
>
<p
class="MuiTypography-root MuiTypography-body1 css-19pemnp-MuiTypography-root"
>
Inactive
</p>
<strong>
Team Leads:
</strong>
Expand Down Expand Up @@ -142,7 +152,7 @@ exports[`renders correctly for ADMIN 1`] = `
exports[`renders correctly for team lead 1`] = `
<div>
<div
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation1 MuiCard-root TeamSummaryCard-card css-2bwzc-MuiPaper-root-MuiCard-root"
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation1 MuiCard-root TeamSummaryCard-card css-55zgp6-MuiPaper-root-MuiCard-root"
>
<div
class="MuiCardHeader-root css-185gdzj-MuiCardHeader-root"
Expand All @@ -153,7 +163,7 @@ exports[`renders correctly for team lead 1`] = `
<span
class="MuiTypography-root MuiTypography-h5 MuiCardHeader-title TeamSummaryCard-title css-1qvr50w-MuiTypography-root"
>
stuff (Inactive)
stuff
</span>
<span
class="MuiTypography-root MuiTypography-body1 MuiCardHeader-subheader TeamSummaryCard-title css-nrdprl-MuiTypography-root"
Expand All @@ -169,6 +179,11 @@ exports[`renders correctly for team lead 1`] = `
<div
class="MuiCardContent-root css-46bh2p-MuiCardContent-root"
>
<p
class="MuiTypography-root MuiTypography-body1 css-19pemnp-MuiTypography-root"
>
Inactive
</p>
<strong>
Team Leads:
</strong>
Expand Down
14 changes: 12 additions & 2 deletions web-ui/src/context/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -686,11 +686,21 @@ export const selectNormalizedTeams = createSelector(
})
);

export const selectActiveTeams = createSelector(
selectTeams,
(teams, searchText) => teams?.filter(team => team.active)
);

export const selectActiveGuilds = createSelector(
selectGuilds,
(guilds, searchText) => guilds?.filter(guild => guild.active)
);

export const selectMyGuilds = createSelector(
selectCurrentUserId,
selectGuilds,
(id, guilds) =>
guilds?.filter(guild =>
guilds?.filter(guild => guild.active &&
guild.guildMembers?.some(member => member.memberId === id)
)
);
Expand All @@ -699,7 +709,7 @@ export const selectMyTeams = createSelector(
selectCurrentUserId,
selectTeams,
(id, teams) =>
teams?.filter(team =>
teams?.filter(team => team.active &&
team.teamMembers?.some(member => member.memberId === id)
)
);
Expand Down
1 change: 0 additions & 1 deletion web-ui/src/pages/BirthdayAnniversaryReportPage.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

.select-month {
display: flex;
justify-content: space-between;
align-items: center;
margin-left: 15px;
margin-right: 10px;
Expand Down
Loading

0 comments on commit dee0ca8

Please sign in to comment.