Skip to content

Commit 2b428d0

Browse files
committed
PM-1906 - tabs
1 parent be10e19 commit 2b428d0

File tree

10 files changed

+65
-5
lines changed

10 files changed

+65
-5
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ const AiReviewsTable: FC<AiReviewsTableProps> = props => {
144144
<td className={styles.scoreCol}>
145145
{run.status === 'SUCCESS' ? (
146146
run.workflow.scorecard ? (
147-
<a href={`/scorecard/${run.workflow.scorecard.id}`}>{run.score}</a>
147+
<a href={`./ai-scorecard/${props.submission.id}/${run.workflow.id}`}>{run.score}</a>
148148
) : run.score
149149
) : '-'}
150150
</td>

src/apps/review/src/lib/components/Scorecard/ScorecardAttachments/ScorecardAttachments.module.scss

Whitespace-only changes.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { FC } from 'react'
2+
3+
import styles from './ScorecardAttachments.module.scss'
4+
5+
interface ScorecardAttachmentsProps {
6+
}
7+
8+
const ScorecardAttachments: FC<ScorecardAttachmentsProps> = props => {
9+
10+
return (
11+
<div className={styles.wrap}>
12+
attachments
13+
</div>
14+
)
15+
}
16+
17+
export default ScorecardAttachments
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as ScorecardAttachments } from './ScorecardAttachments'

src/apps/review/src/lib/components/Scorecard/ScorecardTabsLayout/ScorecardTabsLayout.module.scss

Whitespace-only changes.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { FC } from 'react'
2+
3+
import styles from './ScorecardTabsLayout.module.scss'
4+
5+
interface ScorecardTabsLayoutProps {
6+
}
7+
8+
const ScorecardTabsLayout: FC<ScorecardTabsLayoutProps> = props => {
9+
10+
return (
11+
<div className={styles.wrap}>
12+
</div>
13+
)
14+
}
15+
16+
export default ScorecardTabsLayout
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as ScorecardTabsLayout } from './ScorecardTabsLayout'
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
export * from './ScorecardViewer'
2+
export * from './ScorecardTabsLayout'

src/apps/review/src/pages/ai-scorecards/AiScorecardViewer/AiScorecardViewer.module.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@
2626
}
2727
}
2828
}
29+
2930
.contentWrap {
3031
width: 100%;
3132
}
33+
34+
.tabs {
35+
justify-content: center;
36+
margin: $sp-6 0;
37+
}

src/apps/review/src/pages/ai-scorecards/AiScorecardViewer/AiScorecardViewer.tsx

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
1-
import { FC, useEffect, useMemo } from 'react'
1+
import { FC, useEffect, useMemo, useState } from 'react'
22

33
import { NotificationContextType, useNotification } from '~/libs/shared'
44

55
import { ScorecardHeader } from '../components/ScorecardHeader'
66
import { IconAiReview } from '../../../lib/assets/icons'
7-
import { PageWrapper } from '../../../lib'
7+
import { PageWrapper, Tabs } from '../../../lib'
88
import { useAiScorecardContext } from '../AiScorecardContext'
9-
import { AiScorecardContextModel } from '../../../lib/models'
9+
import { AiScorecardContextModel, SelectOption } from '../../../lib/models'
1010
import { AiWorkflowsSidebar } from '../components/AiWorkflowsSidebar'
1111
import { ScorecardViewer } from '../../../lib/components/Scorecard'
1212
import { AiWorkflowRunItemsResponse, useFetchAiWorkflowsRunItems } from '../../../lib/hooks'
1313

1414
import styles from './AiScorecardViewer.module.scss'
15+
import { ScorecardAttachments } from '../../../lib/components/Scorecard/ScorecardAttachments'
16+
17+
const tabItems: SelectOption[] = [
18+
{ label: 'Scorecard', value: 'scorecard'},
19+
{ label: 'Attachments', value: 'attachments' },
20+
]
1521

1622
const AiScorecardViewer: FC = () => {
1723
const { showBannerNotification, removeNotification }: NotificationContextType = useNotification()
@@ -23,6 +29,8 @@ const AiScorecardViewer: FC = () => {
2329
[],
2430
)
2531

32+
const [selectedTab, setSelectedTab] = useState('scorecard');
33+
2634
useEffect(() => {
2735
const notification = showBannerNotification({
2836
icon: <IconAiReview />,
@@ -43,13 +51,23 @@ const AiScorecardViewer: FC = () => {
4351
<AiWorkflowsSidebar className={styles.sidebar} />
4452
<div className={styles.contentWrap}>
4553
<ScorecardHeader />
46-
{!!scorecard && (
54+
<Tabs
55+
className={styles.tabs}
56+
items={tabItems}
57+
selected={selectedTab}
58+
onChange={setSelectedTab}
59+
/>
60+
{!!scorecard && selectedTab === 'scorecard' && (
4761
<ScorecardViewer
4862
scorecard={scorecard}
4963
aiFeedback={runItems}
5064
score={workflowRun?.score}
5165
/>
5266
)}
67+
68+
{selectedTab === 'attachments' && (
69+
<ScorecardAttachments />
70+
)}
5371
</div>
5472
</div>
5573
</PageWrapper>

0 commit comments

Comments
 (0)