decidim-meetings 0.28.0 → 0.28.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/meetings/dates_and_map/show.erb +2 -4
  3. data/app/cells/decidim/meetings/dates_and_map_cell.rb +4 -0
  4. data/app/cells/decidim/meetings/highlighted_meetings_for_component/show.erb +1 -1
  5. data/app/cells/decidim/meetings/meeting_card_metadata_cell.rb +1 -1
  6. data/app/cells/decidim/meetings/meeting_l/image.erb +1 -1
  7. data/app/cells/decidim/meetings/online_meeting_link/show.erb +1 -1
  8. data/app/packs/stylesheets/decidim/meetings/_item.scss +6 -6
  9. data/app/views/decidim/meetings/admin/agenda/edit.html.erb +2 -2
  10. data/app/views/decidim/meetings/admin/agenda/new.html.erb +2 -2
  11. data/app/views/decidim/meetings/admin/invites/index.html.erb +2 -2
  12. data/app/views/decidim/meetings/admin/meeting_closes/edit.html.erb +2 -2
  13. data/app/views/decidim/meetings/admin/meeting_copies/new.html.erb +2 -2
  14. data/app/views/decidim/meetings/admin/meetings/edit.html.erb +2 -2
  15. data/app/views/decidim/meetings/admin/meetings/index.html.erb +2 -2
  16. data/app/views/decidim/meetings/admin/meetings/new.html.erb +2 -2
  17. data/app/views/decidim/meetings/admin/poll/edit.html.erb +2 -2
  18. data/app/views/decidim/meetings/admin/registrations/edit.html.erb +2 -2
  19. data/app/views/decidim/meetings/layouts/live_event.html.erb +1 -1
  20. data/app/views/decidim/meetings/meetings/_add_to_calendar_modal.html.erb +1 -1
  21. data/app/views/decidim/meetings/shared/_meetings.html.erb +1 -1
  22. data/config/locales/ca.yml +3 -3
  23. data/config/locales/de.yml +1 -1
  24. data/config/locales/es.yml +4 -4
  25. data/config/locales/fi-plain.yml +2 -0
  26. data/config/locales/fi.yml +3 -1
  27. data/config/locales/fr-CA.yml +2 -0
  28. data/config/locales/fr.yml +2 -0
  29. data/config/locales/he-IL.yml +1 -0
  30. data/config/locales/hu.yml +7 -0
  31. data/config/locales/ja.yml +10 -2
  32. data/config/locales/pl.yml +74 -0
  33. data/config/locales/pt-BR.yml +107 -0
  34. data/config/locales/sv.yml +1 -0
  35. data/decidim-meetings.gemspec +43 -0
  36. data/lib/decidim/meetings/test/factories.rb +56 -122
  37. data/lib/decidim/meetings/version.rb +1 -1
  38. metadata +22 -21
  39. data/config/environment.rb +0 -3
@@ -7,9 +7,12 @@ require "decidim/participatory_processes/test/factories"
7
7
 
8
8
  FactoryBot.define do
9
9
  factory :meeting_component, parent: :component do
10
- name { Decidim::Components::Namer.new(participatory_space.organization.available_locales, :meetings).i18n_name }
10
+ transient do
11
+ skip_injection { false }
12
+ end
13
+ name { generate_component_name(participatory_space.organization.available_locales, :meetings, skip_injection:) }
11
14
  manifest_name { :meetings }
12
- participatory_space { create(:participatory_process, :with_steps, organization:) }
15
+ participatory_space { create(:participatory_process, :with_steps, organization:, skip_injection:) }
13
16
 
14
17
  trait :with_creation_enabled do
15
18
  settings do
@@ -25,40 +28,10 @@ FactoryBot.define do
25
28
  skip_injection { false }
26
29
  end
27
30
 
28
- title do
29
- if skip_injection
30
- Decidim::Faker::Localized.localized { generate(:title) }
31
- else
32
- Decidim::Faker::Localized.localized { "<script>alert(\"Meetings TITLE\")</script> #{generate(:title)}" }
33
- end
34
- end
35
- description do
36
- Decidim::Faker::Localized.wrapped("<p>", "</p>") do
37
- if skip_injection
38
- Decidim::Faker::Localized.localized { generate(:title) }
39
- else
40
- Decidim::Faker::Localized.localized { "<script>alert(\"Meetings description\");</script> #{generate(:title)}" }
41
- end
42
- end
43
- end
44
- location do
45
- Decidim::Faker::Localized.wrapped("<p>", "</p>") do
46
- if skip_injection
47
- Decidim::Faker::Localized.localized { generate(:title) }
48
- else
49
- Decidim::Faker::Localized.localized { "<script>alert(\"Meetings location\");</script> #{generate(:title)}" }
50
- end
51
- end
52
- end
53
- location_hints do
54
- Decidim::Faker::Localized.wrapped("<p>", "</p>") do
55
- if skip_injection
56
- Decidim::Faker::Localized.localized { generate(:title) }
57
- else
58
- Decidim::Faker::Localized.localized { "<script>alert(\"Meetings location_hints\");</script> #{generate(:title)}" }
59
- end
60
- end
61
- end
31
+ title { generate_localized_title(:meeting_title, skip_injection:) }
32
+ description { generate_localized_description(:meeting_description, skip_injection:) }
33
+ location { generate_localized_description(:meeting_location, skip_injection:) }
34
+ location_hints { generate_localized_description(:meeting_location_hints, skip_injection:) }
62
35
  address { Faker::Lorem.sentence(word_count: 3) }
63
36
  latitude { Faker::Address.latitude }
64
37
  longitude { Faker::Address.longitude }
@@ -68,18 +41,10 @@ FactoryBot.define do
68
41
  transparent { true }
69
42
  questionnaire { build(:questionnaire) }
70
43
  registration_form_enabled { true }
71
- registration_terms do
72
- Decidim::Faker::Localized.wrapped("<p>", "</p>") do
73
- if skip_injection
74
- Decidim::Faker::Localized.localized { generate(:title) }
75
- else
76
- Decidim::Faker::Localized.localized { "<script>alert(\"Meetings registration_terms\");</script> #{generate(:title)}" }
77
- end
78
- end
79
- end
44
+ registration_terms { generate_localized_description(:meeting_registration_terms, skip_injection:) }
80
45
  registration_type { :on_this_platform }
81
46
  type_of_meeting { :in_person }
82
- component { build(:component, manifest_name: "meetings") }
47
+ component { build(:meeting_component) }
83
48
  iframe_access_level { :all }
84
49
  iframe_embed_type { :none }
85
50
 
@@ -114,7 +79,7 @@ FactoryBot.define do
114
79
  end
115
80
 
116
81
  trait :not_official do
117
- author { create(:user, organization: component.organization) if component }
82
+ author { create(:user, organization: component.organization, skip_injection:) if component }
118
83
  end
119
84
 
120
85
  trait :with_services do
@@ -125,7 +90,7 @@ FactoryBot.define do
125
90
  end
126
91
 
127
92
  after(:build) do |meeting, evaluator|
128
- meeting.services = evaluator.services || build_list(:service, 2, meeting:)
93
+ meeting.services = evaluator.services || build_list(:service, 2, meeting:, skip_injection: evaluator.skip_injection)
129
94
  end
130
95
  end
131
96
 
@@ -133,21 +98,15 @@ FactoryBot.define do
133
98
 
134
99
  trait :user_group_author do
135
100
  author do
136
- create(:user, organization: component.organization) if component
101
+ create(:user, organization: component.organization, skip_injection:) if component
137
102
  end
138
103
  user_group do
139
- create(:user_group, :verified, organization: component.organization, users: [author]) if component
104
+ create(:user_group, :verified, organization: component.organization, users: [author], skip_injection:) if component
140
105
  end
141
106
  end
142
107
 
143
108
  trait :closed do
144
- closing_report do
145
- if skip_injection
146
- Decidim::Faker::Localized.localized { generate(:title) }
147
- else
148
- Decidim::Faker::Localized.localized { "<script>alert(\"Meetings registration_terms\");</script> #{generate(:title)}" }
149
- end
150
- end
109
+ closing_report { generate_localized_title(:meeting_closing_report, skip_injection:) }
151
110
  attendees_count { rand(50) }
152
111
  contributions_count { rand(50) }
153
112
  attending_organizations { Array.new(3) { Faker::TvShows::GameOfThrones.house }.join(", ") }
@@ -166,13 +125,7 @@ FactoryBot.define do
166
125
  registrations_enabled { true }
167
126
  available_slots { 10 }
168
127
  reserved_slots { 4 }
169
- registration_terms do
170
- if skip_injection
171
- Decidim::Faker::Localized.localized { generate(:title) }
172
- else
173
- Decidim::Faker::Localized.localized { "<script>alert(\"Meetings registration_terms\");</script> #{generate(:title)}" }
174
- end
175
- end
128
+ registration_terms { generate_localized_title(:meeting_registration_terms, skip_injection:) }
176
129
  end
177
130
 
178
131
  trait :past do
@@ -218,13 +171,16 @@ FactoryBot.define do
218
171
  end
219
172
 
220
173
  trait :moderated do
221
- after(:create) do |meeting, _evaluator|
222
- create(:moderation, reportable: meeting, hidden_at: 2.days.ago)
174
+ after(:create) do |meeting, evaluator|
175
+ create(:moderation, reportable: meeting, hidden_at: 2.days.ago, skip_injection: evaluator.skip_injection)
223
176
  end
224
177
  end
225
178
  end
226
179
 
227
180
  factory :registration, class: "Decidim::Meetings::Registration" do
181
+ transient do
182
+ skip_injection { false }
183
+ end
228
184
  meeting
229
185
  user
230
186
  end
@@ -235,18 +191,12 @@ FactoryBot.define do
235
191
  end
236
192
 
237
193
  meeting
238
- title do
239
- if skip_injection
240
- Decidim::Faker::Localized.localized { generate(:title) }
241
- else
242
- Decidim::Faker::Localized.localized { "<script>alert(\"Meetings agenda title\");</script> #{generate(:title)}" }
243
- end
244
- end
194
+ title { generate_localized_title(:meeting_agenda_title, skip_injection:) }
245
195
  visible { true }
246
196
 
247
197
  trait :with_agenda_items do
248
- after(:create) do |agenda, _evaluator|
249
- create_list(:agenda_item, 2, :with_children, agenda:)
198
+ after(:create) do |agenda, evaluator|
199
+ create_list(:agenda_item, 2, :with_children, agenda:, skip_injection: evaluator.skip_injection)
250
200
  end
251
201
  end
252
202
  end
@@ -257,37 +207,26 @@ FactoryBot.define do
257
207
  end
258
208
 
259
209
  agenda
260
- title do
261
- if skip_injection
262
- Decidim::Faker::Localized.localized { generate(:title) }
263
- else
264
- Decidim::Faker::Localized.localized { "<script>alert(\"Meetings agenda item title\");</script> #{generate(:title)}" }
265
- end
266
- end
267
- description do
268
- Decidim::Faker::Localized.wrapped("<p>", "</p>") do
269
- if skip_injection
270
- Decidim::Faker::Localized.localized { generate(:title) }
271
- else
272
- Decidim::Faker::Localized.localized { "<script>alert(\"Meetings agenda item descrition\");</script> #{generate(:title)}" }
273
- end
274
- end
275
- end
210
+ title { generate_localized_title(:meeting_agenda_item_title, skip_injection:) }
211
+ description { generate_localized_description(:meeting_agenda_item_description, skip_injection:) }
276
212
  duration { 15 }
277
213
  position { 0 }
278
214
 
279
215
  trait :with_parent do
280
- parent { create(:agenda_item, agenda:) }
216
+ parent { create(:agenda_item, agenda:, skip_injection:) }
281
217
  end
282
218
 
283
219
  trait :with_children do
284
220
  after(:create) do |agenda_item, evaluator|
285
- create_list(:agenda_item, 2, parent: agenda_item, agenda: evaluator.agenda)
221
+ create_list(:agenda_item, 2, parent: agenda_item, agenda: evaluator.agenda, skip_injection: evaluator.skip_injection)
286
222
  end
287
223
  end
288
224
  end
289
225
 
290
226
  factory :invite, class: "Decidim::Meetings::Invite" do
227
+ transient do
228
+ skip_injection { false }
229
+ end
291
230
  meeting
292
231
  user
293
232
  sent_at { 1.day.ago }
@@ -309,30 +248,22 @@ FactoryBot.define do
309
248
  end
310
249
 
311
250
  meeting
312
- title do
313
- if skip_injection
314
- Decidim::Faker::Localized.localized { generate(:title) }
315
- else
316
- Decidim::Faker::Localized.localized { "<script>alert(\"Meetings agenda title\");</script> #{generate(:title)}" }
317
- end
318
- end
319
- description do
320
- Decidim::Faker::Localized.wrapped("<p>", "</p>") do
321
- if skip_injection
322
- Decidim::Faker::Localized.localized { generate(:title) }
323
- else
324
- Decidim::Faker::Localized.localized { "<script>alert(\"Meetings agenda title\");</script> #{generate(:title)}" }
325
- end
326
- end
327
- end
251
+ title { generate_localized_title(:meeting_service_title, skip_injection:) }
252
+ description { generate_localized_description(:meeting_service_description, skip_injection:) }
328
253
  end
329
254
 
330
255
  factory :poll, class: "Decidim::Meetings::Poll" do
256
+ transient do
257
+ skip_injection { false }
258
+ end
331
259
  meeting
332
260
  end
333
261
 
334
262
  factory :meetings_poll_questionnaire, class: "Decidim::Meetings::Questionnaire" do
335
- questionnaire_for { build(:poll) }
263
+ transient do
264
+ skip_injection { false }
265
+ end
266
+ questionnaire_for { build(:poll, skip_injection:) }
336
267
  end
337
268
 
338
269
  factory :meetings_poll_question, class: "Decidim::Meetings::Question" do
@@ -341,19 +272,13 @@ FactoryBot.define do
341
272
  options { [] }
342
273
  end
343
274
 
344
- body do
345
- if skip_injection
346
- Decidim::Faker::Localized.localized { generate(:title) }
347
- else
348
- Decidim::Faker::Localized.localized { "<script>alert(\"Meetings agenda title\");</script> #{generate(:title)}" }
349
- end
350
- end
275
+ body { generate_localized_title(:meeting_poll_question_body, skip_injection:) }
351
276
  position { 0 }
352
277
  status { 0 }
353
278
  question_type { Decidim::Meetings::Question::QUESTION_TYPES.first }
354
279
  questionnaire factory: :meetings_poll_questionnaire
355
280
  answer_options do
356
- Array.new(3).collect { build(:meetings_poll_answer_option, question: nil) }
281
+ Array.new(3).collect { build(:meetings_poll_answer_option, question: nil, skip_injection:) }
357
282
  end
358
283
 
359
284
  trait :unpublished do
@@ -370,18 +295,27 @@ FactoryBot.define do
370
295
  end
371
296
 
372
297
  factory :meetings_poll_answer, class: "Decidim::Meetings::Answer" do
298
+ transient do
299
+ skip_injection { false }
300
+ end
373
301
  questionnaire factory: :meetings_poll_questionnaire
374
- question { create(:meetings_poll_question, questionnaire:) }
375
- user { create(:user, organization: questionnaire.questionnaire_for.organization) }
302
+ question { create(:meetings_poll_question, questionnaire:, skip_injection:) }
303
+ user { create(:user, organization: questionnaire.questionnaire_for.organization, skip_injection:) }
376
304
  end
377
305
 
378
306
  factory :meetings_poll_answer_option, class: "Decidim::Meetings::AnswerOption" do
379
- question { create(:meetings_poll_question) }
307
+ transient do
308
+ skip_injection { false }
309
+ end
310
+ question { create(:meetings_poll_question, skip_injection:) }
380
311
  body { generate_localized_title }
381
312
  end
382
313
 
383
314
  factory :meetings_poll_answer_choice, class: "Decidim::Meetings::AnswerChoice" do
315
+ transient do
316
+ skip_injection { false }
317
+ end
384
318
  answer factory: :meetings_poll_answer
385
- answer_option { create(:meetings_poll_answer_option, question: answer.question) }
319
+ answer_option { create(:meetings_poll_answer_option, question: answer.question, skip_injection:) }
386
320
  end
387
321
  end
@@ -4,7 +4,7 @@ module Decidim
4
4
  # This holds the decidim-meetings version.
5
5
  module Meetings
6
6
  def self.version
7
- "0.28.0"
7
+ "0.28.1"
8
8
  end
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-meetings
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.28.0
4
+ version: 0.28.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josep Jaume Rey Peroy
8
8
  - Marc Riera Casals
9
9
  - Oriol Gual Oliva
10
- autorequire:
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2023-12-20 00:00:00.000000000 Z
13
+ date: 2024-04-30 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: decidim-core
@@ -18,28 +18,28 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 0.28.0
21
+ version: 0.28.1
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.28.0
28
+ version: 0.28.1
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.28.0
35
+ version: 0.28.1
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.28.0
42
+ version: 0.28.1
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: icalendar
45
45
  requirement: !ruby/object:Gem::Requirement
