Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/apps/review/src/lib/assets/icons/icon-ai-review.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/apps/review/src/lib/assets/icons/icon-phase-appeal.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/apps/review/src/lib/assets/icons/icon-phase-review.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions src/apps/review/src/lib/assets/icons/icon-phase-submission.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/apps/review/src/lib/assets/icons/icon-phase-winners.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 28 additions & 1 deletion src/apps/review/src/lib/assets/icons/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ import { ReactComponent as IconArrowLeft } from './arrow-left.svg'
import { ReactComponent as IconExternalLink } from './external-link.svg'
import { ReactComponent as IconChevronDown } from './selector.svg'
import { ReactComponent as IconError } from './icon-error.svg'
import { ReactComponent as IconAiReview } from './icon-ai-review.svg'
import { ReactComponent as IconSubmission } from './icon-phase-submission.svg'
import { ReactComponent as IconRegistration } from './icon-phase-registration.svg'
import { ReactComponent as IconReview } from './icon-phase-review.svg'
import { ReactComponent as IconAppeal } from './icon-phase-appeal.svg'
import { ReactComponent as IconAppealResponse } from './icon-phase-appeal-response.svg'
import { ReactComponent as IconPhaseWinners } from './icon-phase-winners.svg'

export * from './editor/bold'
export * from './editor/code'
Expand All @@ -19,4 +26,24 @@ export * from './editor/table'
export * from './editor/unordered-list'
export * from './editor/upload-file'

export { IconArrowLeft, IconExternalLink, IconChevronDown, IconError }
export {
IconArrowLeft,
IconExternalLink,
IconChevronDown,
IconError,
IconAiReview,
IconSubmission,
IconReview,
IconAppeal,
IconAppealResponse,
IconPhaseWinners,
}

export const phasesIcons = {
appeal: IconAppeal,
appealResponse: IconAppealResponse,
'iterative review': IconReview,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ maintainability]
The key 'iterative review' and 'review' both map to IconReview. If these represent distinct phases, consider using different icons or clarifying the distinction to avoid confusion.

registration: IconRegistration,
review: IconReview,
submission: IconSubmission,
}
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,7 @@
background-color: $red-25;
color: $red-140;
}

.mr2 {
margin-right: $sp-2;
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
} from '../../models'
import { TableWrapper } from '../TableWrapper'
import { ProgressBar } from '../ProgressBar'
import { IconAiReview, phasesIcons } from '../../assets/icons'

import styles from './TableActiveReviews.module.scss'

Expand Down Expand Up @@ -253,11 +254,20 @@ export const TableActiveReviews: FC<Props> = (props: Props) => {
isSortable: true,
label: 'Phase',
propertyName: 'currentPhase',
renderer: (data: ActiveReviewAssignment) => (
<div className={styles.phase}>
{data.currentPhase}
</div>
),
renderer: (data: ActiveReviewAssignment) => {
const Icon = data.hasAIReview ? IconAiReview : (

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
The property hasAIReview is used here, but the previous code used hasAsAIReview. Ensure that this change is intentional and that the property hasAIReview exists and is correctly populated in the ActiveReviewAssignment data model.

phasesIcons[data.currentPhase.toLowerCase() as keyof typeof phasesIcons]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ maintainability]
The lookup in phasesIcons using data.currentPhase.toLowerCase() could fail silently if the key does not exist. Consider handling the case where the icon is not found to improve robustness.

)

return (
<div className={styles.phase}>
{Icon && (
<Icon className={styles.mr2} />
)}
{data.currentPhase}
</div>
)
},
type: 'element',
},
{
Expand Down
1 change: 1 addition & 0 deletions src/apps/review/src/lib/hooks/useFetchActiveReviews.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ export const transformAssignments = (
.local()
.format(TABLE_DATE_FORMAT)
: undefined,
hasAIReview: base.hasAIReview,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
The property name change from hasAsAIReview to hasAIReview should be verified across the codebase to ensure consistency and avoid potential runtime errors due to mismatched property names.

id: base.challengeId,
index: currentIndex,
name: base.challengeName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export interface ActiveReviewAssignment {
currentPhaseEndDateString?: string
challengeEndDate?: string | Date | null
challengeEndDateString?: string
hasAIReview: boolean;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
The variable name change from hasAsAIReview to hasAIReview appears to be a correction. Ensure that all references to this property in the codebase are updated accordingly to prevent runtime errors.

timeLeft?: string
timeLeftColor?: string
timeLeftStatus?: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export interface BackendMyReviewAssignment {
challengeEndDate: string | null
currentPhaseName: string
currentPhaseEndDate: string | null
hasAIReview: boolean;
timeLeftInCurrentPhase: number | null
resourceRoleName: string
reviewProgress: number | null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import classNames from 'classnames'
import { Pagination, TableLoading } from '~/apps/admin/src/lib'
import { Sort } from '~/apps/admin/src/platform/gamification-admin/src/game-lib'
import { Button, IconOutline, InputText } from '~/libs/ui'
import { NotificationContextType, useNotification } from '~/libs/shared'

import { CHALLENGE_TYPE_SELECT_ALL_OPTION } from '../../../config/index.config'
import {
Expand All @@ -37,6 +38,7 @@ import {
import { ReviewAppContextModel } from '../../../lib/models'
import { SelectOption } from '../../../lib/models/SelectOption.model'
import { getAllowedTypeAbbreviationsByTrack } from '../../../lib/utils/challengeTypesByTrack'
import { IconAiReview } from '../../../lib/assets/icons'

import styles from './ActiveReviewsPage.module.scss'

Expand All @@ -50,6 +52,8 @@ const DEFAULT_SORT: Sort = {
}

export const ActiveReviewsPage: FC<Props> = (props: Props) => {
const { showBannerNotification, removeNotification }: NotificationContextType = useNotification()

const {
loginUserInfo,
}: ReviewAppContextModel = useContext(ReviewAppContext)
Expand Down Expand Up @@ -193,6 +197,16 @@ export const ActiveReviewsPage: FC<Props> = (props: Props) => {
})
}, [loadActiveReviews, sort])

useEffect(() => {
const notification = showBannerNotification({
icon: <IconAiReview />,
id: 'ai-review-icon-notification',
message: `Challenges with this icon indicate that
one or more AI reviews will be conducted for each member submission.`,
})
return () => notification && removeNotification(notification.id)
}, [showBannerNotification, removeNotification])

return (
<PageWrapper
pageTitle='My Active Challenges'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,7 @@
.icon {
flex: 0 0;
margin-right: $sp-2;
> svg path {
fill: $tc-white;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ const NotificationBanner: FC<NotificationBannerProps> = props => {
return (
<div className={styles.wrap}>
<div className={styles.inner}>
{props.icon || (
<div className={styles.icon}>
<div className={styles.icon}>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ performance]
The change from conditionally rendering the icon div to always rendering it could lead to unnecessary DOM elements when props.icon is not provided. Consider reverting to the previous conditional rendering approach to avoid rendering an empty div.

{props.icon || (
<InformationCircleIcon className='icon-xl' />
</div>
)}
)}
</div>

{props.content}

Expand Down