-
Notifications
You must be signed in to change notification settings - Fork 6
Feature 2295 review assignment percentages #2391
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
Feature 2295 review assignment percentages #2391
Conversation
| margin-bottom: 1rem; | ||
| } | ||
|
|
||
| .reviewPeriodSection { |
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.
This CSS class is no longer used.
| @@ -0,0 +1,22 @@ | |||
| .review-period-card { | |||
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.
The UI that renders each review period in ReviewPeriods.jsx was factored out to create the new component ReviewPeriodCard. This is the CSS for the new component.
| @@ -0,0 +1,214 @@ | |||
| import PropTypes from 'prop-types'; | |||
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.
This is the new component that was factored out of ReviewPeriod.jsx.
Most of the code stayed the same, but new code was added to get and display approval percentages.
| const periods = selectReviewPeriods(state); | ||
|
|
||
| const period = periods.find(period => period.id === periodId); | ||
| const showPercentages = |
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.
This determines whether we should show percentages. The user must have a certain permission AND the review period must have a status of "AWAITING APPROVAL".
| import PropTypes from 'prop-types'; | ||
| import React, { useCallback, useContext, useEffect, useState } from 'react'; | ||
|
|
||
| import { |
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.
All the deleted code was moved to the new component ReviewPeriodCard.
| }); | ||
| const [reviewStatus, setReviewStatus] = useState(ReviewStatus.CLOSED); | ||
| const [selfReviews, setSelfReviews] = useState(null); | ||
| const [selfReviews, setSelfReviews] = useState({}); |
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.
This holds a map of review data. Initializing it to an empty object simplifies the code a bit.
jackkeller
left a comment
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.
![]()
No description provided.