-
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 1 commit
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
- Loading branch information
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' | ||
|
||
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} | ||
/> | ||
)} | ||
</> | ||
|
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>({}) | ||
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 { | ||
page, | ||
setPage, | ||
|
@@ -40,12 +41,14 @@ export const BillingAccountResourcesTable: FC<Props> = (props: Props) => { | |
const columns = useMemo<TableColumn<BillingAccountResource>[]>( | ||
() => [ | ||
{ | ||
columnId: 'name', | ||
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 |
||
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} | ||
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={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, | ||
setColWidth: Dispatch<SetStateAction<colWidthType>> | undefined | ||
} | ||
|
||
export const BillingAccountsTable: FC<Props> = (props: Props) => { | ||
const columns = useMemo<TableColumn<BillingAccount>[]>( | ||
() => [ | ||
{ | ||
columnId: 'id', | ||
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 |
---|---|---|
|
@@ -421,6 +421,7 @@ const ChallengeUserList: FC<ChallengeUserListProps> = props => { | |
columns={columns} | ||
data={props.users} | ||
disableSorting | ||
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. Ensure that |
||
/> | ||
)} | ||
{screenWidth <= 984 && ( | ||
|
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 |
||
label: 'Client ID', | ||
renderer: (data: ClientInfo) => ( | ||
<div> | ||
|
@@ -39,26 +42,31 @@ export const ClientsTable: FC<Props> = (props: Props) => { | |
}, | ||
{ | ||
className: styles.tableCell, | ||
columnId: 'name', | ||
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 ensuring that the |
||
label: 'Name', | ||
propertyName: 'name', | ||
type: 'text', | ||
}, | ||
{ | ||
columnId: 'status', | ||
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. Ensure that the |
||
label: 'Status', | ||
propertyName: 'status', | ||
type: 'text', | ||
}, | ||
{ | ||
columnId: 'startDateString', | ||
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. Verify that the |
||
label: 'Start Date', | ||
propertyName: 'startDateString', | ||
type: 'text', | ||
}, | ||
{ | ||
columnId: 'endDateString', | ||
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. Check that the |
||
label: 'End Date', | ||
propertyName: 'endDateString', | ||
type: 'text', | ||
}, | ||
{ | ||
columnId: 'codeName', | ||
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. Ensure that the |
||
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 if |
||
/> | ||
) : ( | ||
<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 { | ||
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 renaming the class |
||
td { | ||
vertical-align: middle; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -223,6 +223,7 @@ export const DialogEditUserTerms: FC<Props> = (props: Props) => { | |
data={addedInfo.datas} | ||
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 |
||
/> | ||
<Pagination | ||
page={addedInfo.page} | ||
|
@@ -276,6 +277,7 @@ export const DialogEditUserTerms: FC<Props> = (props: Props) => { | |
data={notAddedInfo.datas} | ||
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 |
||
/> | ||
<Pagination | ||
page={notAddedInfo.page} | ||
|
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 using a more descriptive class name than |
||
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 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.