Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions web-ui/src/components/member_selector/MemberSelector.jsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
import React, { useCallback, useContext, useEffect, useState } from 'react';
import PropTypes from 'prop-types';
import {
Avatar,
Box,
Card,
CardHeader,
Divider,
IconButton,
List,
ListItemIcon,
ListItemText,
Tooltip,
Typography
} from '@mui/material';
import { Add, FileDownload } from '@mui/icons-material';
import { getAvatarURL } from '../../api/api';

import MemberSelectorDialog, {
FilterType
Expand Down Expand Up @@ -156,7 +151,7 @@ const MemberSelector = ({
</div>
}
action={
<>
<Box sx={{ mr: 2 }}>
<Tooltip title={`Change ${memberDescriptor}`} arrow>
<IconButton
style={{ margin: '4px 8px 0 0' }}
Expand All @@ -177,7 +172,7 @@ const MemberSelector = ({
</IconButton>
</Tooltip>
)}
</>
</Box>
}
/>
</Card>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
width: 100%;
margin: 0 0.75rem;
}

.team-member-map-summmary-latest-activity {
color: var(--muted);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ const TeamMemberMap = ({ members, id, closed, planned, reportDate }) => {
component={'time'}
dateTime={getLastCheckinDate(checkins).toISOString()}
sx={{ display: { xs: 'none', sm: 'flex' } }}
className="team-member-map-summmary-latest-activity"
>
Activity:{' '}
Latest Activity:{' '}
{getLastCheckinDate(checkins).toLocaleDateString(
navigator.language,
{
Expand Down
12 changes: 6 additions & 6 deletions web-ui/src/pages/CheckinsReportPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const CheckinsReportPage = () => {
const newPdls = ids
.map(id => pdls.find(pdl => pdl.id === id))
.filter(Boolean);
setSelectedPdls(newPdls);
newPdls.length > 0 && setSelectedPdls(newPdls);
Copy link
Collaborator

Choose a reason for hiding this comment

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

If newPdls becomes empty, does it to clear out the array of selected PDLs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For newPdls to become empty I believe we would have a data issue on our hands. This change is to allow us to short-circuit the logic for changing component state as the default state when no pdls are available is controlled in a useEffect queuing off processedQPs.current.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I see what you're saying. This looks good. I actually didn't noticed that this was in code related to the query parameters. Makes sense now.

},
toQP(newPdls) {
if (isArrayPresent(newPdls)) {
Expand All @@ -113,12 +113,12 @@ const CheckinsReportPage = () => {
processedQPs
);

// Set the selected PDLs to the mapped PDLs unless they are already set
// Update selected PDLs when processedQPs is updated
useEffect(() => {
if (pdls.length > 0) return;
const mapped = selectMappedPdls(state);
setSelectedPdls(mapped);
}, [state]);
if (selectedPdls.length === 0 && processedQPs.current) {
setSelectedPdls(selectMappedPdls(state));
}
}, [processedQPs.current]);

// Set the mapped PDLs to the PDLs with members
useEffect(() => {
Expand Down
2 changes: 2 additions & 0 deletions web-ui/src/styles/variables.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
--primary-link-dark-hover: #4f5f8c;
--action: color-mix(in oklab, var(--black), var(--white) 50%);
--action-disabled: color-mix(in oklab, var(--black), var(--white) 5%);
--muted: color-mix(in oklab, var(--black), var(--white) 47%);

--checkins-palette-action-disabledOpacity: 0.58;

Expand Down Expand Up @@ -66,6 +67,7 @@
--primary-text: color-mix(in oklab, var(--white), var(--black) 10%);
--action: var(--white);
--action-disabled: color-mix(in oklab, var(--white), var(--black) 30%);
--muted: color-mix(in oklab, var(--black), var(--white) 53%);

--primary-main: var(--oci-light-blue);
--primary-light: color-mix(
Expand Down