Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix 2748/missing tests #2767

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 26 additions & 16 deletions server/src/main/resources/db/dev/R__Load_testing_data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1699,19 +1699,29 @@ VALUES
('d27b679c-3aa8-4c4d-b08e-4eda63cea23f', '105f2968-a182-45a3-892c-eeff76383fe0', '06c03df3-85fe-4fc3-979e-9f1f6ba74a03', '5', '2022-08-01');

INSERT INTO kudos
(id, message, senderid, teamid, datecreated, dateapproved)
(id, message, senderid, teamid, datecreated, dateapproved, publiclyvisible)
VALUES
('39dfd281-d0af-4016-848b-8156dfef2b92', PGP_SYM_ENCRYPT('Kudos to Revolver Ocelot!', '${aeskey}'), 'e4b2fe52-1915-4544-83c5-21b8f871f6db', null, '2022-10-01', '2022-10-02');
('39dfd281-d0af-4016-848b-8156dfef2b93', PGP_SYM_ENCRYPT('Kudos to Revolver Ocelot!', '${aeskey}'), 'e4b2fe52-1915-4544-83c5-21b8f871f6db', null, '2023-12-01', '2023-12-02', true);

INSERT INTO kudos_recipient
(id, kudosid, memberid)
VALUES
('ebc023e1-b577-4b02-a2fb-fc9472a8474b', '39dfd281-d0af-4016-848b-8156dfef2b93', '105f2968-a182-45a3-892c-eeff76383fe0');

INSERT INTO kudos
(id, message, senderid, teamid, datecreated, dateapproved, publiclyvisible)
VALUES
('39dfd281-d0af-4016-848b-8156dfef2b92', PGP_SYM_ENCRYPT('Kudos to Revolver Ocelot!', '${aeskey}'), 'e4b2fe52-1915-4544-83c5-21b8f871f6db', null, '2022-10-01', null, true);

INSERT INTO kudos_recipient
(id, kudosid, memberid)
VALUES
('ebc023e1-b577-4b02-a2fb-fc9472a8474a', '39dfd281-d0af-4016-848b-8156dfef2b92', '105f2968-a182-45a3-892c-eeff76383fe0');

INSERT INTO kudos
(id, message, senderid, teamid, datecreated, dateapproved)
(id, message, senderid, teamid, datecreated, dateapproved, publiclyvisible)
VALUES
('fbcde196-7703-4f80-ac5e-5ac60b28555e', PGP_SYM_ENCRYPT('Kudos to Huey and Awesome!', '${aeskey}'), 'e4b2fe52-1915-4544-83c5-21b8f871f6db', null, '2022-10-01', null);
('fbcde196-7703-4f80-ac5e-5ac60b28555e', PGP_SYM_ENCRYPT('Kudos to Huey and Awesome!', '${aeskey}'), 'e4b2fe52-1915-4544-83c5-21b8f871f6db', null, '2024-10-21', '2024-10-21', true);

INSERT INTO kudos_recipient
(id, kudosid, memberid)
Expand All @@ -1724,9 +1734,9 @@ VALUES
('bf37c244-f478-42b2-9077-dd4cb052bbb1', 'fbcde196-7703-4f80-ac5e-5ac60b28555e', '67dc3a3b-5bfa-4759-997a-fb6bac98dcf3');

INSERT INTO kudos
(id, message, senderid, teamid, datecreated, dateapproved)
(id, message, senderid, teamid, datecreated, dateapproved, publiclyvisible)
VALUES
('df2766f0-efab-4925-859e-d993e2e38eaa', PGP_SYM_ENCRYPT('Kudos to the Checkins Experts team!', '${aeskey}'), 'e4b2fe52-1915-4544-83c5-21b8f871f6db', 'a8733740-cf4c-4c16-a8cf-4f928c409acc', '2022-09-28', '2022-09-29');
('df2766f0-efab-4925-859e-d993e2e38eaa', PGP_SYM_ENCRYPT('Kudos to the Checkins Experts team!', '${aeskey}'), 'e4b2fe52-1915-4544-83c5-21b8f871f6db', 'a8733740-cf4c-4c16-a8cf-4f928c409acc', '2024-09-28', '2024-09-29', true);

INSERT INTO kudos_recipient
(id, kudosid, memberid)
Expand All @@ -1744,19 +1754,19 @@ VALUES
('0ca86d55-cffb-4b84-883c-c4c2e41eff73', 'df2766f0-efab-4925-859e-d993e2e38eaa', '67dc3a3b-5bfa-4759-997a-fb6bac98dcf3');

INSERT INTO kudos
(id, message, senderid, teamid, datecreated, dateapproved)
(id, message, senderid, teamid, datecreated, dateapproved, publiclyvisible)
VALUES
('17e19f16-d731-4242-a74a-43493a556f08', PGP_SYM_ENCRYPT('Kudos to Michael Kimberlin!', '${aeskey}'), 'a90be358-aa3d-49c8-945a-879a93646e45', null, '2022-08-15', '2022-08-25');
('17e19f16-d731-4242-a74a-43493a556f08', PGP_SYM_ENCRYPT('Kudos to Mischievous Kangaroo!', '${aeskey}'), 'a90be358-aa3d-49c8-945a-879a93646e45', null, '2024-11-01', null, true);

INSERT INTO kudos_recipient
(id, kudosid, memberid)
VALUES
('038485ee-8cac-416b-9da6-d838ee345d0e', '17e19f16-d731-4242-a74a-43493a556f08', 'e4b2fe52-1915-4544-83c5-21b8f871f6db');

INSERT INTO kudos
(id, message, senderid, teamid, datecreated, dateapproved)
(id, message, senderid, teamid, datecreated, dateapproved, publiclyvisible)
VALUES
('6612b8a0-1d45-4155-b0fb-e0b2d9eaafcb', PGP_SYM_ENCRYPT('Wanted to give some kudos to Mischievous Kangaroo and Revolver Ocelot for their recent help on the project. Thank you very much!', '${aeskey}'), '1b4f99da-ef70-4a76-9b37-8bb783b749ad', null, '2022-10-05', null);
('6612b8a0-1d45-4155-b0fb-e0b2d9eaafcb', PGP_SYM_ENCRYPT('Wanted to give some kudos to Mischievous Kangaroo and Revolver Ocelot for their recent help on the project. Thank you very much!', '${aeskey}'), '1b4f99da-ef70-4a76-9b37-8bb783b749ad', null, '2024-10-29', '2024-10-29', true);

INSERT INTO kudos_recipient
(id, kudosid, memberid)
Expand All @@ -1769,9 +1779,9 @@ VALUES
('01f639d5-b7b3-47a2-b165-d7a20d01fec2', '6612b8a0-1d45-4155-b0fb-e0b2d9eaafcb', '105f2968-a182-45a3-892c-eeff76383fe0');

INSERT INTO kudos
(id, message, senderid, teamid, datecreated, dateapproved)
(id, message, senderid, teamid, datecreated, dateapproved, publiclyvisible)
VALUES
('9cdce399-4c02-41ed-a63f-35beb6ecb622', PGP_SYM_ENCRYPT('A huge thank you to the Javascript Gurus team for offering their advice on the tech stack for the new project. Kudos to you all!', '${aeskey}'), '8d75c07e-6adc-437a-8659-7dd953ce6600', 'e8f052a8-40b5-4fb4-9bab-8b16ed36adc7', '2022-10-10', '2022-10-11');
('9cdce399-4c02-41ed-a63f-35beb6ecb622', PGP_SYM_ENCRYPT('A huge thank you to the Javascript Gurus team for offering their advice on the tech stack for the new project. Kudos to you all!', '${aeskey}'), '8d75c07e-6adc-437a-8659-7dd953ce6600', 'e8f052a8-40b5-4fb4-9bab-8b16ed36adc7', '2022-10-10', '2022-10-11', true);

INSERT INTO kudos_recipient
(id, kudosid, memberid)
Expand All @@ -1789,19 +1799,19 @@ VALUES
('f792056b-22ce-4e3d-a442-0fdc3cb35e7b', '9cdce399-4c02-41ed-a63f-35beb6ecb622', '105f2968-a182-45a3-892c-eeff76383fe0');

INSERT INTO kudos
(id, message, senderid, teamid, datecreated, dateapproved)
(id, message, senderid, teamid, datecreated, dateapproved, publiclyvisible)
VALUES
('39dfd284-d0bf-4017-848c-8156dfef2b93', PGP_SYM_ENCRYPT('Kudos are tasty.', '${aeskey}'), 'e4b2fe52-1915-4544-83c5-21b8f871f6db', null, '2024-09-04', '2022-09-04');
('39dfd284-d0bf-4017-848c-8156dfef2b93', PGP_SYM_ENCRYPT('Kudos are tasty.', '${aeskey}'), 'e4b2fe52-1915-4544-83c5-21b8f871f6db', null, '2024-11-10', '2024-11-10', true);

INSERT INTO kudos_recipient
(id, kudosid, memberid)
VALUES
('ebc023e2-b578-4b03-a2fc-fc9472a8474b', '39dfd284-d0bf-4017-848c-8156dfef2b93', 'c7406157-a38f-4d48-aaed-04018d846727');

INSERT INTO kudos
(id, message, senderid, teamid, datecreated, dateapproved)
(id, message, senderid, teamid, datecreated, dateapproved, publiclyvisible)
VALUES
('39dfd284-d0bf-4017-848c-8156dfef2b94', PGP_SYM_ENCRYPT('Kudos are covered in chocolate.', '${aeskey}'), 'e4b2fe52-1915-4544-83c5-21b8f871f6db', null, '2024-09-04', '2022-09-04');
('39dfd284-d0bf-4017-848c-8156dfef2b94', PGP_SYM_ENCRYPT('Kudos are covered in chocolate.', '${aeskey}'), 'e4b2fe52-1915-4544-83c5-21b8f871f6db', null, '2024-09-04', '2022-09-04', true);

INSERT INTO kudos_recipient
(id, kudosid, memberid)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const EarnedCertificationsTable = ({
});
if (res.error) return;

const certs = res.payload.data;
const certs = res.payload.data ?? [];
setCertifications(certs.sort((c1, c2) => c1.name.localeCompare(c2.name)));

const certMap = certs.reduce((map, cert) => {
Expand All @@ -114,7 +114,7 @@ const EarnedCertificationsTable = ({
});
if (res.error) return;

let earned = res.payload.data;
let earned = res.payload.data ?? [];
if (onlyMe) {
earned = earned.filter(cert => cert.memberId === currentUser.id);
}
Expand Down Expand Up @@ -512,7 +512,7 @@ const EarnedCertificationsTable = ({
});
if (res.error) return;

const newEarned = res.payload.data;
const newEarned = res.payload.data ?? [];
setEarnedCertifications(earned => {
if (id) {
const index = earned.findIndex(c => c.id === id);
Expand Down
15 changes: 2 additions & 13 deletions web-ui/src/components/feedback_submit_form/FeedbackSubmitForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ const FeedbackSubmitForm = ({
type: UPDATE_TOAST,
payload: {
severity: 'error',
toast: res.error
toast: res?.error ?? 'Unknown Error'
}
});
}
Expand All @@ -188,21 +188,10 @@ const FeedbackSubmitForm = ({
<SkeletonLoader type="feedback_requests" />
) : (
<Root className="submit-form">
<Typography className={classes.announcement} variant="h3">
<Typography component={'span'} className={classes.announcement} variant="h3">
{isReviewing ? 'Reviewing' : 'Submitting'} Feedback on{' '}
<b>{requesteeName}</b>
</Typography>
{/* {!isReviewing && ( */}
{/* <div className="wrapper"> */}
{/* <InfoIcon style={{ color: blue[900], fontSize: '2vh' }}> */}
{/* info-icon */}
{/* </InfoIcon> */}
{/* <Typography className={classes.tip}> */}
{/* <b>Tip of the day: </b> */}
{/* {tip} */}
{/* </Typography> */}
{/* </div> */}
{/* )} */}
{!isReviewing && (
<Alert className={classes.warning} severity="warning">
<AlertTitle>Notice!</AlertTitle>
Expand Down
13 changes: 10 additions & 3 deletions web-ui/src/components/reviews/TeamMemberReview.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ const TeamMemberReview = ({
: 'Self-Review'
}
{...a11yProps(0)}
key={0}
/>
{reviews &&
reviews.filter(r => !!r).map((review, index) => {
Expand All @@ -148,7 +149,10 @@ const TeamMemberReview = ({
}

return (
<Tab icon={icon} label={label} {...a11yProps(index + 1)} />
<Tab key={index + 1}
icon={icon}
label={label}
{...a11yProps(index + 1)} />
);
})}
</Tabs>
Expand All @@ -158,7 +162,7 @@ const TeamMemberReview = ({
index={value}
onChangeIndex={handleChangeIndex}
>
<TabPanel value={value} index={0} dir={theme.direction}>
<TabPanel key={0} value={value} index={0} dir={theme.direction}>
{selfReview?.id ? (
<FeedbackSubmitForm
requesteeName={
Expand All @@ -179,7 +183,10 @@ const TeamMemberReview = ({
review.status?.toUpperCase() === 'SUBMITTED');

return (
<TabPanel value={value} index={index + 1} dir={theme.direction}>
<TabPanel key={index + 1}
value={value}
index={index + 1}
dir={theme.direction}>
<FeedbackSubmitForm
requesteeName={requesteeName}
requestId={review.id}
Expand Down
3 changes: 1 addition & 2 deletions web-ui/src/components/reviews/periods/ReviewPeriods.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -399,9 +399,8 @@ const ReviewPeriods = ({ onPeriodSelected, mode }) => {
: aName.localeCompare(b.name));
})
.map((period) => (
<div>
<div key={`review-period-card-${period.id}`}>
<ReviewPeriodCard
key={`review-period-card-${period.id}`}
mode={mode}
onSelect={onPeriodClick}
periodId={period.id}
Expand Down
24 changes: 24 additions & 0 deletions web-ui/src/components/volunteer/VolunteerTables.test.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import React from 'react';
import VolunteerTables from './VolunteerTables';
import { AppContextProvider } from '../../context/AppContext';
import { BrowserRouter } from 'react-router-dom';


const initialState = {
state: {
userProfile: {
name: 'Mitch Hedberg',
role: ['MEMBER'],
},
},
};

it('renders correctly', () => {
snapshot(
<AppContextProvider value={initialState}>
<BrowserRouter>
<VolunteerTables />
</BrowserRouter>
</AppContextProvider>
);
});
Loading
Loading