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

Gutenlypso: Set allowed MIME types #29743

Merged
merged 1 commit into from
Dec 26, 2018
Merged

Conversation

mmtr
Copy link
Member

@mmtr mmtr commented Dec 25, 2018

Changes proposed in this Pull Request

Define in the Gutenberg editor settings the allowed MIME types by the site, so the media blocks (i.e.: audio, block, ...) check them before uploading the media file.

If the file extension doesn't match any of the allowed MIME types, the media block will display an error saying that the file type is not permitted for security reasons.

Fixes #29742

Testing instructions

  1. Switch to a Simple site with a Free plan.
  2. If the current editor is still the Classic editor, opt-in to the Block editor.
  3. Start writing a post.
  4. Add a video block, click on the "Upload" button and select a video file.
  5. Check that an error is displayed immediately and no request to the API is performed trying to upload the file (/wp/v2/sites/:site_id/media).

screen shot 2018-12-25 at 11 08 58

  1. Upload the same video by dragging the file directly to the post content.
  2. Make sure again that an error is displayed immediately and no request to the API is performed trying to upload the file (/wp/v2/sites/:site_id/media).
  3. Repeat steps 4-7 with an audio file
  4. Switch now to a Simple site with Premium or Business plan.
  5. Confirm that you can upload any video or audio file either manually or by dragging them to the editor.

@mmtr mmtr added [Type] Bug [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. [Feature] Media The media screen in Calypso, general media management, or integration with third party media. [Goal] Gutenberg Working towards full integration with Gutenberg labels Dec 25, 2018
@mmtr mmtr self-assigned this Dec 25, 2018
@matticbot
Copy link
Contributor

Copy link
Member

@vindl vindl left a comment

Choose a reason for hiding this comment

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

LGTM! :shipit:

@vindl vindl added [Status] Ready to Merge and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Dec 26, 2018
@mmtr mmtr merged commit abbd15d into master Dec 26, 2018
@mmtr mmtr deleted the fix/gutenlypso-allowed-mime-types branch December 26, 2018 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Media The media screen in Calypso, general media management, or integration with third party media. [Goal] Gutenberg Working towards full integration with Gutenberg [Type] Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gutenlypso: Dragging audio/video files on free plans fails with no notice
3 participants