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

File block: Allow content only editing #65787

Merged
merged 1 commit into from
Oct 3, 2024
Merged

Conversation

talldan
Copy link
Contributor

@talldan talldan commented Oct 1, 2024

What?

See #65778

Allows contentOnly editing in the file block.

How?

Adds role: content to the file block attributes. I've tried to match other media blocks like image with the attributes that receive the content role.

Testing Instructions

  1. Open a template in the Site Editor
  2. Insert a file block in one of the sections
  3. Switch to Write mode
  4. Try editing the file block

Screenshots or screencast

Before

Kapture.2024-10-01.at.14.59.03.mp4

After

Kapture.2024-10-01.at.15.01.26.mp4

@talldan talldan added [Type] Enhancement A suggestion for improvement. [Block] File Affects the File Block labels Oct 1, 2024
@talldan talldan self-assigned this Oct 1, 2024
@talldan talldan requested a review from ajitbohra as a code owner October 1, 2024 13:03
Copy link

github-actions bot commented Oct 1, 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: talldan <[email protected]>
Co-authored-by: andrewserong <[email protected]>

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

Copy link
Contributor

@andrewserong andrewserong left a comment

Choose a reason for hiding this comment

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

Good catch, this is all testing nicely for me!

✅ Confirmed that before, the File block cannot be interacted with in Write / contentOnly mode when it's part of a section in a template
✅ With this applied, I can upload a file, and update its filename text and download button text

LGTM! 🚀

@talldan talldan merged commit 45ecb4e into trunk Oct 3, 2024
70 checks passed
@talldan talldan deleted the fix/file-block-content-only branch October 3, 2024 07:21
@github-actions github-actions bot added this to the Gutenberg 19.4 milestone Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] File Affects the File Block [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants