Skip to content

Commit

Permalink
Cleanup from self-review.
Browse files Browse the repository at this point in the history
  • Loading branch information
ocielliottc committed Jan 15, 2025
1 parent a6516e2 commit b4d3b38
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
import React, { useContext, useState } from 'react';
import {
Accordion,
AccordionSummary,
Avatar,
Chip,
Typography,
AccordionDetails,
Box,
Card,
CardContent,
} from '@mui/material';
import { Link } from 'react-router-dom';
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
import { getAvatarURL } from '../../../api/api.js';
import { AppContext } from '../../../context/AppContext.jsx';
import { selectCheckinsForMember } from '../../../context/selectors.js';
Expand Down Expand Up @@ -54,8 +50,7 @@ const TeamMemberMap = ({ members, closed, planned, reportDate }) => {
sortByName(memberMap[a.reportDatePDLId], memberMap[b.reportDatePDLId]);

// We're going to cache the checkins into the member data structures so that
// we can properly sort by PDL when the PDL, in the past, is different than
// the current PDL.
// we only have to do this once per member.
const { startOfQuarter, endOfQuarter } = getQuarterBeginEnd(reportDate);
members.map(member => {
member.checkins = selectCheckinsForMember(
Expand All @@ -67,8 +62,9 @@ const TeamMemberMap = ({ members, closed, planned, reportDate }) => {

// If there are checkins, we're going to sort them with the latest
// first. Since the member's PDL could have changed since the last
// checkin, we are going to use the PDL id of the checkin instead
// of the current PDL. They may be the same, but again they may not.
// checkin, we are going to use the PDL id of the checkin with the report
// date range instead of the current PDL. They may be the same, but again
// they may not.
member.checkin = null;
member.reportDatePDLId = member.pdlId;
if (member.checkins.length > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export const getCheckinDateForPeriod = (checkins, reportDate) => {

/**
* Determine check-in status for a member during the reporting period.
* Include the grace period for the end of the quarter.
* @param {Checkin} checkin - Latest Check-in for a member.
* @param {Date} reportDate - The date of the report.
* @returns {SchedulingStatus} The status of the check-ins.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ describe('statusForPeriodByMemberScheduling', () => {
});

test('returns "Scheduled" when the check-in is within the reporting period are not completed', () => {
console.log(mockReportDate);
const checkin =
{ checkInDate: [2024, 4, 10, 10, 0], completed: false }; // April 1, 2024 (within reporting period, not completed)
const result = statusForPeriodByMemberScheduling(checkin, mockReportDate);
Expand Down

0 comments on commit b4d3b38

Please sign in to comment.