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

fix: total value shows NaN when an expense with 0 amount #1574

Merged
merged 1 commit into from
Nov 25, 2024

Conversation

anuj-kumary
Copy link
Contributor

@anuj-kumary anuj-kumary commented Nov 24, 2024

First thing, PLEASE READ THIS: ReactPlay Code Review Checklist

Description

Summary of the Change:

  1. Resolved an issue where adding an expense with the Amount field set to 0 or left blank resulted in the total value being displayed as NaN. This fix ensures the amount field defaults to 0 if it is not provided.
  2. Added the cursor pointer style to the edit and delete buttons to enhance the user experience by providing a visual indicator of interactivity.

Issue Fixed:
When adding an expense without specifying the amount field, the total displayed was NaN instead of the expected numeric value. This disrupted the accuracy of expense calculations in the tracker.

Fixes #1573

Type of change

  • fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Verified that adding an expense with the amount field set to 0 or left blank updates the total correctly without displaying NaN.
  • Tested with various edge cases, such as:
    • Adding multiple expenses with and without valid amounts.
    • Omitting the Amount field entirely.
    • Entering invalid inputs (e.g., strings or special characters).

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Screenshots or example output

Screen.Recording.2024-11-23.at.11.18.12.PM.mov

Copy link

netlify bot commented Nov 24, 2024

Deploy Preview for reactplayio ready!

Name Link
🔨 Latest commit e27085d
🔍 Latest deploy log https://app.netlify.com/sites/reactplayio/deploys/6742c44d0f72380008413c31
😎 Deploy Preview https://deploy-preview-1574--reactplayio.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Hey! contributor, thank you for opening a Pull Request 🎉.

@reactplay/maintainers will review your submission soon and give you helpful feedback. If you're interested in continuing your contributions to open source and want to be a part of a welcoming and fantastic community, we invite you to join our ReactPlay Discord Community.
Show your support by starring ⭐ this repository. Thank you and we appreciate your contribution to open source!
Stale Marking : After 30 days of inactivity this issue/PR will be marked as stale issue/PR and it will be closed and locked in 7 days if no further activity occurs.

@anuj-kumary
Copy link
Contributor Author

I have completed the changes and the pull request is now ready for your review. Please let me know if you have any questions or need further clarification.

Thank you!

@Sachin-chaurasiya
Copy link
Member

Thanks for the PR @anuj-kumary , can you link the relevant issue?

@anuj-kumary
Copy link
Contributor Author

Thanks for the PR @anuj-kumary , can you link the relevant issue?

The issue link has already been included in the PR description. Please let me know if there's anything else you'd like me to update.

@Sachin-chaurasiya
Copy link
Member

Thanks for the PR @anuj-kumary , can you link the relevant issue?

The issue link has already been included in the PR description. Please let me know if there's anything else you'd like me to update.

@anuj-kumary , need to link in below format.

Fixes #1573

@anuj-kumary
Copy link
Contributor Author

Thanks for the PR @anuj-kumary , can you link the relevant issue?

The issue link has already been included in the PR description. Please let me know if there's anything else you'd like me to update.

@anuj-kumary , need to link in below format.

Fixes #1573

Done

@Sachin-chaurasiya Sachin-chaurasiya merged commit 7ce02ab into reactplay:main Nov 25, 2024
5 checks passed
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.

🐛 [Bug report]: Total value shows NaN when an expense with 0 amount is added
2 participants