Skip to content

Commit 366c806

Browse files
committed
Merge branch 'feat/system-admin' into diazz-admin-code-30376878
2 parents a9b4b2b + f3d3e67 commit 366c806

File tree

54 files changed

+516
-104
lines changed

Some content is hidden

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

54 files changed

+516
-104
lines changed

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/lib/components/BillingAccountResourcesTable/BillingAccountResourcesTable.module.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,9 @@
2121
.btnDelete {
2222
padding-right: 0;
2323
}
24+
25+
.desktopTable {
26+
td {
27+
vertical-align: middle;
28+
}
29+
}

src/apps/admin/src/lib/components/BillingAccountResourcesTable/BillingAccountResourcesTable.tsx

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

77
import { useWindowSize, WindowSize } from '~/libs/shared'
8-
import { Button, Table, TableColumn } from '~/libs/ui'
8+
import { Button, colWidthType, Table, TableColumn } from '~/libs/ui'
99

1010
import { useTableFilterLocal, useTableFilterLocalProps } from '../../hooks'
1111
import { Pagination } from '../common/Pagination'
@@ -26,6 +26,7 @@ interface Props {
2626
}
2727

2828
export const BillingAccountResourcesTable: FC<Props> = (props: Props) => {
29+
const [colWidth, setColWidth] = useState<colWidthType>({})
2930
const {
3031
page,
3132
setPage,
@@ -40,12 +41,14 @@ export const BillingAccountResourcesTable: FC<Props> = (props: Props) => {
4041
const columns = useMemo<TableColumn<BillingAccountResource>[]>(
4142
() => [
4243
{
44+
columnId: 'name',
4345
label: 'Name',
4446
propertyName: 'name',
4547
type: 'text',
4648
},
4749
{
4850
className: styles.blockColumnAction,
51+
columnId: 'action',
4952
label: '',
5053
renderer: (data: BillingAccountResource) => (
5154
<Button
@@ -100,6 +103,9 @@ export const BillingAccountResourcesTable: FC<Props> = (props: Props) => {
100103
onToggleSort={setSort}
101104
forceSort={sort}
102105
removeDefaultSort
106+
className={styles.desktopTable}
107+
colWidth={colWidth}
108+
setColWidth={setColWidth}
103109
/>
104110
)}
105111

src/apps/admin/src/lib/components/BillingAccountsTable/BillingAccountsTable.module.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,9 @@
3838
white-space: break-spaces !important;
3939
text-align: left !important;
4040
}
41+
42+
.desktopTable {
43+
td {
44+
vertical-align: middle;
45+
}
46+
}

src/apps/admin/src/lib/components/BillingAccountsTable/BillingAccountsTable.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { Link } from 'react-router-dom'
66
import classNames from 'classnames'
77

88
import { Sort } from '~/apps/gamification-admin/src/game-lib'
9-
import { LinkButton, Table, TableColumn } from '~/libs/ui'
9+
import { colWidthType, LinkButton, Table, TableColumn } from '~/libs/ui'
1010
import { useWindowSize, WindowSize } from '~/libs/shared'
1111

1212
import { BillingAccount, MobileTableColumn } from '../../models'
@@ -23,12 +23,15 @@ interface Props {
2323
setPage: Dispatch<SetStateAction<number>>
2424
sort: Sort | undefined,
2525
setSort: Dispatch<SetStateAction<Sort | undefined>>
26+
colWidth: colWidthType | undefined,
27+
setColWidth: Dispatch<SetStateAction<colWidthType>> | undefined
2628
}
2729

2830
export const BillingAccountsTable: FC<Props> = (props: Props) => {
2931
const columns = useMemo<TableColumn<BillingAccount>[]>(
3032
() => [
3133
{
34+
columnId: 'id',
3235
label: 'Account ID',
3336
renderer: (data: BillingAccount) => (
3437
<div>
@@ -39,26 +42,31 @@ export const BillingAccountsTable: FC<Props> = (props: Props) => {
3942
},
4043
{
4144
className: styles.tableCell,
45+
columnId: 'name',
4246
label: 'Name',
4347
propertyName: 'name',
4448
type: 'text',
4549
},
4650
{
51+
columnId: 'status',
4752
label: 'Status',
4853
propertyName: 'status',
4954
type: 'text',
5055
},
5156
{
57+
columnId: 'startDateString',
5258
label: 'Start Date',
5359
propertyName: 'startDateString',
5460
type: 'text',
5561
},
5662
{
63+
columnId: 'endDateString',
5764
label: 'End Date',
5865
propertyName: 'endDateString',
5966
type: 'text',
6067
},
6168
{
69+
columnId: 'action',
6270
label: '',
6371
renderer: (data: BillingAccount) => (
6472
<span>
@@ -167,6 +175,9 @@ export const BillingAccountsTable: FC<Props> = (props: Props) => {
167175
onToggleSort={props.setSort}
168176
removeDefaultSort
169177
forceSort={props.sort}
178+
colWidth={props.colWidth}
179+
setColWidth={props.setColWidth}
180+
className={styles.desktopTable}
170181
/>
171182
)}
172183
<Pagination

src/apps/admin/src/lib/components/ChallengeList/ChallengeList.module.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,9 @@
5353
flex: none;
5454
}
5555
}
56+
57+
.desktopTable {
58+
td {
59+
vertical-align: middle;
60+
}
61+
}

src/apps/admin/src/lib/components/ChallengeList/ChallengeList.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,8 @@ const ChallengeList: FC<ChallengeListProps> = props => {
344344
columns={columns}
345345
data={props.challenges}
346346
disableSorting
347+
onToggleSort={_.noop}
348+
className={styles.desktopTable}
347349
/>
348350
)}
349351
{screenWidth <= 1279 && (

src/apps/admin/src/lib/components/ChallengeUserList/ChallengeUserList.module.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,9 @@
4848
text-align: right;
4949
}
5050
}
51+
52+
.desktopTable {
53+
td {
54+
vertical-align: middle;
55+
}
56+
}

src/apps/admin/src/lib/components/ChallengeUserList/ChallengeUserList.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,7 @@ const ChallengeUserList: FC<ChallengeUserListProps> = props => {
421421
columns={columns}
422422
data={props.users}
423423
disableSorting
424+
className={styles.desktopTable}
424425
/>
425426
)}
426427
{screenWidth <= 984 && (

0 commit comments

Comments
 (0)