-
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
Refactor admin poll section #4990
Merged
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
Actions :search_booths and :search_officers in admin polls controller are moved to other controllers since commit 20e3113 for :search_booths and commit 19ec7f9 for :search_officers. This then allows us to remove the code that references these actions in the controller and in the administrator abilities.
Since commit adf18ee this action no longer makes sense.
javierm
reviewed
Sep 13, 2022
app/controllers/admin/poll/questions/answers/videos_controller.rb
Outdated
Show resolved
Hide resolved
After removing a question from a poll it makes more sense to redirect to your own poll show page in order to manage their questions. Currently it is redirecting to the questions index page where all the questions from all the polls are displayed and takes you completely out of the context of the poll you are in. In the future we will remove this index question page.
…ller We also add a missing translation.
241f090
to
28d944b
Compare
We are simplifying the load answer and we can remove the ambiguous hidden field from answer form.
This way we have a controller just to manage Poll::Question::Answer related documents in the same way we have for videos and images.
We might change the style of this caption or remove it completely in the future. In the meantime, we use the right HTML tag for the task to give information regarding what the table is about, and that tag is `<caption>`.
Until now, in order to edit an answer, we had to click on its title on the table and then on the "Edit answer" link. That was tedious and different from what we usually do in the admin section. Furthermore, the code for the answers table was written twice and when we modified it we forgot to update the one in the `show` action, meaning the table here provided less information than the information present in the answers tables. Co-Authored-By: Javi Martín <javim@elretirao.net>
These methods aren't necessary since commit 71601bd.
Minor change for replace @video.answer_id to @video.answer.
In some cases (e.g. after editing or creating a resource with errors) the default back_link did not redirect to the expected page. Now we force the back_links to the index pages, so we always get the desired redirect.
28d944b
to
86ff4ee
Compare
javierm
approved these changes
Sep 14, 2022
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.
References
Objectives
Notes
Maybe we can improve the action :documents from Admin::Poll::Questions::AnswersController.
Right now the load_and_authorize_resource :answer include a "except: :documents" and @answer is loaded in :documents action in commit Load answer through question in answers controller