Conversation
|
Hi, @mrcasals, based on rails/rails#31325 (comment) I've added the routes to the Decidim admin engine provided by ActiveStorage:
It has the disadvantage that the namespace isolation of engines is broken a bit and missing routes are looked up in the main app. I can add the missing methods from ActiveStorate directly to avoid this. What do you think? |
7649389 to
ee3dded
Compare
decidim-admin/app/forms/decidim/admin/organization_appearance_form.rb
Outdated
Show resolved
Hide resolved
af58e54 to
558879a
Compare
I don't have a clear opinion on this yet! I'd say go ahead! |
a55150b to
44ef20e
Compare
3f293c7 to
16ec5d2
Compare
fe90dba to
a848a3d
Compare
enable_processing method was a method provided by CarrierWave, not required using ActiveStorage
45c824b to
ca0cbe8
Compare
leio10
left a comment
There was a problem hiding this comment.
Awesome and huge job! 👏👏
I've checked that works well with production apps and I've reviewed specially the core changes. Let's address my comments and merge this! 💪
decidim-core/db/migrate/20180810092428_move_organization_fields_to_hero_content_block.rb
Outdated
Show resolved
Hide resolved
decidim-core/app/helpers/decidim/main_app_missing_routes_helper.rb
Outdated
Show resolved
Hide resolved
decidim-core/app/commands/decidim/attachment_attributes_methods.rb
Outdated
Show resolved
Hide resolved
Co-authored-by: leio10 <leiodd@gmail.com>
d6b1a29 to
6bda58d
Compare
* develop: (32 commits) Remove obsolete rake webpack task (#8237) Active storage migrations service (#7902) Fix content type delegation to blank attachments (#8230) Evote bug fixing (#8220) Fix the proposal data migration for proposals without authors or organization (#8015) Bump addressable version because security issues (#8229) Online meetings iframe visibility with time (#8097) Meetings iframe and iframe URL (#8096) Remove flaky test on meetings (#8226) Fix broken tests after problematic PRs (#8224) Apply permissions system to comments (#8035) Set current_component as commentable when commentable is a participatory space (#8189) Fix don't require inactive authorization handlers (#8122) Improve metrics calculations performance (#8215) Fix performance issue in notification settings page (#8155) Active storage migration (#7598) Update manual installation guide in documentation (#8217) Load JS configuration in elections focus mode layout (#8213) Fix user activity pagination when there are hidden items (#8202) Make it possible to define SCSS settings overrides from modules (#8198) ...
Co-authored-by: leio10 <leiodd@gmail.com> Co-authored-by: Fernando Blat <fernando@blat.es> Co-authored-by: Antti Hukkanen <antti.hukkanen@mainiotech.fi>
Co-authored-by: leio10 <leiodd@gmail.com> Co-authored-by: Fernando Blat <fernando@blat.es> Co-authored-by: Antti Hukkanen <antti.hukkanen@mainiotech.fi>
🎩 What? Why?
This PR replaces CarrierWave attachments with ActiveStorage:
For example:
changes to
CarrierWave also has a system of versions to define different sizes of images, for example. ActiveStorage has something similar, variants, but does not admit named variants by default. I've moved the CarrierWave versions definitions to a hash in the uploaders which can be used to generate named variants:
For example
changes to:
Other methods are available to generate full URLs:
OrganizationPresentValidatorChecks the presence of an organization in the instance of the model. This is important because some configurations for the validations are defined in the organizationUploaderImageDimensionsValidatorChecks dimension of the images and compares them with the maximum values set in the upoaderOther relevant changes of this PR:
remote_url=method provided by CarrierWave to attach a file from a URL in Decidim::ApplicationUploader📌 Related Issues
Link your PR to an issue
Testing
The interface behavior should be the same as before this PR
📋 Checklist
🚨 Please review the guidelines for contributing to this repository.
docs/.📷 Screenshots
Please add screenshots of the changes you're proposing
