decidim-forms 0.29.6 → 0.29.7

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.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/app/views/decidim/forms/admin/questionnaires/_question.html.erb +11 -1
  3. data/app/views/decidim/forms/admin/questionnaires/_separator.html.erb +10 -3
  4. data/app/views/decidim/forms/admin/questionnaires/_title_and_description.html.erb +11 -1
  5. data/config/locales/ar.yml +7 -0
  6. data/config/locales/bg.yml +6 -0
  7. data/config/locales/ca-IT.yml +6 -0
  8. data/config/locales/ca.yml +6 -0
  9. data/config/locales/cs.yml +6 -0
  10. data/config/locales/de.yml +6 -0
  11. data/config/locales/el.yml +6 -0
  12. data/config/locales/en.yml +6 -0
  13. data/config/locales/es-MX.yml +6 -0
  14. data/config/locales/es-PY.yml +6 -0
  15. data/config/locales/es.yml +6 -0
  16. data/config/locales/eu.yml +8 -2
  17. data/config/locales/fi-plain.yml +6 -0
  18. data/config/locales/fi.yml +6 -0
  19. data/config/locales/fr-CA.yml +6 -0
  20. data/config/locales/fr.yml +6 -0
  21. data/config/locales/ga-IE.yml +7 -0
  22. data/config/locales/gl.yml +7 -0
  23. data/config/locales/hu.yml +7 -0
  24. data/config/locales/id-ID.yml +8 -0
  25. data/config/locales/it.yml +7 -0
  26. data/config/locales/ja.yml +6 -0
  27. data/config/locales/lb.yml +7 -0
  28. data/config/locales/lt.yml +6 -0
  29. data/config/locales/lv.yml +7 -0
  30. data/config/locales/nl.yml +6 -0
  31. data/config/locales/no.yml +6 -0
  32. data/config/locales/pl.yml +6 -0
  33. data/config/locales/pt-BR.yml +6 -0
  34. data/config/locales/pt.yml +7 -0
  35. data/config/locales/ro-RO.yml +6 -0
  36. data/config/locales/ru.yml +8 -0
  37. data/config/locales/sk.yml +8 -0
  38. data/config/locales/sv.yml +6 -0
  39. data/config/locales/tr-TR.yml +7 -0
  40. data/config/locales/zh-CN.yml +7 -0
  41. data/config/locales/zh-TW.yml +6 -0
  42. data/lib/decidim/forms/test/shared_examples/manage_questionnaires/update_questions.rb +25 -122
  43. data/lib/decidim/forms/test/shared_examples/manage_questionnaires.rb +0 -5
  44. data/lib/decidim/forms/version.rb +1 -1
  45. metadata +8 -8
@@ -72,13 +72,20 @@ lb:
72
72
  any: Irgendein
73
73
  collapse: Zouklappen
74
74
  description: Beschreiwung
75
+ down: Runter
75
76
  expand: Ausklappen
76
77
  question: Fro
77
78
  remove: Löschen
78
79
  statement: Aussage
80
+ up: Hoch
79
81
  separator:
82
+ down: Runter
80
83
  remove: Löschen
81
84
  separator: Trennzeichen
85
+ up: Hoch
86
+ title_and_description:
87
+ down: Runter
88
+ up: Hoch
82
89
  update:
83
90
  invalid: Beim Speichern des Fragebogens sind Fehler aufgetreten.
84
91
  success: Formular erfolgreich gespeichert.
@@ -76,20 +76,26 @@ lt:
76
76
  any: Bet koks
77
77
  collapse: Suskleisti
78
78
  description: Aprašymas
79
+ down: Žemyn
79
80
  expand: Išplėsti
80
81
  question: Klausimas
81
82
  remove: Pašalinti
82
83
  statement: Pareiškimas
84
+ up: Į viršų
83
85
  separator:
86
+ down: Žemyn
84
87
  remove: Pašalinti
85
88
  separator: Skirtukas
89
+ up: Į viršų
86
90
  title_and_description:
87
91
  collapse: Suskleisti
88
92
  description: Aprašymas
93
+ down: Žemyn
89
94
  expand: Išplėsti
90
95
  remove: Pašalinti
91
96
  title: Pavadinimas
92
97
  title_and_description: Pavadinimas ir aprašymas
98
+ up: Į viršų
93
99
  update:
94
100
  invalid: Išsaugant šią formą iškilo problema.
95
101
  success: Forma sėkmingai išsaugota.
@@ -38,13 +38,20 @@ lv:
38
38
  any: Jebkura
39
39
  collapse: Sakļaut
40
40
  description: Apraksts
41
+ down: Lejup
41
42
  expand: Izvērst
42
43
  question: Jautājums
43
44
  remove: Noņemt
44
45
  statement: Paziņojums
46
+ up: Augšup
45
47
  separator:
48
+ down: Lejup
46
49
  remove: Noņemt
47
50
  separator: Atdalītājs
51
+ up: Augšup
52
+ title_and_description:
53
+ down: Lejup
54
+ up: Augšup
48
55
  update:
49
56
  invalid: Saglabājot veidlapu, radās problēma.
50
57
  images:
@@ -70,20 +70,26 @@ nl:
70
70
  any: Ieder
71
71
  collapse: Samenvouwen
72
72
  description: Omschrijving
73
+ down: naar beneden
73
74
  expand: Uitklappen
74
75
  question: Vraag
75
76
  remove: Verwijderen
76
77
  statement: Uitspraak
78
+ up: omhoog
77
79
  separator:
80
+ down: naar beneden
78
81
  remove: Verwijderen
79
82
  separator: Scheidingsteken
83
+ up: omhoog
80
84
  title_and_description:
81
85
  collapse: Inklappen
82
86
  description: Beschrijving
87
+ down: naar beneden
83
88
  expand: Uitklappen
84
89
  remove: Verwijderen
85
90
  title: Titel
86
91
  title_and_description: Titel en beschrijving
92
+ up: omhoog
87
93
  update:
88
94
  invalid: Er zijn fouten opgetreden bij het opslaan van de vragenlijst.
89
95
  success: Formulier succesvol opgeslagen.
@@ -72,20 +72,26 @@
72
72
  any: Alle
73
73
  collapse: Skjul
74
74
  description: Beskrivelse
75
+ down: Ned
75
76
  expand: Utvid
76
77
  question: Spørsmål
77
78
  remove: Fjern
78
79
  statement: Uttalelse
80
+ up: Opp
79
81
  separator:
82
+ down: Ned
80
83
  remove: Fjern
81
84
  separator: Skilletegn
85
+ up: Opp
82
86
  title_and_description:
83
87
  collapse: Kollaps
84
88
  description: Beskrivelse
89
+ down: Ned
85
90
  expand: Utvid
86
91
  remove: Fjern
87
92
  title: Tittel
88
93
  title_and_description: Tittel og beskrivelse
94
+ up: Opp
89
95
  update:
90
96
  invalid: Det oppstod et problem med å lagre dette skjema.
91
97
  success: Skjemaet ble lagret.
@@ -76,20 +76,26 @@ pl:
76
76
  any: Dowolny
77
77
  collapse: Zwiń
78
78
  description: Opis
79
+ down: Na dół
79
80
  expand: Rozwiń
80
81
  question: Pytanie
81
82
  remove: Usuń
82
83
  statement: Komunikat
84
+ up: W górę
83
85
  separator:
86
+ down: Na dół
84
87
  remove: Usuń
85
88
  separator: Separator
89
+ up: W górę
86
90
  title_and_description:
87
91
  collapse: Zwiń
88
92
  description: Opis
93
+ down: Na dół
89
94
  expand: Rozwiń
90
95
  remove: Usuń
91
96
  title: Tytuł
92
97
  title_and_description: Tytuł i opis
98
+ up: W górę
93
99
  update:
94
100
  invalid: Podczas zapisywania formularza wystąpił błąd.
95
101
  success: Formularz został zapisany.
@@ -72,20 +72,26 @@ pt-BR:
72
72
  any: Qualquer
73
73
  collapse: Recolher
74
74
  description: Descrição
75
+ down: Baixa
75
76
  expand: Expandir
76
77
  question: Questão
77
78
  remove: Remover
78
79
  statement: Declaração
80
+ up: Acima
79
81
  separator:
82
+ down: Baixa
80
83
  remove: Remover
81
84
  separator: Separador
85
+ up: Acima
82
86
  title_and_description:
83
87
  collapse: Recolher
84
88
  description: Descrição
89
+ down: Baixa
85
90
  expand: Expandir
86
91
  remove: Excluir
87
92
  title: Título
88
93
  title_and_description: Título e descrição
94
+ up: Acima
89
95
  update:
90
96
  invalid: Houve erros ao salvar o questionário.
91
97
  success: Formulário salvo com sucesso.
@@ -72,13 +72,20 @@ pt:
72
72
  any: Qualquer
73
73
  collapse: Colapsar
74
74
  description: Descrição
75
+ down: Abaixo
75
76
  expand: Expandir
76
77
  question: Questão
77
78
  remove: Remover
78
79
  statement: Declaração
80
+ up: Acima
79
81
  separator:
82
+ down: Abaixo
80
83
  remove: Remover
81
84
  separator: Separador
85
+ up: Acima
86
+ title_and_description:
87
+ down: Abaixo
88
+ up: Acima
82
89
  update:
83
90
  invalid: Ocorreu um problema ao guardar o questionário.
84
91
  success: Formulário guardado com êxito
@@ -89,20 +89,26 @@ ro:
89
89
  any: Oricare
90
90
  collapse: Restrângeți
91
91
  description: Descriere
92
+ down: Mergi în jos
92
93
  expand: Extindeți
93
94
  question: Întrebare
94
95
  remove: Eliminați
95
96
  statement: Declarație
97
+ up: Mergi în sus
96
98
  separator:
99
+ down: Mergi în jos
97
100
  remove: Elimină
98
101
  separator: Separator
102
+ up: Mergi în sus
99
103
  title_and_description:
100
104
  collapse: Restrângeți
101
105
  description: Descriere
106
+ down: Mergi în jos
102
107
  expand: Extindeți
103
108
  remove: Șterge
104
109
  title: Titlu
105
110
  title_and_description: Titlu și descriere
111
+ up: Mergi în sus
106
112
  update:
107
113
  invalid: A apărut o eroare la salvarea chestionarului.
108
114
  success: Chestionarul a fost salvat cu succes.
@@ -20,8 +20,16 @@ ru:
20
20
  question:
21
21
  add_answer_option: Добавить вариант ответа
22
22
  any: Любые
23
+ down: Вниз
23
24
  question: Вопрос
24
25
  remove: Удалить
26
+ up: Вверх
27
+ separator:
28
+ down: Вниз
29
+ up: Вверх
30
+ title_and_description:
31
+ down: Вниз
32
+ up: Вверх
25
33
  update:
26
34
  invalid: При попытке сохранить форму произошли ошибки.
27
35
  question_types:
@@ -32,9 +32,17 @@ sk:
32
32
  add_answer_option: Pridať možnosť odpovede
33
33
  any: Akékoľvek
34
34
  description: Popis
35
+ down: Nadol
35
36
  question: Otázka
36
37
  remove: Odstrániť
37
38
  statement: Prehlásenie
39
+ up: Hore
40
+ separator:
41
+ down: Nadol
42
+ up: Hore
43
+ title_and_description:
44
+ down: Nadol
45
+ up: Hore
38
46
  update:
39
47
  invalid: Vyskytol sa problém s ukladaním formulára.
40
48
  question_types:
@@ -100,20 +100,26 @@ sv:
100
100
  any: Valfritt
101
101
  collapse: Dölj
102
102
  description: Beskrivning
103
+ down: Ner
103
104
  expand: Visa
104
105
  question: Fråga
105
106
  remove: Ta bort
106
107
  statement: Titel
108
+ up: Upp
107
109
  separator:
110
+ down: Ner
108
111
  remove: Ta bort
109
112
  separator: Avgränsare
113
+ up: Upp
110
114
  title_and_description:
111
115
  collapse: Dölj
112
116
  description: Beskrivning
117
+ down: Ner
113
118
  expand: Visa
114
119
  remove: Ta bort
115
120
  title: Titel
116
121
  title_and_description: Titel och beskrivning
122
+ up: Upp
117
123
  update:
118
124
  invalid: Det gick inte att spara formuläret.
119
125
  success: Formuläret har sparats.
@@ -71,13 +71,20 @@ tr:
71
71
  any: herhangi
72
72
  collapse: Daralt
73
73
  description: Açıklama
74
+ down: Aşağı
74
75
  expand: Genişlet
75
76
  question: Soru
76
77
  remove: Kaldır
77
78
  statement: Beyan
79
+ up: yukarı
78
80
  separator:
81
+ down: Aşağı
79
82
  remove: Kaldır
80
83
  separator: Ayraç
84
+ up: yukarı
85
+ title_and_description:
86
+ down: Aşağı
87
+ up: yukarı
81
88
  update:
82
89
  invalid: Formu kaydederken bir sorun oluştu.
83
90
  success: Başarıyla kaydedildi.
@@ -70,13 +70,20 @@ zh-CN:
70
70
  any: 任何
71
71
  collapse: 收起
72
72
  description: 描述
73
+ down: 向下
73
74
  expand: 扩展
74
75
  question: 问
75
76
  remove: 删除
76
77
  statement: 声明
78
+ up: 上移
77
79
  separator:
80
+ down: 向下
78
81
  remove: 删除
79
82
  separator: 分隔符
83
+ up: 上移
84
+ title_and_description:
85
+ down: 向下
86
+ up: 上移
80
87
  update:
