decidim-forms 0.23.6 → 0.24.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/decidim/forms/forms.js.es6 +4 -4
- data/app/commands/decidim/forms/admin/update_questionnaire.rb +2 -1
- data/app/commands/decidim/forms/answer_questionnaire.rb +43 -1
- data/app/controllers/decidim/forms/admin/concerns/has_questionnaire.rb +10 -2
- data/app/controllers/decidim/forms/concerns/has_questionnaire.rb +10 -4
- data/app/forms/decidim/forms/admin/question_form.rb +2 -0
- data/app/forms/decidim/forms/answer_form.rb +27 -0
- data/app/helpers/decidim/forms/admin/application_helper.rb +1 -6
- data/app/helpers/decidim/forms/admin/concerns/has_questionnaire_answers_url_helper.rb +3 -3
- data/app/jobs/decidim/forms/export_questionnaire_answers_job.rb +1 -1
- data/app/models/decidim/forms/answer.rb +8 -0
- data/app/models/decidim/forms/question.rb +9 -3
- data/app/presenters/decidim/forms/admin/questionnaire_answer_presenter.rb +20 -0
- data/app/presenters/decidim/forms/admin/questionnaire_participant_presenter.rb +4 -4
- data/app/queries/decidim/forms/questionnaire_user_answers.rb +2 -1
- data/app/views/decidim/forms/admin/questionnaires/_form.html.erb +3 -3
- data/app/views/decidim/forms/admin/questionnaires/_question.html.erb +11 -0
- data/app/views/decidim/forms/admin/questionnaires/edit.html.erb +1 -1
- data/app/views/decidim/forms/questionnaires/_answer.html.erb +1 -1
- data/app/views/decidim/forms/questionnaires/answers/_files.html.erb +1 -0
- data/app/views/decidim/forms/questionnaires/answers/_long_answer.html.erb +1 -1
- data/app/views/decidim/forms/questionnaires/answers/_matrix_multiple.html.erb +2 -1
- data/app/views/decidim/forms/questionnaires/answers/_matrix_single.html.erb +2 -1
- data/app/views/decidim/forms/questionnaires/answers/_multiple_option.html.erb +2 -1
- data/app/views/decidim/forms/questionnaires/answers/_short_answer.html.erb +1 -1
- data/app/views/decidim/forms/questionnaires/answers/_single_option.html.erb +2 -1
- data/app/views/decidim/forms/questionnaires/show.html.erb +1 -1
- data/config/initializers/wicked_pdf.rb +2 -0
- data/config/locales/ca.yml +4 -2
- data/config/locales/cs.yml +8 -2
- data/config/locales/de.yml +8 -2
- data/config/locales/el.yml +1 -1
- data/config/locales/en.yml +8 -2
- data/config/locales/es-MX.yml +2 -2
- data/config/locales/es-PY.yml +2 -2
- data/config/locales/es.yml +2 -2
- data/config/locales/fi-plain.yml +8 -2
- data/config/locales/fi.yml +8 -2
- data/config/locales/fr-CA.yml +8 -2
- data/config/locales/fr.yml +8 -2
- data/config/locales/gl.yml +0 -3
- data/config/locales/it.yml +1 -2
- data/config/locales/ja.yml +2 -2
- data/config/locales/lv.yml +1 -1
- data/config/locales/nl.yml +4 -5
- data/config/locales/no.yml +1 -2
- data/config/locales/pl.yml +8 -2
- data/config/locales/pt.yml +1 -2
- data/config/locales/ro-RO.yml +1 -7
- data/config/locales/sv.yml +1 -4
- data/config/locales/tr-TR.yml +2 -2
- data/config/locales/zh-CN.yml +1 -2
- data/db/migrate/20210208094442_add_max_characters_to_decidim_forms_questions.rb +7 -0
- data/lib/decidim/api/answer_option_type.rb +13 -0
- data/lib/decidim/api/question_type.rb +21 -0
- data/lib/decidim/api/questionnaire_entity_interface.rb +5 -5
- data/lib/decidim/api/questionnaire_type.rb +19 -0
- data/lib/decidim/exporters/form_pdf_controller_helper.rb +2 -0
- data/lib/decidim/forms/api.rb +3 -0
- data/lib/decidim/forms/data_portability_user_answers_serializer.rb +7 -1
- data/lib/decidim/forms/test/factories.rb +12 -2
- data/lib/decidim/forms/test/shared_examples/has_questionnaire.rb +38 -5
- data/lib/decidim/forms/test/shared_examples/manage_questionnaires/add_display_conditions.rb +7 -3
- data/lib/decidim/forms/test/shared_examples/manage_questionnaires/add_questions.rb +1 -1
- data/lib/decidim/forms/test/shared_examples/manage_questionnaires/update_questions.rb +5 -0
- data/lib/decidim/forms/test/shared_examples/manage_questionnaires.rb +5 -4
- data/lib/decidim/forms/user_answers_serializer.rb +9 -1
- data/lib/decidim/forms/version.rb +1 -1
- data/lib/decidim/forms.rb +1 -1
- metadata +17 -15
- data/app/types/decidim/forms/answer_option_type.rb +0 -14
- data/app/types/decidim/forms/question_type.rb +0 -23
- data/app/types/decidim/forms/questionnaire_type.rb +0 -22
@@ -1,14 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Decidim
|
4
|
-
module Forms
|
5
|
-
AnswerOptionType = GraphQL::ObjectType.define do
|
6
|
-
name "AnswerOption"
|
7
|
-
description "An answer option for a multi-choice question in a questionnaire"
|
8
|
-
|
9
|
-
field :id, !types.ID, "ID of this answer option"
|
10
|
-
field :body, !Decidim::Core::TranslatedFieldType, "The text answer response option."
|
11
|
-
field :freeText, !types.Boolean, "Whether if this answer accepts any free text from the user.", property: :free_text
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Decidim
|
4
|
-
module Forms
|
5
|
-
QuestionType = GraphQL::ObjectType.define do
|
6
|
-
name "Question"
|
7
|
-
description "A question in a questionnaire"
|
8
|
-
|
9
|
-
interfaces [
|
10
|
-
-> { Decidim::Core::TimestampsInterface }
|
11
|
-
]
|
12
|
-
|
13
|
-
field :id, !types.ID, "ID of this question"
|
14
|
-
field :body, !Decidim::Core::TranslatedFieldType, "What is being asked in this question."
|
15
|
-
field :description, Decidim::Core::TranslatedFieldType, "The description of this question."
|
16
|
-
field :mandatory, !types.Boolean, "Whether if this question is mandatory."
|
17
|
-
field :position, types.Int, "Order position of the question in the questionnaire"
|
18
|
-
field :maxChoices, types.Int, "On questions with answer options, maximum number of choices the user has", property: :max_choices
|
19
|
-
field :questionType, types.String, "Type of question.", property: :question_type
|
20
|
-
field :answerOptions, !types[AnswerOptionType], "List of answer options in multi-choice questions.", property: :answer_options
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Decidim
|
4
|
-
module Forms
|
5
|
-
QuestionnaireType = GraphQL::ObjectType.define do
|
6
|
-
name "Questionnaire"
|
7
|
-
description "A questionnaire"
|
8
|
-
|
9
|
-
interfaces [
|
10
|
-
-> { Decidim::Core::TimestampsInterface }
|
11
|
-
]
|
12
|
-
|
13
|
-
field :id, !types.ID, "ID of this questionnaire"
|
14
|
-
field :title, !Decidim::Core::TranslatedFieldType, "The title of this questionnaire."
|
15
|
-
field :description, Decidim::Core::TranslatedFieldType, "The description of this questionnaire."
|
16
|
-
field :tos, Decidim::Core::TranslatedFieldType, "The Terms of Service for this questionnaire."
|
17
|
-
field :forType, types.String, "Type of entity using this questionnaire.", property: :questionnaire_for_type
|
18
|
-
field :forEntity, QuestionnaireEntityInterface, "Entity using this questionnaire.", property: :questionnaire_for
|
19
|
-
field :questions, !types[QuestionType], "Questions in this questionnaire."
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|