decidim-forms 0.28.3 → 0.29.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/forms/question_readonly_cell.rb +0 -2
  3. data/app/cells/decidim/forms/step_navigation/show.erb +3 -3
  4. data/app/cells/decidim/forms/step_navigation_cell.rb +2 -3
  5. data/app/commands/decidim/forms/answer_questionnaire.rb +4 -4
  6. data/app/controllers/decidim/forms/concerns/has_questionnaire.rb +1 -1
  7. data/app/forms/decidim/forms/answer_form.rb +2 -2
  8. data/app/forms/decidim/forms/questionnaire_form.rb +1 -1
  9. data/app/helpers/decidim/forms/application_helper.rb +2 -2
  10. data/app/models/decidim/forms/answer_option.rb +1 -1
  11. data/app/models/decidim/forms/display_condition.rb +11 -3
  12. data/app/models/decidim/forms/question_matrix_row.rb +1 -1
  13. data/app/presenters/decidim/forms/admin/questionnaire_participant_presenter.rb +7 -7
  14. data/app/views/decidim/forms/admin/questionnaires/_answer_option.html.erb +1 -1
  15. data/app/views/decidim/forms/admin/questionnaires/_display_condition.html.erb +2 -2
  16. data/app/views/decidim/forms/admin/questionnaires/_matrix_row.html.erb +1 -1
  17. data/app/views/decidim/forms/admin/questionnaires/_question.html.erb +4 -4
  18. data/app/views/decidim/forms/admin/questionnaires/_separator.html.erb +4 -4
  19. data/app/views/decidim/forms/admin/questionnaires/_title_and_description.html.erb +4 -4
  20. data/config/initializers/wicked_pdf.rb +5 -5
  21. data/config/locales/ar.yml +0 -1
  22. data/config/locales/bg.yml +1 -2
  23. data/config/locales/ca.yml +1 -1
  24. data/config/locales/cs.yml +0 -1
  25. data/config/locales/de.yml +1 -1
  26. data/config/locales/el.yml +0 -2
  27. data/config/locales/en.yml +2 -2
  28. data/config/locales/es-MX.yml +2 -2
  29. data/config/locales/es-PY.yml +2 -2
  30. data/config/locales/es.yml +2 -2
  31. data/config/locales/eu.yml +1 -1
  32. data/config/locales/fi-plain.yml +1 -1
  33. data/config/locales/fi.yml +2 -2
  34. data/config/locales/fr-CA.yml +1 -1
  35. data/config/locales/fr.yml +1 -1
  36. data/config/locales/gl.yml +0 -1
  37. data/config/locales/hu.yml +3 -4
  38. data/config/locales/id-ID.yml +0 -1
  39. data/config/locales/it.yml +0 -1
  40. data/config/locales/ja.yml +1 -1
  41. data/config/locales/lb.yml +0 -1
  42. data/config/locales/lt.yml +0 -2
  43. data/config/locales/lv.yml +0 -1
  44. data/config/locales/nl.yml +0 -1
  45. data/config/locales/no.yml +0 -1
  46. data/config/locales/pl.yml +1 -1
  47. data/config/locales/pt-BR.yml +0 -1
  48. data/config/locales/pt.yml +0 -1
  49. data/config/locales/ro-RO.yml +0 -2
  50. data/config/locales/sk.yml +0 -1
  51. data/config/locales/sv.yml +29 -47
  52. data/config/locales/tr-TR.yml +0 -1
  53. data/config/locales/zh-CN.yml +0 -1
  54. data/config/locales/zh-TW.yml +0 -2
  55. data/db/migrate/20240402092039_add_answer_options_counter_cache_to_questions.rb +16 -0
  56. data/db/migrate/20240402095253_add_matrix_row_counter_cache_to_questions.rb +16 -0
  57. data/db/migrate/20240416111953_add_display_conditions_counter_cache_to_questions.rb +16 -0
  58. data/db/migrate/20240416113926_add_display_conditions_for_other_questions_counter_cache_to_questions.rb +16 -0
  59. data/decidim-forms.gemspec +1 -1
  60. data/lib/decidim/forms/test/shared_examples/has_questionnaire.rb +44 -44
  61. data/lib/decidim/forms/test/shared_examples/manage_questionnaire_answers.rb +12 -12
  62. data/lib/decidim/forms/test/shared_examples/manage_questionnaires/add_display_conditions.rb +10 -10
  63. data/lib/decidim/forms/test/shared_examples/manage_questionnaires/add_questions.rb +85 -85
  64. data/lib/decidim/forms/test/shared_examples/manage_questionnaires/update_display_conditions.rb +8 -8
  65. data/lib/decidim/forms/test/shared_examples/manage_questionnaires/update_questions.rb +82 -82
  66. data/lib/decidim/forms/test/shared_examples/manage_questionnaires.rb +9 -9
  67. data/lib/decidim/forms/version.rb +1 -1
  68. metadata +16 -12
@@ -20,18 +20,18 @@ shared_examples_for "update questions" do
20
20
  select "Long answer", from: "Type"
21
21
  end
22
22
 
23
- click_button "Save"
23
+ click_on "Save"
24
24
  end
25
25
 
26
26
  expect(page).to have_admin_callout("successfully")
27
27
 
28
28
  visit_questionnaire_edit_path_and_expand_all
29
29
 
30
- expect(page).to have_selector("input[value='Modified question']")
31
- expect(page).not_to have_selector("input[value='This is the first question']")
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']")
34
- expect(page).to have_selector("select#questionnaire_questions_#{question.id}_question_type option[value='long_answer'][selected]")
30
+ expect(page).to have_css("input[value='Modified question']")
31
+ expect(page).to have_no_css("input[value='This is the first question']")
32
+ expect(page).to have_css("input#questionnaire_questions_#{question.id}_mandatory[checked]")
33
+ expect(page).to have_css("input#questionnaire_questions_#{question.id}_max_characters[value='30']")
34
+ expect(page).to have_css("select#questionnaire_questions_#{question.id}_question_type option[value='long_answer'][selected]")
35
35
  end
36
36
 
37
37
  it "re-renders the form when the information is invalid and displays errors" do
@@ -47,49 +47,49 @@ shared_examples_for "update questions" do
47
47
  select "2", from: "Maximum number of choices"
48
48
  end
49
49
 
50
- click_button "Save"
50
+ click_on "Save"
51
51
  end
52
52
 
53
53
  expand_all_questions
54
54
 
55
55
  expect(page).to have_admin_callout("There was a problem saving")
56
- expect(page).to have_content("cannot be blank", count: 5) # emtpy question, 2 empty default answer options, 2 empty default matrix rows
56
+ expect(page).to have_content("cannot be blank", count: 5) # empty question, 2 empty default answer options, 2 empty default matrix rows
57
57
  expect(page).to have_content("must be greater than or equal to 0", count: 1)
58
58
 
59
- expect(page).to have_selector("input[value='']")
60
- expect(page).not_to have_selector("input[value='This is the first question']")
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']")
59
+ expect(page).to have_css("input[value='']")
60
+ expect(page).to have_no_css("input[value='This is the first question']")
61
+ expect(page).to have_css("input#questionnaire_questions_#{question.id}_mandatory[checked]")
62
+ expect(page).to have_css("input#questionnaire_questions_#{question.id}_max_characters[value='-3']")
63
63
  expect(page).to have_select("Maximum number of choices", selected: "2")
64
- expect(page).to have_selector("select#questionnaire_questions_#{question.id}_question_type option[value='matrix_multiple'][selected]")
64
+ expect(page).to have_css("select#questionnaire_questions_#{question.id}_question_type option[value='matrix_multiple'][selected]")
65
65
  end
66
66
 
67
67
  it "preserves deleted status across submission failures" do
68
68
  within "form.edit_questionnaire" do
69
69
  within ".questionnaire-question" do
70
- click_button "Remove"
70
+ click_on "Remove"
71
71
  end
72
72
  end
73
73
 
74
- click_button "Add question"
74
+ click_on "Add question"
75
75
 
76
- click_button "Save"
76
+ click_on "Save"
77
77
 
78
- expect(page).to have_selector(".questionnaire-question", count: 1)
78
+ expect(page).to have_css(".questionnaire-question", count: 1)
79
79
 
80
80
  within ".questionnaire-question" do
81
- expect(page).to have_selector(".card-title", text: "#1")
82
- expect(page).not_to have_button("Up")
81
+ expect(page).to have_css(".card-title", text: "#1")
82
+ expect(page).to have_no_button("Up")
83
83
  end
84
84
  end
85
85
 
86
86
  it "removes the question" do
87
87
  within "form.edit_questionnaire" do
88
88
  within ".questionnaire-question" do
89
- click_button "Remove"
89
+ click_on "Remove"
90
90
  end
91
91
 
92
- click_button "Save"
92
+ click_on "Save"
93
93
  end
94
94
 
95
95
  expect(page).to have_admin_callout("successfully")
@@ -97,14 +97,14 @@ shared_examples_for "update questions" do
97
97
  visit questionnaire_edit_path
98
98
 
99
99
  within "form.edit_questionnaire" do
100
- expect(page).to have_selector(".questionnaire-question", count: 0)
100
+ expect(page).to have_css(".questionnaire-question", count: 0)
101
101
  end
102
102
  end
103
103
 
104
104
  it "cannot be moved up" do
105
105
  within "form.edit_questionnaire" do
106
106
  within ".questionnaire-question" do
107
- expect(page).not_to have_button("Up")
107
+ expect(page).to have_no_button("Up")
108
108
  end
109
109
  end
110
110
  end
@@ -112,7 +112,7 @@ shared_examples_for "update questions" do
112
112
  it "cannot be moved down" do
113
113
  within "form.edit_questionnaire" do
114
114
  within ".questionnaire-question" do
115
- expect(page).not_to have_button("Down")
115
+ expect(page).to have_no_button("Down")
116
116
  end
117
117
  end
118
118
  end
@@ -132,15 +132,15 @@ shared_examples_for "update questions" do
132
132
  fill_in "questionnaire_questions_#{question.id}_body_en", with: "Modified title and description"
133
133
  end
134
134
 
135
- click_button "Save"
135
+ click_on "Save"
136
136
  end
137
137
 
138
138
  expect(page).to have_admin_callout("successfully")
139
139
 
140
140
  visit_questionnaire_edit_path_and_expand_all
141
141
 
142
- expect(page).to have_selector("input[value='Modified title and description']")
143
- expect(page).not_to have_selector("input[value='This is the first title and description']")
142
+ expect(page).to have_css("input[value='Modified title and description']")
143
+ expect(page).to have_no_css("input[value='This is the first title and description']")
144
144
  end
145
145
 
146
146
  it "re-renders the form when the information is invalid and displays errors" do
@@ -151,43 +151,43 @@ shared_examples_for "update questions" do
151
151
  fill_in "questionnaire_questions_#{question.id}_body_en", with: ""
152
152
  end
153
153
 
154
- click_button "Save"
154
+ click_on "Save"
155
155
  end
156
156
 
157
157
  expand_all_questions
158
158
 
159
159
  expect(page).to have_admin_callout("There was a problem saving")
160
160
  expect(page).to have_content("cannot be blank", count: 1)
161
- expect(page).to have_selector("input[value='']")
162
- expect(page).not_to have_selector("input[value='This is the first title and description']")
161
+ expect(page).to have_css("input[value='']")
162
+ expect(page).to have_no_css("input[value='This is the first title and description']")
163
163
  end
164
164
 
165
165
  it "preserves deleted status across submission failures" do
166
166
  within "form.edit_questionnaire" do
167
167
  within ".questionnaire-question" do
168
- click_button "Remove"
168
+ click_on "Remove"
169
169
  end
170
170
  end
171
171
 
172
- click_button "Add question"
172
+ click_on "Add question"
173
173
 
174
- click_button "Save"
174
+ click_on "Save"
175
175
 
176
- expect(page).to have_selector(".questionnaire-question", count: 1)
176
+ expect(page).to have_css(".questionnaire-question", count: 1)
177
177
 
178
178
  within ".questionnaire-question" do
179
- expect(page).to have_selector(".card-title", text: "#1")
180
- expect(page).not_to have_button("Up")
179
+ expect(page).to have_css(".card-title", text: "#1")
180
+ expect(page).to have_no_button("Up")
181
181
  end
182
182
  end
183
183
 
184
184
  it "removes the question" do
185
185
  within "form.edit_questionnaire" do
186
186
  within ".questionnaire-question" do
187
- click_button "Remove"
187
+ click_on "Remove"
188
188
  end
189
189
 
190
- click_button "Save"
190
+ click_on "Save"
191
191
  end
192
192
 
193
193
  expect(page).to have_admin_callout("successfully")
@@ -195,14 +195,14 @@ shared_examples_for "update questions" do
195
195
  visit questionnaire_edit_path
196
196
 
197
197
  within "form.edit_questionnaire" do
198
- expect(page).to have_selector(".questionnaire-question", count: 0)
198
+ expect(page).to have_css(".questionnaire-question", count: 0)
199
199
  end
200
200
  end
201
201
 
202
202
  it "cannot be moved up" do
203
203
  within "form.edit_questionnaire" do
204
204
  within ".questionnaire-question" do
205
- expect(page).not_to have_button("Up")
205
+ expect(page).to have_no_button("Up")
206
206
  end
207
207
  end
208
208
  end
@@ -210,7 +210,7 @@ shared_examples_for "update questions" do
210
210
  it "cannot be moved down" do
211
211
  within "form.edit_questionnaire" do
212
212
  within ".questionnaire-question" do
213
- expect(page).not_to have_button("Down")
213
+ expect(page).to have_no_button("Down")
214
214
  end
215
215
  end
216
216
  end
@@ -240,19 +240,19 @@ shared_examples_for "update questions" do
240
240
  expand_all_questions
241
241
 
242
242
  within ".questionnaire-question-answer-option:last-of-type" do
243
- click_button "Remove"
243
+ click_on "Remove"
244
244
  end
245
245
 
246
- click_button "Save"
246
+ click_on "Save"
247
247
 
248
248
  visit_questionnaire_edit_path_and_expand_all
249
249
 
250
- expect(page).to have_selector(".questionnaire-question-answer-option", count: 2)
250
+ expect(page).to have_css(".questionnaire-question-answer-option", count: 2)
251
251
  end
252
252
 
253
253
  it "still removes the question even if previous editions rendered the options invalid" do
254
254
  within "form.edit_questionnaire" do
255
- expect(page).to have_selector(".questionnaire-question", count: 1)
255
+ expect(page).to have_css(".questionnaire-question", count: 1)
256
256
 
257
257
  expand_all_questions
258
258
 
@@ -261,10 +261,10 @@ shared_examples_for "update questions" do
261
261
  end
262
262
 
263
263
  within ".questionnaire-question" do
264
- click_button "Remove", match: :first
264
+ click_on "Remove", match: :first
265
265
  end
266
266
 
267
- click_button "Save"
267
+ click_on "Save"
268
268
  end
269
269
 
270
270
  expect(page).to have_admin_callout("successfully")
@@ -272,7 +272,7 @@ shared_examples_for "update questions" do
272
272
  visit_questionnaire_edit_path_and_expand_all
273
273
 
274
274
  within "form.edit_questionnaire" do
275
- expect(page).to have_selector(".questionnaire-question", count: 0)
275
+ expect(page).to have_css(".questionnaire-question", count: 0)
276
276
  end
277
277
  end
278
278
  end
@@ -305,32 +305,32 @@ shared_examples_for "update questions" do
305
305
 
306
306
  it "allows deleting matrix rows" do
307
307
  within ".questionnaire-question-matrix-row:last-of-type" do
308
- click_button "Remove"
308
+ click_on "Remove"
309
309
  end
310
310
 
311
- click_button "Save"
311
+ click_on "Save"
312
312
 
313
313
  visit_questionnaire_edit_path_and_expand_all
314
314
 
315
315
  within ".questionnaire-question:last-of-type" do
316
- expect(page).to have_selector(".questionnaire-question-matrix-row", count: 2)
317
- expect(page).to have_selector(".questionnaire-question-answer-option", count: 3)
316
+ expect(page).to have_css(".questionnaire-question-matrix-row", count: 2)
317
+ expect(page).to have_css(".questionnaire-question-answer-option", count: 3)
318
318
  end
319
319
  end
320
320
 
321
321
  it "still removes the question even if previous editions rendered the rows invalid" do
322
322
  within "form.edit_questionnaire" do
323
- expect(page).to have_selector(".questionnaire-question", count: 2)
323
+ expect(page).to have_css(".questionnaire-question", count: 2)
324
324
 
325
325
  within ".questionnaire-question-matrix-row:first-of-type" do
326
326
  fill_in find_nested_form_field_locator("body_en"), with: ""
327
327
  end
328
328
 
329
329
  within ".questionnaire-question:last-of-type" do
330
- click_button "Remove", match: :first
330
+ click_on "Remove", match: :first
331
331
  end
332
332
 
333
- click_button "Save"
333
+ click_on "Save"
334
334
  end
335
335
 
336
336
  expect(page).to have_admin_callout("successfully")
@@ -338,7 +338,7 @@ shared_examples_for "update questions" do
338
338
  visit_questionnaire_edit_path_and_expand_all
339
339
 
340
340
  within "form.edit_questionnaire" do
341
- expect(page).to have_selector(".questionnaire-question", count: 1)
341
+ expect(page).to have_css(".questionnaire-question", count: 1)
342
342
  end
343
343
  end
344
344
  end
@@ -382,7 +382,7 @@ shared_examples_for "update questions" do
382
382
  context "when moving a question up" do
383
383
  before do
384
384
  within ".questionnaire-question:last-of-type" do
385
- click_button "Up"
385
+ click_on "Up"
386
386
  end
387
387
  end
388
388
 
@@ -392,7 +392,7 @@ shared_examples_for "update questions" do
392
392
  context "when moving a question down" do
393
393
  before do
394
394
  within ".questionnaire-question:first-of-type" do
395
- click_button "Down"
395
+ click_on "Down"
396
396
  end
397
397
  end
398
398
 
@@ -402,30 +402,30 @@ shared_examples_for "update questions" do
402
402
  describe "collapsible questions" do
403
403
  context "when clicking on Expand all button" do
404
404
  it "expands all questions" do
405
- click_button "Expand all questions"
406
- expect(page).to have_selector(".collapsible", visible: :all)
407
- expect(page).to have_selector(".question--collapse .icon-collapse", count: questionnaire.questions.count)
405
+ click_on "Expand all questions"
406
+ expect(page).to have_css(".collapsible", visible: :all)
407
+ expect(page).to have_css(".question--collapse .icon-collapse", count: questionnaire.questions.count)
408
408
  end
409
409
  end
410
410
 
411
411
  context "when clicking on Collapse all button" do
412
412
  it "collapses all questions" do
413
- click_button "Collapse all questions"
414
- expect(page).not_to have_selector(".collapsible", visible: :visible)
415
- expect(page).to have_selector(".question--collapse .icon-expand", count: questionnaire.questions.count)
413
+ click_on "Collapse all questions"
414
+ expect(page).to have_no_css(".collapsible", visible: :visible)
415
+ expect(page).to have_css(".question--collapse .icon-expand", count: questionnaire.questions.count)
416
416
  end
417
417
  end
418
418
 
419
419
  shared_examples_for "collapsing a question" do
420
420
  it "changes the toggle button" do
421
421
  within ".questionnaire-question:last-of-type" do
422
- expect(page).to have_selector(".icon-expand")
422
+ expect(page).to have_css(".icon-expand")
423
423
  end
424
424
  end
425
425
 
426
426
  it "hides the question card section" do
427
427
  within ".questionnaire-question:last-of-type" do
428
- expect(page).not_to have_selector(".collapsible", visible: :visible)
428
+ expect(page).to have_no_css(".collapsible", visible: :visible)
429
429
  end
430
430
  end
431
431
  end
@@ -433,12 +433,12 @@ shared_examples_for "update questions" do
433
433
  shared_examples_for "uncollapsing a question" do
434
434
  it "changes the toggle button" do
435
435
  within ".questionnaire-question:last-of-type" do
436
- expect(page).to have_selector(".icon-collapse")
436
+ expect(page).to have_css(".icon-collapse")
437
437
  end
438
438
  end
439
439
 
440
440
  it "shows the question card section" do
441
- expect(page).to have_selector(".collapsible", visible: :visible)
441
+ expect(page).to have_css(".collapsible", visible: :visible)
442
442
  end
443
443
  end
444
444
 
@@ -455,7 +455,7 @@ shared_examples_for "update questions" do
455
455
 
456
456
  context "when adding a new question" do
457
457
  before do
458
- click_button "Add question"
458
+ click_on "Add question"
459
459
  expand_all_questions
460
460
 
461
461
  within ".questionnaire-question:last-of-type" do
@@ -468,8 +468,8 @@ shared_examples_for "update questions" do
468
468
 
469
469
  context "when submitting a new question with an error" do
470
470
  before do
471
- click_button "Add question"
472
- click_button "Save"
471
+ click_on "Add question"
472
+ click_on "Save"
473
473
 
474
474
  within ".questionnaire-question:last-of-type" do
475
475
  page.find(".question--collapse").click
@@ -484,14 +484,14 @@ shared_examples_for "update questions" do
484
484
  end
485
485
 
486
486
  within ".questionnaire-question:last-of-type" do
487
- expect(page).to have_selector(".icon-collapse")
487
+ expect(page).to have_css(".icon-collapse")
488
488
  end
489
489
  end
490
490
  end
491
491
  end
492
492
 
493
493
  it "properly decides which button to show after adding/removing questions" do
494
- click_button "Add question"
494
+ click_on "Add question"
495
495
  expand_all_questions
496
496
 
497
497
  expect(page.find(".questionnaire-question:nth-of-type(1)")).to look_like_first_question
@@ -499,7 +499,7 @@ shared_examples_for "update questions" do
499
499
  expect(page.find(".questionnaire-question:nth-of-type(3)")).to look_like_last_question
500
500
 
501
501
  within ".questionnaire-question:first-of-type" do
502
- click_button "Remove"
502
+ click_on "Remove"
503
503
  end
504
504
 
505
505
  expect(page.all(".questionnaire-question").first).to look_like_first_question
@@ -508,41 +508,41 @@ shared_examples_for "update questions" do
508
508
 
509
509
  it "does not duplicate editors when adding new questions" do
510
510
  expect do
511
- click_button "Add question"
511
+ click_on "Add question"
512
512
  expand_all_questions
513
513
  end.to change { page.all(".editor-toolbar").size }.by(1)
514
514
  end
515
515
 
516
516
  it "properly decides which button to show after adding/removing answer options" do
517
- click_button "Add question"
517
+ click_on "Add question"
518
518
  expand_all_questions
519
519
 
520
520
  within ".questionnaire-question:last-of-type" do
521
521
  select "Single option", from: "Type"
522
522
 
523
523
  within ".questionnaire-question-answer-options-list" do
524
- expect(page).not_to have_button("Remove")
524
+ expect(page).to have_no_button("Remove")
525
525
  end
526
526
 
527
- click_button "Add answer option"
527
+ click_on "Add answer option"
528
528
 
529
529
  expect(page.all(".questionnaire-question-answer-option")).to all(have_button("Remove"))
530
530
 
531
531
  within ".questionnaire-question-answer-option:first-of-type" do
532
- click_button "Remove"
532
+ click_on "Remove"
533
533
  end
534
534
 
535
535
  within ".questionnaire-question-answer-options-list" do
536
- expect(page).not_to have_button("Remove")
536
+ expect(page).to have_no_button("Remove")
537
537
  end
538
538
  end
539
539
 
540
- click_button "Save"
540
+ click_on "Save"
541
541
  expand_all_questions
542
542
 
543
543
  within ".questionnaire-question:last-of-type" do
544
544
  within ".questionnaire-question-answer-options-list" do
545
- expect(page).not_to have_button("Remove")
545
+ expect(page).to have_no_button("Remove")
546
546
  end
547
547
  end
548
548
  end
@@ -35,7 +35,7 @@ shared_examples_for "manage questionnaires" do
35
35
 
36
36
  within "form.edit_questionnaire" do
37
37
  fill_in_i18n_editor(:questionnaire_description, "#questionnaire-description-tabs", new_description)
38
- click_button "Save"
38
+ click_on "Save"
39
39
  end
40
40
 
41
41
  expect(page).to have_admin_callout("successfully")
@@ -63,16 +63,16 @@ shared_examples_for "manage questionnaires" do
63
63
  it "cannot modify questionnaire questions" do
64
64
  visit questionnaire_edit_path
65
65
 
66
- expect(page).not_to have_content("Add question")
67
- expect(page).not_to have_content("Remove")
66
+ expect(page).to have_no_content("Add question")
67
+ expect(page).to have_no_content("Remove")
68
68
 
69
69
  expand_all_questions
70
70
 
71
- expect(page).to have_selector("input[value='This is the first question'][disabled]")
72
- expect(page).to have_selector("select[id$=question_type][disabled]")
73
- expect(page).to have_selector("select[id$=max_choices][disabled]")
74
- expect(page).to have_selector("input[id$=max_characters][disabled]")
75
- expect(page).to have_selector(".ProseMirror[contenteditable=false]")
71
+ expect(page).to have_css("input[value='This is the first question'][disabled]")
72
+ expect(page).to have_css("select[id$=question_type][disabled]")
73
+ expect(page).to have_css("select[id$=max_choices][disabled]")
74
+ expect(page).to have_css("input[id$=max_characters][disabled]")
75
+ expect(page).to have_css(".ProseMirror[contenteditable=false]")
76
76
  end
77
77
  end
78
78
 
@@ -100,7 +100,7 @@ shared_examples_for "manage questionnaires" do
100
100
 
101
101
  def within_add_display_condition
102
102
  within ".questionnaire-question:last-of-type" do
103
- click_button "Add display condition"
103
+ click_on "Add display condition"
104
104
 
105
105
  within ".questionnaire-question-display-condition:last-of-type" do
106
106
  yield
@@ -4,7 +4,7 @@ module Decidim
4
4
  # This holds the decidim-forms version.
5
5
  module Forms
6
6
  def self.version
7
- "0.28.3"
7
+ "0.29.0.rc1"
8
8
  end
9
9
  end
10
10
  end
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.28.3
4
+ version: 0.29.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: 2024-09-10 00:00:00.000000000 Z
14
+ date: 2024-07-16 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.28.3
22
+ version: 0.29.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.28.3
29
+ version: 0.29.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.28.3
64
+ version: 0.29.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.28.3
71
+ version: 0.29.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.28.3
78
+ version: 0.29.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.28.3
85
+ version: 0.29.0.rc1
86
86
  description: A forms gem for decidim.
87
87
  email:
88
88
  - josepjaume@gmail.com
@@ -282,6 +282,10 @@ files:
282
282
  - db/migrate/20201110152921_add_salt_to_decidim_forms_questionnaires.rb
283
283
  - db/migrate/20210208094442_add_max_characters_to_decidim_forms_questions.rb
284
284
  - db/migrate/20210616153042_set_position_to_question_matrix_rows.rb
285
+ - db/migrate/20240402092039_add_answer_options_counter_cache_to_questions.rb
286
+ - db/migrate/20240402095253_add_matrix_row_counter_cache_to_questions.rb
287
+ - db/migrate/20240416111953_add_display_conditions_counter_cache_to_questions.rb
288
+ - db/migrate/20240416113926_add_display_conditions_for_other_questions_counter_cache_to_questions.rb
285
289
  - decidim-forms.gemspec
286
290
  - lib/decidim/api/answer_option_type.rb
287
291
  - lib/decidim/api/question_type.rb
@@ -323,14 +327,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
323
327
  requirements:
324
328
  - - "~>"
325
329
  - !ruby/object:Gem::Version
326
- version: 3.1.0
330
+ version: 3.2.0
327
331
  required_rubygems_version: !ruby/object:Gem::Requirement
328
332
  requirements:
329
- - - ">="
333
+ - - ">"
330
334
  - !ruby/object:Gem::Version
331
- version: '0'
335
+ version: 1.3.1
332
336
  requirements: []
333
- rubygems_version: 3.3.7
337
+ rubygems_version: 3.4.10
334
338
  signing_key:
335
339
  specification_version: 4
336
340
  summary: Decidim forms