-
Notifications
You must be signed in to change notification settings - Fork 6
Feature 2357 pulse survey report #2432
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
Changes from all commits
339f309
19a876a
801063d
3232c5e
5f0d675
8681b99
32b1221
568717e
38b37b6
5f5a3a4
735164c
e7df46a
d8374dc
908c363
da6edb2
21c15b0
b7e4ef3
86266ba
2da22e6
3bd56d1
950ec47
80e1786
de4a2b3
aafc5a2
58aab21
758a5f6
a487197
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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}> | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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> | ||
| ); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -458,7 +458,6 @@ const MemberSelectorDialog = ({ | |
| </div> | ||
| <Button | ||
| color="inherit" | ||
| disabled={checked.size === 0} | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This now allows deselecting all members. |
||
| onClick={handleSubmit} | ||
| > | ||
| Save | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,7 @@ import { | |
| selectHasAnniversaryReportPermission, | ||
| selectHasBirthdayReportPermission, | ||
| selectHasCheckinsReportPermission, | ||
| selectHasPulseReportPermission, | ||
| selectHasSkillsReportPermission, | ||
| selectHasTeamSkillsReportPermission | ||
| } from '../../context/selectors'; | ||
|
|
@@ -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']); | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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']); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -69,7 +69,6 @@ import { | |
| selectCurrentUser, | ||
| selectCurrentUserSubordinates, | ||
| selectIsAdmin, | ||
| selectMyTeam, | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This import is not used. |
||
| selectReviewPeriod, | ||
| selectSupervisors, | ||
| selectTeamMembersBySupervisorId | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,7 +13,6 @@ import { | |
| Avatar, | ||
| Card, | ||
| CardActions, | ||
| CardContent, | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This import is not used. |
||
| Collapse, | ||
| ListItemAvatar, | ||
| ListItemText | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,6 @@ import PropTypes from 'prop-types'; | |
| import React, { useCallback, useContext, useEffect, useState } from 'react'; | ||
|
|
||
| import { | ||
| Avatar, | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This import is not used. |
||
| Box, | ||
| Button, | ||
| FormControl, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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'; | ||
|
|
@@ -147,6 +148,10 @@ export default function Routes() { | |
| <Header title="Annual Review Report" /> | ||
| <AnnualReviewReportPage /> | ||
| </Route> | ||
| <Route path="/pulse-reports"> | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 /> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -94,6 +94,16 @@ export const selectHasProfileReportPermission = createSelector( | |
| ) | ||
| ); | ||
|
|
||
| export const selectHasPulseReportPermission = createSelector( | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 => | ||
|
|
||
| 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'; | ||
|
|
@@ -15,9 +16,9 @@ const PulsePage = () => { | |
| const csrf = selectCsrfToken(state); | ||
|
|
||
| const [externalComment, setExternalComment] = useState(''); | ||
| const [externalScore, setExternalScore] = useState(0); | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated default internal and external scores. |
||
| 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'); | ||
|
|
@@ -79,13 +80,11 @@ const PulsePage = () => { | |
|
|
||
| const submit = async () => { | ||
| const myId = currentUser?.id; | ||
| //TODO: The POST endpoint doesn't currently save the score values, | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
|
@@ -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); | ||
| } | ||
|
|
||
| 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; | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added some
pulse_reportrecords to enable testing the new pulse report page.