Skip to content

Commit

Permalink
If there is no reviewer, display a red chip that says "No Reviewer".
Browse files Browse the repository at this point in the history
  • Loading branch information
ocielliottc committed Oct 15, 2024
1 parent 55281f5 commit 3477ed6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
12 changes: 8 additions & 4 deletions web-ui/src/components/reviews/TeamReviews.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -782,13 +782,17 @@ const TeamReviews = ({ onBack, periodId }) => {
};

const renderReviewer = (member, reviewer) => {
const hasReviewer = !!reviewer.name;
const backgroundColor = reviewer.approved ?
'var(--checkins-palette-action-green)' :
'var(--checkins-palette-action-yellow)';
(hasReviewer ?
'var(--checkins-palette-action-yellow)' :
'var(--checkins-palette-action-red)');
const request = getReviewRequest(member, reviewer);
const selfReviewRequest = getSelfReviewRequest(member);
const variant = 'outlined';
const statusLabel = `${reviewer.name}: ${getReviewStatus(request)}`;
const reviewerName = reviewer.name ?? "No Reviewer";
const statusLabel = `${reviewerName}: ${getReviewStatus(request)}`;
const url = getReviewerURL(request, selfReviewRequest);

return (url ?
Expand All @@ -802,9 +806,9 @@ const TeamReviews = ({ onBack, periodId }) => {
</Link> :
<Chip
key={reviewer.id}
label={openMode ? statusLabel : reviewer.name}
label={openMode ? statusLabel : reviewerName}
variant={variant}
onDelete={canUpdate && !openMode ?
onDelete={canUpdate && !openMode && hasReviewer ?
() => deleteReviewer(member, reviewer) : null}
style={{backgroundColor: backgroundColor}}
/>);
Expand Down
1 change: 1 addition & 0 deletions web-ui/src/styles/variables.css
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
--checkins-palette-action-disabled: var(--action-disabled);
--checkins-palette-action-yellow: lightyellow;
--checkins-palette-action-green: lightgreen;
--checkins-palette-action-red: darkred;

&[data-mui-color-scheme='dark'] {
--primary-text: color-mix(in oklab, var(--white), var(--black) 10%);
Expand Down

0 comments on commit 3477ed6

Please sign in to comment.