Skip to content

Commit dab66df

Browse files
authored
Merge pull request #1357 from topcoder-platform/PS-469_update-walletadmin-ui-to-show-onholdadmin
PS-469 - update wallet admin ui to show the onhold admin dropdown
2 parents e12cfd9 + 674c4ed commit dab66df

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

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

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ const ListView: FC<ListViewProps> = (props: ListViewProps) => {
217217
if (updateObj.paymentStatus !== undefined) {
218218
if (updateObj.paymentStatus === 'Owed') {
219219
paymentStatus = 'OWED'
220-
} else if (updateObj.paymentStatus === 'On Hold') {
220+
} else if (updateObj.paymentStatus === 'On Hold (Admin)') {
221221
paymentStatus = 'ON_HOLD_ADMIN'
222222
} else if (updateObj.paymentStatus === 'Cancel') {
223223
paymentStatus = 'CANCELLED'
@@ -267,24 +267,14 @@ const ListView: FC<ListViewProps> = (props: ListViewProps) => {
267267
}, [fetchWinnings])
268268

269269
const onPaymentEditCallback = useCallback((payment: Winning) => {
270-
let status = payment.status
271-
if (status === 'On Hold (Admin)') {
272-
status = 'On Hold'
273-
} else if (['On Hold (Member)', 'On Hold (Tax Form)', 'On Hold (Payment Provider)'].indexOf(status) !== -1) {
274-
status = 'Owed'
275-
}
276-
277270
setConfirmFlow({
278271
action: 'Save',
279272
callback: async () => {
280273
updatePayment(payment.id)
281274
},
282275
content: (
283276
<PaymentEditForm
284-
payment={{
285-
...payment,
286-
status,
287-
}}
277+
payment={payment}
288278
canSave={setIsConfirmFormValid}
289279
onValueUpdated={handleValueUpdated}
290280
/>

src/apps/wallet-admin/src/lib/components/payment-edit/PaymentEdit.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,16 @@ const PaymentEdit: React.FC<PaymentEditFormProps> = (props: PaymentEditFormProps
179179

180180
const options = useCallback(() => {
181181
if (props.payment.status.toUpperCase() !== 'PAID') {
182+
const isMemberHold = [
183+
'On Hold (Member)',
184+
'On Hold (Tax Form)',
185+
'On Hold (Payment Provider)',
186+
].includes(props.payment.status)
187+
182188
return [
189+
...(isMemberHold ? [{ label: props.payment.status, value: props.payment.status }] : []),
183190
{ label: 'Owed', value: 'Owed' },
184-
{ label: 'On Hold', value: 'On Hold' },
191+
{ label: 'On Hold (Admin)', value: 'On Hold (Admin)' },
185192
{ label: 'Cancel', value: 'Cancel' },
186193
]
187194
}

0 commit comments

Comments
 (0)