Skip to content

Add Surveys engine MVP#1364

Merged
oriolgual merged 23 commits intofeature/surveysfrom
feature/surveys-mvp
May 17, 2017
Merged

Add Surveys engine MVP#1364
oriolgual merged 23 commits intofeature/surveysfrom
feature/surveys-mvp

Conversation

@beagleknight
Copy link
Copy Markdown
Contributor

🎩 What? Why?

Add Surveys engine to Decidim. To keep things simple this PR just adds the core functionality of the new engine. The survey questions just have one field for the body and doesn't include different types so the user answer will be just plain text.

📌 Related Issues

📋 Subtasks

  • Engine skeleton
  • Admin can manage a survey
  • Users can answer a survey
  • Validations and stuff
  • Survey questions can be ordered ? (out of scope)
  • Suvey question types ? (out of scope)

📷 Screenshots (optional)

image
image
image
image
image
image
image

👻 GIF

@beagleknight beagleknight self-assigned this May 16, 2017
@codecov
Copy link
Copy Markdown

codecov bot commented May 16, 2017

Codecov Report

Merging #1364 into feature/surveys will decrease coverage by 0.6%.
The diff coverage is 81.62%.

Impacted file tree graph

@@                 Coverage Diff                 @@
##           feature/surveys    #1364      +/-   ##
===================================================
- Coverage            95.42%   94.81%   -0.61%     
===================================================
  Files                  420      444      +24     
  Lines                 7213     7543     +330     
===================================================
+ Hits                  6883     7152     +269     
- Misses                 330      391      +61
Impacted Files Coverage Δ
...im-core/app/helpers/decidim/decidim_form_helper.rb 21.73% <10%> (-78.27%) ⬇️
...veys/app/commands/decidim/surveys/create_survey.rb 100% <100%> (ø)
...urveys/app/models/decidim/surveys/survey_answer.rb 100% <100%> (ø)
...trollers/decidim/surveys/application_controller.rb 100% <100%> (ø)
...ecidim-surveys/lib/decidim/surveys/admin_engine.rb 100% <100%> (ø)
decidim-core/lib/decidim/form_builder.rb 91.19% <100%> (ø) ⬆️
...rs/decidim/surveys/admin/application_controller.rb 100% <100%> (ø)
...veys/app/models/decidim/surveys/survey_question.rb 100% <100%> (ø)
...cidim-surveys/app/models/decidim/surveys/survey.rb 100% <100%> (ø)
decidim-surveys/lib/decidim/surveys.rb 100% <100%> (ø)
... and 41 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 29be570...0103855. Read the comment docs.

oriolgual
oriolgual previously approved these changes May 16, 2017
@mention-bot
Copy link
Copy Markdown

@beagleknight, thanks for your PR! By analyzing the history of the files in this pull request, we identified @lastpotion and @deivid-rodriguez to be potential reviewers.

@beagleknight beagleknight mentioned this pull request May 16, 2017
8 tasks
@oriolgual oriolgual merged commit 225a854 into feature/surveys May 17, 2017
@oriolgual oriolgual deleted the feature/surveys-mvp branch May 17, 2017 07:22
@beagleknight beagleknight restored the feature/surveys-mvp branch May 17, 2017 08:12
@beagleknight beagleknight deleted the feature/surveys-mvp branch May 17, 2017 08:13
beagleknight added a commit that referenced this pull request May 31, 2017
* Add engine skeleton

* Add feature test

* An admin can update a survey without questions

* Admin can add n questions to a survey

* Admin can edit survey questions

* An admin can remove questions from surveys

* Admin can publish a survey

* Minor refactor

* Users answer surveys

* Fix minor errors

* Rubocop

* Add model validations

* Fix minor things

* Fix hound complains

* Fix more complains

* Fix broken specs

* Add some feedback

* Add some permissions

* Add missing translation

* Fix rubocop issues

* Add tests to the CI

* Fix broken test suite

* Normalize locales
beagleknight added a commit that referenced this pull request May 31, 2017
* Add engine skeleton

* Add feature test

* An admin can update a survey without questions

* Admin can add n questions to a survey

* Admin can edit survey questions

* An admin can remove questions from surveys

* Admin can publish a survey

* Minor refactor

* Users answer surveys

* Fix minor errors

* Rubocop

* Add model validations

* Fix minor things

* Fix hound complains

* Fix more complains

* Fix broken specs

* Add some feedback

* Add some permissions

* Add missing translation

* Fix rubocop issues

* Add tests to the CI

* Fix broken test suite

* Normalize locales
beagleknight added a commit that referenced this pull request May 31, 2017
* Add custom styles

* Change from toc to tos

* Fix broken tests

* Fix typo

* Fix spec

* Fix rubocop issues

* Add Surveys engine MVP (#1364)

* Add engine skeleton

* Add feature test

* An admin can update a survey without questions

* Admin can add n questions to a survey

* Admin can edit survey questions

* An admin can remove questions from surveys

* Admin can publish a survey

* Minor refactor

* Users answer surveys

* Fix minor errors

* Rubocop

* Add model validations

* Fix minor things

* Fix hound complains

* Fix more complains

* Fix broken specs

* Add some feedback

* Add some permissions

* Add missing translation

* Fix rubocop issues

* Add tests to the CI

* Fix broken test suite

* Normalize locales

* Admin can mark question as mandatory (#1386)

* Admin can mark question as mandatory

* Users must respond mandatory questions

* Fix problems with poltergeist

* Fix rubocop complains

* Fix i18n-issues

* Add feedback

* Fix rubocop complains

* Huge refactor templates

* Fix rubocop issues

* Admins can select question type

* Factor out auto label position code

* Moar refactor

* Huge JS refactor

* Add dynamic answer options for a question

* Admin survey form working with dynamic answer options

* Single and multiple options working

* Fixed rubocop issues

* Fix i18n problems

* Ignore unused i18n

* Add ignore unused

* Add answer option default value

* Fix rectify problem

* Fix minor issues

* Fix a few bad merges

* Fix broken specs
beagleknight added a commit that referenced this pull request Jun 2, 2017
* Add engine skeleton

* Add feature test

* An admin can update a survey without questions

* Admin can add n questions to a survey

* Admin can edit survey questions

* An admin can remove questions from surveys

* Admin can publish a survey

* Minor refactor

* Users answer surveys

* Fix minor errors

* Rubocop

* Add model validations

* Fix minor things

* Fix hound complains

* Fix more complains

* Fix broken specs

* Add some feedback

* Add some permissions

* Add missing translation

* Fix rubocop issues

* Add tests to the CI

* Fix broken test suite

* Normalize locales
beagleknight added a commit that referenced this pull request Jun 2, 2017
* Add custom styles

* Change from toc to tos

* Fix broken tests

* Fix typo

* Fix spec

* Fix rubocop issues

* Add Surveys engine MVP (#1364)

* Add engine skeleton

* Add feature test

* An admin can update a survey without questions

* Admin can add n questions to a survey

* Admin can edit survey questions

* An admin can remove questions from surveys

* Admin can publish a survey

* Minor refactor

* Users answer surveys

* Fix minor errors

* Rubocop

* Add model validations

* Fix minor things

* Fix hound complains

* Fix more complains

* Fix broken specs

* Add some feedback

* Add some permissions

* Add missing translation

* Fix rubocop issues

* Add tests to the CI

* Fix broken test suite

* Normalize locales

* Admin can mark question as mandatory (#1386)

* Admin can mark question as mandatory

* Users must respond mandatory questions

* Fix problems with poltergeist

* Fix rubocop complains

* Fix i18n-issues

* Add feedback

* Fix rubocop complains

* Huge refactor templates

* Fix rubocop issues

* Admins can select question type

* Factor out auto label position code

* Moar refactor

* Huge JS refactor

* Add dynamic answer options for a question

* Admin survey form working with dynamic answer options

* Single and multiple options working

* Fixed rubocop issues

* Fix i18n problems

* Ignore unused i18n

* Add ignore unused

* Add answer option default value

* Fix rectify problem

* Fix minor issues

* Fix a few bad merges

* Fix broken specs
beagleknight added a commit that referenced this pull request Jun 5, 2017
* Add engine skeleton

* Add feature test

* An admin can update a survey without questions

* Admin can add n questions to a survey

* Admin can edit survey questions

* An admin can remove questions from surveys

* Admin can publish a survey

* Minor refactor

* Users answer surveys

* Fix minor errors

* Rubocop

* Add model validations

* Fix minor things

* Fix hound complains

* Fix more complains

* Fix broken specs

* Add some feedback

* Add some permissions

* Add missing translation

* Fix rubocop issues

* Add tests to the CI

* Fix broken test suite

* Normalize locales
beagleknight added a commit that referenced this pull request Jun 5, 2017
* Add custom styles

* Change from toc to tos

* Fix broken tests

* Fix typo

* Fix spec

* Fix rubocop issues

* Add Surveys engine MVP (#1364)

* Add engine skeleton

* Add feature test

* An admin can update a survey without questions

* Admin can add n questions to a survey

* Admin can edit survey questions

* An admin can remove questions from surveys

* Admin can publish a survey

* Minor refactor

* Users answer surveys

* Fix minor errors

* Rubocop

* Add model validations

* Fix minor things

* Fix hound complains

* Fix more complains

* Fix broken specs

* Add some feedback

* Add some permissions

* Add missing translation

* Fix rubocop issues

* Add tests to the CI

* Fix broken test suite

* Normalize locales

* Admin can mark question as mandatory (#1386)

* Admin can mark question as mandatory

* Users must respond mandatory questions

* Fix problems with poltergeist

* Fix rubocop complains

* Fix i18n-issues

* Add feedback

* Fix rubocop complains

* Huge refactor templates

* Fix rubocop issues

* Admins can select question type

* Factor out auto label position code

* Moar refactor

* Huge JS refactor

* Add dynamic answer options for a question

* Admin survey form working with dynamic answer options

* Single and multiple options working

* Fixed rubocop issues

* Fix i18n problems

* Ignore unused i18n

* Add ignore unused

* Add answer option default value

* Fix rectify problem

* Fix minor issues

* Fix a few bad merges

* Fix broken specs
josepjaume pushed a commit that referenced this pull request Jun 6, 2017
* Add Surveys engine MVP (#1364)

* Add engine skeleton

* Add feature test

* An admin can update a survey without questions

* Admin can add n questions to a survey

* Admin can edit survey questions

* An admin can remove questions from surveys

* Admin can publish a survey

* Minor refactor

* Users answer surveys

* Fix minor errors

* Rubocop

* Add model validations

* Fix minor things

* Fix hound complains

* Fix more complains

* Fix broken specs

* Add some feedback

* Add some permissions

* Add missing translation

* Fix rubocop issues

* Add tests to the CI

* Fix broken test suite

* Normalize locales

* Survey questions can be sorted using drag and drop (#1373)

* Add basic drag and drop features

* Refactor JS and minor adjustments

* Add missing documentation

* Minor label adjustments

* Fix rubocop complains

* Add missing index

* Add missing feature test

* Fix rubocop issues

* Fix lint errors

* Fix broken specs

* Admin can mark question as mandatory

* Restore missing PRs in feature/surveys (#1421)

* Add custom styles

* Change from toc to tos

* Fix broken tests

* Fix typo

* Fix spec

* Fix rubocop issues

* Add Surveys engine MVP (#1364)

* Add engine skeleton

* Add feature test

* An admin can update a survey without questions

* Admin can add n questions to a survey

* Admin can edit survey questions

* An admin can remove questions from surveys

* Admin can publish a survey

* Minor refactor

* Users answer surveys

* Fix minor errors

* Rubocop

* Add model validations

* Fix minor things

* Fix hound complains

* Fix more complains

* Fix broken specs

* Add some feedback

* Add some permissions

* Add missing translation

* Fix rubocop issues

* Add tests to the CI

* Fix broken test suite

* Normalize locales

* Admin can mark question as mandatory (#1386)

* Admin can mark question as mandatory

* Users must respond mandatory questions

* Fix problems with poltergeist

* Fix rubocop complains

* Fix i18n-issues

* Add feedback

* Fix rubocop complains

* Huge refactor templates

* Fix rubocop issues

* Admins can select question type

* Factor out auto label position code

* Moar refactor

* Huge JS refactor

* Add dynamic answer options for a question

* Admin survey form working with dynamic answer options

* Single and multiple options working

* Fixed rubocop issues

* Fix i18n problems

* Ignore unused i18n

* Add ignore unused

* Add answer option default value

* Fix rectify problem

* Fix minor issues

* Fix a few bad merges

* Fix broken specs

* Add survey exports (#1417)

* Add user answers serializer

* Finish export and serializer

* Add admin feature specs

* Fix rubocop issues

* Add allow_answers step setting (#1430)

* Admin cannot modify questions if already answered

* Add step setting to allow/disallow answers

* Fix rubocop issues

* Replace answered? with questions_editable?

* Use available_locales instead of Decidim locales
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.

3 participants