decidim-forms 0.23.1 → 0.24.0.rc2
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 +13 -6
- 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/helpers/decidim/forms/admin/questionnaire_answers_helper.rb +5 -2
- 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/models/decidim/forms/questionnaire.rb +11 -0
- 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 +8 -2
- data/config/locales/cs.yml +10 -4
- data/config/locales/de.yml +10 -2
- data/config/locales/el.yml +1 -1
- data/config/locales/en.yml +8 -2
- data/config/locales/es-MX.yml +8 -2
- data/config/locales/es-PY.yml +8 -2
- data/config/locales/es.yml +8 -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 +10 -4
- data/config/locales/it.yml +1 -2
- data/config/locales/ja.yml +3 -3
- data/config/locales/lv.yml +1 -1
- data/config/locales/nl.yml +4 -5
- data/config/locales/no.yml +1 -1
- 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/si-LK.yml +1 -0
- data/config/locales/sv.yml +1 -2
- data/config/locales/sw-KE.yml +1 -0
- data/config/locales/tr-TR.yml +88 -1
- data/config/locales/zh-CN.yml +1 -2
- data/db/migrate/20201110152921_add_salt_to_decidim_forms_questionnaires.rb +16 -0
- 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 +13 -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 +10 -2
- data/lib/decidim/forms/version.rb +1 -1
- metadata +23 -18
- 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
@@ -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
|
@@ -16,7 +16,7 @@ module Decidim
|
|
16
16
|
def serialize
|
17
17
|
@answers.each_with_index.inject({}) do |serialized, (answer, idx)|
|
18
18
|
serialized.update(
|
19
|
-
answer_translated_attribute_name(:id) => answer.
|
19
|
+
answer_translated_attribute_name(:id) => answer.session_token,
|
20
20
|
answer_translated_attribute_name(:created_at) => answer.created_at.to_s(:db),
|
21
21
|
answer_translated_attribute_name(:ip_hash) => answer.ip_hash,
|
22
22
|
answer_translated_attribute_name(:user_status) => answer_translated_attribute_name(answer.decidim_user_id.present? ? "registered" : "unregistered"),
|
@@ -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,17 +1,17 @@
|
|
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.rc2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josep Jaume Rey Peroy
|
8
8
|
- Marc Riera Casals
|
9
9
|
- Oriol Gual Oliva
|
10
10
|
- Rubén González Valero
|
11
|
-
autorequire:
|
11
|
+
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2021-03-10 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.rc2
|
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.rc2
|
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.rc2
|
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.rc2
|
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.rc2
|
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.rc2
|
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
|
@@ -238,12 +236,14 @@ files:
|
|
238
236
|
- config/locales/pt.yml
|
239
237
|
- config/locales/ro-RO.yml
|
240
238
|
- config/locales/ru.yml
|
239
|
+
- config/locales/si-LK.yml
|
241
240
|
- config/locales/sk-SK.yml
|
242
241
|
- config/locales/sk.yml
|
243
242
|
- config/locales/sl.yml
|
244
243
|
- config/locales/so-SO.yml
|
245
244
|
- config/locales/sr-CS.yml
|
246
245
|
- config/locales/sv.yml
|
246
|
+
- config/locales/sw-KE.yml
|
247
247
|
- config/locales/ti-ER.yml
|
248
248
|
- config/locales/tr-TR.yml
|
249
249
|
- config/locales/uk.yml
|
@@ -261,7 +261,12 @@ files:
|
|
261
261
|
- db/migrate/20200130194123_create_decidim_forms_display_conditions.rb
|
262
262
|
- db/migrate/20200225123810_create_decidim_forms_question_matrix_rows.rb
|
263
263
|
- db/migrate/20200304152939_add_matrix_row_id_to_decidim_forms_answer_choices.rb
|
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
|
264
268
|
- lib/decidim/api/questionnaire_entity_interface.rb
|
269
|
+
- lib/decidim/api/questionnaire_type.rb
|
265
270
|
- lib/decidim/exporters/form_pdf.rb
|
266
271
|
- lib/decidim/exporters/form_pdf_controller_helper.rb
|
267
272
|
- lib/decidim/forms.rb
|
@@ -285,7 +290,7 @@ homepage: https://github.com/decidim/decidim
|
|
285
290
|
licenses:
|
286
291
|
- AGPL-3.0
|
287
292
|
metadata: {}
|
288
|
-
post_install_message:
|
293
|
+
post_install_message:
|
289
294
|
rdoc_options: []
|
290
295
|
require_paths:
|
291
296
|
- lib
|
@@ -293,15 +298,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
293
298
|
requirements:
|
294
299
|
- - ">="
|
295
300
|
- !ruby/object:Gem::Version
|
296
|
-
version: '2.
|
301
|
+
version: '2.7'
|
297
302
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
298
303
|
requirements:
|
299
|
-
- - "
|
304
|
+
- - ">"
|
300
305
|
- !ruby/object:Gem::Version
|
301
|
-
version:
|
306
|
+
version: 1.3.1
|
302
307
|
requirements: []
|
303
|
-
rubygems_version: 3.
|
304
|
-
signing_key:
|
308
|
+
rubygems_version: 3.1.2
|
309
|
+
signing_key:
|
305
310
|
specification_version: 4
|
306
311
|
summary: Decidim forms
|
307
312
|
test_files: []
|
@@ -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
|