Skip to content

Commit a2c3c38

Browse files
authored
Merge pull request #1081 from topcoder-platform/wallet-admin-fixes
minor admin-wallet fixes
2 parents 13d048a + 69aed09 commit a2c3c38

File tree

4 files changed

+24
-3
lines changed

4 files changed

+24
-3
lines changed

src/apps/wallet-admin/src/home/tabs/payments/PaymentsTab.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ function formatStatus(status: string): string {
3737
return 'Cancel'
3838
case 'PROCESSING':
3939
return 'Processing'
40+
case 'FAILED':
41+
return 'Failed'
42+
case 'RETURNED':
43+
return 'Returned'
4044
default:
4145
return status.replaceAll('_', ' ')
4246
}
@@ -340,6 +344,14 @@ const ListView: FC<ListViewProps> = (props: ListViewProps) => {
340344
label: 'Processing',
341345
value: 'PROCESSING',
342346
},
347+
{
348+
label: 'Failed',
349+
value: 'FAILED',
350+
},
351+
{
352+
label: 'Returned',
353+
value: 'RETURNED',
354+
},
343355
],
344356
type: 'dropdown',
345357
},

src/apps/wallet-admin/src/lib/components/filter-bar/FilterBar.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* eslint-disable react/jsx-no-bind */
2-
import React, { ChangeEvent } from 'react'
2+
import React, { ChangeEvent, useRef } from 'react'
33

44
import { Button, IconOutline, InputSelect, InputText } from '~/libs/ui'
55
import { InputHandleAutocomplete, MembersAutocompeteResult } from '~/apps/gamification-admin/src/game-lib'
@@ -28,6 +28,7 @@ interface FilterBarProps {
2828

2929
const FilterBar: React.FC<FilterBarProps> = (props: FilterBarProps) => {
3030
const [selectedValue, setSelectedValue] = React.useState<Map<string, string | any[]>>(new Map())
31+
const selectedMembers = useRef<MembersAutocompeteResult[]>([])
3132

3233
const renderDropdown = (index: number, filter: Filter): JSX.Element => (
3334
<InputSelect
@@ -52,10 +53,12 @@ const FilterBar: React.FC<FilterBarProps> = (props: FilterBarProps) => {
5253
className={styles.filterInput}
5354
placeholder={filter.label}
5455
onChange={(event: Array<MembersAutocompeteResult>) => {
56+
selectedMembers.current = event
5557
setSelectedValue(new Map(selectedValue.set(filter.key, event)))
5658
props.onFilterChange(filter.key, event.map(member => member.userId))
5759
}}
5860
tabIndex={index}
61+
value={selectedMembers.current}
5962
/>
6063
)
6164

@@ -121,6 +124,7 @@ const FilterBar: React.FC<FilterBarProps> = (props: FilterBarProps) => {
121124
size='lg'
122125
disabled={selectedValue.size === 0}
123126
onClick={() => {
127+
selectedMembers.current = []
124128
setSelectedValue(new Map())
125129
props.onResetFilters?.()
126130
}}

src/apps/wallet-admin/src/lib/components/payments-table/PaymentTable.module.scss

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ table {
4141
top: 0;
4242
background-color: white !important;
4343
text-transform: uppercase;
44+
45+
&.description {
46+
width: 360px;
47+
max-width: 360px;
48+
}
4449
}
4550

4651
tbody tr td:first-child {
@@ -97,7 +102,7 @@ table {
97102
.actionButtons {
98103
padding-left: 8px;
99104
display: flex;
100-
justify-content: center;
105+
justify-content: flex-end;
101106
align-items: center;
102107
}
103108

src/apps/wallet-admin/src/lib/components/payments-table/PaymentTable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const PaymentsTable: React.FC<PaymentTableProps> = (props: PaymentTableProps) =>
3838
<thead>
3939
<tr>
4040
<th className='body-ultra-small-bold'>HANDLE</th>
41-
<th className='body-ultra-small-bold'>DESCRIPTION</th>
41+
<th className={`body-ultra-small-bold ${styles.description}`}>DESCRIPTION</th>
4242
<th className='body-ultra-small-bold'>CREATE DATE</th>
4343
<th className='body-ultra-small-bold'>PAYMENT</th>
4444
<th className='body-ultra-small-bold'>STATUS</th>

0 commit comments

Comments
 (0)