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: Array data type accepts whitespace as input #7707

Merged
merged 2 commits into from
Oct 16, 2024

Conversation

harshit078
Copy link
Contributor

Description

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

This PR addresses the issue of whitespace and null inputs being accepted as valid in the MultiItemFieldInput component for array data types.

  • Introduced turnIntoEmptyStringIfWhitespacesOnly utility function in packages/twenty-front/src/modules/object-record/record-field/meta-types/input/components/MultiItemFieldInput.tsx
  • Applied the new utility function to the input value in the onChange handler to prevent whitespace-only inputs
  • This change aligns the behavior of array data type inputs with other UI elements, rejecting whitespace and null values

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

@bosiraphael bosiraphael self-assigned this Oct 16, 2024
@bosiraphael
Copy link
Contributor

Hello @harshit078, thank you for contributing. It still accepts empty string values, is this intended?

@harshit078
Copy link
Contributor Author

Yes @bosiraphael, RecordInineCell container still accepts null values and white space as valid input. I'm currently working on it and will push an issue regarding the same. This PR was a fix to reducing the GraphQL request made and RightDrawer saving the State when input entered.

Copy link
Contributor

@bosiraphael bosiraphael left a comment

Choose a reason for hiding this comment

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

LGTM

@bosiraphael bosiraphael merged commit 03dd752 into twentyhq:main Oct 16, 2024
9 of 11 checks passed
Copy link

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

Contributions

@bosiraphael
Copy link
Contributor

Congratulations @harshit078!

@harshit078 harshit078 deleted the input-fix branch October 16, 2024 17:21
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