Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
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
23 changes: 21 additions & 2 deletions server/src/main/resources/db/dev/R__Load_testing_data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -648,8 +648,27 @@ values('dd694cf2-c0f9-4470-b897-00c564c1252b','06cd3202-a209-4ae1-a49a-10395fbe3
INSERT INTO pulse_response
(id, submissiondate, teammemberid, internalfeelings, externalfeelings, internal_score, external_score) -- Holly Williams
VALUES
('cda41eed-70ea-4d3f-a9d7-cd0c5158eb5f', '2021-01-29', '8fa673c0-ca19-4271-b759-41cb9db2e83a', PGP_SYM_ENCRYPT('Feeling pretty happy','${aeskey}'), PGP_SYM_ENCRYPT('Feeling really good','${aeskey}'), 1, 3);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added some pulse_report records to enable testing the new pulse report page.


('802e125c-4db5-4ed9-a4a6-024cc23e4e41', '2024-05-17', '8fa673c0-ca19-4271-b759-41cb9db2e83a', PGP_SYM_ENCRYPT('internal #1','${aeskey}'), PGP_SYM_ENCRYPT('external #1','${aeskey}'), 4, 5);
INSERT INTO pulse_response
(id, submissiondate, teammemberid, internalfeelings, externalfeelings, internal_score, external_score) -- Holly Williams
VALUES
('23dfdb75-8ef7-4754-a82a-d39e165a9aab', '2024-05-18', '8fa673c0-ca19-4271-b759-41cb9db2e83a', PGP_SYM_ENCRYPT('internal #2','${aeskey}'), PGP_SYM_ENCRYPT('external #2','${aeskey}'), 3, 4);
INSERT INTO pulse_response
(id, submissiondate, teammemberid, internalfeelings, externalfeelings, internal_score, external_score) -- Holly Williams
VALUES
('a11b7f6b-aaa4-4a3e-a0a3-48da0a31e695', '2024-05-19', '8fa673c0-ca19-4271-b759-41cb9db2e83a', PGP_SYM_ENCRYPT('internal #3','${aeskey}'), PGP_SYM_ENCRYPT('external #3','${aeskey}'), 2, 5);
INSERT INTO pulse_response
(id, submissiondate, teammemberid, internalfeelings, externalfeelings, internal_score, external_score) -- Holly Williams
VALUES
('cda41eed-70ea-4d3f-a9d7-cd0c5158eb5f', '2024-05-20', '8fa673c0-ca19-4271-b759-41cb9db2e83a', PGP_SYM_ENCRYPT('internal #4','${aeskey}'), PGP_SYM_ENCRYPT('external #4','${aeskey}'), 4, 1);
INSERT INTO pulse_response
(id, submissiondate, teammemberid, internalfeelings, externalfeelings, internal_score, external_score) -- Holly Williams
VALUES
('c75be148-1cb6-425f-9671-7fb68a33f2bf', '2024-05-21', '8fa673c0-ca19-4271-b759-41cb9db2e83a', PGP_SYM_ENCRYPT('internal #5','${aeskey}'), PGP_SYM_ENCRYPT('external #5','${aeskey}'), 5, 2);
INSERT INTO pulse_response
(id, submissiondate, teammemberid, internalfeelings, externalfeelings, internal_score, external_score) -- Mark Volkmann
VALUES
('8c4e215f-44c8-4b73-bdd1-b5cdc0048f32', '2024-05-21', '2c1b77e2-e2fc-46d1-92f2-beabbd28ee3d', PGP_SYM_ENCRYPT('working on Check-ins','${aeskey}'), PGP_SYM_ENCRYPT('writing htmx book','${aeskey}'), 3, 5);

-- Admin Permissions
insert into role_permissions
Expand Down
2 changes: 1 addition & 1 deletion web-ui/src/components/expand-more/ExpandMore.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { IconButton } from '@mui/material';
const ExpandMore = styled(props => {
const { expand, ...other } = props;
return (
<IconButton {...other}>
<IconButton classes={{ root: 'expand-more' }} {...other}>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a CSS class to this so I can apply CSS properties in pages were it is used.

{props.children ? props.children : <ExpandMoreIcon />}
</IconButton>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ exports[`renders correctly 1`] = `
<button
aria-expanded="false"
aria-label="show more"
class="MuiButtonBase-root MuiIconButton-root MuiIconButton-sizeLarge css-9tbq5g-MuiButtonBase-root-MuiIconButton-root"
class="MuiButtonBase-root MuiIconButton-root expand-more MuiIconButton-sizeLarge css-9tbq5g-MuiButtonBase-root-MuiIconButton-root"
tabindex="0"
type="button"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,6 @@ const MemberSelectorDialog = ({
</div>
<Button
color="inherit"
disabled={checked.size === 0}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This now allows deselecting all members.

onClick={handleSubmit}
>
Save
Expand Down
7 changes: 7 additions & 0 deletions web-ui/src/components/menu/Menu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
selectHasAnniversaryReportPermission,
selectHasBirthdayReportPermission,
selectHasCheckinsReportPermission,
selectHasPulseReportPermission,
selectHasSkillsReportPermission,
selectHasTeamSkillsReportPermission
} from '../../context/selectors';
Expand Down Expand Up @@ -122,6 +123,12 @@ function Menu({ children }) {
links.push(['/checkins-reports', 'Check-ins']);
}

//TODO: Skipping the permission check during testing
// because this permission has not been implemented yet.
// if (selectHasPulseReportPermission(state)) {
links.push(['/pulse-reports', 'Pulses']);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adds a new page to the menu.

// }

if (selectHasSkillsReportPermission(state)) {
links.push(['/skills-reports', 'Skills']);
}
Expand Down
1 change: 1 addition & 0 deletions web-ui/src/components/pulse/Pulse.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ it('renders correctly', () => {
score={2}
setComment={() => {}}
setScore={() => {}}
title="How are you feeling about work today? (*)"
/>
);
expect(component.baseElement).toMatchSnapshot();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ exports[`renders correctly 1`] = `
>
<h6
class="MuiTypography-root MuiTypography-h6 css-2ulfj5-MuiTypography-root"
/>
>
How are you feeling about work today? (*)
</h6>
<div
class="icon-row"
>
Expand Down
1 change: 0 additions & 1 deletion web-ui/src/components/reviews/TeamReviews.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ import {
selectCurrentUser,
selectCurrentUserSubordinates,
selectIsAdmin,
selectMyTeam,
Copy link
Collaborator Author

@mvolkmann mvolkmann May 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This import is not used.

selectReviewPeriod,
selectSupervisors,
selectTeamMembersBySupervisorId
Expand Down
1 change: 0 additions & 1 deletion web-ui/src/components/reviews/periods/ReviewPeriodCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
Avatar,
Card,
CardActions,
CardContent,
Copy link
Collaborator Author

@mvolkmann mvolkmann May 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This import is not used.

Collapse,
ListItemAvatar,
ListItemText
Expand Down
1 change: 0 additions & 1 deletion web-ui/src/components/reviews/periods/ReviewPeriods.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import PropTypes from 'prop-types';
import React, { useCallback, useContext, useEffect, useState } from 'react';

import {
Avatar,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This import is not used.

Box,
Button,
FormControl,
Expand Down
5 changes: 5 additions & 0 deletions web-ui/src/components/routes/Routes.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import Header from '../header/Header';
import HomePage from '../../pages/HomePage';
import PeoplePage from '../../pages/PeoplePage';
import PulsePage from '../../pages/PulsePage';
import PulseReportPage from '../../pages/PulseReportPage';
import MemberProfilePage from '../../pages/MemberProfilePage';
import Roles from '../admin/roles/Roles';
import SkillReportPage from '../../pages/SkillReportPage';
Expand Down Expand Up @@ -147,6 +148,10 @@ export default function Routes() {
<Header title="Annual Review Report" />
<AnnualReviewReportPage />
</Route>
<Route path="/pulse-reports">
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New route for new page.

<Header title="Pulse Report" />
<PulseReportPage />
</Route>
<Route path="/admin/roles">
<Header title="Roles"></Header>
<Roles />
Expand Down
10 changes: 10 additions & 0 deletions web-ui/src/context/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,16 @@ export const selectHasProfileReportPermission = createSelector(
)
);

export const selectHasPulseReportPermission = createSelector(
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New permission check.

selectUserProfile,
userProfile =>
userProfile &&
userProfile.role &&
userProfile.permissions.some(p =>
p?.permission?.includes('CAN_VIEW_ALL_PULSE_RESPONSES')
)
);

export const selectHasSkillsReportPermission = createSelector(
selectUserProfile,
userProfile =>
Expand Down
14 changes: 8 additions & 6 deletions web-ui/src/pages/PulsePage.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { format } from 'date-fns';
import React, { useContext, useEffect, useState } from 'react';
import {useHistory} from 'react-router-dom';
import { Button, Typography } from '@mui/material';

import { resolve } from '../api/api.js';
Expand All @@ -15,9 +16,9 @@ const PulsePage = () => {
const csrf = selectCsrfToken(state);

const [externalComment, setExternalComment] = useState('');
const [externalScore, setExternalScore] = useState(0);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated default internal and external scores.
These are 0-based in the code (not in the database), so 2 is in the middle.

const [externalScore, setExternalScore] = useState(2); // zero-based
const [internalComment, setInternalComment] = useState('');
const [internalScore, setInternalScore] = useState(0);
const [internalScore, setInternalScore] = useState(2); // zero-based
const [pulse, setPulse] = useState(null);
const [submittedToday, setSubmittedToday] = useState(false);
const today = format(new Date(), 'yyyy-MM-dd');
Expand Down Expand Up @@ -79,13 +80,11 @@ const PulsePage = () => {

const submit = async () => {
const myId = currentUser?.id;
//TODO: The POST endpoint doesn't currently save the score values,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This TODO has been addressed.

// but story #2345 will fix that.
const data = {
externalFeelings: externalComment,
externalScore,
externalScore: externalScore + 1, // converts to 1-based
internalFeelings: internalComment,
internalScore,
internalScore: internalScore + 1, // converts to 1-based
submissionDate: today,
updatedDate: today,
teamMemberId: myId
Expand All @@ -102,6 +101,9 @@ const PulsePage = () => {
data
});
if (res.error) throw new Error(res.error.message);

// Refresh browser to show that pulses where already submitted today.
history.push(location.pathname);
} catch (err) {
console.error('PulsePage.jsx submit:', err);
}
Expand Down
20 changes: 20 additions & 0 deletions web-ui/src/pages/PulseReportPage.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.pulse-report-page {
.date-pickers {
display: flex;
gap: 1rem;
}

.expand-more {
margin-bottom: 1rem;
}

.recharts-wrapper {
display: inline-block;
}

.response-row {
display: flex;
align-items: center;
gap: 1rem;
}
}
Loading