Skip to content

Conversation

@mvolkmann
Copy link
Collaborator

No description provided.

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.

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.

</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.

//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.

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.

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.

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.

<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.

)
);

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.

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 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.

@@ -0,0 +1,402 @@
import { format } from 'date-fns';
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 is the new report page.

Copy link
Contributor

@vhscom vhscom left a comment

Choose a reason for hiding this comment

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

Looking great! One change suggested for consideration.

if (res.error) throw new Error(res.error.message);

// Refresh browser to show that pulses where already submitted today.
location.reload();
Copy link
Contributor

Choose a reason for hiding this comment

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

I noticed the page reloads nicely using react-router-dom's useHistory hook like:

import {useHistory} from 'react-router-dom';

const PulsePage = () => {
  const { state } = useContext(AppContext);
  const currentUser = selectCurrentUser(state);
  const csrf = selectCsrfToken(state);
  const history = useHistory();

Then the hook can be used to navigate the same page:

history.push(location.pathname);

The user will then see a gentle page update and the thank you message.

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 made the change you suggested. Thanks for catching that!

Copy link
Contributor

@S78901 S78901 left a comment

Choose a reason for hiding this comment

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

Looks good, agree with @vhscom on the router update

@mvolkmann mvolkmann merged commit ae8efb1 into develop May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants