Skip to content

Feat/system admin #1108

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 26 commits into from
Jun 18, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
228b71f
Deploy this branch
jmgasper Apr 15, 2025
2d59f23
permission-submit
stevenfrog Apr 27, 2025
11232bd
review and billing account update
stevenfrog Apr 27, 2025
774a8f5
Merge branch 'dev' into permission-update
stevenfrog Apr 27, 2025
580617f
Merge pull request #1053 from stevenfrog/permission-update
jmgasper Apr 27, 2025
af68445
Fix typo
jmgasper Apr 27, 2025
88fe2bf
Topcoder Admin App - Misc Update 0505
suppermancool May 7, 2025
2be1b57
Merge pull request #1070 from topcoder-platform/diazz-admin-f2f-30376773
jmgasper May 8, 2025
59d8bc6
fix unapprove challenge id
stevenfrog May 13, 2025
9510de9
Merge pull request #1073 from stevenfrog/fix-unapprove-challenge-id
jmgasper May 14, 2025
d558ca8
Topcoder Admin App - Misc Update 0518
suppermancool May 22, 2025
a9b4b2b
Topcoder Admin App - Marathon Match Functionality
suppermancool May 25, 2025
f3d3e67
Merge pull request #1085 from topcoder-platform/diazz-admin-f2f-30376861
jmgasper May 27, 2025
366c806
Merge branch 'feat/system-admin' into diazz-admin-code-30376878
suppermancool Jun 1, 2025
21fad4a
Marathon match functionality - final fix
suppermancool Jun 2, 2025
07ac31d
Topcoder Admin App - Misc Update 0601
suppermancool Jun 3, 2025
b261088
Merge pull request #1092 from topcoder-platform/diazz-admin-code-3037…
jmgasper Jun 4, 2025
9204d86
Merge branch 'feat/system-admin' into diazz-admin-f2f-30376988
suppermancool Jun 4, 2025
a82243b
Merge pull request #1093 from topcoder-platform/diazz-admin-f2f-30376988
jmgasper Jun 5, 2025
6f686e3
admin billing accounts: always set payment_terms_id = 1 when send upd…
suppermancool Jun 6, 2025
5ddb252
Merge branch 'dev' into feat/system-admin
suppermancool Jun 6, 2025
538deb9
fix lint after merging
suppermancool Jun 6, 2025
5fd7ac7
Merge pull request #1095 from topcoder-platform/diazz-admin-f2f-30376988
jmgasper Jun 8, 2025
a8a6f0a
Topcoder Admin App - Misc Update 0610
suppermancool Jun 10, 2025
58b5490
fix lint
suppermancool Jun 13, 2025
c367efe
Merge pull request #1105 from topcoder-platform/diazz-admin-f2f-30377050
jmgasper Jun 16, 2025
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
Prev Previous commit
Next Next commit
fix unapprove challenge id
  • Loading branch information
stevenfrog committed May 13, 2025
commit 59d8bc61c66d6acdf46a54dfea713cf492bb612f
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Dispatch, FC, SetStateAction, useMemo, useState } from 'react'
import { Dispatch, FC, SetStateAction, useEffect, useMemo, useState } from 'react'

Choose a reason for hiding this comment

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

The useEffect hook has been added to the import statement, but there is no usage of useEffect in the current code diff. Ensure that useEffect is actually needed in this file, otherwise consider removing it to avoid unused imports.

import { NavigateFunction, useLocation, useNavigate } from 'react-router-dom'

import { TabsNavbar } from '~/libs/ui'
Expand All @@ -24,6 +24,14 @@ const SystemAdminTabs: FC = () => {
navigate(childTabId)
}

// If url is changed by navigator on different tabs, we need set activeTab
useEffect(() => {
const pathTabId = getTabIdFromPathName(pathname)
if (pathTabId !== activeTab) {
setActiveTab(pathTabId)
}
}, [pathname]) // eslint-disable-line react-hooks/exhaustive-deps

Choose a reason for hiding this comment

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

Consider adding activeTab to the dependency array to ensure the effect runs correctly when activeTab changes. This can prevent potential bugs related to stale state values.


return (
<div className={styles.container}>
<TabsNavbar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
} from '../../lib/models'
import {
approveApplication,
getChallengeByLegacyId,

Choose a reason for hiding this comment

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

The function getChallengeByLegacyId is imported but not used in this file. Consider removing it if it's not needed to avoid unnecessary imports.

getChallengeReviewers,
getChallengeReviewOpportunities,
rejectPending,
Expand Down Expand Up @@ -61,6 +62,7 @@ export const ManageReviewerPage: FC = () => {
const { challengeId = '' }: { challengeId?: string } = useParams<{
challengeId: string
}>()
const [challengeUuid, setChallengeUuid] = useState('')
const navigate: NavigateFunction = useNavigate()
const [filterCriteria, setFilterCriteria]: [
ReviewFilterCriteria,
Expand Down Expand Up @@ -136,17 +138,25 @@ export const ManageReviewerPage: FC = () => {
})

const unapprove = useEventCallback((): void => {
// how to get challenge Id?
// Now we use one specific challenge id for testing
const realChallengeId = 'c713e250-ecb4-4192-8717-d607ddda8db4'
navigate(`${rootRoute}/challenge-management/${realChallengeId}/manage-user`)
if (challengeUuid) {
navigate(`${rootRoute}/challenge-management/${challengeUuid}/manage-user`)
}
})

// Init
useEffect(() => {
search()
}, [challengeId]) // eslint-disable-line react-hooks/exhaustive-deps -- missing dependency: search

// Gets the challenge details by legacyId
useEffect(() => {
getChallengeByLegacyId(+challengeId)

Choose a reason for hiding this comment

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

Consider adding error handling for the promise returned by getChallengeByLegacyId. This will help manage any potential errors that might occur during the API call.

.then(challenge => {
setChallengeUuid(challenge.id)

Choose a reason for hiding this comment

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

Ensure that challenge.id is always defined before calling setChallengeUuid. You might want to add a check to handle cases where challenge might be undefined or challenge.id is not present.

})
// eslint-disable-next-line react-hooks/exhaustive-deps -- missing dependency: setChallengeUuid
}, [challengeId, getChallengeByLegacyId])

// Page change
const [pageChangeEvent, setPageChangeEvent] = useState(false)
const previousPageChangeEvent = useRef(false)
Expand Down