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

MPDX-8123 & MPDX-8125 Add Pledges, Commitments and donations flows view #1020

Merged

Conversation

dr-bizz
Copy link
Contributor

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

Description

This PR introduces enhancements to the flows view by adding support for pledges, commitments, and donations. The changes include cleaning up the flows view and centralizing logic into a reusable hook.

Changes

  • Fix the ContactFlowRow component
  • Refactored the list ContactRow pledges functionality into a custom hook used in both the list and flows view.
  • Added functionality to edit and remove commitments.
  • Implemented the logic for determining pledges, commitments, and donations within the new hook.
  • Updated the visual indication for overdue dates.
  • Added tests for the new contactFlowsRow component and hook.

Please explain a bullet-point summary of the changes.
List any PRs that this PR is dependent on and any Jira tickets that this PR is related to.

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

Copy link
Contributor

github-actions bot commented Aug 29, 2024

Bundle sizes [mpdx-react]

Compared against c09143f

Dynamic import Size (gzipped) Diff
../src/components/Contacts/ContactFlow/DynamicContactFlow.tsx -> ./ContactFlow 58.1 KB +2.32 KB
../src/components/Contacts/ContactsList/DynamicContactsList.tsx -> ./ContactsList 42.03 KB +1.42 KB
../src/components/Tool/Appeal/Flow/DynamicContactFlow.tsx -> ./ContactFlow 58.1 KB +2.32 KB
../src/components/Tool/Appeal/List/ContactsList/DynamicContactsList.tsx -> ./ContactsList 42.03 KB +1.42 KB

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

canac commented Aug 30, 2024

When you delete a commitment, the edit/delete buttons are still there in the flows view. Then if you click edit, I get an error message about the pledge not being found. Is that a bug you want to fix in this PR?

Screen.Recording.2024-08-30.at.9.51.43.AM.mov

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've got a few refactoring suggestions, but great work with this! I like how you're breaking logic out into separate components and hooks. 🔥

src/hooks/useGetPledgeOrDonation.ts Outdated Show resolved Hide resolved
src/hooks/useGetPledgeOrDonation.ts Outdated Show resolved Hide resolved
src/hooks/useGetPledgeOrDonation.ts Outdated Show resolved Hide resolved
src/hooks/useGetPledgeOrDonation.ts Outdated Show resolved Hide resolved
src/hooks/useGetPledgeOrDonation.ts Outdated Show resolved Hide resolved
src/hooks/useGetPledgeOrDonation.ts Outdated Show resolved Hide resolved
src/hooks/useGetPledgeOrDonation.ts Outdated Show resolved Hide resolved
src/hooks/useGetPledgeOrDonation.ts Outdated Show resolved Hide resolved
@dr-bizz
Copy link
Contributor Author

dr-bizz commented Aug 30, 2024

When you delete a commitment, the edit/delete buttons are still there in the flows view. Then if you click edit, I get an error message about the pledge not being found. Is that a bug you want to fix in this PR?

This fix deserves its own PR.

@dr-bizz
Copy link
Contributor Author

dr-bizz commented Aug 30, 2024

Added it as a task here- MPDX-8137

@dr-bizz dr-bizz requested a review from canac August 30, 2024 18:46
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.

Love it!

Thanks for making a new ticket for the bug fix.

@dr-bizz dr-bizz force-pushed the MPDX-8123-MPDX-8125-pledges-commitments-and-donations-flows-view branch from 72e9bc3 to aad2fc4 Compare August 30, 2024 20:08
@dr-bizz dr-bizz merged commit 01b23a2 into main Aug 30, 2024
18 checks passed
@dr-bizz dr-bizz deleted the MPDX-8123-MPDX-8125-pledges-commitments-and-donations-flows-view branch August 30, 2024 20:24
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