Skip to content

Commit

Permalink
Add edit button for donation tab in admin panel
Browse files Browse the repository at this point in the history
related to #1161
  • Loading branch information
mohammadranjbarz committed Oct 18, 2023
1 parent 46a1496 commit 57a5a98
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/server/adminJs/adminJs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ const getadminJsInstance = async () => {
properties: {
transactionNetworkId: 'Network',
transactionId: 'txHash',
isProjectVerified: 'Givback Eligible',
disperseTxHash:
'disperseTxHash, this is optional, just for disperse transactions',
},
Expand Down
60 changes: 55 additions & 5 deletions src/server/adminJs/tabs/donationTab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,16 @@ export const donationTab = {
list: false,
filter: false,
show: true,
edit: false,
edit: true,
new: false,
},
},
isProjectVerified: {
isVisible: {
list: false,
filter: false,
show: true,
edit: true,
new: false,
},
},
Expand All @@ -530,9 +539,14 @@ export const donationTab = {
list: true,
filter: true,
show: true,
edit: false,
edit: true,
new: false,
},
availableValues: [
{ value: DONATION_STATUS.VERIFIED, label: DONATION_STATUS.VERIFIED },
{ value: DONATION_STATUS.PENDING, label: DONATION_STATUS.PENDING },
{ value: DONATION_STATUS.FAILED, label: DONATION_STATUS.FAILED },
],
},
createdAt: {
isVisible: {
Expand Down Expand Up @@ -580,19 +594,55 @@ export const donationTab = {
list: false,
show: false,
new: true,
edit: true,
edit: false,
},
},
priceUsd: {
isVisible: {
list: false,
filter: false,
show: true,
edit: false,
edit: true,
new: false,
},
type: 'number',
},
transactionId: {
isVisible: {
list: true,
filter: false,
show: true,
edit: false,
new: false,
},
},
isReferrerGivbackEligible: {
isVisible: {
list: false,
filter: false,
show: true,
edit: false,
new: false,
},
},
segmentNotified: {
isVisible: {
list: false,
filter: false,
show: true,
edit: false,
new: false,
},
},
referralStartTimestamp: {
isVisible: {
list: false,
filter: false,
show: true,
edit: false,
new: false,
},
},
},
actions: {
bulkDelete: {
Expand All @@ -604,7 +654,7 @@ export const donationTab = {
),
},
edit: {
isVisible: false,
isVisible: true,
isAccessible: ({ currentAdmin }) =>
canAccessDonationAction({ currentAdmin }, ResourceActions.EDIT),
},
Expand Down

0 comments on commit 57a5a98

Please sign in to comment.