Skip to content

Commit 257557b

Browse files
authored
Merge pull request #1336 from topcoder-platform/PM-2921_fix-screener-multiple-submissions
PM-2921 - fix screener multiple submissions showing up
2 parents b019fc0 + 925d190 commit 257557b

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ export const SubmissionHistoryModal: FC<SubmissionHistoryModalProps> = (props: S
100100
[props.submissions],
101101
)
102102

103-
const aiReviewersCount = useMemo(() => (props.aiReviewers?.length ?? 0) + 1, [props.aiReviewers])
103+
const aiReviewers = useMemo(() => props.aiReviewers ?? [], [props.aiReviewers])
104+
const aiReviewersCount = useMemo(() => (aiReviewers.length ?? 0) + 1, [aiReviewers])
104105

105106
const [toggledRows, setToggledRows] = useState(new Set<string>())
106107

@@ -279,7 +280,7 @@ export const SubmissionHistoryModal: FC<SubmissionHistoryModalProps> = (props: S
279280
<td className={styles.aiReviewersTableRow} colSpan={4}>
280281
<div className={styles.aiReviewersTable}>
281282
<AiReviewsTable
282-
reviewers={props.aiReviewers!}
283+
reviewers={aiReviewers}
283284
submission={submission}
284285
/>
285286
</div>

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -802,13 +802,18 @@ export const TableSubmissionScreening: FC<Props> = (props: Props) => {
802802
[historySourceSubmissions, primarySubmissionInfos],
803803
)
804804

805-
const { historyByMember }: SubmissionHistoryPartition = submissionHistory
805+
const { historyByMember, latestSubmissionIds }: SubmissionHistoryPartition = submissionHistory
806806

807807
const shouldShowHistoryActions = useMemo(
808808
() => hasIsLatestFlag(primarySubmissionInfos),
809809
[primarySubmissionInfos],
810810
)
811811

812+
const filteredScreenings = useMemo(() => (
813+
props.screenings
814+
.filter(screening => latestSubmissionIds.has(screening.submissionId))
815+
), [props.screenings, latestSubmissionIds])
816+
812817
const hasAnyScreeningAssignment = useMemo(
813818
() => props.screenings.some(screening => Boolean(screening.myReviewResourceId)),
814819
[props.screenings],
@@ -1172,7 +1177,7 @@ export const TableSubmissionScreening: FC<Props> = (props: Props) => {
11721177
) : (
11731178
<Table
11741179
columns={columns}
1175-
data={props.screenings}
1180+
data={filteredScreenings}
11761181
disableSorting
11771182
onToggleSort={_.noop}
11781183
removeDefaultSort

0 commit comments

Comments
 (0)