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 all commits
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
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ workflows:
- dev
- LVT-256
- CORE-635
- feat/system-admin

- deployQa:
context: org-global
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
"tc-auth-lib": "topcoder-platform/tc-auth-lib#1.0.27",
"typescript": "^4.8.4",
"universal-navigation": "https://github.com/topcoder-platform/universal-navigation#9fc50d938be7182",
"uuid": "^9.0.0",
"uuid": "^11.1.0",
"yup": "^1.6.1"
},
"devDependencies": {
Expand Down
19 changes: 5 additions & 14 deletions src/apps/admin/src/admin-app.routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,9 @@ const ManageUserPage: LazyLoadedComponent = lazyLoad(
() => import('./challenge-management/ManageUserPage'),
'ManageUserPage',
)
const ManageResourcePage: LazyLoadedComponent = lazyLoad(
() => import('./challenge-management/ManageResourcePage'),
'ManageResourcePage',
)
const AddResourcePage: LazyLoadedComponent = lazyLoad(
() => import('./challenge-management/AddResourcePage'),
'AddResourcePage',
const ManageSubmissionPage: LazyLoadedComponent = lazyLoad(
() => import('./challenge-management/ManageSubmissionPage'),
'ManageSubmissionPage',
)
const UserManagementPage: LazyLoadedComponent = lazyLoad(
() => import('./user-management/UserManagementPage'),
Expand Down Expand Up @@ -136,14 +132,9 @@ export const adminRoutes: ReadonlyArray<PlatformRoute> = [
route: ':challengeId/manage-user',
},
{
element: <ManageResourcePage />,
element: <ManageSubmissionPage />,

Choose a reason for hiding this comment

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

The id for this route is still 'manage-resource', but the element has been changed to ManageSubmissionPage. Consider updating the id to reflect the new functionality, such as 'manage-submission'.

id: 'manage-resource',
route: ':challengeId/manage-resource',
},
{
element: <AddResourcePage />,
id: 'add-resource',
route: ':challengeId/manage-resource/add',
route: ':challengeId/manage-submission',

Choose a reason for hiding this comment

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

The route for this entry has been updated to ':challengeId/manage-submission', but the id is still 'manage-resource'. Ensure that the id accurately describes the route's purpose, possibly changing it to 'manage-submission'.

},
],
element: <ChallengeManagement />,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import _ from 'lodash'
import classNames from 'classnames'
import moment from 'moment'

import { EnvironmentConfig } from '~/config'

Choose a reason for hiding this comment

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

The import statement for EnvironmentConfig is added, but it is not used in the current code. Consider removing it if it's not needed to avoid unnecessary imports.

import {
Button,
InputDatePicker,
Expand All @@ -30,7 +31,7 @@ import { useManageAddBillingAccount, useManageAddBillingAccountProps } from '../
import { BILLING_ACCOUNT_STATUS_EDIT_OPTIONS } from '../../config/index.config'
import { PageContent, PageHeader } from '../../lib'
import { FormEditBillingAccount, SelectOption } from '../../lib/models'
import { formEditBillingAccountSchema } from '../../lib/utils'
import { formAddBillingAccountSchema, formEditBillingAccountSchema } from '../../lib/utils'

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

Expand All @@ -46,6 +47,7 @@ export const BillingAccountNewPage: FC<Props> = (props: Props) => {
const { accountId = '' }: { accountId?: string } = useParams<{
accountId: string
}>()
const isEdit = useMemo(() => !!accountId, [accountId])
const {
isLoading,
isAdding,
Expand All @@ -55,8 +57,8 @@ export const BillingAccountNewPage: FC<Props> = (props: Props) => {
billingAccount,
}: useManageAddBillingAccountProps = useManageAddBillingAccount(accountId)
const pageTitle = useMemo(
() => (accountId ? 'Edit Billing Account' : 'New Billing Account'),
[accountId],
() => (isEdit ? 'Edit Billing Account' : 'New Billing Account'),

Choose a reason for hiding this comment

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

The variable isEdit is used here, but it is not clear from the diff if it is defined or how it is being set. Ensure that isEdit is properly defined and initialized in the component to avoid potential runtime errors.

[isEdit],
)
const {
register,
Expand All @@ -81,7 +83,9 @@ export const BillingAccountNewPage: FC<Props> = (props: Props) => {
subscriptionNumber: '' as any,
},
mode: 'all',
resolver: yupResolver(formEditBillingAccountSchema),
resolver: yupResolver(
isEdit ? formEditBillingAccountSchema : formAddBillingAccountSchema,

Choose a reason for hiding this comment

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

The use of isEdit to determine the schema could be clarified by ensuring isEdit is well-defined and initialized before this point in the code. Verify that isEdit is correctly set based on the intended logic to avoid potential runtime errors.

),
})

const endDate = watch('endDate')
Expand Down Expand Up @@ -130,7 +134,7 @@ export const BillingAccountNewPage: FC<Props> = (props: Props) => {
name: billingAccount.name,
paymentTerms: billingAccount.paymentTerms
? parseInt(billingAccount.paymentTerms, 10) ?? 0
: undefined,
: EnvironmentConfig.ADMIN.DEFAULT_PAYMENT_TERMS,

Choose a reason for hiding this comment

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

Consider checking if EnvironmentConfig.ADMIN.DEFAULT_PAYMENT_TERMS is defined and valid before using it as a fallback value. This will prevent potential issues if the configuration is missing or incorrect.

poNumber: billingAccount.poNumber,
salesTax: billingAccount.salesTax,
startDate: billingAccount.startDate,
Expand Down Expand Up @@ -354,7 +358,9 @@ export const BillingAccountNewPage: FC<Props> = (props: Props) => {
onChange={_.noop}
classNameWrapper={styles.field}
inputControl={register('paymentTerms')}
disabled={isAdding || isUpdating}
disabled={
isEdit ? true : isAdding || isUpdating

Choose a reason for hiding this comment

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

Consider simplifying the conditional expression. The current expression isEdit ? true : isAdding || isUpdating can be simplified to isEdit || isAdding || isUpdating for better readability and maintainability.

}
error={_.get(errors, 'paymentTerms.message')}
dirty
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/**
* Billing accounts page.
*/
import { FC } from 'react'
import { FC, useState } from 'react'
import classNames from 'classnames'

import { PlusIcon } from '@heroicons/react/solid'
import { LinkButton, LoadingSpinner, PageDivider, PageTitle } from '~/libs/ui'
import { colWidthType, LinkButton, LoadingSpinner, PageDivider, PageTitle } from '~/libs/ui'

Choose a reason for hiding this comment

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

The import colWidthType is added but not used in the code. Consider removing it if it's unnecessary to avoid unused imports.


import { BillingAccountsFilter } from '../../lib/components/BillingAccountsFilter'
import { BillingAccountsTable } from '../../lib/components/BillingAccountsTable'
Expand All @@ -22,6 +22,7 @@ interface Props {
const pageTitle = 'Billing Accounts'

export const BillingAccountsPage: FC<Props> = (props: Props) => {
const [colWidth, setColWidth] = useState<colWidthType>({})

Choose a reason for hiding this comment

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

The type colWidthType used in useState<colWidthType>({}) is not defined in the provided code snippet. Ensure that colWidthType is properly defined and imported if necessary.

const {
isLoading,
datas,
Expand Down Expand Up @@ -76,6 +77,8 @@ export const BillingAccountsPage: FC<Props> = (props: Props) => {
setPage={setPage}
setSort={setSort}
sort={sort}
colWidth={colWidth}
setColWidth={setColWidth}
/>
)}
</>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/**
* Billing account clients page.
*/
import { FC } from 'react'
import { FC, useState } from 'react'

Choose a reason for hiding this comment

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

The useState import is added but not used in the current code. Consider removing it if it's not needed.

import classNames from 'classnames'

import { LinkButton, LoadingSpinner, PageDivider, PageTitle } from '~/libs/ui'
import { colWidthType, LinkButton, LoadingSpinner, PageDivider, PageTitle } from '~/libs/ui'

Choose a reason for hiding this comment

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

The colWidthType import is added but not used in the current code. Consider removing it if it's not needed.

import { PlusIcon } from '@heroicons/react/solid'

import { MSG_NO_RECORD_FOUND } from '../../config/index.config'
Expand All @@ -22,6 +22,7 @@ interface Props {
const pageTitle = 'Clients'

export const ClientsPage: FC<Props> = (props: Props) => {
const [colWidth, setColWidth] = useState<colWidthType>({})

Choose a reason for hiding this comment

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

The colWidthType type is used here, but it is not defined in the provided code. Ensure that colWidthType is imported or defined within this file or elsewhere in the project.

const {
isLoading,
datas,
Expand Down Expand Up @@ -77,6 +78,8 @@ export const ClientsPage: FC<Props> = (props: Props) => {
setPage={setPage}
setSort={setSort}
sort={sort}
colWidth={colWidth}
setColWidth={setColWidth}
/>
)}
</>
Expand Down

This file was deleted.

Loading