Skip to content

Commit 5d94f8f

Browse files
committed
Fixes for appeals response, submission ID showing, tab layouts
1 parent 14fbe40 commit 5d94f8f

File tree

6 files changed

+87
-10
lines changed

6 files changed

+87
-10
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ export const AppealComment: FC<Props> = (props: Props) => {
174174
onSubmit={handleSubmit(onSubmit)}
175175
>
176176
<div className={styles.blockReaponseAppealHeader}>
177-
<label>Respond Appeal</label>
177+
<label>Respond to Appeal</label>
178178

179179
<Select
180180
className={classNames('react-select-container')}
@@ -223,7 +223,7 @@ export const AppealComment: FC<Props> = (props: Props) => {
223223
type='submit'
224224
disabled={isSavingAppealResponse}
225225
>
226-
Submit Appeal
226+
Submit Response
227227
</button>
228228
<button
229229
type='button'

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,13 @@ export const SubmissionBarInfo: FC<Props> = (props: Props) => {
3434
[resourceMemberIdMapping, props.submission],
3535
)
3636
const { myChallengeRoles }: useRoleProps = useRole()
37+
const submissionIdValue = props.submission?.id ?? submissionId
3738
const uiItems = useMemo(() => [
3839
{
3940
icon: 'icon-file',
4041
title: 'Submission ID',
4142
type: 'link',
42-
value: submissionId,
43+
value: submissionIdValue,
4344
},
4445
{
4546
icon: 'icon-handle',
@@ -62,7 +63,7 @@ export const SubmissionBarInfo: FC<Props> = (props: Props) => {
6263
type: 'link',
6364
value: useInfo?.memberHandle ?? '',
6465
},
65-
], [myChallengeRoles, submissionId, useInfo])
66+
], [myChallengeRoles, submissionIdValue, useInfo])
6667

6768
return (
6869
<div className={classNames(styles.container, props.className)}>

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

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ export const TableCheckpointSubmissions: FC<Props> = (props: Props) => {
309309
}
310310

311311
// mode === 'review'
312-
return [
312+
const reviewColumns: TableColumn<Screening>[] = [
313313
...baseColumns,
314314
{
315315
label: 'Review Score',
@@ -366,6 +366,54 @@ export const TableCheckpointSubmissions: FC<Props> = (props: Props) => {
366366
type: 'element',
367367
},
368368
]
369+
370+
const hasAnyMyAssignment = (props.datas || []).some(d => !!d.myReviewResourceId)
371+
if (!hasAnyMyAssignment) {
372+
return reviewColumns
373+
}
374+
375+
const actionColumn: TableColumn<Screening> = {
376+
label: 'Action',
377+
propertyName: 'action',
378+
renderer: (data: Screening) => {
379+
const status = (data.myReviewStatus || '').toUpperCase()
380+
if (['COMPLETED', 'SUBMITTED'].includes(status)) {
381+
return (
382+
<div
383+
aria-label='Review completed'
384+
className={styles.completedAction}
385+
title='Review completed'
386+
>
387+
<span className={styles.completedIcon} aria-hidden='true'>
388+
<IconOutline.CheckIcon />
389+
</span>
390+
<span className={styles.completedPill}>Review Complete</span>
391+
</div>
392+
)
393+
}
394+
395+
const reviewId = data.myReviewId
396+
if (!reviewId) {
397+
return undefined
398+
}
399+
400+
return (
401+
<Link
402+
to={`./../review/${reviewId}`}
403+
className={classNames(styles.submit, 'last-element')}
404+
>
405+
<i className='icon-upload' />
406+
Complete Review
407+
</Link>
408+
)
409+
},
410+
type: 'element',
411+
}
412+
413+
return [
414+
...reviewColumns,
415+
actionColumn,
416+
]
369417
},
370418
[
371419
props,

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

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -774,10 +774,6 @@ export const TableReviewAppeals: FC<Props> = (props: Props) => {
774774
const finishedAppeals = reviewDetail?.finishedAppeals ?? 0
775775
const unresolvedAppeals = reviewDetail?.unresolvedAppeals
776776
?? Math.max(totalAppeals - finishedAppeals, 0)
777-
const primaryAppealsCount = tab === 'Appeals Response'
778-
? finishedAppeals
779-
: unresolvedAppeals
780-
781777
if (!totalAppeals && (reviewInfo.status ?? '').toUpperCase() !== 'COMPLETED') {
782778
return (
783779
<span className={styles.notReviewed}>
@@ -786,6 +782,19 @@ export const TableReviewAppeals: FC<Props> = (props: Props) => {
786782
)
787783
}
788784

785+
if (tab === 'Appeals Response') {
786+
return (
787+
<Link
788+
to={`./../review/${reviewInfo.id}`}
789+
className={styles.appealsLink}
790+
>
791+
<span className={styles.textBlue}>{totalAppeals}</span>
792+
</Link>
793+
)
794+
}
795+
796+
const primaryAppealsCount = unresolvedAppeals
797+
789798
return (
790799
<Link
791800
to={`./../review/${reviewInfo.id}`}
@@ -1328,6 +1337,19 @@ export const TableReviewAppeals: FC<Props> = (props: Props) => {
13281337
return undefined
13291338
}
13301339

1340+
if (tab === 'Appeals Response') {
1341+
return (
1342+
<Link
1343+
to={`./../review/${reviewId}`}
1344+
className={styles.appealsLink}
1345+
>
1346+
<span className={styles.textBlue}>
1347+
{appealInfo.totalAppeals}
1348+
</span>
1349+
</Link>
1350+
)
1351+
}
1352+
13311353
return (
13321354
<>
13331355
[

src/apps/review/src/lib/services/reviews.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ export const updateAppealResponse = async (
505505
appealResponseId: string,
506506
data: BackendRequestAppealResponse,
507507
): Promise<BackendAppealResponse> => {
508-
const result = await xhrPostAsync<
508+
const result = await xhrPatchAsync<
509509
BackendRequestAppealResponse,
510510
BackendAppealResponse
511511
>(`${EnvironmentConfig.API.V6}/appeals/response/${appealResponseId}`, data)

src/apps/review/src/pages/active-review-assignements/ChallengeDetailsPage/ChallengeDetailsPage.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -958,6 +958,9 @@ export const ChallengeDetailsPage: FC<Props> = (props: Props) => {
958958
myResources,
959959
mappingReviewAppeal,
960960
phaseOrderingOptions,
961+
screening,
962+
checkpoint,
963+
checkpointReview,
961964
])
962965

963966
// Add completion indicators for active challenges on relevant tabs
@@ -1074,6 +1077,9 @@ export const ChallengeDetailsPage: FC<Props> = (props: Props) => {
10741077
mappingReviewAppeal,
10751078
challengeInfo,
10761079
approvalReviews,
1080+
screening,
1081+
checkpoint,
1082+
checkpointReview,
10771083
])
10781084

10791085
// Determine if current user should see the Resources section

0 commit comments

Comments
 (0)