Skip to content

Collapse and expand questions when editing questionnaire#5933

Closed
verarojman wants to merge 16 commits intodecidim:developfrom
Platoniq:feature/questionnaire-collapsible-questions
Closed

Collapse and expand questions when editing questionnaire#5933
verarojman wants to merge 16 commits intodecidim:developfrom
Platoniq:feature/questionnaire-collapsible-questions

Conversation

@verarojman
Copy link
Copy Markdown
Contributor

@verarojman verarojman commented Apr 6, 2020

🎩 What? Why?

This PR allows for questions to be collapsed into their statement in order for the experience of editing a questionnaire to be more comfortable when there is a considerable number of questions being edited. They can later be expanded, and collapsed/expanded all at once with two buttons at the beginning of the questions list.

As part of this feature, the question title in the collapsed version is updated with the question statement input (instead of e.g. "Question 3") to have a better visual reference of the questions when they are all collapsed.

📌 Related Issues

📋 Subtasks

  • Add CHANGELOG entry
  • Add tests

📷 Screenshots

Example-Optimized

@verarojman
Copy link
Copy Markdown
Contributor Author

verarojman commented Apr 7, 2020

Tests are failing at "Install Ruby deps" 😢

@andreslucena
Copy link
Copy Markdown
Member

Tests are failing at "Install Ruby deps"

It seems that at least one of the failures is solved with #5910

@agustibr
Copy link
Copy Markdown
Contributor

agustibr commented Apr 8, 2020

@verarojman I've rerunned the jobs, sometimes fixes the install failures 😀

microstudi and others added 3 commits April 8, 2020 20:46
* Link to results from questionnaire edit view

* Define results_url in surveys controller

* Create and link questonnaire results view

* Remove answer-related statements from HasQuestionnaire concern

* Remove answer-related methods from general forms helper

* Create QuestionnaireAnswersHelper

* Redefine query method to be more general

* Add answers permissions to surveys module

* Enforce permission to view responses in questionnaire form

* Create HasQuestionnaireAnswers concern

* Add HasQuestionnaireAnswers to surveys controller

* Add questionnaire answers routes to surveys routes

* Create questionnaire answers index and show views

* Fix participant_fields method name

* Remove unnecessary 'participant_fields' method

* Fix empty line rubocop offense

* Add WickedPdf dependency to decidim-forms module

* Setup routes and permissions for questionnaire answers export

* Create queries to manage questionnaire participants

* Create presenter for questionnaire participant

* Refactor HasQuestionnaireAnswers to use new queries and presenters

* Refactor index and show views to use presenters

* Create views for questionnaire pdf export

* Return QuestionnaireUserAnswers to its previous state

* Create spec for QuestionnaireParticipants query

* Create spec for QuestionnaireParticipant query

* Create spec for QuestionnaireParticipantPresenter

* Add questionnaire_answers permissions specs

* Create spec for QuestionnaireAnswersHelper

* Create surveys controller spec

* Refactor pdf render in HasQuestionnaireAnswers

* Revert QuestionnaireUserAnswers to original state

* Remove trailing format from urls and set pdf title

* Display disabled button when no answers for questionnaire

* Display questionnaire completion percentage for participants

* Spec example for display_percentage

* Spec example for participant completion

* Style questionnaire answers pdf

* Update HasQuestionnaireAnswers usage explanation

* Move HasQuestionnaireAnswers helper methods to separate class

* Add #i18n-tasks-use comment in controller

* Fix usage of # i18n-tasks-use comment

* Normalize locales

* Update spec for helper ip_hash

* Refactor HasQuestionnaireAnswers helpers

* Normalize locales

* Create QuestionnaireAnswerPresenter

* Use answer presenter for participant answers

* Create spec for QuestionnaireAnswerPresenter

* Fix erblint errors

* Allow defining custom exporters derived from base PDF exporter

* Allow customizing controller for PDF exporters

* Modify exporters to take in any options

* Write spec for export manifest #options and #formats

* Remove options for exporters and set in child class instead

* Survey PDF spec

* Add doc comment to load_exporters in export_manifest

* Fix label in exports dropdown

* Add export label to locales

* Add doc comments

* update gemfile.lock

* Add CHANGELOG entry

* Normalize locales

* Simplify export locales

* Add i18n-use comments in exporters

* Update Gemfile.lock in decidim-generators and decidim_app-design

* Remove non-background answer exports

* Remove unused translations

* Remove unused translation

* Fix translations

* Normalize locales

* Fix answer presenter specs

* Add wicked_pdf gem to decidim-generators Gemfile

* Update decidim-generators Gemfile.lock

* requiire wickedpdf in initalizer file

* code optimizations

* refactor answer grouping query. Fix completion percentage

* refactor pdf exporter. bring back individual response export

* present first user answer to navigate

* fix tests

* changelog

* add alternate first td view if no short answers available

* add examples for admin answers pages

* Introduce i18n tasks use comments with another comment

* Export single answers as a background job

* Override questionnaire_participant_answers_url specifying engine in surveys controller

* Update changelog

Co-authored-by: Vera Rojman <vrojman@protonmail.com>
Co-authored-by: Vera Rojman <8806781+verarojman@users.noreply.github.com>
* Update move up and down buttons after dragging questions when managing a questionnaire in admin

* Update changelog

Co-authored-by: Vera Rojman <vrojman@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants