Skip to content
Closed
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
1 change: 0 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ workflows:
branches:
only:
- dev
- hide_ba_details

- deployQa:
context: org-global
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/code_reviewer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: AI PR Reviewer

on:
pull_request:
types:
- opened
- synchronize
permissions:
pull-requests: write
jobs:
tc-ai-pr-review:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: TC AI PR Reviewer
uses: topcoder-platform/tc-ai-pr-reviewer@master
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # The GITHUB_TOKEN is there by default so you just need to keep it like it is and not necessarily need to add it as secret as it will throw an error. [More Details](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret)
LAB45_API_KEY: ${{ secrets.LAB45_API_KEY }}
exclude: '**/*.json, **/*.md, **/*.jpg, **/*.png, **/*.jpeg, **/*.bmp, **/*.webp' # Optional: exclude patterns separated by commas
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"@uiw/react-codemirror": "^4.25.8",
"amazon-s3-uri": "^0.1.1",
"apexcharts": "^3.54.1",
"axios": "^1.15.0",
"axios": "^1.13.2",
"browser-cookies": "^1.2.0",
"city-timezones": "^1.3.2",
"classnames": "^2.5.1",
Expand All @@ -66,7 +66,7 @@
"highcharts-react-official": "^3.2.3",
"highlight.js": "^11.11.1",
"html2canvas": "^1.4.1",
"lodash": "^4.18.1",
"lodash": "^4.17.21",
"markdown-it": "^13.0.2",
"marked": "4.3.0",
"moment": "^2.30.1",
Expand Down Expand Up @@ -213,7 +213,7 @@
"sass-loader": "^13.3.3",
"serve": "^14.2.5",
"start-server-and-test": "^2.1.3",
"storybook": "7.6.21",
"storybook": "7.6.20",
"style-loader": "^3.3.4",
"systemjs-webpack-interop": "^2.3.7",
"tsconfig-paths-webpack-plugin": "^4.2.0",
Expand Down
1 change: 0 additions & 1 deletion public/llm-icons/claude-icon.svg

This file was deleted.

2 changes: 1 addition & 1 deletion src/apps/admin/src/AdminHomeRedirect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { reportsRootRoute } from '~/apps/reports'
import { ProfileContextData, useProfileContext } from '~/libs/core'

import { manageChallengeRouteId } from './config/routes.config'
import { isAdministrator } from './lib/utils/access'
import { isAdministrator } from './lib/utils'

/**
* Redirects authenticated admin-app users to the first route they can access.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ import {
checkIsMM,
getSubmissionReprocessTopic,
handleError,
resolveManualUploadSubmissionType,
} from '../../lib/utils'

import styles from './ManageSubmissionPage.module.scss'
Expand Down Expand Up @@ -93,9 +92,7 @@ interface ManualSubmissionUploadModalProps {
selectedHandle?: SelectOption
setSelectedHandle: (value: SelectOption) => void
isUploading: boolean
isLoadingChallenge: boolean
isLoadingSubmitters: boolean
submissionTypeLabel: string
submitterOptions: SelectOption[]
handleFileChange: (event: ChangeEvent<HTMLInputElement>) => void
selectedFile?: File
Expand Down Expand Up @@ -163,7 +160,6 @@ const ManualSubmissionUploadModal: FC<ManualSubmissionUploadModalProps> = (
props: ManualSubmissionUploadModalProps,
) => {
const isHandleSelectDisabled = props.isUploading
|| props.isLoadingChallenge
|| props.isLoadingSubmitters
|| props.submitterOptions.length === 0
const memberHandleHint = !props.isLoadingSubmitters
Expand All @@ -183,16 +179,6 @@ const ManualSubmissionUploadModal: FC<ManualSubmissionUploadModalProps> = (
>
<div className={styles.uploadForm}>
<div className={styles.uploadFormFields}>
<div className={styles.fileInputContainer}>
<span className={styles.inputLabel}>
Submission type
</span>
<span className={styles.selectedFile}>
{props.isLoadingChallenge
? 'Loading challenge phases...'
: props.submissionTypeLabel}
</span>
</div>
<FieldSingleSelect
label='Member Handle'
hint={memberHandleHint}
Expand Down Expand Up @@ -239,7 +225,6 @@ const ManualSubmissionUploadModal: FC<ManualSubmissionUploadModalProps> = (
onClick={props.handleUploadSubmission}
disabled={
props.isUploading
|| props.isLoadingChallenge
|| props.isLoadingSubmitters
|| !props.selectedHandle?.value
|| !props.selectedFile
Expand Down Expand Up @@ -271,18 +256,6 @@ export const ManageSubmissionPage: FC<Props> = (props: Props) => {
challengeInfo,
}: useFetchChallengeProps = useFetchChallenge(challengeId)
const isMM = useMemo(() => checkIsMM(challengeInfo), [challengeInfo])
const manualUploadSubmissionType = useMemo(
() => resolveManualUploadSubmissionType(challengeInfo),
[challengeInfo],
)
const manualUploadSubmissionTypeLabel = useMemo(
() => (
manualUploadSubmissionType === 'CHECKPOINT_SUBMISSION'
? 'Checkpoint Submission'
: 'Submission'
),
[manualUploadSubmissionType],
)
const submissionReprocessTopic = useMemo(
() => getSubmissionReprocessTopic(challengeInfo),
[challengeInfo],
Expand Down Expand Up @@ -356,12 +329,7 @@ export const ManageSubmissionPage: FC<Props> = (props: Props) => {
)

const handleUploadSubmission = useCallback(async () => {
if (
!challengeId
|| !challengeInfo
|| !selectedFile
|| !selectedHandle?.value
) {
if (!challengeId || !selectedFile || !selectedHandle?.value) {
return
}

Expand All @@ -373,7 +341,6 @@ export const ManageSubmissionPage: FC<Props> = (props: Props) => {
fileName: selectedFile.name,
memberHandle: String(selectedHandle.label),
memberId: selectedHandle.value,
type: manualUploadSubmissionType,
})

toast.success('Submission uploaded successfully', {
Expand All @@ -387,15 +354,7 @@ export const ManageSubmissionPage: FC<Props> = (props: Props) => {
} finally {
setIsUploading(false)
}
}, [
challengeId,
challengeInfo,
manualUploadSubmissionType,
refresh,
resetUploadForm,
selectedFile,
selectedHandle,
])
}, [challengeId, selectedFile, selectedHandle, resetUploadForm, refresh])

useEffect(() => {
let isCancelled = false
Expand Down Expand Up @@ -456,7 +415,7 @@ export const ManageSubmissionPage: FC<Props> = (props: Props) => {
<Button
primary
size='lg'
disabled={isUploading || isLoadingChallenge || !challengeInfo}
disabled={isUploading}
onClick={openUploadModal}
>
Upload submission
Expand Down Expand Up @@ -500,9 +459,7 @@ export const ManageSubmissionPage: FC<Props> = (props: Props) => {
selectedHandle={selectedHandle}
setSelectedHandle={setSelectedHandle}
isUploading={isUploading}
isLoadingChallenge={isLoadingChallenge}
isLoadingSubmitters={isLoadingSubmitters}
submissionTypeLabel={manualUploadSubmissionTypeLabel}
submitterOptions={submitterOptions}
handleFileChange={handleFileChange}
selectedFile={selectedFile}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import _ from 'lodash'

import { TabsNavItem } from '~/libs/ui'
import { isAdministrator } from '~/apps/admin/src/lib/utils/access'
import { isAdministrator } from '~/apps/admin/src/lib/utils'
import {
billingAccountRouteId,
defaultReviewersRouteId,
Expand Down
63 changes: 0 additions & 63 deletions src/apps/admin/src/lib/utils/challenge.spec.ts

This file was deleted.

35 changes: 0 additions & 35 deletions src/apps/admin/src/lib/utils/challenge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,6 @@ import _ from 'lodash'
import { SUBMISSION_REPROCESS_TOPICS } from '../../config/busEvent.config'
import { Challenge, MemberSubmission } from '../models'

const CONTEST_SUBMISSION_TYPE = 'CONTEST_SUBMISSION'
const CHECKPOINT_SUBMISSION_TYPE = 'CHECKPOINT_SUBMISSION'
const CHECKPOINT_MANUAL_UPLOAD_PHASES = new Set([
'checkpoint screening',
'checkpoint review',
])

const normalizePhaseName = (value?: string): string => (
value?.trim()
.toLowerCase() ?? ''
)

/**
* Check if the challenge is a marathon match challenge
* @param challenge challenge info
Expand Down Expand Up @@ -55,29 +43,6 @@ export function getSubmissionReprocessTopic(
return undefined
}

/**
* Resolve the submission type used by the admin manual-upload flow.
* Checkpoint uploads are only valid once checkpoint review phases are active,
* so the admin UI switches to checkpoint submission type whenever the
* challenge is currently in Checkpoint Screening or Checkpoint Review.
* @param challenge challenge info
* @returns submission type expected by review-api-v6 manual upload endpoint
*/
export function resolveManualUploadSubmissionType(
challenge?: Challenge,
): string {
const hasOpenCheckpointManualUploadPhase = (challenge?.phases ?? []).some(
phase => phase?.isOpen
&& CHECKPOINT_MANUAL_UPLOAD_PHASES.has(
normalizePhaseName(phase?.name),
),
)

return hasOpenCheckpointManualUploadPhase
? CHECKPOINT_SUBMISSION_TYPE
: CONTEST_SUBMISSION_TYPE
}

/**
* Process each submission rank of MM challenge
* @param submissions the array of submissions
Expand Down
6 changes: 0 additions & 6 deletions src/apps/admin/src/lib/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,3 @@ export * from './number'
export * from './string'
export * from './others'
export * from './access'
export {
administratorOnlyRoles,
adminReportsAccessRoles,
canAccessAdminReports,
isAdministrator,
} from './access'
26 changes: 2 additions & 24 deletions src/apps/copilots/src/services/copilot-opportunities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ export const copilotBaseUrl = `${EnvironmentConfig.API.V6}/projects`

const PAGE_SIZE = 20

type CopilotApplicationApiResponse = Omit<CopilotApplication, 'id' | 'userId'> & {
id: number | string
userId: number | string
}

/**
* Creates a CopilotOpportunity object by merging the provided data and its nested data,
* setting specific properties, and formatting the createdAt date.
Expand All @@ -32,23 +27,6 @@ function copilotOpportunityFactory(data: any): CopilotOpportunity {
}
}

/**
* Normalizes copilot application identifiers that the API may serialize as strings.
*
* The copilot opportunity UI joins applications to member records and the signed-in profile
* using numeric ids, so we coerce the API payload into the shape expected by the UI.
*
* @param data - Raw copilot application returned by the API.
* @returns A copilot application with numeric identifiers.
*/
function copilotApplicationFactory(data: CopilotApplicationApiResponse): CopilotApplication {
return {
...data,
id: Number(data.id),
userId: Number(data.userId),
}
}

export interface CopilotOpportunitiesResponse {
isValidating: boolean;
data: CopilotOpportunity[];
Expand Down Expand Up @@ -166,8 +144,8 @@ export const useCopilotApplications = (opportunityId?: string): CopilotApplicati
? buildUrl(`${copilotBaseUrl}/copilots/opportunity/${opportunityId}/applications`)
: undefined

const fetcher = (urlp: string): Promise<CopilotApplication[]> => xhrGetAsync<CopilotApplicationApiResponse[]>(urlp)
.then(data => data.map(copilotApplicationFactory))
const fetcher = (urlp: string): Promise<CopilotApplication[]> => xhrGetAsync<CopilotApplication[]>(urlp)
.then(data => data)
.catch(() => [])

return useSWR(url, fetcher)
Expand Down
1 change: 1 addition & 0 deletions src/apps/customer-portal/src/config/routes.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ export const rootRoute: string
: `/${AppSubdomain.customer}`

export const talentSearchRouteId = 'talent-search'
export const profileCompletionRouteId = 'profile-completion'
Loading
Loading