Skip to content

Forms: Add file upload dropzone block - #43114

Closed
edanzer wants to merge 121 commits into
trunkfrom
update/file-dropzone-block
Closed

edanzer wants to merge 121 commits into
trunkfrom
update/file-dropzone-block

Conversation

@edanzer

@edanzer edanzer commented Apr 16, 2025 •

Copy link
Copy Markdown
Contributor

Proposed changes:

Before, the block would use "group" block as its container

Screenshot 2025-05-15 at 12 32 33 Screenshot 2025-05-15 at 12 32 57

After, the block uses separate "dropzone" block

Screenshot 2025-05-15 at 12 24 09 Screenshot 2025-05-15 at 12 23 20

Other information:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?
  • Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

Jetpack product discussion

None.

Does this pull request change what data or activity we track or use?

No.

Testing instructions:

  • Enable beta blocks by adding this to your environment:

    add_filter( 'jetpack_blocks_variation', function () { return 'beta'; } );
  • Add form with file upload field.

  • Confirm file upload and dropzone look right in editor.

  • Confirm file upload and dropzone look correct and work as expected on frontend. Add jetpack-beta-blocks sticker via Blog RC to allow file uploads to your site.

  • Refresh the block editor page, and confirm the file upload and dropzone block still load as expected.

@edanzer edanzer added [Status] In Progress Task [Pri] Normal [Block] Form Form block (also see Form package label) [Package] Forms [Feature] Forms Blocks Blocks designed to streamline user input and engagement, such as contact, newsletter sign-ups, etc. labels Apr 16, 2025
@edanzer edanzer self-assigned this Apr 16, 2025
@edanzer
edanzer changed the base branch from trunk to update/migrate-form-fields-to-inner-blocks April 16, 2025 18:17
@github-actions

This comment was marked as resolved.

ramonjd and others added 29 commits June 3, 2025 10:30
* initial commit - adding extra markup to the select rendering and fixing positioning of labels

* uncommenting

* Remove default select border

* Update select field rendering to include a wrapper div with the correct class structure for improved styling and consistency in tests.

* Update contact form styles to inherit text color and adjust z-index for select wrapper elements

* Only run `getAttribute` on select wrapper if there is one

* Reinstate padding change

* phan me

* phanos

* whitespace
… to select dropdown and fix z-index (#43721)

* Enhance select field transformation by adding default placeholder for input block. Update contact form plugin to correctly reference placeholder attribute. Adjust z-index values in CSS for improved label positioning.

* Update z-index values in contact form CSS for improved label positioning and remove redundant styles for outlined fields.

* Complete CSS comment

* Refactor select field transformation to set placeholder attribute directly from attributes. Remove redundant placeholder handling in inner block creation.

* Revert createTextFieldInnerBlocks

* Revert experiment. Add default placeholder for select in createTextFieldInnerBlocks

* Don't mutate the attributes object

* Don't spread optional chaining just in case
…s. Add 'color: unset !important;' to both editor.scss and grunion.css for consistent input appearance. (#43737)
…PACK-262  (#43002)

* inital commit - exploratory

* do_shortcode

* Add test_block_attributes_to_shortcode_attributes_with_styles

* add more simple tests

* remove unnecessary changes

* changelog

* LINTO!

* Adding WP namespaces

* test_gutenblock_render_field_checkbox

* Add test for trim

* Use optionsdata to presume that block_attributes_to_shortcode_attributes has taken place. Let's test that as a unit

* Adding classes and styles in attributes.

* block_attributes_to_shortcode_attributes tests

* text field which has input and label

* Phan complains about \DOMNode::getAttribute. Shut it up.

* Try to quiet Phan again by passing a WP_Block instance

* Attempt to fix a couple of the code coverage warnings

* Try to fix namespace again

* Try using the full namespace for the covers annotation instead of the relative name

---------

Co-authored-by: Andrew Serong <14988353+andrewserong@users.noreply.github.com>
- Ensure block class is added to legend element
- Add custom block classes and styles to legend
- Tweak default style specificity so global styles can apply
* Fix text input-style field label font size when outlined style is active.

* Remove scaling using variable

* Fix scaling of multiple option fields when using outlined style

* Tidy up styles

* Wrap labels

* Fix outlined label font size and animation

* Fix animation by ensuring top is a valid value

* Remove will-change: transform on frontend too. Transform usually does not change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Form Form block (also see Form package label) DO NOT MERGE don't merge it! Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Feature] Forms Blocks Blocks designed to streamline user input and engagement, such as contact, newsletter sign-ups, etc. [Feature] Forms I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage. [Package] Forms [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Tests] Includes Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants