-
Notifications
You must be signed in to change notification settings - Fork 1.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/imageable concern #1915
Merged
voodoorai2000
merged 85 commits into
consuldemocracy:master
from
rockandror:feature/imageable_concern
Sep 26, 2017
Merged
Feature/imageable concern #1915
voodoorai2000
merged 85 commits into
consuldemocracy:master
from
rockandror:feature/imageable_concern
Sep 26, 2017
+2,765
−670
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
MariaCheca
approved these changes
Sep 25, 2017
decabeza
approved these changes
Sep 25, 2017
This is great! |
voodoorai2000
approved these changes
Sep 26, 2017
… Added translation.
…rs and administrators.
…w. Refactor some css into partecipation.scss for pass scss-lint.
…age error detected.
… manage new nested fields creation on documents.
…nage new nested fields creation on images.
…hared specs to admin fetaure specs and include at admin poll questions specs.
Senen
force-pushed
the
feature/imageable_concern
branch
from
September 26, 2017 11:57
032a1cf
to
5deb073
Compare
Merged
Merged
Closed
javierm
pushed a commit
to javierm/consul
that referenced
this pull request
May 29, 2019
…e-poll Allow delete polls with associated questions and answers
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.
Where
What
Create imageable model concern to allow model to have one image as descriptive image. This image will be displayed in the index and show views as a representative image for the record.
How
First of all we need to create a centralized controller to manage file uploads through AJAX. This controller has a "create" action to allow attachment upload a single file with validations and a "destroy" action to allow to delete uploaded files if needed.
Images and documents uploading will use this endpoint to upload and delete files.
We have used rails built in "nested form fiels" with cocoon special links in combination with custom links to allow to really destroy cached_files.
Also i checked admin usage of documentable and catch some errors. Now is working on admin poll questions and is a little easier to add shared specs to admin feature specs.
This controller extraction and the usage of cocoon helpers lead us to refactor documentable module.
Screenshots
Nested image
Nested validation errors
Single upload
Single uploads validation errors
Admin poll questions fix
Tests
Shared specs adaptation to run on admin feature specs.
Deploy
As usual
Warnings
None.