-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Move Paperclip into an extension #2328
Conversation
# This provides a more robust interface | ||
# | ||
# @return [Enumberable] of media for a variant | ||
def gallery |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use empty lines between method definitions.
core/app/models/spree/product.rb
Outdated
@@ -280,6 +266,16 @@ def find_variant_property_rule(option_value_ids) | |||
end | |||
end | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra blank line detected.
# This provides a more robust interface | ||
# | ||
# @return [Enumberable] of media for a variant | ||
def gallery |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use empty lines between method definitions.
core/app/models/spree/product.rb
Outdated
@@ -280,6 +266,16 @@ def find_variant_property_rule(option_value_ids) | |||
end | |||
end | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra blank line detected.
This partial renders product images.
In the API.
In the API.
These are used mostly in the upload zone, progress, and related areas.
This has been moved to solidus_paperclip. Other image upload extensions will possibly need to borrow from there.
Extensions adding this would need to override this file.
Overrides have been added to the solidus_paperclip side.
Since we don't use Paperclip anymore, this isn't necessary.
This has been moved into the solidus_paperclip extension.
This also removes the code that loads the images.
We have taken all image (Paperclip) related content from Solidus.
TODO: This is hardcoded path right now. This needs to point to an actual gem before being merged.
Otherwise I would need to add a weird "guard" statement here, and I don't want to do that.
I think the best approach will be to merge #2337 before pulling out Paperclip. |
Can this move forward now? |
@swcraig there are a number of conflicting files but this is a great direction! |
Paperclip is dead and has been for months.
Removes all Paperclip specific code (including all JavaScript related to uploading images in the admin) from Solidus. All of this functionality has been moved into a branch in (the currently temporary repo) solidus_paperclip.
Views in the admin/frontend render empty space for images. This way, future image uploading extensions only need to attach images to variants and they will show up in the expected places. Image upload implementations shouldn't need to know about specific views in Solidus.
This PR also adds
#gallery
methods toSpree::Variant
andSpree::Product
. These methods return an emptyEnumerable
, which future image upload extensions would be expected to override. I can open a separate PR for this change, but it is cleaner to have#gallery
before this is merged. Most notably for JBuilder endpoints in the API and also the Handlebars templates in the admin. By using the null object pattern here I can leave those files without modification for now.Spree::Taxon#icon
has been removed, and a decorator has been added on the extension side. If this needs a better interface, I will work on addressing that.This is a relatively large PR, and would be difficult to review easily. If there is an obvious way to split this up logically, please let me know.
I am more than happy to discuss any aspect of this change, and will do everything I can to move this forward in the best possible way.
Before this is merged solidus_paperclip needs to exist on solidusio-contrib and that location needs to be referenced in
lib/sandbox.sh
. At the moment it's a hardcoded relative path on my machine.