Skip to content

Commit 36f27b3

Browse files
committed
fix: dont show edit manager comment to reviewer and filter reviews which are failed screening
1 parent 22737bd commit 36f27b3

File tree

4 files changed

+18
-3
lines changed

4 files changed

+18
-3
lines changed

src/apps/review/src/lib/components/ChallengeDetailsContent/ChallengeDetailsContent.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,7 @@ export const ChallengeDetailsContent: FC<Props> = (props: Props) => {
508508
selectedTab={props.selectedTab}
509509
reviews={reviewTabReviews}
510510
submitterReviews={reviewTabSubmitterReviews}
511+
screeningOutcome={screeningOutcome}
511512
reviewMinimumPassingScore={props.reviewMinimumPassingScore}
512513
isLoadingReview={props.isLoadingSubmission}
513514
isDownloading={isDownloadingSubmission}

src/apps/review/src/lib/components/ChallengeDetailsContent/TabContentReview.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ import { hasSubmitterPassedThreshold } from '../../utils/reviewScoring'
4646
interface Props {
4747
aiReviewers?: { aiWorkflowId: string }[]
4848
selectedTab: string
49+
screeningOutcome: {
50+
failingSubmissionIds: Set<string>;
51+
passingSubmissionIds: Set<string>;
52+
}
4953
reviews: SubmissionInfo[]
5054
submitterReviews: SubmissionInfo[]
5155
reviewMinimumPassingScore?: number | null
@@ -636,6 +640,7 @@ export const TabContentReview: FC<Props> = (props: Props) => {
636640
},
637641
[resolvedReviewsWithSubmitter],
638642
)
643+
639644
const filteredSubmitterReviews = useMemo(
640645
() => {
641646
if (!resolvedSubmitterReviews.length) {
@@ -729,6 +734,7 @@ export const TabContentReview: FC<Props> = (props: Props) => {
729734
<TableReview
730735
aiReviewers={props.aiReviewers}
731736
datas={reviewRows}
737+
screeningOutcome={props.screeningOutcome}
732738
isDownloading={props.isDownloading}
733739
downloadSubmission={props.downloadSubmission}
734740
mappingReviewAppeal={props.mappingReviewAppeal}

src/apps/review/src/lib/components/Scorecard/ScorecardViewer/ScorecardQuestion/ReviewResponse/ReviewManagerComment/ReviewManagerComment.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ const ReviewManagerComment: FC<ReviewManagerCommentProps> = props => {
119119
<div className={styles.content}>
120120
<MarkdownReview value={comment} />
121121
</div>
122-
{isManagerEdit && (
122+
{isManagerEdit && canAddManagerComment && (
123123
<button
124124
type='button'
125125
onClick={handleShowCommentForm}

src/apps/review/src/lib/components/TableReview/TableReview.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ export interface TableReviewProps {
7272
aiReviewers?: { aiWorkflowId: string }[]
7373
className?: string
7474
datas: SubmissionInfo[]
75+
screeningOutcome: {
76+
failingSubmissionIds: Set<string>;
77+
passingSubmissionIds: Set<string>;
78+
}
7579
isDownloading: IsRemovingType
7680
downloadSubmission: (submissionId: string) => void
7781
mappingReviewAppeal: MappingReviewAppeal
@@ -230,9 +234,13 @@ export const TableReview: FC<TableReviewProps> = (props: TableReviewProps) => {
230234
[myReviewerResourceIds],
231235
)
232236

237+
const filterScreeningPassedReviews = useCallback((submissions: SubmissionInfo[]): SubmissionInfo[] => {
238+
return submissions.filter(submission => props.screeningOutcome.passingSubmissionIds.has(submission.id ?? ''))
239+
}, [props.screeningOutcome.passingSubmissionIds])
240+
233241
const submissionsForAggregation = useMemo<SubmissionInfo[]>(
234-
() => (restrictToLatest ? latestSubmissions : reviewPhaseDatas),
235-
[latestSubmissions, restrictToLatest, reviewPhaseDatas],
242+
() => (restrictToLatest ? filterScreeningPassedReviews(latestSubmissions) : filterScreeningPassedReviews(reviewPhaseDatas)),
243+
[latestSubmissions, restrictToLatest, reviewPhaseDatas, filterScreeningPassedReviews],
236244
)
237245

238246
const aggregatedSubmissionRows = useMemo<AggregatedSubmissionReviews[]>(() => (

0 commit comments

Comments
 (0)