decidim-surveys 0.29.2 → 0.30.0.rc2

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 (92) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/surveys/survey_card_metadata_cell.rb +43 -0
  3. data/app/cells/decidim/surveys/survey_cell.rb +26 -0
  4. data/app/cells/decidim/surveys/survey_l_cell.rb +34 -0
  5. data/app/cells/decidim/surveys/survey_s_cell.rb +21 -0
  6. data/app/commands/decidim/surveys/admin/create_survey.rb +21 -0
  7. data/app/commands/decidim/surveys/admin/publish_survey.rb +58 -0
  8. data/app/commands/decidim/surveys/admin/unpublish_survey.rb +44 -0
  9. data/app/commands/decidim/surveys/admin/update_survey.rb +62 -0
  10. data/app/commands/decidim/surveys/publish_answers.rb +55 -0
  11. data/app/commands/decidim/surveys/unpublish_answers.rb +55 -0
  12. data/app/controllers/concerns/decidim/surveys/admin/filterable.rb +23 -0
  13. data/app/controllers/decidim/surveys/admin/answers_controller.rb +73 -0
  14. data/app/controllers/decidim/surveys/admin/publish_answers_controller.rb +66 -0
  15. data/app/controllers/decidim/surveys/admin/surveys_controller.rb +99 -11
  16. data/app/controllers/decidim/surveys/surveys_controller.rb +50 -5
  17. data/app/forms/decidim/surveys/admin/survey_form.rb +18 -0
  18. data/app/helpers/decidim/surveys/application_helper.rb +34 -0
  19. data/app/helpers/decidim/surveys/publish_answers_helper.rb +104 -0
  20. data/app/helpers/decidim/surveys/survey_helper.rb +4 -0
  21. data/app/models/decidim/surveys/survey.rb +67 -12
  22. data/app/permissions/decidim/surveys/admin/permissions.rb +10 -1
  23. data/app/permissions/decidim/surveys/permissions.rb +0 -2
  24. data/app/presenters/decidim/surveys/admin_log/survey_presenter.rb +34 -0
  25. data/app/queries/decidim/surveys/metrics/answers_metric_manage.rb +3 -3
  26. data/app/queries/decidim/surveys/metrics/survey_participants_metric_measure.rb +2 -2
  27. data/app/views/decidim/surveys/admin/answers/index.html.erb +49 -0
  28. data/app/views/decidim/surveys/admin/answers/show.html.erb +43 -0
  29. data/app/views/decidim/surveys/admin/publish_answers/_toggle_button.html.erb +22 -0
  30. data/app/views/decidim/surveys/admin/publish_answers/index.html.erb +44 -0
  31. data/app/views/decidim/surveys/admin/surveys/_form.html.erb +28 -0
  32. data/app/views/decidim/surveys/admin/surveys/edit.html.erb +4 -21
  33. data/app/views/decidim/surveys/admin/surveys/edit_questions.html.erb +47 -0
  34. data/app/views/decidim/surveys/admin/surveys/index.html.erb +51 -0
  35. data/app/views/decidim/surveys/surveys/_published_questions_answers.html.erb +13 -0
  36. data/app/views/decidim/surveys/surveys/_surveys.html.erb +13 -0
  37. data/app/views/decidim/surveys/surveys/index.html.erb +27 -0
  38. data/app/views/decidim/surveys/surveys/index.js.erb +4 -0
  39. data/app/views/decidim/surveys/surveys/not_allowed.html.erb +22 -0
  40. data/config/locales/ar.yml +4 -3
  41. data/config/locales/bg.yml +0 -14
  42. data/config/locales/ca.yml +83 -14
  43. data/config/locales/cs.yml +87 -14
  44. data/config/locales/de.yml +83 -14
  45. data/config/locales/el.yml +0 -11
  46. data/config/locales/en.yml +83 -14
  47. data/config/locales/es-MX.yml +83 -14
  48. data/config/locales/es-PY.yml +83 -14
  49. data/config/locales/es.yml +83 -14
  50. data/config/locales/eu.yml +83 -14
  51. data/config/locales/fi-plain.yml +83 -14
  52. data/config/locales/fi.yml +83 -14
  53. data/config/locales/fr-CA.yml +74 -14
  54. data/config/locales/fr.yml +74 -14
  55. data/config/locales/ga-IE.yml +0 -4
  56. data/config/locales/gl.yml +0 -10
  57. data/config/locales/hu.yml +0 -3
  58. data/config/locales/id-ID.yml +0 -2
  59. data/config/locales/is-IS.yml +0 -2
  60. data/config/locales/it.yml +3 -10
  61. data/config/locales/ja.yml +80 -13
  62. data/config/locales/lb.yml +0 -10
  63. data/config/locales/lt.yml +0 -11
  64. data/config/locales/lv.yml +0 -3
  65. data/config/locales/nl.yml +0 -10
  66. data/config/locales/no.yml +0 -10
  67. data/config/locales/pl.yml +0 -14
  68. data/config/locales/pt-BR.yml +0 -14
  69. data/config/locales/pt.yml +0 -10
  70. data/config/locales/ro-RO.yml +0 -11
  71. data/config/locales/ru.yml +0 -2
  72. data/config/locales/sk.yml +0 -3
  73. data/config/locales/sv.yml +0 -14
  74. data/config/locales/tr-TR.yml +0 -10
  75. data/config/locales/uk.yml +0 -2
  76. data/config/locales/zh-CN.yml +0 -6
  77. data/config/locales/zh-TW.yml +0 -11
  78. data/db/migrate/20240828103030_add_deleted_at_to_decidim_surveys_surveys.rb +8 -0
  79. data/db/migrate/20240925124312_add_settings_to_decidim_surveys_surveys.rb +42 -0
  80. data/db/migrate/20250115193836_add_allow_survey_editing.rb +7 -0
  81. data/decidim-surveys.gemspec +1 -1
  82. data/lib/decidim/api/survey_type.rb +2 -2
  83. data/lib/decidim/api/surveys_type.rb +4 -5
  84. data/lib/decidim/surveys/admin_engine.rb +15 -5
  85. data/lib/decidim/surveys/component.rb +7 -24
  86. data/lib/decidim/surveys/engine.rb +2 -2
  87. data/lib/decidim/surveys/seeds.rb +115 -10
  88. data/lib/decidim/surveys/test/factories.rb +24 -0
  89. data/lib/decidim/surveys/version.rb +1 -1
  90. metadata +48 -18
  91. data/app/commands/decidim/surveys/create_survey.rb +0 -19
  92. data/app/views/decidim/surveys/admin/component/_actions.html.erb +0 -44
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-surveys
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.29.2
4
+ version: 0.30.0.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josep Jaume Rey Peroy
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2025-02-12 00:00:00.000000000 Z
13
+ date: 2025-03-03 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: decidim-core
@@ -18,84 +18,84 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 0.29.2
21
+ version: 0.30.0.rc2
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - '='
27
27
  - !ruby/object:Gem::Version
