Skip to content
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

Appeal list contact row functionality #1013

Merged
merged 4 commits into from
Aug 29, 2024

Conversation

dr-bizz
Copy link
Contributor

@dr-bizz dr-bizz commented Aug 27, 2024

Description

In this PR, I added functionality to the contact row. Allow the user to add a pledge, edit a pledge, delete a pledge, remove a contact from an appeal and add an excluded contact.

You will see I added some files from the commit [1. List Filters - Add contacts to appeal](https://github.com/CruGlobal/mpdx-react/commit/c2412ee8379da48151c5e0cdfc13e81d0862fd3c) otherwise this PR would break. This should be merged in before this merges so I will remove that once that happens.

Changes

  • Add a Pledge: Implemented the ability to add a new pledge with associated donation amounts.
  • Edit a Pledge: Enabled the editing of existing pledges within a contact row.
  • Delete a Pledge: Added functionality to delete a pledge.
  • Remove Contact from Appeal: Users can now remove a contact from an appeal.
  • Add Excluded Contact: Implemented the option to add contacts to the excluded list.

Checklist:

  • I have given my PR a title with the format "MPDX-(JIRA#) (summary sentence max 80 chars)"
  • I have applied the appropriate labels. (Add the label "On Staging" to get the branch automatically merged into staging.)
  • I have requested a review from another person on the project

@dr-bizz dr-bizz requested a review from canac August 27, 2024 21:31
Copy link
Contributor

github-actions bot commented Aug 27, 2024

Bundle sizes [mpdx-react]

Compared against 5c1f773

Dynamic import Size (gzipped) Diff
../src/components/Contacts/ContactsList/DynamicContactsList.tsx -> ./ContactsList 40.61 KB +1.29 KB
../src/components/Tool/Appeal/List/ContactsList/DynamicContactsList.tsx -> ./ContactsList 40.61 KB +1.29 KB
../src/components/Tool/Appeal/Modals/DeleteAppealContact/DynamicDeleteAppealContactModal.tsx -> ./DeleteAppealContactModal 3.86 KB added
../src/components/Tool/Appeal/Modals/DeletePledgeModal/DynamicDeletePledgeModal.tsx -> ./DeletePledgeModal 3.33 KB added
../src/components/Tool/Appeal/Modals/PledgeModal/DynamicPledgeModal.tsx -> ./PledgeModal 74.61 KB added

@dr-bizz
Copy link
Contributor Author

dr-bizz commented Aug 27, 2024

If codecov/patch is above 80% I have been approving PRs as that is a pass in my book.

canac
canac previously requested changes Aug 27, 2024
Copy link
Contributor

@canac canac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't tested it thoroughly yet but here's my comments so far.

@dr-bizz
Copy link
Contributor Author

dr-bizz commented Aug 27, 2024

@canac I can't see you comments

@canac canac dismissed their stale review August 28, 2024 11:42

Wrong PR

@dr-bizz dr-bizz requested a review from canac August 28, 2024 15:31
Copy link
Contributor

@canac canac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking great! Just some minor suggestions.

@dr-bizz dr-bizz force-pushed the appeal-header-and-bulk-actions branch from e96beb3 to b88d799 Compare August 28, 2024 19:33
Base automatically changed from appeal-header-and-bulk-actions to main August 28, 2024 19:43
@dr-bizz dr-bizz requested a review from canac August 28, 2024 21:14
const amount = donation?.appealAmount?.amount;
const currency = donation?.appealAmount?.convertedCurrency;
let donationAmount = '';
if (amount && currency) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't realize what you were trying to accomplish was so simple. I thought there was a branch where you needed to render the raw amount without calling currency format. Thanks for making the logic verbose and clear! If you wanted to simplify, you could do const donationAmount = currencyFormat(amount && currency ? amount : 0, currency, locale);

@dr-bizz dr-bizz force-pushed the appeal-list-contact-row-functionality branch from 1aee532 to 3600e13 Compare August 29, 2024 12:23
@dr-bizz dr-bizz merged commit ed7c72e into main Aug 29, 2024
17 of 18 checks passed
@dr-bizz dr-bizz deleted the appeal-list-contact-row-functionality branch August 29, 2024 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants