-
Notifications
You must be signed in to change notification settings - Fork 13
Topcoder Admin App - Misc Update 0518 #1085
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
base: feat/system-admin
Are you sure you want to change the base?
Changes from all commits
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 |
---|---|---|
@@ -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 { 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 |
||
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>({}) | ||
const { | ||
isLoading, | ||
datas, | ||
|
@@ -77,6 +78,8 @@ export const ClientsPage: FC<Props> = (props: Props) => { | |
setPage={setPage} | ||
setSort={setSort} | ||
sort={sort} | ||
colWidth={colWidth} | ||
setColWidth={setColWidth} | ||
/> | ||
)} | ||
</> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,3 +21,9 @@ | |
.btnDelete { | ||
padding-right: 0; | ||
} | ||
|
||
.desktopTable { | ||
td { | ||
vertical-align: middle; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
/** | ||
* Billing account resources table. | ||
*/ | ||
import { FC, useMemo } from 'react' | ||
import { FC, useMemo, 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 { useWindowSize, WindowSize } from '~/libs/shared' | ||
import { Button, Table, TableColumn } from '~/libs/ui' | ||
import { Button, colWidthType, Table, TableColumn } 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 { useTableFilterLocal, useTableFilterLocalProps } from '../../hooks' | ||
import { Pagination } from '../common/Pagination' | ||
|
@@ -26,6 +26,7 @@ interface Props { | |
} | ||
|
||
export const BillingAccountResourcesTable: FC<Props> = (props: Props) => { | ||
const [colWidth, setColWidth] = useState<colWidthType>({}) | ||
const { | ||
page, | ||
setPage, | ||
|
@@ -40,12 +41,14 @@ export const BillingAccountResourcesTable: FC<Props> = (props: Props) => { | |
const columns = useMemo<TableColumn<BillingAccountResource>[]>( | ||
() => [ | ||
{ | ||
columnId: 'name', | ||
label: 'Name', | ||
propertyName: 'name', | ||
type: 'text', | ||
}, | ||
{ | ||
className: styles.blockColumnAction, | ||
columnId: 'action', | ||
label: '', | ||
renderer: (data: BillingAccountResource) => ( | ||
<Button | ||
|
@@ -100,6 +103,9 @@ export const BillingAccountResourcesTable: FC<Props> = (props: Props) => { | |
onToggleSort={setSort} | ||
forceSort={sort} | ||
removeDefaultSort | ||
className={styles.desktopTable} | ||
colWidth={colWidth} | ||
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 |
||
setColWidth={setColWidth} | ||
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 |
||
/> | ||
)} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ import { Link } from 'react-router-dom' | |
import classNames from 'classnames' | ||
|
||
import { Sort } from '~/apps/gamification-admin/src/game-lib' | ||
import { LinkButton, Table, TableColumn } from '~/libs/ui' | ||
import { colWidthType, LinkButton, Table, TableColumn } from '~/libs/ui' | ||
import { useWindowSize, WindowSize } from '~/libs/shared' | ||
|
||
import { BillingAccount, MobileTableColumn } from '../../models' | ||
|
@@ -23,12 +23,15 @@ interface Props { | |
setPage: Dispatch<SetStateAction<number>> | ||
sort: Sort | undefined, | ||
setSort: Dispatch<SetStateAction<Sort | undefined>> | ||
colWidth: colWidthType | undefined, | ||
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 |
||
setColWidth: Dispatch<SetStateAction<colWidthType>> | undefined | ||
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 |
||
} | ||
|
||
export const BillingAccountsTable: FC<Props> = (props: Props) => { | ||
const columns = useMemo<TableColumn<BillingAccount>[]>( | ||
() => [ | ||
{ | ||
columnId: 'id', | ||
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 addition of |
||
label: 'Account ID', | ||
renderer: (data: BillingAccount) => ( | ||
<div> | ||
|
@@ -39,26 +42,31 @@ export const BillingAccountsTable: FC<Props> = (props: Props) => { | |
}, | ||
{ | ||
className: styles.tableCell, | ||
columnId: 'name', | ||
label: 'Name', | ||
propertyName: 'name', | ||
type: 'text', | ||
}, | ||
{ | ||
columnId: 'status', | ||
label: 'Status', | ||
propertyName: 'status', | ||
type: 'text', | ||
}, | ||
{ | ||
columnId: 'startDateString', | ||
label: 'Start Date', | ||
propertyName: 'startDateString', | ||
type: 'text', | ||
}, | ||
{ | ||
columnId: 'endDateString', | ||
label: 'End Date', | ||
propertyName: 'endDateString', | ||
type: 'text', | ||
}, | ||
{ | ||
columnId: 'action', | ||
label: '', | ||
renderer: (data: BillingAccount) => ( | ||
<span> | ||
|
@@ -167,6 +175,9 @@ export const BillingAccountsTable: FC<Props> = (props: Props) => { | |
onToggleSort={props.setSort} | ||
removeDefaultSort | ||
forceSort={props.sort} | ||
colWidth={props.colWidth} | ||
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 |
||
setColWidth={props.setColWidth} | ||
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 |
||
className={styles.desktopTable} | ||
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 |
||
/> | ||
)} | ||
<Pagination | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,3 +53,9 @@ | |
flex: none; | ||
} | ||
} | ||
|
||
.desktopTable { | ||
td { | ||
vertical-align: middle; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -332,6 +332,8 @@ const ChallengeList: FC<ChallengeListProps> = props => { | |
columns={columns} | ||
data={props.challenges} | ||
disableSorting | ||
onToggleSort={_.noop} | ||
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 |
||
className={styles.desktopTable} | ||
/> | ||
)} | ||
{screenWidth <= 1279 && ( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,3 +48,9 @@ | |
text-align: right; | ||
} | ||
} | ||
|
||
.desktopTable { | ||
td { | ||
vertical-align: middle; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ import classNames from 'classnames' | |
|
||
import { Sort } from '~/apps/gamification-admin/src/game-lib' | ||
import { useWindowSize, WindowSize } from '~/libs/shared' | ||
import { Table, TableColumn } from '~/libs/ui' | ||
import { colWidthType, Table, TableColumn } from '~/libs/ui' | ||
|
||
import { ClientInfo, MobileTableColumn } from '../../models' | ||
import { Pagination } from '../common/Pagination' | ||
|
@@ -23,12 +23,15 @@ interface Props { | |
setPage: Dispatch<SetStateAction<number>> | ||
sort: Sort | undefined | ||
setSort: Dispatch<SetStateAction<Sort | undefined>> | ||
colWidth: colWidthType | undefined, | ||
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 |
||
setColWidth: Dispatch<SetStateAction<colWidthType>> | undefined | ||
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 |
||
} | ||
|
||
export const ClientsTable: FC<Props> = (props: Props) => { | ||
const columns = useMemo<TableColumn<ClientInfo>[]>( | ||
() => [ | ||
{ | ||
columnId: 'ClientID', | ||
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 addition of |
||
label: 'Client ID', | ||
renderer: (data: ClientInfo) => ( | ||
<div> | ||
|
@@ -39,26 +42,31 @@ export const ClientsTable: FC<Props> = (props: Props) => { | |
}, | ||
{ | ||
className: styles.tableCell, | ||
columnId: 'name', | ||
label: 'Name', | ||
propertyName: 'name', | ||
type: 'text', | ||
}, | ||
{ | ||
columnId: 'status', | ||
label: 'Status', | ||
propertyName: 'status', | ||
type: 'text', | ||
}, | ||
{ | ||
columnId: 'startDateString', | ||
label: 'Start Date', | ||
propertyName: 'startDateString', | ||
type: 'text', | ||
}, | ||
{ | ||
columnId: 'endDateString', | ||
label: 'End Date', | ||
propertyName: 'endDateString', | ||
type: 'text', | ||
}, | ||
{ | ||
columnId: 'codeName', | ||
label: 'Code name', | ||
renderer: (data: ClientInfo) => ( | ||
<> | ||
|
@@ -161,6 +169,9 @@ export const ClientsTable: FC<Props> = (props: Props) => { | |
onToggleSort={props.setSort} | ||
removeDefaultSort | ||
forceSort={props.sort} | ||
className={styles.desktopTable} | ||
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 |
||
colWidth={props.colWidth} | ||
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 |
||
setColWidth={props.setColWidth} | ||
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 |
||
/> | ||
)} | ||
<Pagination | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,3 +61,9 @@ | |
background: none; | ||
} | ||
} | ||
|
||
.desktopTable { | ||
td { | ||
vertical-align: middle; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -158,6 +158,7 @@ export const DialogEditUserGroups: FC<Props> = (props: Props) => { | |
data={userGroups} | ||
disableSorting | ||
onToggleSort={_.noop} | ||
className={styles.desktopTable} | ||
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 verifying that |
||
/> | ||
) : ( | ||
<div>No groups</div> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,3 +61,9 @@ | |
background: none; | ||
} | ||
} | ||
|
||
.desktopTable { | ||
td { | ||
vertical-align: middle; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -154,6 +154,7 @@ export const DialogEditUserRoles: FC<Props> = (props: Props) => { | |
data={userRoles} | ||
disableSorting | ||
onToggleSort={_.noop} | ||
className={styles.desktopTable} | ||
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 verifying if the |
||
/> | ||
) : ( | ||
<div>No roles</div> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,3 +78,9 @@ | |
background: none; | ||
} | ||
} | ||
|
||
.desktopTable { | ||
td { | ||
vertical-align: middle; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,3 +41,9 @@ | |
padding: 16px 16px 32px; | ||
text-align: center; | ||
} | ||
|
||
.desktopTable { | ||
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 adding a class for the |
||
td { | ||
vertical-align: middle; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,3 +32,9 @@ | |
.blockCellWrap { | ||
white-space: break-spaces !important; | ||
} | ||
|
||
.desktopTable { | ||
td { | ||
vertical-align: middle; | ||
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 using |
||
} | ||
} |
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
useState
hook is imported but not used in the current code. Consider removing it if it's not needed.