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

DataViews: update renderFormElements to make sure the value respects the type #64391

Merged
merged 1 commit into from
Aug 9, 2024

Conversation

oandregal
Copy link
Member

Follow-up to #64338

What?

Make sure the updated value for integer fields remains a number and not a string.

Why?

We want the value to respect the field type.

Testing Instructions

Go to DataForm's storybook and change the author value to something else. Using panel or regular layout. It should always display the name, never the number.

Copy link

github-actions bot commented Aug 9, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: oandregal <oandregal@git.wordpress.org>
Co-authored-by: youknowriad <youknowriad@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@oandregal oandregal self-assigned this Aug 9, 2024
@oandregal oandregal requested a review from youknowriad August 9, 2024 09:08
@oandregal oandregal added [Type] Code Quality Issues or PRs that relate to code quality [Feature] DataViews Work surrounding upgrading and evolving views in the site editor and beyond labels Aug 9, 2024
@@ -53,7 +53,7 @@ function Edit< Item >( {
( newValue: string | undefined ) =>
onChange( ( prevItem: Item ) => ( {
...prevItem,
[ id ]: newValue,
[ id ]: Number( newValue ),
Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I actually did that as well in #64389

Copy link
Contributor

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@oandregal oandregal enabled auto-merge (squash) August 9, 2024 09:12
@oandregal oandregal merged commit 360c6f9 into trunk Aug 9, 2024
69 of 71 checks passed
@oandregal oandregal deleted the update/render-from-elements branch August 9, 2024 09:42
@github-actions github-actions bot added this to the Gutenberg 19.1 milestone Aug 9, 2024
getdave pushed a commit that referenced this pull request Aug 14, 2024
…s the type (#64391)

Co-authored-by: oandregal <oandregal@git.wordpress.org>
Co-authored-by: youknowriad <youknowriad@git.wordpress.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] DataViews Work surrounding upgrading and evolving views in the site editor and beyond [Type] Code Quality Issues or PRs that relate to code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants