Skip to content

Commit a3be432

Browse files
authored
Merge pull request #1382 from topcoder-platform/pm-3216
fix(PM-3216, PM-2573): dont show edit manager comment to reviewer and filter reviews which are failed screening
2 parents e4b38d9 + ff680e7 commit a3be432

File tree

4 files changed

+25
-3
lines changed

4 files changed

+25
-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: 17 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,20 @@ export const TableReview: FC<TableReviewProps> = (props: TableReviewProps) => {
230234
[myReviewerResourceIds],
231235
)
232236

237+
const filterScreeningPassedReviews = useCallback(
238+
(submissions: SubmissionInfo[]): SubmissionInfo[] => submissions.filter(
239+
submission => props.screeningOutcome.passingSubmissionIds.has(submission.id ?? ''),
240+
),
241+
[props.screeningOutcome.passingSubmissionIds],
242+
)
243+
233244
const submissionsForAggregation = useMemo<SubmissionInfo[]>(
234-
() => (restrictToLatest ? latestSubmissions : reviewPhaseDatas),
235-
[latestSubmissions, restrictToLatest, reviewPhaseDatas],
245+
() => (
246+
restrictToLatest
247+
? filterScreeningPassedReviews(latestSubmissions)
248+
: filterScreeningPassedReviews(reviewPhaseDatas)
249+
),
250+
[latestSubmissions, restrictToLatest, reviewPhaseDatas, filterScreeningPassedReviews],
236251
)
237252

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

0 commit comments

Comments
 (0)