28
- version: 0.29.2
28
+ version: 0.30.0.rc2
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: decidim-forms
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
33
  - - '='
34
34
  - !ruby/object:Gem::Version
35
- version: 0.29.2
35
+ version: 0.30.0.rc2
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - '='
41
41
  - !ruby/object:Gem::Version
42
- version: 0.29.2
42
+ version: 0.30.0.rc2
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: decidim-admin
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - '='
48
48
  - !ruby/object:Gem::Version
49
- version: 0.29.2
49
+ version: 0.30.0.rc2
50
50
  type: :development
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
54
  - - '='
55
55
  - !ruby/object:Gem::Version
56
- version: 0.29.2
56
+ version: 0.30.0.rc2
57
57
  - !ruby/object:Gem::Dependency
58
58
  name: decidim-dev
59
59
  requirement: !ruby/object:Gem::Requirement
60
60
  requirements:
61
61
  - - '='
62
62
  - !ruby/object:Gem::Version
63
- version: 0.29.2
63
+ version: 0.30.0.rc2
64
64
  type: :development
65
65
  prerelease: false
66
66
  version_requirements: !ruby/object:Gem::Requirement
67
67
  requirements:
68
68
  - - '='
69
69
  - !ruby/object:Gem::Version
70
- version: 0.29.2
70
+ version: 0.30.0.rc2
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: decidim-participatory_processes
73
73
  requirement: !ruby/object:Gem::Requirement
74
74
  requirements:
75
75
  - - '='
76
76
  - !ruby/object:Gem::Version
77
- version: 0.29.2
77
+ version: 0.30.0.rc2
78
78
  type: :development
79
79
  prerelease: false
80
80
  version_requirements: !ruby/object:Gem::Requirement
81
81
  requirements:
82
82
  - - '='
83
83
  - !ruby/object:Gem::Version
84
- version: 0.29.2
84
+ version: 0.30.0.rc2
85
85
  - !ruby/object:Gem::Dependency
86
86
  name: decidim-templates
87
87
  requirement: !ruby/object:Gem::Requirement
88
88
  requirements:
89
89
  - - '='
90
90
  - !ruby/object:Gem::Version
91
- version: 0.29.2
91
+ version: 0.30.0.rc2
92
92
  type: :development
93
93
  prerelease: false
94
94
  version_requirements: !ruby/object:Gem::Requirement
95
95
  requirements:
96
96
  - - '='
97
97
  - !ruby/object:Gem::Version
98
- version: 0.29.2
98
+ version: 0.30.0.rc2
99
99
  description: A surveys component for decidim's participatory spaces.
100
100
  email:
101
101
  - josepjaume@gmail.com
@@ -108,13 +108,28 @@ files:
108
108
  - README.md
109
109
  - Rakefile
110
110
  - app/cells/decidim/surveys/survey_activity_cell.rb
111
- - app/commands/decidim/surveys/create_survey.rb
111
+ - app/cells/decidim/surveys/survey_card_metadata_cell.rb
112
+ - app/cells/decidim/surveys/survey_cell.rb
113
+ - app/cells/decidim/surveys/survey_l_cell.rb
114
+ - app/cells/decidim/surveys/survey_s_cell.rb
115
+ - app/commands/decidim/surveys/admin/create_survey.rb
116
+ - app/commands/decidim/surveys/admin/publish_survey.rb
117
+ - app/commands/decidim/surveys/admin/unpublish_survey.rb
118
+ - app/commands/decidim/surveys/admin/update_survey.rb
119
+ - app/commands/decidim/surveys/publish_answers.rb
120
+ - app/commands/decidim/surveys/unpublish_answers.rb
121
+ - app/controllers/concerns/decidim/surveys/admin/filterable.rb
122
+ - app/controllers/decidim/surveys/admin/answers_controller.rb
112
123
  - app/controllers/decidim/surveys/admin/application_controller.rb
124
+ - app/controllers/decidim/surveys/admin/publish_answers_controller.rb
113
125
  - app/controllers/decidim/surveys/admin/surveys_controller.rb
114
126
  - app/controllers/decidim/surveys/application_controller.rb
115
127
  - app/controllers/decidim/surveys/surveys_controller.rb
116
128
  - app/events/decidim/surveys/closed_survey_event.rb
117
129
  - app/events/decidim/surveys/opened_survey_event.rb
130
+ - app/forms/decidim/surveys/admin/survey_form.rb
131
+ - app/helpers/decidim/surveys/application_helper.rb
132
+ - app/helpers/decidim/surveys/publish_answers_helper.rb
118
133
  - app/helpers/decidim/surveys/survey_helper.rb
119
134
  - app/jobs/decidim/surveys/clean_survey_answers_job.rb
120
135
  - app/jobs/decidim/surveys/settings_change_job.rb
@@ -123,14 +138,26 @@ files:
123
138
  - app/models/decidim/surveys/survey.rb
124
139
  - app/permissions/decidim/surveys/admin/permissions.rb
125
140
  - app/permissions/decidim/surveys/permissions.rb
141
+ - app/presenters/decidim/surveys/admin_log/survey_presenter.rb
126
142
  - app/queries/decidim/surveys/metrics/answers_metric_manage.rb
127
143
  - app/queries/decidim/surveys/metrics/survey_participants_metric_measure.rb
128
144
  - app/serializers/decidim/surveys/data_importer.rb
129
145
  - app/serializers/decidim/surveys/data_serializer.rb
130
- - app/views/decidim/surveys/admin/component/_actions.html.erb
146
+ - app/views/decidim/surveys/admin/answers/index.html.erb
147
+ - app/views/decidim/surveys/admin/answers/show.html.erb
148
+ - app/views/decidim/surveys/admin/publish_answers/_toggle_button.html.erb
149
+ - app/views/decidim/surveys/admin/publish_answers/index.html.erb
150
+ - app/views/decidim/surveys/admin/surveys/_form.html.erb
131
151
  - app/views/decidim/surveys/admin/surveys/edit.html.erb
152
+ - app/views/decidim/surveys/admin/surveys/edit_questions.html.erb
153
+ - app/views/decidim/surveys/admin/surveys/index.html.erb
132
154
  - app/views/decidim/surveys/survey_confirmation_mailer/confirmation.html.erb
155
+ - app/views/decidim/surveys/surveys/_published_questions_answers.html.erb
156
+ - app/views/decidim/surveys/surveys/_surveys.html.erb
157
+ - app/views/decidim/surveys/surveys/index.html.erb
158
+ - app/views/decidim/surveys/surveys/index.js.erb
133
159
  - app/views/decidim/surveys/surveys/no_permission.html.erb
160
+ - app/views/decidim/surveys/surveys/not_allowed.html.erb
134
161
  - config/assets.rb
135
162
  - config/locales/am-ET.yml
136
163
  - config/locales/ar-SA.yml
@@ -236,6 +263,9 @@ files:
236
263
  - db/migrate/20200610090725_remove_survey_answers.rb