@@ -60,56 +60,56 @@ dependencies:
60
60
  requirements:
61
61
  - - '='
62
62
  - !ruby/object:Gem::Version
63
- version: 0.28.0
63
+ version: 0.28.1
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.28.0
70
+ version: 0.28.1
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: decidim-assemblies
73
73
  requirement: !ruby/object:Gem::Requirement
74
74
  requirements:
75
75
  - - '='
76
76
  - !ruby/object:Gem::Version
77
- version: 0.28.0
77
+ version: 0.28.1
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.28.0
84
+ version: 0.28.1
85
85
  - !ruby/object:Gem::Dependency
86
86
  name: decidim-dev
87
87
  requirement: !ruby/object:Gem::Requirement
88
88
  requirements:
89
89
  - - '='
90
90
  - !ruby/object:Gem::Version
91
- version: 0.28.0
91
+ version: 0.28.1
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.28.0
98
+ version: 0.28.1
99
99
  - !ruby/object:Gem::Dependency
100
100
  name: decidim-participatory_processes
101
101
  requirement: !ruby/object:Gem::Requirement
102
102
  requirements:
103
103
  - - '='
104
104
  - !ruby/object:Gem::Version
105
- version: 0.28.0
105
+ version: 0.28.1
106
106
  type: :development
107
107
  prerelease: false
108
108
  version_requirements: !ruby/object:Gem::Requirement
109
109
  requirements:
110
110
  - - '='
111
111
  - !ruby/object:Gem::Version
112
- version: 0.28.0
112
+ version: 0.28.1
113
113
  description: A meetings component for decidim's participatory spaces.
114
114
  email:
115
115
  - josepjaume@gmail.com
@@ -375,7 +375,6 @@ files:
375
375
  - app/views/devise/mailer/join_meeting.html.erb
376
376
  - app/views/devise/mailer/join_meeting.text.erb
377
377
  - config/assets.rb
378
- - config/environment.rb
379
378
  - config/locales/am-ET.yml
380
379
  - config/locales/ar-SA.yml
381
380
  - config/locales/ar.yml
@@ -408,6 +407,7 @@ files:
408
407
  - config/locales/ga-IE.yml
409
408
  - config/locales/gl.yml
410
409
  - config/locales/gn-PY.yml
410
+ - config/locales/he-IL.yml
411
411
  - config/locales/hr-HR.yml
412
412
  - config/locales/hr.yml
413
413
  - config/locales/hu.yml
@@ -512,6 +512,7 @@ files:
512
512
  - db/migrate/20210928095036_rename_upcoming_events_content_block_to_upcoming_meetings.rb
513
513
  - db/migrate/20211105115625_remove_not_null_on_customize_registration_email.rb
514
514
  - db/migrate/20230427105701_change_types_and_registration_types_on_meetings.rb
515
+ - decidim-meetings.gemspec
515
516
  - lib/decidim/api/agenda_item_type.rb
516
517
  - lib/decidim/api/agenda_type.rb
517
518
  - lib/decidim/api/linked_resources_interface.rb
@@ -552,23 +553,23 @@ metadata:
552
553
  funding_uri: https://opencollective.com/decidim
553
554
  homepage_uri: https://decidim.org
554
555
  source_code_uri: https://github.com/decidim/decidim
555
- post_install_message:
556
+ post_install_message:
556
557
  rdoc_options: []
557
558
  require_paths:
558
559
  - lib
559
560
  required_ruby_version: !ruby/object:Gem::Requirement
560
561
  requirements:
561
- - - ">="
562
+ - - "~>"
562
563
  - !ruby/object:Gem::Version
563
- version: '3.1'
564
+ version: 3.1.0
564
565
  required_rubygems_version: !ruby/object:Gem::Requirement
565
566
  requirements:
566
567
  - - ">="
567
568
  - !ruby/object:Gem::Version
568
569
  version: '0'
569
570
  requirements: []
570
- rubygems_version: 3.4.22
571
- signing_key:
571
+ rubygems_version: 3.5.9
572
+ signing_key:
572
573
  specification_version: 4
573
574
  summary: Decidim meetings module
574
575
  test_files: []
@@ -1,3 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Empty line for playing nice with tpope/vim-rails