decidim-forms 0.23.3 → 0.24.0.rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 -1
- 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 +11 -2
- data/config/locales/pt.yml +1 -2
- data/config/locales/ro-RO.yml +1 -2
- data/config/locales/sv.yml +1 -2
- 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.rb +1 -1
- 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.rb +5 -4
- 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/user_answers_serializer.rb +9 -1
- data/lib/decidim/forms/version.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
data/lib/decidim/forms/api.rb
CHANGED
@@ -3,5 +3,8 @@
|
|
3
3
|
module Decidim
|
4
4
|
module Forms
|
5
5
|
autoload :QuestionnaireEntityInterface, "decidim/api/questionnaire_entity_interface"
|
6
|
+
autoload :AnswerOptionType, "decidim/api/answer_option_type"
|
7
|
+
autoload :QuestionType, "decidim/api/question_type"
|
8
|
+
autoload :QuestionnaireType, "decidim/api/questionnaire_type"
|
6
9
|
end
|
7
10
|
end
|
@@ -30,7 +30,13 @@ module Decidim
|
|
30
30
|
private
|
31
31
|
|
32
32
|
def normalize_body(resource)
|
33
|
-
resource.body || resource.choices.pluck(:body)
|
33
|
+
attachments_for(resource) || resource.body || resource.choices.pluck(:body)
|
34
|
+
end
|
35
|
+
|
36
|
+
def attachments_for(resource)
|
37
|
+
return if resource.attachments.blank?
|
38
|
+
|
39
|
+
resource.attachments.map(&:url)
|
34
40
|
end
|
35
41
|
end
|
36
42
|
end
|
@@ -17,10 +17,13 @@ FactoryBot.define do
|
|
17
17
|
|
18
18
|
trait :with_questions do
|
19
19
|
questions do
|
20
|
+
position = 0
|
20
21
|
qs = %w(short_answer long_answer).collect do |text_question_type|
|
21
|
-
build(:questionnaire_question, question_type: text_question_type)
|
22
|
+
q = build(:questionnaire_question, question_type: text_question_type, position: position)
|
23
|
+
position += 1
|
24
|
+
q
|
22
25
|
end
|
23
|
-
qs << build(:questionnaire_question, :with_answer_options, question_type: :single_option)
|
26
|
+
qs << build(:questionnaire_question, :with_answer_options, question_type: :single_option, position: position)
|
24
27
|
qs
|
25
28
|
end
|
26
29
|
end
|
@@ -91,6 +94,13 @@ FactoryBot.define do
|
|
91
94
|
question { create(:questionnaire_question, questionnaire: questionnaire) }
|
92
95
|
user { create(:user, organization: questionnaire.questionnaire_for.organization) }
|
93
96
|
session_token { Digest::MD5.hexdigest(user.id.to_s) }
|
97
|
+
|
98
|
+
trait :with_attachments do
|
99
|
+
after(:create) do |answer, _evaluator|
|
100
|
+
create :attachment, :with_image, attached_to: answer
|
101
|
+
create :attachment, :with_pdf, attached_to: answer
|
102
|
+
end
|
103
|
+
end
|
94
104
|
end
|
95
105
|
|
96
106
|
factory :answer_option, class: "Decidim::Forms::AnswerOption" do
|
@@ -194,6 +194,28 @@ shared_examples_for "has questionnaire" do
|
|
194
194
|
end
|
195
195
|
end
|
196
196
|
|
197
|
+
shared_examples_for "question has a character limit" do
|
198
|
+
context "when max_characters value is positive" do
|
199
|
+
let(:max_characters) { 30 }
|
200
|
+
|
201
|
+
it "shows a message indicating number of characters left" do
|
202
|
+
visit questionnaire_public_path
|
203
|
+
|
204
|
+
expect(page).to have_content("30 characters left")
|
205
|
+
end
|
206
|
+
end
|
207
|
+
|
208
|
+
context "when max_characters value is 0" do
|
209
|
+
let(:max_characters) { 0 }
|
210
|
+
|
211
|
+
it "doesn't show message indicating number of characters left" do
|
212
|
+
visit questionnaire_public_path
|
213
|
+
|
214
|
+
expect(page).not_to have_content("characters left")
|
215
|
+
end
|
216
|
+
end
|
217
|
+
end
|
218
|
+
|
197
219
|
describe "leaving a blank question (without js)", driver: :rack_test do
|
198
220
|
include_context "when a non multiple choice question is mandatory"
|
199
221
|
|
@@ -268,12 +290,13 @@ shared_examples_for "has questionnaire" do
|
|
268
290
|
|
269
291
|
describe "free text options" do
|
270
292
|
let(:answer_option_bodies) { Array.new(3) { Decidim::Faker::Localized.sentence } }
|
271
|
-
|
293
|
+
let(:max_characters) { 0 }
|
272
294
|
let!(:question) do
|
273
295
|
create(
|
274
296
|
:questionnaire_question,
|
275
297
|
questionnaire: questionnaire,
|
276
298
|
question_type: question_type,
|
299
|
+
max_characters: max_characters,
|
277
300
|
position: 1,
|
278
301
|
options: [
|
279
302
|
{ "body" => answer_option_bodies[0] },
|
@@ -346,6 +369,8 @@ shared_examples_for "has questionnaire" do
|
|
346
369
|
|
347
370
|
expect(page).to have_field("questionnaire_responses_0_choices_2_custom_body", with: "Cacatua")
|
348
371
|
end
|
372
|
+
|
373
|
+
it_behaves_like "question has a character limit"
|
349
374
|
end
|
350
375
|
|
351
376
|
context "when question is multiple_option type" do
|
@@ -392,27 +417,35 @@ shared_examples_for "has questionnaire" do
|
|
392
417
|
|
393
418
|
expect(page).to have_field("questionnaire_responses_0_choices_2_custom_body", with: "Cacatua")
|
394
419
|
end
|
420
|
+
|
421
|
+
it_behaves_like "question has a character limit"
|
395
422
|
end
|
396
423
|
end
|
397
424
|
|
398
425
|
context "when question type is long answer" do
|
399
|
-
let
|
426
|
+
let(:max_characters) { 0 }
|
427
|
+
let!(:question) { create(:questionnaire_question, questionnaire: questionnaire, question_type: "long_answer", max_characters: max_characters) }
|
400
428
|
|
401
429
|
it "renders the answer as a textarea" do
|
402
430
|
visit questionnaire_public_path
|
403
431
|
|
404
432
|
expect(page).to have_selector("textarea#questionnaire_responses_0")
|
405
433
|
end
|
434
|
+
|
435
|
+
it_behaves_like "question has a character limit"
|
406
436
|
end
|
407
437
|
|
408
438
|
context "when question type is short answer" do
|
409
|
-
let
|
439
|
+
let(:max_characters) { 0 }
|
440
|
+
let!(:question) { create(:questionnaire_question, questionnaire: questionnaire, question_type: "short_answer", max_characters: max_characters) }
|
410
441
|
|
411
442
|
it "renders the answer as a text field" do
|
412
443
|
visit questionnaire_public_path
|
413
444
|
|
414
445
|
expect(page).to have_selector("input[type=text]#questionnaire_responses_0")
|
415
446
|
end
|
447
|
+
|
448
|
+
it_behaves_like "question has a character limit"
|
416
449
|
end
|
417
450
|
|
418
451
|
context "when question type is single option" do
|
@@ -665,7 +698,7 @@ shared_examples_for "has questionnaire" do
|
|
665
698
|
end
|
666
699
|
|
667
700
|
radio_buttons = page.all(".radio-button-collection input[type=radio]")
|
668
|
-
expect(radio_buttons.
|
701
|
+
expect(radio_buttons.pluck(:checked)).to eq([nil, "true", nil, nil])
|
669
702
|
end
|
670
703
|
|
671
704
|
context "when the question is mandatory and the answer is not complete" do
|
@@ -830,7 +863,7 @@ shared_examples_for "has questionnaire" do
|
|
830
863
|
end
|
831
864
|
|
832
865
|
checkboxes = page.all(".check-box-collection input[type=checkbox]")
|
833
|
-
expect(checkboxes.
|
866
|
+
expect(checkboxes.pluck(:checked)).to eq(["true", "true", "true", nil, nil, "true"])
|
834
867
|
end
|
835
868
|
end
|
836
869
|
end
|
@@ -2,10 +2,10 @@
|
|
2
2
|
|
3
3
|
require "spec_helper"
|
4
4
|
|
5
|
-
require "decidim/forms/test/shared_examples/manage_questionnaires/add_questions
|
6
|
-
require "decidim/forms/test/shared_examples/manage_questionnaires/update_questions
|
7
|
-
require "decidim/forms/test/shared_examples/manage_questionnaires/add_display_conditions
|
8
|
-
require "decidim/forms/test/shared_examples/manage_questionnaires/update_display_conditions
|
5
|
+
require "decidim/forms/test/shared_examples/manage_questionnaires/add_questions"
|
6
|
+
require "decidim/forms/test/shared_examples/manage_questionnaires/update_questions"
|
7
|
+
require "decidim/forms/test/shared_examples/manage_questionnaires/add_display_conditions"
|
8
|
+
require "decidim/forms/test/shared_examples/manage_questionnaires/update_display_conditions"
|
9
9
|
|
10
10
|
shared_examples_for "manage questionnaires" do
|
11
11
|
let(:body) do
|
@@ -63,6 +63,7 @@ shared_examples_for "manage questionnaires" do
|
|
63
63
|
expect(page).to have_selector("input[value='This is the first question'][disabled]")
|
64
64
|
expect(page).to have_selector("select[id$=question_type][disabled]")
|
65
65
|
expect(page).to have_selector("select[id$=max_choices][disabled]")
|
66
|
+
expect(page).to have_selector("input[id$=max_characters][disabled]")
|
66
67
|
expect(page).to have_selector(".ql-editor[contenteditable=false]")
|
67
68
|
end
|
68
69
|
end
|
@@ -39,18 +39,21 @@ shared_examples_for "add display conditions" do
|
|
39
39
|
context "when questionnaire has more than one question" do
|
40
40
|
let!(:question_short_answer) do
|
41
41
|
create(:questionnaire_question,
|
42
|
+
position: 0,
|
42
43
|
questionnaire: questionnaire,
|
43
44
|
body: Decidim::Faker::Localized.sentence,
|
44
45
|
question_type: "short_answer")
|
45
46
|
end
|
46
47
|
let!(:question_long_answer) do
|
47
48
|
create(:questionnaire_question,
|
49
|
+
position: 1,
|
48
50
|
questionnaire: questionnaire,
|
49
51
|
body: Decidim::Faker::Localized.sentence,
|
50
52
|
question_type: "long_answer")
|
51
53
|
end
|
52
54
|
let!(:question_single_option) do
|
53
55
|
create(:questionnaire_question,
|
56
|
+
position: 2,
|
54
57
|
questionnaire: questionnaire,
|
55
58
|
body: Decidim::Faker::Localized.sentence,
|
56
59
|
question_type: "single_option",
|
@@ -58,6 +61,7 @@ shared_examples_for "add display conditions" do
|
|
58
61
|
end
|
59
62
|
let!(:question_multiple_option) do
|
60
63
|
create(:questionnaire_question,
|
64
|
+
position: 3,
|
61
65
|
questionnaire: questionnaire,
|
62
66
|
body: Decidim::Faker::Localized.sentence,
|
63
67
|
question_type: "multiple_option",
|
@@ -101,7 +105,7 @@ shared_examples_for "add display conditions" do
|
|
101
105
|
|
102
106
|
within "select[id$=decidim_condition_question_id]" do
|
103
107
|
elements = page.all("option[data-type]")
|
104
|
-
expect(elements.map { |element| element[:"data-type"] }).to
|
108
|
+
expect(elements.map { |element| element[:"data-type"] }).to match_array(questions.map(&:question_type))
|
105
109
|
expect(page.find("option[value='#{questions.last.id}']")).to be_disabled
|
106
110
|
end
|
107
111
|
end
|
@@ -117,7 +121,7 @@ shared_examples_for "add display conditions" do
|
|
117
121
|
option_elements = page.all("select[id$=condition_type] option")
|
118
122
|
option_elements = option_elements.to_a.reject { |option| option[:style].match? "display: none" }
|
119
123
|
|
120
|
-
expect(option_elements.map(&:text)).to
|
124
|
+
expect(option_elements.map(&:text)).to match_array(options)
|
121
125
|
end
|
122
126
|
end
|
123
127
|
end
|
@@ -132,7 +136,7 @@ shared_examples_for "add display conditions" do
|
|
132
136
|
option_elements = page.all("select[id$=condition_type] option")
|
133
137
|
option_elements = option_elements.to_a.reject { |option| option[:style].match? "display: none" }
|
134
138
|
|
135
|
-
expect(option_elements.map(&:text)).to
|
139
|
+
expect(option_elements.map(&:text)).to match_array(options)
|
136
140
|
end
|
137
141
|
end
|
138
142
|
end
|
@@ -41,7 +41,7 @@ shared_examples_for "add questions" do
|
|
41
41
|
within ".questionnaire-question" do
|
42
42
|
fill_in find_nested_form_field_locator("body_en"), with: "Body"
|
43
43
|
|
44
|
-
fill_in_editor find_nested_form_field_locator("description_en", visible: false), with: "<
|
44
|
+
fill_in_editor find_nested_form_field_locator("description_en", visible: false), with: "<strong>Superkalifragilistic description</strong>"
|
45
45
|
end
|
46
46
|
|
47
47
|
click_button "Save"
|
@@ -15,6 +15,7 @@ shared_examples_for "update questions" do
|
|
15
15
|
within "form.edit_questionnaire" do
|
16
16
|
within ".questionnaire-question" do
|
17
17
|
fill_in "questionnaire_questions_#{question.id}_body_en", with: "Modified question"
|
18
|
+
fill_in "questionnaire_questions_#{question.id}_max_characters", with: 30
|
18
19
|
check "Mandatory"
|
19
20
|
select "Long answer", from: "Type"
|
20
21
|
end
|
@@ -29,6 +30,7 @@ shared_examples_for "update questions" do
|
|
29
30
|
expect(page).to have_selector("input[value='Modified question']")
|
30
31
|
expect(page).to have_no_selector("input[value='This is the first question']")
|
31
32
|
expect(page).to have_selector("input#questionnaire_questions_#{question.id}_mandatory[checked]")
|
33
|
+
expect(page).to have_selector("input#questionnaire_questions_#{question.id}_max_characters[value='30']")
|
32
34
|
expect(page).to have_selector("select#questionnaire_questions_#{question.id}_question_type option[value='long_answer'][selected]")
|
33
35
|
end
|
34
36
|
|
@@ -39,6 +41,7 @@ shared_examples_for "update questions" do
|
|
39
41
|
within ".questionnaire-question" do
|
40
42
|
expect(page).to have_content("Statement*")
|
41
43
|
fill_in "questionnaire_questions_#{question.id}_body_en", with: ""
|
44
|
+
fill_in "questionnaire_questions_#{question.id}_max_characters", with: -3
|
42
45
|
check "Mandatory"
|
43
46
|
select "Matrix (Multiple option)", from: "Type"
|
44
47
|
select "2", from: "Maximum number of choices"
|
@@ -51,10 +54,12 @@ shared_examples_for "update questions" do
|
|
51
54
|
|
52
55
|
expect(page).to have_admin_callout("There was a problem saving")
|
53
56
|
expect(page).to have_content("can't be blank", count: 5) # emtpy question, 2 empty default answer options, 2 empty default matrix rows
|
57
|
+
expect(page).to have_content("must be greater than or equal to 0", count: 1)
|
54
58
|
|
55
59
|
expect(page).to have_selector("input[value='']")
|
56
60
|
expect(page).to have_no_selector("input[value='This is the first question']")
|
57
61
|
expect(page).to have_selector("input#questionnaire_questions_#{question.id}_mandatory[checked]")
|
62
|
+
expect(page).to have_selector("input#questionnaire_questions_#{question.id}_max_characters[value='-3']")
|
58
63
|
expect(page).to have_select("Maximum number of choices", selected: "2")
|
59
64
|
expect(page).to have_selector("select#questionnaire_questions_#{question.id}_question_type option[value='matrix_multiple'][selected]")
|
60
65
|
end
|
@@ -28,7 +28,15 @@ module Decidim
|
|
28
28
|
private
|
29
29
|
|
30
30
|
def normalize_body(answer)
|
31
|
-
answer.body ||
|
31
|
+
answer.body ||
|
32
|
+
normalize_attachments(answer) ||
|
33
|
+
normalize_choices(answer, answer.choices)
|
34
|
+
end
|
35
|
+
|
36
|
+
def normalize_attachments(answer)
|
37
|
+
return if answer.attachments.blank?
|
38
|
+
|
39
|
+
answer.attachments.map(&:url)
|
32
40
|
end
|
33
41
|
|
34
42
|
def normalize_choices(answer, choices)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: decidim-forms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.24.0.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josep Jaume Rey Peroy
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2021-
|
14
|
+
date: 2021-03-01 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: decidim-core
|
@@ -19,14 +19,14 @@ dependencies:
|
|
19
19
|
requirements:
|
20
20
|
- - '='
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 0.
|
22
|
+
version: 0.24.0.rc1
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
27
|
- - '='
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 0.
|
29
|
+
version: 0.24.0.rc1
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: wicked_pdf
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -61,28 +61,28 @@ dependencies:
|
|
61
61
|
requirements:
|
62
62
|
- - '='
|
63
63
|
- !ruby/object:Gem::Version
|
64
|
-
version: 0.
|
64
|
+
version: 0.24.0.rc1
|
65
65
|
type: :development
|
66
66
|
prerelease: false
|
67
67
|
version_requirements: !ruby/object:Gem::Requirement
|
68
68
|
requirements:
|
69
69
|
- - '='
|
70
70
|
- !ruby/object:Gem::Version
|
71
|
-
version: 0.
|
71
|
+
version: 0.24.0.rc1
|
72
72
|
- !ruby/object:Gem::Dependency
|
73
73
|
name: decidim-dev
|
74
74
|
requirement: !ruby/object:Gem::Requirement
|
75
75
|
requirements:
|
76
76
|
- - '='
|
77
77
|
- !ruby/object:Gem::Version
|
78
|
-
version: 0.
|
78
|
+
version: 0.24.0.rc1
|
79
79
|
type: :development
|
80
80
|
prerelease: false
|
81
81
|
version_requirements: !ruby/object:Gem::Requirement
|
82
82
|
requirements:
|
83
83
|
- - '='
|
84
84
|
- !ruby/object:Gem::Version
|
85
|
-
version: 0.
|
85
|
+
version: 0.24.0.rc1
|
86
86
|
description: A forms gem for decidim.
|
87
87
|
email:
|
88
88
|
- josepjaume@gmail.com
|
@@ -156,9 +156,6 @@ files:
|
|
156
156
|
- app/queries/decidim/forms/questionnaire_participant.rb
|
157
157
|
- app/queries/decidim/forms/questionnaire_participants.rb
|
158
158
|
- app/queries/decidim/forms/questionnaire_user_answers.rb
|
159
|
-
- app/types/decidim/forms/answer_option_type.rb
|
160
|
-
- app/types/decidim/forms/question_type.rb
|
161
|
-
- app/types/decidim/forms/questionnaire_type.rb
|
162
159
|
- app/views/decidim/forms/admin/questionnaires/_answer_option.html.erb
|
163
160
|
- app/views/decidim/forms/admin/questionnaires/_answer_option_template.html.erb
|
164
161
|
- app/views/decidim/forms/admin/questionnaires/_display_condition.html.erb
|
@@ -174,6 +171,7 @@ files:
|
|
174
171
|
- app/views/decidim/forms/admin/questionnaires/answers/show.html.erb
|
175
172
|
- app/views/decidim/forms/admin/questionnaires/edit.html.erb
|
176
173
|
- app/views/decidim/forms/questionnaires/_answer.html.erb
|
174
|
+
- app/views/decidim/forms/questionnaires/answers/_files.html.erb
|
177
175
|
- app/views/decidim/forms/questionnaires/answers/_long_answer.html.erb
|
178
176
|
- app/views/decidim/forms/questionnaires/answers/_matrix_multiple.html.erb
|
179
177
|
- app/views/decidim/forms/questionnaires/answers/_matrix_single.html.erb
|
@@ -264,7 +262,11 @@ files:
|
|
264
262
|
- db/migrate/20200225123810_create_decidim_forms_question_matrix_rows.rb
|
265
263
|
- db/migrate/20200304152939_add_matrix_row_id_to_decidim_forms_answer_choices.rb
|
266
264
|
- db/migrate/20201110152921_add_salt_to_decidim_forms_questionnaires.rb
|
265
|
+
- db/migrate/20210208094442_add_max_characters_to_decidim_forms_questions.rb
|
266
|
+
- lib/decidim/api/answer_option_type.rb
|
267
|
+
- lib/decidim/api/question_type.rb
|
267
268
|
- lib/decidim/api/questionnaire_entity_interface.rb
|
269
|
+
- lib/decidim/api/questionnaire_type.rb
|
268
270
|
- lib/decidim/exporters/form_pdf.rb
|
269
271
|
- lib/decidim/exporters/form_pdf_controller_helper.rb
|
270
272
|
- lib/decidim/forms.rb
|
@@ -296,14 +298,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
296
298
|
requirements:
|
297
299
|
- - ">="
|
298
300
|
- !ruby/object:Gem::Version
|
299
|
-
version: '2.
|
301
|
+
version: '2.7'
|
300
302
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
301
303
|
requirements:
|
302
|
-
- - "
|
304
|
+
- - ">"
|
303
305
|
- !ruby/object:Gem::Version
|
304
|
-
version:
|
306
|
+
version: 1.3.1
|
305
307
|
requirements: []
|
306
|
-
rubygems_version: 3.
|
308
|
+
rubygems_version: 3.1.2
|
307
309
|
signing_key:
|
308
310
|
specification_version: 4
|
309
311
|
summary: Decidim forms
|
@@ -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
|