Skip to content

Commit 715478c

Browse files
authored
Merge pull request #1108 from topcoder-platform/feat/system-admin
Feat/system admin
2 parents 2bf40eb + c367efe commit 715478c

File tree

121 files changed

+2196
-1239
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+2196
-1239
lines changed

.circleci/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ workflows:
221221
- dev
222222
- LVT-256
223223
- CORE-635
224+
- feat/system-admin
224225

225226
- deployQa:
226227
context: org-global

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
"tc-auth-lib": "topcoder-platform/tc-auth-lib#1.0.27",
104104
"typescript": "^4.8.4",
105105
"universal-navigation": "https://github.com/topcoder-platform/universal-navigation#9fc50d938be7182",
106-
"uuid": "^9.0.0",
106+
"uuid": "^11.1.0",
107107
"yup": "^1.6.1"
108108
},
109109
"devDependencies": {

src/apps/admin/src/admin-app.routes.tsx

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,9 @@ const ManageUserPage: LazyLoadedComponent = lazyLoad(
2929
() => import('./challenge-management/ManageUserPage'),
3030
'ManageUserPage',
3131
)
32-
const ManageResourcePage: LazyLoadedComponent = lazyLoad(
33-
() => import('./challenge-management/ManageResourcePage'),
34-
'ManageResourcePage',
35-
)
36-
const AddResourcePage: LazyLoadedComponent = lazyLoad(
37-
() => import('./challenge-management/AddResourcePage'),
38-
'AddResourcePage',
32+
const ManageSubmissionPage: LazyLoadedComponent = lazyLoad(
33+
() => import('./challenge-management/ManageSubmissionPage'),
34+
'ManageSubmissionPage',
3935
)
4036
const UserManagementPage: LazyLoadedComponent = lazyLoad(
4137
() => import('./user-management/UserManagementPage'),
@@ -136,14 +132,9 @@ export const adminRoutes: ReadonlyArray<PlatformRoute> = [
136132
route: ':challengeId/manage-user',
137133
},
138134
{
139-
element: <ManageResourcePage />,
135+
element: <ManageSubmissionPage />,
140136
id: 'manage-resource',
141-
route: ':challengeId/manage-resource',
142-
},
143-
{
144-
element: <AddResourcePage />,
145-
id: 'add-resource',
146-
route: ':challengeId/manage-resource/add',
137+
route: ':challengeId/manage-submission',
147138
},
148139
],
149140
element: <ChallengeManagement />,

src/apps/admin/src/billing-account/BillingAccountNewPage/BillingAccountNewPage.tsx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import _ from 'lodash'
1414
import classNames from 'classnames'
1515
import moment from 'moment'
1616

17+
import { EnvironmentConfig } from '~/config'
1718
import {
1819
Button,
1920
InputDatePicker,
@@ -30,7 +31,7 @@ import { useManageAddBillingAccount, useManageAddBillingAccountProps } from '../
3031
import { BILLING_ACCOUNT_STATUS_EDIT_OPTIONS } from '../../config/index.config'
3132
import { PageContent, PageHeader } from '../../lib'
3233
import { FormEditBillingAccount, SelectOption } from '../../lib/models'
33-
import { formEditBillingAccountSchema } from '../../lib/utils'
34+
import { formAddBillingAccountSchema, formEditBillingAccountSchema } from '../../lib/utils'
3435

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

@@ -46,6 +47,7 @@ export const BillingAccountNewPage: FC<Props> = (props: Props) => {
4647
const { accountId = '' }: { accountId?: string } = useParams<{
4748
accountId: string
4849
}>()
50+
const isEdit = useMemo(() => !!accountId, [accountId])
4951
const {
5052
isLoading,
5153
isAdding,
@@ -55,8 +57,8 @@ export const BillingAccountNewPage: FC<Props> = (props: Props) => {
5557
billingAccount,
5658
}: useManageAddBillingAccountProps = useManageAddBillingAccount(accountId)
5759
const pageTitle = useMemo(
58-
() => (accountId ? 'Edit Billing Account' : 'New Billing Account'),
59-
[accountId],
60+
() => (isEdit ? 'Edit Billing Account' : 'New Billing Account'),
61+
[isEdit],
6062
)
6163
const {
6264
register,
@@ -81,7 +83,9 @@ export const BillingAccountNewPage: FC<Props> = (props: Props) => {
8183
subscriptionNumber: '' as any,
8284
},
8385
mode: 'all',
84-
resolver: yupResolver(formEditBillingAccountSchema),
86+
resolver: yupResolver(
87+
isEdit ? formEditBillingAccountSchema : formAddBillingAccountSchema,
88+
),
8589
})
8690

8791
const endDate = watch('endDate')
@@ -130,7 +134,7 @@ export const BillingAccountNewPage: FC<Props> = (props: Props) => {
130134
name: billingAccount.name,
131135
paymentTerms: billingAccount.paymentTerms
132136
? parseInt(billingAccount.paymentTerms, 10) ?? 0
133-
: undefined,
137+
: EnvironmentConfig.ADMIN.DEFAULT_PAYMENT_TERMS,
134138
poNumber: billingAccount.poNumber,
135139
salesTax: billingAccount.salesTax,
136140
startDate: billingAccount.startDate,
@@ -354,7 +358,9 @@ export const BillingAccountNewPage: FC<Props> = (props: Props) => {
354358
onChange={_.noop}
355359
classNameWrapper={styles.field}
356360
inputControl={register('paymentTerms')}
357-
disabled={isAdding || isUpdating}
361+
disabled={
362+
isEdit ? true : isAdding || isUpdating
363+
}
358364
error={_.get(errors, 'paymentTerms.message')}
359365
dirty
360366
/>

src/apps/admin/src/billing-account/BillingAccountsPage/BillingAccountsPage.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/**
22
* Billing accounts page.
33
*/
4-
import { FC } from 'react'
4+
import { FC, useState } from 'react'
55
import classNames from 'classnames'
66

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

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

2424
export const BillingAccountsPage: FC<Props> = (props: Props) => {
25+
const [colWidth, setColWidth] = useState<colWidthType>({})
2526
const {
2627
isLoading,
2728
datas,
@@ -76,6 +77,8 @@ export const BillingAccountsPage: FC<Props> = (props: Props) => {
7677
setPage={setPage}
7778
setSort={setSort}
7879
sort={sort}
80+
colWidth={colWidth}
81+
setColWidth={setColWidth}
7982
/>
8083
)}
8184
</>

src/apps/admin/src/billing-account/ClientsPage/ClientsPage.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/**
22
* Billing account clients page.
33
*/
4-
import { FC } from 'react'
4+
import { FC, useState } from 'react'
55
import classNames from 'classnames'
66

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

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

2424
export const ClientsPage: FC<Props> = (props: Props) => {
25+
const [colWidth, setColWidth] = useState<colWidthType>({})
2526
const {
2627
isLoading,
2728
datas,
@@ -77,6 +78,8 @@ export const ClientsPage: FC<Props> = (props: Props) => {
7778
setPage={setPage}
7879
setSort={setSort}
7980
sort={sort}
81+
colWidth={colWidth}
82+
setColWidth={setColWidth}
8083
/>
8184
)}
8285
</>

src/apps/admin/src/challenge-management/AddResourcePage/AddResourcePage.module.scss

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)