Skip to content

Commit 1d6eacd

Browse files
committed
2024-09-11 - Add supervisor as reviewer whenever adding a member, when the member has no reviewer
1 parent 9b2a3a9 commit 1d6eacd

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

web-ui/src/components/reviews/TeamReviews.jsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,9 @@ const TeamReviews = ({ onBack, periodId }) => {
249249
const exists = assignments.some(
250250
a => a.revieweeId === member.id
251251
);
252-
if (!!!exists && member.reviewerId) {
253-
const reviewers = [{ id: member.reviewerId }];
254-
updateReviewers(member, reviewers);
252+
if (!!!exists && member.supervisorid) {
253+
const reviewers = [{ id: member.supervisorid }];
254+
updateReviewers(member, reviewers, true);
255255
}
256256
});
257257
}
@@ -689,7 +689,7 @@ const TeamReviews = ({ onBack, periodId }) => {
689689
return compare;
690690
});
691691

692-
const updateReviewers = async (member, reviewers) => {
692+
const updateReviewers = async (member, reviewers, addAsApproved) => {
693693
const memberId = member.id;
694694

695695
let newAssignments = [...assignments];
@@ -707,7 +707,8 @@ const TeamReviews = ({ onBack, periodId }) => {
707707
newAssignments.push({
708708
reviewPeriodId: periodId,
709709
reviewerId: reviewer.id,
710-
revieweeId: member.id
710+
revieweeId: member.id,
711+
approved: addAsApproved,
711712
});
712713
}
713714
}
@@ -1057,7 +1058,7 @@ const TeamReviews = ({ onBack, periodId }) => {
10571058
selectedMembers={selectedReviewers}
10581059
onClose={closeReviewerDialog}
10591060
onSubmit={reviewers => {
1060-
updateReviewers(selectedMember, reviewers);
1061+
updateReviewers(selectedMember, reviewers, null);
10611062
closeReviewerDialog();
10621063
}}
10631064
/>

0 commit comments

Comments
 (0)