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 #8963

Merged
merged 1 commit into from
Dec 9, 2024
Merged

fix #8963

merged 1 commit into from
Dec 9, 2024

Conversation

guillim
Copy link
Contributor

@guillim guillim commented Dec 9, 2024

fixing
image

@guillim guillim self-assigned this Dec 9, 2024
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Improved handling of undefined/null values in NumberFieldDisplay component with simplified percentage calculations and cleaner code structure.

  • Added early return with <NumberDisplay value={null}> when fieldValue is undefined in /packages/twenty-front/src/modules/object-record/record-field/meta-types/display/components/NumberFieldDisplay.tsx
  • Simplified percentage calculation by directly multiplying Number(fieldValue) by 100 without redundant checks
  • Removed nested ternary operators in favor of a more readable if/else structure
  • Potential risk: Converting undefined/null values to numbers without validation could cause runtime errors

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

@guillim guillim enabled auto-merge (squash) December 9, 2024 13:42
@guillim guillim merged commit 310bba7 into main Dec 9, 2024
19 checks passed
@guillim guillim deleted the fix-numberDisplay-0 branch December 9, 2024 13:44
Copy link

github-actions bot commented Dec 9, 2024

Thanks @guillim for your contribution!
This marks your 20th PR on the repo. You're top 2% of all our contributors 🎉
See contributor page - Share on LinkedIn - Share on Twitter

Contributions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

2 participants