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

Add layout related updates to the DataForm README #68050

Merged
merged 3 commits into from
Dec 18, 2024

Conversation

louwie17
Copy link
Contributor

What?

Related to: #59745

Updates DataViews/README.md for the DataForm component to reflect the new options around the layout, in particular:

  • The addition of labelPosition
  • The addition of passing an object into form.fields with support for layout, labelPosition
  • The combined fields support, by using children and label within form.fields.

Testing Instructions

  1. Read over the documentation updates and see if they make sense.

@louwie17 louwie17 added [Type] Developer Documentation Documentation for developers [Feature] DataViews Work surrounding upgrading and evolving views in the site editor and beyond labels Dec 17, 2024
@louwie17 louwie17 self-assigned this Dec 17, 2024
},
],
};
```
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added labelPosition and an example.

}
}
```

## Form Field API
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added documentation around the FormField type, that is supported by form.fields


A function that determines if a media field or a primary field is clickable. It receives an item as an argument and returns a boolean value indicating whether the item can be clicked.

### `onClickItem`: `function`
#### `onClickItem`: `function`
Copy link
Contributor Author

@louwie17 louwie17 Dec 17, 2024

Choose a reason for hiding this comment

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

Update the header of the above two to match the other options.

@@ -2,8 +2,8 @@

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I left comments by the real changes, the rest are formatting done by prettier.

@louwie17 louwie17 marked this pull request as ready for review December 17, 2024 12:56
Copy link

github-actions bot commented Dec 17, 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: louwie17 <louwie17@git.wordpress.org>
Co-authored-by: gigitux <gigitux@git.wordpress.org>
Co-authored-by: oandregal <oandregal@git.wordpress.org>

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

Copy link
Contributor

@gigitux gigitux left a comment

Choose a reason for hiding this comment

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

Thanks for improving the documentation! LGTM!

Copy link
Member

@oandregal oandregal left a comment

Choose a reason for hiding this comment

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

Thanks for taking care of this.

@louwie17 louwie17 merged commit c9c6830 into trunk Dec 18, 2024
69 checks passed
@louwie17 louwie17 deleted the update/dataform_layout_documentation branch December 18, 2024 14:14
@github-actions github-actions bot added this to the Gutenberg 20.0 milestone Dec 18, 2024
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] Developer Documentation Documentation for developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants