Skip to content

Conversation

@mvolkmann
Copy link
Collaborator

No description provided.

margin-bottom: 1rem;
}

.reviewPeriodSection {
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 CSS class is no longer used.

@@ -0,0 +1,22 @@
.review-period-card {
Copy link
Collaborator Author

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';
Copy link
Collaborator Author

@mvolkmann mvolkmann May 15, 2024

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 =
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 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 {
Copy link
Collaborator Author

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({});
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 holds a map of review data. Initializing it to an empty object simplifies the code a bit.

Copy link
Collaborator

@jackkeller jackkeller left a comment

Choose a reason for hiding this comment

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

:shipit:

@mvolkmann mvolkmann merged commit 84fa7e0 into develop May 16, 2024
@mkimberlin mkimberlin deleted the feature-2295-review-assignment-percentages branch August 27, 2024 18:44
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