-
Notifications
You must be signed in to change notification settings - Fork 14
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
Feat/system admin #1108
Changes from all commits
228b71f
2d59f23
11232bd
774a8f5
580617f
af68445
88fe2bf
2be1b57
59d8bc6
9510de9
d558ca8
a9b4b2b
f3d3e67
366c806
21fad4a
07ac31d
b261088
9204d86
a82243b
6f686e3
5ddb252
538deb9
5fd7ac7
a8a6f0a
58b5490
c367efe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -221,6 +221,7 @@ workflows: | |
- dev | ||
- LVT-256 | ||
- CORE-635 | ||
- feat/system-admin | ||
|
||
- deployQa: | ||
context: org-global | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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'), | ||
|
@@ -136,14 +132,9 @@ export const adminRoutes: ReadonlyArray<PlatformRoute> = [ | |
route: ':challengeId/manage-user', | ||
}, | ||
{ | ||
element: <ManageResourcePage />, | ||
element: <ManageSubmissionPage />, | ||
id: 'manage-resource', | ||
route: ':challengeId/manage-resource', | ||
}, | ||
{ | ||
element: <AddResourcePage />, | ||
id: 'add-resource', | ||
route: ':challengeId/manage-resource/add', | ||
route: ':challengeId/manage-submission', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
}, | ||
], | ||
element: <ChallengeManagement />, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ import _ from 'lodash' | |
import classNames from 'classnames' | ||
import moment from 'moment' | ||
|
||
import { EnvironmentConfig } from '~/config' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The import statement for |
||
import { | ||
Button, | ||
InputDatePicker, | ||
|
@@ -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' | ||
|
||
|
@@ -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, | ||
|
@@ -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'), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The variable |
||
[isEdit], | ||
) | ||
const { | ||
register, | ||
|
@@ -81,7 +83,9 @@ export const BillingAccountNewPage: FC<Props> = (props: Props) => { | |
subscriptionNumber: '' as any, | ||
}, | ||
mode: 'all', | ||
resolver: yupResolver(formEditBillingAccountSchema), | ||
resolver: yupResolver( | ||
isEdit ? formEditBillingAccountSchema : formAddBillingAccountSchema, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The use of |
||
), | ||
}) | ||
|
||
const endDate = watch('endDate') | ||
|
@@ -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, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider checking if |
||
poNumber: billingAccount.poNumber, | ||
salesTax: billingAccount.salesTax, | ||
startDate: billingAccount.startDate, | ||
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider simplifying the conditional expression. The current expression |
||
} | ||
error={_.get(errors, 'paymentTerms.message')} | ||
dirty | ||
/> | ||
|
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' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The import |
||
|
||
import { BillingAccountsFilter } from '../../lib/components/BillingAccountsFilter' | ||
import { BillingAccountsTable } from '../../lib/components/BillingAccountsTable' | ||
|
@@ -22,6 +22,7 @@ interface Props { | |
const pageTitle = 'Billing Accounts' | ||
|
||
export const BillingAccountsPage: FC<Props> = (props: Props) => { | ||
const [colWidth, setColWidth] = useState<colWidthType>({}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The type |
||
const { | ||
isLoading, | ||
datas, | ||
|
@@ -76,6 +77,8 @@ export const BillingAccountsPage: FC<Props> = (props: Props) => { | |
setPage={setPage} | ||
setSort={setSort} | ||
sort={sort} | ||
colWidth={colWidth} | ||
setColWidth={setColWidth} | ||
/> | ||
)} | ||
</> | ||
|
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' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
import classNames from 'classnames' | ||
|
||
import { LinkButton, LoadingSpinner, PageDivider, PageTitle } from '~/libs/ui' | ||
import { colWidthType, LinkButton, LoadingSpinner, PageDivider, PageTitle } from '~/libs/ui' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
import { PlusIcon } from '@heroicons/react/solid' | ||
|
||
import { MSG_NO_RECORD_FOUND } from '../../config/index.config' | ||
|
@@ -22,6 +22,7 @@ interface Props { | |
const pageTitle = 'Clients' | ||
|
||
export const ClientsPage: FC<Props> = (props: Props) => { | ||
const [colWidth, setColWidth] = useState<colWidthType>({}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
const { | ||
isLoading, | ||
datas, | ||
|
@@ -77,6 +78,8 @@ export const ClientsPage: FC<Props> = (props: Props) => { | |
setPage={setPage} | ||
setSort={setSort} | ||
sort={sort} | ||
colWidth={colWidth} | ||
setColWidth={setColWidth} | ||
/> | ||
)} | ||
</> | ||
|
This file was deleted.
There was a problem hiding this comment.
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 toManageSubmissionPage
. Consider updating theid
to reflect the new functionality, such as 'manage-submission'.