-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Feature Request: Media committed with Post / Collection Item #1344
Comments
Completely agree! I had not noticed this yet, but I'm days away from a use case where it would have come up. I've just started to learn more about selenium and automated testing... and I could see this affecting my ability to automate a test that checks to see if an uploaded image is sized correctly and doesn't break a layout |
I created a very naive implementation for github. Not useful to merge in here but might be useful for anyone who needs a quick implementation |
Awesome - thanks for submitting this! In our use case, we'd like to open editing to the general public and have configured our site so that only admins can merge to master. Currently, users logged into Netlify CMS can edit content but cannot upload images because they are not allowed to commit directly to master. |
Not sure how that's possible, aren't write permissions required for successful login? |
@erquhart This is not related to logging in. It is in the case of a protected |
Ah, protected branch, so the user does have write permissions, nevermind. The closest solution is to use an external media library, a feature I expect to be merged in the near future. The first integration is Uploadcare and they have a great free tier. |
@erquhart I think this is still worth discussing -- would you mind giving the reasons you decided to commit to master instead of the PR when you first worked on the media library? |
Our fork commits to the PR instead of master.
It checks if you are creating a new/editing post, if you are then when you
use the upload the media it will check if a branch already exists and
commits to that, or if it's new it will create a branch, commits the media,
and create a PR.
Then when you save the post, it make makes a new commit to the same branch.
We also had to make to so you couldn't upload media until you made a post
title, and we had to change the preview URLs for media images.
It all works fine, but only tested in GitHub and could certainly be
refined. (E.g. don't create PR until the post is saved.)
But it's is 100% possible for GitHub with protected master, and we have
been using in production for a few months.
I never made a PR because I don't think what we did is ready for a library
and we didn't test on using methods other than GitHub direct integration.
…On Mon, 27 Aug 2018, 3:26 PM Caleb, ***@***.***> wrote:
@erquhart <https://github.com/erquhart> I think this is still worth
discussing -- would you mind giving the reasons you decided to commit to
master instead of the PR when you first worked on the media library?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1344 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AI0PW0PkgwNyl5fDiDXMIIBuKLmTj3yzks5uVHIUgaJpZM4T14KR>
.
|
The reason media commits to master is because we wanted assets to be reusable between entries rather than being tied to them. If you had an oft used image you had to have access to it somewhere physically so you could upload it again every time you needed it in an entry. What we now see is that there's a need for both approaches. |
When running in
publish_mode: editorial_workflow
the current setup is to create a PR for the post / collection item but upload media directly to master ( or thebranch
specified inbackend
)This means that images are automatically committed, while the collection item needs approval.
We would like to see, by default, when an image is uploaded to the media gallery it goes to the same PR as the collection item to be posted.
This way both the collection item and any related media are contained in a single PR and can be reviewed and approved.
The text was updated successfully, but these errors were encountered: