Skip to content

Commit b019fc0

Browse files
authored
Merge pull request #1335 from topcoder-platform/fix-review-tab
Fix order of ai review in review tab
2 parents 4a7b886 + 8cee8a0 commit b019fc0

5 files changed

Lines changed: 55 additions & 35 deletions

File tree

src/apps/review/src/lib/components/Scorecard/ScorecardViewer/ScorecardQuestion/AiFeedback/AiFeedback.tsx

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { ReviewsContextModel, ScorecardQuestion } from '~/apps/review/src/lib/mo
66
import { createFeedbackComment } from '~/apps/review/src/lib/services'
77
import { useReviewsContext } from '~/apps/review/src/pages/reviews/ReviewsContext'
88
import { EnvironmentConfig } from '~/config'
9+
import { Tooltip } from '~/libs/ui'
910

1011
import { ScorecardViewerContextValue, useScorecardViewerContext } from '../../ScorecardViewer.context'
1112
import { ScorecardQuestionRow } from '../ScorecardQuestionRow'
@@ -61,11 +62,21 @@ const AiFeedback: FC<AiFeedbackProps> = props => {
6162
/>
6263
)}
6364
>
64-
{isYesNo && (
65-
<p>
66-
<strong>{feedback.questionScore ? 'Yes' : 'No'}</strong>
67-
</p>
68-
)}
65+
<p>
66+
<strong>
67+
{isYesNo && (feedback.questionScore ? 'Yes' : 'No')}
68+
{!isYesNo && (
69+
<Tooltip
70+
content={`On a scale of ${props.question.scaleMin} to ${props.question.scaleMax}`}
71+
triggerOn='hover'
72+
>
73+
<span>
74+
{feedback.questionScore}
75+
</span>
76+
</Tooltip>
77+
)}
78+
</strong>
79+
</p>
6980

7081
<MarkdownReview value={feedback.content} />
7182

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

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -621,22 +621,6 @@ export const TableReview: FC<TableReviewProps> = (props: TableReviewProps) => {
621621
}
622622

623623
baseColumns.push(
624-
...(props.aiReviewers ? [{
625-
columnId: 'ai-reviews-table',
626-
isExpand: true,
627-
label: '',
628-
renderer: (submission: SubmissionRow, allRows: SubmissionRow[]) => (
629-
props.aiReviewers && (
630-
<CollapsibleAiReviewsRow
631-
className={styles.aiReviews}
632-
aiReviewers={props.aiReviewers}
633-
submission={submission as any}
634-
defaultOpen={allRows ? !allRows.indexOf(submission) : false}
635-
/>
636-
)
637-
),
638-
type: 'element',
639-
}] : []) as TableColumn<SubmissionRow>[],
640624
{
641625
columnId: 'review-date',
642626
label: 'Review Date',
@@ -688,6 +672,25 @@ export const TableReview: FC<TableReviewProps> = (props: TableReviewProps) => {
688672
})
689673
}
690674

675+
if (props.aiReviewers) {
676+
baseColumns.push({
677+
columnId: 'ai-reviews-table',
678+
isExpand: true,
679+
label: '',
680+
renderer: (submission: SubmissionRow, allRows: SubmissionRow[]) => (
681+
props.aiReviewers && (
682+
<CollapsibleAiReviewsRow
683+
className={styles.aiReviews}
684+
aiReviewers={props.aiReviewers}
685+
submission={submission as any}
686+
defaultOpen={allRows ? !allRows.indexOf(submission) : false}
687+
/>
688+
)
689+
),
690+
type: 'element',
691+
})
692+
}
693+
691694
return baseColumns
692695
}, [
693696
downloadButtonConfig,

src/apps/review/src/lib/components/common/TableColumnRenderers.module.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,6 @@
9191
font-weight: 700;
9292
}
9393

94-
.appealsLink {
95-
padding: 0 $sp-1;
96-
}
97-
9894
.tableCellNoWrap {
9995
white-space: nowrap;
10096
text-align: left !important;

src/apps/review/src/pages/reviews/components/ReviewsSidebar/ReviewsSidebar.tsx

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import classNames from 'classnames'
55
import { ReviewsContextModel } from '~/apps/review/src/lib/models'
66
import { AiWorkflowRunStatus } from '~/apps/review/src/lib/components/AiReviewsTable'
77
import { IconAiReview, IconPhaseReview } from '~/apps/review/src/lib/assets/icons'
8-
import { IconOutline, IconSolid } from '~/libs/ui'
8+
import { IconOutline, IconSolid, Tooltip } from '~/libs/ui'
99
import StatusLabel from '~/apps/review/src/lib/components/AiReviewsTable/StatusLabel'
1010

1111
import { useReviewsContext } from '../../ReviewsContext'
@@ -37,6 +37,10 @@ const ReviewsSidebar: FC<ReviewsSidebarProps> = props => {
3737
setIsMobileOpen(false)
3838
}, [])
3939

40+
const runUrl = useCallback((runWorkflowId: string) => (
41+
`../reviews/${submissionId}?workflowId=${runWorkflowId}&reviewId=${reviewId}`
42+
), [reviewId, submissionId])
43+
4044
return (
4145
<div className={classNames(props.className, styles.wrap)}>
4246
{((workflow && workflowRun) || reviewId) && (
@@ -82,14 +86,20 @@ const ReviewsSidebar: FC<ReviewsSidebarProps> = props => {
8286
}
8387
key={run.id}
8488
>
85-
<Link
86-
to={`../reviews/${submissionId}?workflowId=${run.workflow.id}&reviewId=${reviewId}`}
87-
onClick={close}
88-
/>
89-
<span className={styles.workflowNameWrap}>
90-
<IconAiReview />
91-
<span className={styles.workflowName}>{run.workflow.name}</span>
92-
</span>
89+
<Tooltip
90+
content={run.workflow.name}
91+
triggerOn='hover'
92+
disableWrap
93+
>
94+
<Link
95+
to={runUrl(run.workflow.id)}
96+
onClick={close}
97+
/>
98+
<span className={styles.workflowNameWrap}>
99+
<IconAiReview />
100+
<span className={styles.workflowName}>{run.workflow.name}</span>
101+
</span>
102+
</Tooltip>
93103
<AiWorkflowRunStatus run={run} showScore hideLabel />
94104
</li>
95105
))}

src/libs/shared/lib/components/notifications/NotificationsContainer.module.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
.wrap {
44
position: relative;
55
width: 100%;
6-
z-index: 20;
6+
z-index: 1;
77
}

0 commit comments

Comments
 (0)