-
Notifications
You must be signed in to change notification settings - Fork 35
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
Pattern Creation: Prevent uploads to the media library #373
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ryelle
added
the
[Component] Pattern Creator
Anything related to the pattern front end editor or preview
label
Oct 28, 2021
ryelle
force-pushed
the
update/restricted-media-library
branch
from
November 11, 2021 18:40
70d67c0
to
8cd72e3
Compare
ryelle
force-pushed
the
update/restricted-media-library
branch
from
November 19, 2021 17:26
1d04f73
to
c2c5137
Compare
The intention here was to overwrite the blockEditorStore's selector, but this is a separate store so that doesn't work.
ryelle
force-pushed
the
update/restricted-media-library
branch
from
November 19, 2021 18:21
c2c5137
to
ce8984f
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #37 —
There are over 100 images uploaded to the Pattern Directory, these have been verified CC0 and can be used in patterns. This PR removes the ability for users to upload to the site, but leaves the ability to open the media library to insert already-uploaded images.This PR is laying the groundwork for #375. It disables uploads for non-admins, and sets up a button to open the media modal. In #375, this will be used to open our Openverse modal.
❓ Specifically requesting reviews because I'm touching capabilities, if there's a better way to achieve this let me know.
Screenshots
When media blocks are inserted, they now just have "Pattern Media Library" as an option, for example the Gallery block:
Media & Text:
In the Media & Text block, only "Open Media Library" is available to replace the image.
The Media Library itself still has the "Upload files" tab, but if you try to upload you get a permissions error:
How to test the changes in this Pull Request: