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

DataForm: if a field of type text declare elements, render it as a SelectControl in edit #64251

Merged
merged 2 commits into from
Aug 5, 2024

Conversation

oandregal
Copy link
Member

@oandregal oandregal commented Aug 5, 2024

Part of #59745
Follow-up to #63983

What?

For text fields that have elements, this PR renders a SelectControl with the elements — like the integer type does.

How?

  • Render as SelectControl if field has elements. 04039f8
  • Updates the DataForm storybook to include a field with elements whose type is text.

Testing Instructions

Visit the storybook (npm install && npm run storybook:dev), go to the DataForm component and verify it has a status field rendered as a SelectControl.

Copy link

github-actions bot commented Aug 5, 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 5, 2024
@oandregal oandregal added [Type] Enhancement A suggestion for improvement. [Feature] Data Views Work surrounding upgrading and evolving views in the site editor and beyond labels Aug 5, 2024
@oandregal
Copy link
Member Author

I counted on implementing this when adding the status field to DataForm but the component for status is more complex — so better to have this one in before we forget adding it.

@oandregal oandregal changed the title Render a SelectControl for fields of type text if they define elements DataForm: if a field of type text declare elements, render it as a SelectControl in edit Aug 5, 2024
@oandregal oandregal merged commit e3c2cd3 into trunk Aug 5, 2024
71 checks passed
@oandregal oandregal deleted the add/select-control-for-text-fields-with-elements branch August 5, 2024 16:38
@github-actions github-actions bot added this to the Gutenberg 19.0 milestone Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Data Views Work surrounding upgrading and evolving views in the site editor and beyond [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants