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

Introduce disableDropZone prop for MediaPlaceholder component. #17077

Merged
merged 3 commits into from Sep 2, 2019

Conversation

@desaiuditd
Copy link
Member

commented Aug 18, 2019

Description

Currently, MediaPlaceholder does not allow us to disable the drop zone. I work for a newsroom where we do not allow our editors/reporters to drag & drop images into the post, because we have our own media service to handle the images. This PR introduces a component prop which disables the drop zone for MediaPlaceholder.

Types of changes

  • A new prop added in MediaPlaceholder component.
  • Relevant README.md file is also updated to document the use of this prop.
  • dropZoneUIOnly prop is also documented along with this.

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.

- Type: `Boolean`
- Required: No
- Default: `false`

This comment has been minimized.

Copy link
@talldan

talldan Aug 19, 2019

Contributor

Thanks for also documenting this! I didn't even know it existed.

@@ -65,6 +65,24 @@ Class name added to the placeholder.
- Type: `String`
- Required: No

### disableDropZone

This comment has been minimized.

Copy link
@jorgefilipecosta

jorgefilipecosta Aug 19, 2019

Member

Hi @desaiuditd, would it be possible to share more information about the use case you have that needs a media placeholder without the option for drag & drop? What is the main reason for wanting the disable drag & drop in that use case?

This comment has been minimized.

Copy link
@peterwilsoncc

peterwilsoncc Aug 19, 2019

Contributor

@jorgefilipecosta

I'm a colleague of Udit's so can answer your question about the use case.

We have a custom media frame implementation that has required fields for the user to fill in. The drop zone component allows them to work around the required fields.

Eventually we're hoping to replace or extend the drop zone to open the media library with the uploaded image selected and ready to be inserted once the required fields are filled in. But this is a little way down the track.

There's further discussion in the original pull request, #17053.

This comment has been minimized.

Copy link
@desaiuditd

desaiuditd Aug 19, 2019

Author Member

After Pete’s reply, my 2 cents which I had written in the PR description:

I work for a newsroom where we do not allow our editors/reporters to drag & drop images into the post, because we have our own media service to handle the images.

@desaiuditd

This comment has been minimized.

Copy link
Member Author

commented Aug 31, 2019

This should be ready for another review.

@talldan
talldan approved these changes Sep 2, 2019
Copy link
Contributor

left a comment

Gave it a test run and works well in my testing 👍

Thanks again for updating the docs for the component as part of this change.

@talldan talldan merged commit 5ac0b12 into WordPress:master Sep 2, 2019
1 of 4 checks passed
1 of 4 checks passed
Filter opened
Details
Filter opened
Details
Milestone It
Details
Travis CI - Pull Request Build Passed
Details
@desaiuditd desaiuditd deleted the desaiuditd:add/introduce-disable-drop-zone-prop-for-media-placeholder-component branch Sep 2, 2019
@gziolo gziolo added this to the Gutenberg 6.5 milestone Sep 2, 2019
dd32 pushed a commit to dd32/gutenberg that referenced this pull request Sep 27, 2019
…ress#17077)

* Introduce disableDropZone prop for MediaPlaceholder component.

* Move disableDropZone check into renderDropZone() method.

* update README doc and return null instead of Fragment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.