81
88
  invalid: 保存表单时出错。
82
89
  success: 表单保存成功。
@@ -76,20 +76,26 @@ zh-TW:
76
76
  any: 任何
77
77
  collapse: 收回
78
78
  description: 說明
79
+ down: 向下
79
80
  expand: 展開
80
81
  question: 問題
81
82
  remove: 移除
82
83
  statement: 聲明
84
+ up: 往上
83
85
  separator:
86
+ down: 向下
84
87
  remove: 移除
85
88
  separator: 分隔線
89
+ up: 往上
86
90
  title_and_description:
87
91
  collapse: 收回
88
92
  description: 說明
93
+ down: 向下
89
94
  expand: 展開
90
95
  remove: 移除
91
96
  title: 標題
92
97
  title_and_description: 標題和描述
98
+ up: 往上
93
99
  update:
94
100
  invalid: 儲存表單時發生問題。
95
101
  success: 表單已成功儲存。
@@ -352,10 +352,6 @@ shared_examples_for "update questions" do
352
352
  create(:questionnaire_question, questionnaire:, body: second_body, position: 1)
353
353
  end
354
354
 
355
- let!(:question3) do
356
- create(:questionnaire_question, questionnaire:, body: third_body, position: 2)
357
- end
358
-
359
355
  let(:first_body) do
360
356
  { en: "First", ca: "Primera", es: "Primera" }
361
357
  end
@@ -364,10 +360,6 @@ shared_examples_for "update questions" do
364
360
  { en: "Second", ca: "Segona", es: "Segunda" }
365
361
  end
366
362
 
367
- let(:third_body) do
368
- { en: "Third", ca: "Tercera", es: "Tercera" }
369
- end
370
-
371
363
  before do
372
364
  visit questionnaire_edit_path
373
365
  expand_all_questions
@@ -387,6 +379,26 @@ shared_examples_for "update questions" do
387
379
  end
388
380
  end
389
381
 
382
+ context "when moving a question up" do
383
+ before do
384
+ within ".questionnaire-question:last-of-type" do
385
+ click_on "Up"
386
+ end
387
+ end
388
+
389
+ it_behaves_like "switching questions order"
390
+ end
391
+
392
+ context "when moving a question down" do
393
+ before do
394
+ within ".questionnaire-question:first-of-type" do
395
+ click_on "Down"
396
+ end
397
+ end
398
+
399
+ it_behaves_like "switching questions order"
400
+ end
401
+
390
402
  describe "collapsible questions" do
391
403
  context "when clicking on Expand all button" do
392
404
  it "expands all questions" do
@@ -482,37 +494,16 @@ shared_examples_for "update questions" do
482
494
  click_on "Add question"
483
495
  expand_all_questions
484
496
 
485
- question_cards = page.all(".questionnaire-question")
486
- expect(question_cards.size).to eq(4)
487
-
488
- within question_cards[1] do
489
- expect(find("input[name*='[body_en]']").value).to eq("Second")
490
- end
491
- within question_cards[2] do
492
- expect(find("input[name*='[body_en]']").value).to eq("Third")
493
- end
497
+ expect(page.find(".questionnaire-question:nth-of-type(1)")).to look_like_first_question
498
+ expect(page.find(".questionnaire-question:nth-of-type(2)")).to look_like_intermediate_question
499
+ expect(page.find(".questionnaire-question:nth-of-type(3)")).to look_like_last_question
494
500
 
495
501
  within ".questionnaire-question:first-of-type" do
496
502
  click_on "Remove"
497
503
  end
498
504
 
499
- remaining_cards = page.all(".questionnaire-question")
500
- expect(remaining_cards.size).to eq(3)
501
-
502
- # Check that the first question is now what was previously the second
503
- within remaining_cards.first do
504
- expect(find("input[name*='[body_en]']").value).to eq("Second")
505
- end
506
-
507
- # Check that the second question is now what was previously the third
508
- within remaining_cards[1] do
509
- expect(find("input[name*='[body_en]']").value).to eq("Third")
510
- end
511
-
512
- # The last question should be the new empty question
513
- within remaining_cards.last do
514
- expect(find("input[name*='[body_en]']").value).to eq("")
515
- end
505
+ expect(page.all(".questionnaire-question").first).to look_like_first_question
506
+ expect(page.all(".questionnaire-question").last).to look_like_last_question
516
507
  end
517
508
 
518
509
  it "does not duplicate editors when adding new questions" do
@@ -556,94 +547,6 @@ shared_examples_for "update questions" do
556
547
  end
557
548
  end
558
549
 
559
- context "when reordering questions with drag and drop", :js do
560
- before do
561
- expand_all_questions
562
- end
563
-
564
- it "allows moving questions using drag and drop" do
565
- question_cards = all(".questionnaire-question")
566
-
567
- # Verify initial order by checking the body field values
568
- within question_cards[0] do
569
- expect(find("input[name*='[body_en]']").value).to eq("First")
570
- end
571
- within question_cards[1] do
572
- expect(find("input[name*='[body_en]']").value).to eq("Second")
573
- end
574
- within question_cards[2] do
575
- expect(find("input[name*='[body_en]']").value).to eq("Third")
576
- end
577
-
578
- # JavaScript to simulate drag and drop.
579
- page.execute_script(<<~JS)
580
- var questions = document.querySelectorAll('.questionnaire-question');
581
- var container = questions[0].parentNode;
582
- var second = questions[1];
583
- var first = questions[0];
584
-
585
- // Move second question before first
586
- container.insertBefore(second, first);
587
-
588
- // Update position values
589
- var updatedQuestions = container.querySelectorAll('.questionnaire-question');
590
- updatedQuestions.forEach(function(question, index) {
591
- var positionInput = question.querySelector('input[name$="[position]"]');
592
- if (positionInput) positionInput.value = index;
593
- });
594
- JS
595
-
596
- sleep 0.5
597
-
598
- question_cards = all(".questionnaire-question")
599
- within question_cards[0] do
600
- expect(find("input[name*='[body_en]']").value).to eq("Second")
601
- end
602
- within question_cards[1] do
603
- expect(find("input[name*='[body_en]']").value).to eq("First")
604
- end
605
- within question_cards[2] do
606
- expect(find("input[name*='[body_en]']").value).to eq("Third")
607
- end
608
- end
609
-
610
- it "persists drag and drop changes when saving" do
611
- # Move second question to last position
612
- page.execute_script(<<~JS)
613
- var questions = document.querySelectorAll('.questionnaire-question');
614
- var container = questions[0].parentNode;
615
- var second = questions[1];
616
-
617
- container.appendChild(second);
618
-
619
- // Update the positions of questions
620
- var updatedQuestions = container.querySelectorAll('.questionnaire-question');
621
- updatedQuestions.forEach(function(question, index) {
622
- var positionInput = question.querySelector('input[name$="[position]"]');
623
- if (positionInput) positionInput.value = index;
624
- });
625
- JS
626
-
627
- sleep 0.5
628
-
629
- click_on "Save"
630
- expect(page).to have_admin_callout("successfully")
631
-
632
- visit_manage_questions_and_expand_all
633
-
634
- question_cards = all(".questionnaire-question")
635
- within question_cards[0] do
636
- expect(find("input[name*='[body_en]']").value).to eq("First")
637
- end
638
- within question_cards[1] do
639
- expect(find("input[name*='[body_en]']").value).to eq("Third")
640
- end
641
- within question_cards[2] do
642
- expect(find("input[name*='[body_en]']").value).to eq("Second")
643
- end
644
- end
645
- end
646
-
647
550
  private
648
551
 
649
552
  def look_like_first_question
@@ -116,9 +116,4 @@ shared_examples_for "manage questionnaires" do
116
116
  visit questionnaire_edit_path
117
117
  expand_all_questions
118
118
  end
119
-
120
- def visit_manage_questions_and_expand_all
121
- visit questionnaire_edit_path
122
- expand_all_questions
123
- end
124
119
  end
@@ -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.29.6"
7
+ "0.29.7"
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.29.6
4
+ version: 0.29.7
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: 2025-10-28 00:00:00.000000000 Z
14
+ date: 2025-11-20 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.29.6
22
+ version: 0.29.7
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.6
29
+ version: 0.29.7
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: wicked_pdf
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -47,28 +47,28 @@ dependencies:
47
47
  requirements:
48
48
  - - '='
49
49
  - !ruby/object:Gem::Version
50
- version: 0.29.6
50
+ version: 0.29.7
51
51
  type: :development
52
52
  prerelease: false
53
53
  version_requirements: !ruby/object:Gem::Requirement
54
54
  requirements:
55
55
  - - '='
56
56
  - !ruby/object:Gem::Version
57
- version: 0.29.6
57
+ version: 0.29.7
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: decidim-dev
60
60
  requirement: !ruby/object:Gem::Requirement
61
61
  requirements:
62
62
  - - '='
63
63
  - !ruby/object:Gem::Version
64
- version: 0.29.6
64
+ version: 0.29.7
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.29.6
71
+ version: 0.29.7
72
72
  description: A forms gem for decidim.
73
73
  email:
74
74
  - josepjaume@gmail.com