237
264
  - db/migrate/20200610090845_remove_survey_questions.rb
238
265
  - db/migrate/20200610105927_remove_survey_columns.rb
266
+ - db/migrate/20240828103030_add_deleted_at_to_decidim_surveys_surveys.rb
267
+ - db/migrate/20240925124312_add_settings_to_decidim_surveys_surveys.rb
268
+ - db/migrate/20250115193836_add_allow_survey_editing.rb
239
269
  - decidim-surveys.gemspec
240
270
  - lib/decidim/api/survey_type.rb
241
271
  - lib/decidim/api/surveys_type.rb
@@ -266,14 +296,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
266
296
  requirements:
267
297
  - - "~>"
268
298
  - !ruby/object:Gem::Version
269
- version: 3.2.0
299
+ version: 3.3.0
270
300
  required_rubygems_version: !ruby/object:Gem::Requirement
271
301
  requirements:
272
302
  - - ">="
273
303
  - !ruby/object:Gem::Version
274
304
  version: '0'
275
305
  requirements: []
276
- rubygems_version: 3.4.10
306
+ rubygems_version: 3.5.11
277
307
  signing_key:
278
308
  specification_version: 4
279
309
  summary: Decidim surveys module
@@ -1,19 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Decidim
4
- module Surveys
5
- # Command that gets called whenever a component's survey has to be created. It
6
- # usually happens as a callback when the component itself is created.
7
- class CreateSurvey < Decidim::Command
8
- def initialize(component)
9
- @component = component
10
- end
11
-
12
- def call
13
- @survey = Survey.new(component: @component, questionnaire: Decidim::Forms::Questionnaire.new)
14
-
15
- @survey.save ? broadcast(:ok) : broadcast(:invalid)
16
- end
17
- end
18
- end
19
- end
@@ -1,44 +0,0 @@
1
- <% if component.manifest.admin_engine %>
2
- <%= icon_link_to "pencil-line", manage_component_path(component), t("actions.manage", scope: "decidim.admin"), class: "action-icon--manage" %>
3
- <% else %>
4
- <span class="action-space icon"></span>
5
- <% end %>
6
-
7
- <% if allowed_to? :share, :component, component: component %>
8
- <%= icon_link_to "share-line", url_for(action: :share, id: component, controller: "components"), t("actions.share", scope: "decidim.admin"), target: :blank, class: "action-icon--share" %>
9
- <% else %>
10
- <span class="action-space icon"></span>
11
- <% end %>
12
- <% if allowed_to? :update, :component, component: component %>
13
- <%= icon_link_to "settings-4-line", url_for(action: :edit, id: component, controller: "components"), t("actions.configure", scope: "decidim.admin"), class: "action-icon--configure" %>
14
- <% else %>
15
- <span class="action-space icon"></span>
16
- <% end %>
17
-
18
- <% if allowed_to?(:update, :component, component: component) %>
19
- <% if component.published? %>
20
- <%= icon_link_to "close-circle-line", url_for(action: :unpublish, id: component, controller: "components"), t("actions.unpublish", scope: "decidim.admin"), class: "action-icon--unpublish", method: :put %>
21
- <% else %>
22
- <%= icon_link_to "check-line", url_for(action: :publish, id: component, controller: "components"), t("actions.publish", scope: "decidim.admin"), class: "action-icon--publish", method: :put, data: { confirm: t(".answers_alert") } %>
23
- <% end %>
24
- <% else %>
25
- <span class="action-space icon"></span>
26
- <% end %>
27
-
28
- <%= icon_link_to "eye-line", main_component_path(component), t("actions.preview", scope: "decidim.admin"), class: "action-icon--preview", target: :blank, data: { "external-link": false } %>
29
-
30
- <% if allowed_to? :update, :component, component: component %>
31
- <% if component.manifest.actions.empty? %>
32
- <%= icon "key-2-line", class: "action-icon action-icon--disabled" %>
33
- <% else %>
34
- <%= icon_link_to "key-2-line", url_for(action: :edit, component_id: component, controller: "component_permissions"), t("actions.permissions", scope: "decidim.admin"), class: "action-icon--permissions" %>
35
- <% end %>
36
- <% else %>
37
- <span class="action-space icon"></span>
38
- <% end %>
39
-
40
- <% if allowed_to? :destroy, :component, component: component %>
41
- <%= icon_link_to "delete-bin-line", url_for(action: :destroy, id: component, controller: "components"), t("actions.destroy", scope: "decidim.admin"), class: "action-icon--remove", method: :delete %>
42
- <% else %>
43
- <span class="action-space icon"></span>
44
- <% end %>