decidim-comments 0.28.5 → 0.29.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/comments/comment/actions.erb +4 -3
  3. data/app/cells/decidim/comments/comment/deletion_data.erb +1 -1
  4. data/app/cells/decidim/comments/comment/show.erb +3 -3
  5. data/app/cells/decidim/comments/comment_cell.rb +0 -2
  6. data/app/cells/decidim/comments/comment_form/opinion.erb +4 -4
  7. data/app/cells/decidim/comments/comment_form_cell.rb +0 -2
  8. data/app/cells/decidim/comments/comment_metadata_cell.rb +1 -1
  9. data/app/cells/decidim/comments/comments_cell.rb +0 -3
  10. data/app/cells/decidim/comments/edit_comment_modal_form_cell.rb +0 -1
  11. data/app/commands/decidim/comments/create_comment.rb +6 -6
  12. data/app/commands/decidim/comments/update_comment.rb +3 -4
  13. data/app/controllers/decidim/comments/comments_controller.rb +5 -3
  14. data/app/helpers/decidim/comments/comment_cells_helper.rb +1 -1
  15. data/app/models/decidim/comments/seed.rb +55 -5
  16. data/app/packs/entrypoints/decidim_comments.js +1 -1
  17. data/app/packs/src/decidim/comments/comments.component.js +8 -8
  18. data/app/packs/src/decidim/comments/comments.component.test.js +14 -14
  19. data/app/views/decidim/comments/comments/create.js.erb +2 -2
  20. data/app/views/decidim/comments/comments/delete.js.erb +5 -2
  21. data/app/views/decidim/comments/comments/update.js.erb +0 -6
  22. data/app/views/decidim/comments/votes/create.js.erb +1 -1
  23. data/config/locales/bg.yml +0 -1
  24. data/config/locales/ca.yml +2 -2
  25. data/config/locales/cs.yml +0 -6
  26. data/config/locales/de.yml +1 -2
  27. data/config/locales/en.yml +1 -1
  28. data/config/locales/es-MX.yml +1 -1
  29. data/config/locales/es-PY.yml +1 -1
  30. data/config/locales/es.yml +2 -2
  31. data/config/locales/eu.yml +16 -19
  32. data/config/locales/fi-plain.yml +1 -1
  33. data/config/locales/fi.yml +9 -9
  34. data/config/locales/fr-CA.yml +1 -1
  35. data/config/locales/fr.yml +1 -1
  36. data/config/locales/ja.yml +1 -1
  37. data/config/locales/pl.yml +1 -1
  38. data/config/locales/pt-BR.yml +0 -3
  39. data/config/locales/ro-RO.yml +8 -16
  40. data/config/locales/sv.yml +24 -42
  41. data/config/locales/tr-TR.yml +0 -1
  42. data/db/seeds.rb +1 -0
  43. data/decidim-comments.gemspec +2 -2
  44. data/lib/decidim/api/comment_type.rb +0 -13
  45. data/lib/decidim/api/commentable_interface.rb +1 -7
  46. data/lib/decidim/api/commentable_mutation_type.rb +2 -1
  47. data/lib/decidim/comments/commentable.rb +2 -2
  48. data/lib/decidim/comments/commentable_with_component.rb +1 -3
  49. data/lib/decidim/comments/query_extensions.rb +1 -1
  50. data/lib/decidim/comments/test/factories.rb +1 -1
  51. data/lib/decidim/comments/test/shared_examples/create_comment_context.rb +3 -2
  52. data/lib/decidim/comments/version.rb +1 -1
  53. data/lib/tasks/upgrade/decidim_comments.rake +28 -0
  54. metadata +14 -16
  55. data/config/locales/bn-BD.yml +0 -1
  56. data/config/locales/bs-BA.yml +0 -15
  57. data/lib/tasks/decidim_comments.rake +0 -26
@@ -8,7 +8,7 @@ FactoryBot.define do
8
8
  skip_injection { false }
9
9
  end
10
10
  author { build(:user, organization: commentable.organization, skip_injection:) }
11
- commentable { build(:dummy_resource, :published, skip_injection:) }
11
+ commentable { build(:dummy_resource, skip_injection:) }
12
12
  root_commentable { commentable }
13
13
  body { Decidim::Faker::Localized.paragraph }
14
14
  participatory_space { commentable.try(:participatory_space) }
@@ -6,6 +6,7 @@ RSpec.shared_context "when creating a comment" do
6
6
  let(:component) { create(:component, participatory_space: participatory_process) }
7
7
  let(:user) { create(:user, organization:) }
8
8
  let(:author) { create(:user, organization:) }
9
+ let(:current_user) { author }
9
10
  let(:dummy_resource) { create :dummy_resource, component: }
10
11
  let(:commentable) { dummy_resource }
11
12
  let(:body) { Faker::Lorem.paragraph }
@@ -25,8 +26,8 @@ RSpec.shared_context "when creating a comment" do
25
26
  Decidim::Comments::CommentForm.from_params(
26
27
  form_params
27
28
  ).with_context(
28
- current_organization: organization
29
+ current_organization: organization, current_user:
29
30
  )
30
31
  end
31
- let(:command) { described_class.new(form, author) }
32
+ let(:command) { described_class.new(form) }
32
33
  end
@@ -4,7 +4,7 @@ module Decidim
4
4
  # This holds the decidim-comments version.
5
5
  module Comments
6
6
  def self.version
7
- "0.28.5"
7
+ "0.29.0.rc1"
8
8
  end
9
9
  end
10
10
  end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ namespace :decidim_comments do
4
+ namespace :upgrade do
5
+ desc "Adds participatory_process_id to comments if they are associated with a participatory process"
6
+ task participatory_process_in_comments: :environment do
7
+ puts "Updating comments..."
8
+ ok = errors = 0
9
+
10
+ log = ActiveSupport::Logger.new(Rails.root.join("log/update_participatory_process_in_comments.log"))
11
+ Decidim::Comments::Comment.where(participatory_space: nil).find_each do |c|
12
+ c.participatory_space = if c.root_commentable.is_a?(Decidim::Participable)
13
+ c.root_commentable
14
+ else
15
+ c.commentable.try(:participatory_space)
16
+ end
17
+ c.save(validate: false)
18
+ ok += 1
19
+ rescue StandardError => e
20
+ errors += 1
21
+ log.info "Error updating comment ##{c.id}: #{e.message}"
22
+ end
23
+
24
+ puts "#{ok} comments updated."
25
+ puts "#{errors} errors found. Check the file 'log/update_participatory_process_in_comments.log' for more information." if errors.positive?
26
+ end
27
+ end
28
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-comments
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.28.5
4
+ version: 0.29.0.rc1
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: 2024-07-16 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: decidim-core
@@ -18,14 +18,14 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 0.28.5
21
+ version: 0.29.0.rc1
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.5
28
+ version: 0.29.0.rc1
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: redcarpet
31
31
  requirement: !ruby/object:Gem::Requirement
@@ -52,28 +52,28 @@ dependencies:
52
52
  requirements:
53
53
  - - '='
54
54
  - !ruby/object:Gem::Version
55
- version: 0.28.5
55
+ version: 0.29.0.rc1
56
56
  type: :development
57
57
  prerelease: false
58
58
  version_requirements: !ruby/object:Gem::Requirement
59
59
  requirements:
60
60
  - - '='
61
61
  - !ruby/object:Gem::Version
62
- version: 0.28.5
62
+ version: 0.29.0.rc1
63
63
  - !ruby/object:Gem::Dependency
64
64
  name: decidim-dev
65
65
  requirement: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - '='
68
68
  - !ruby/object:Gem::Version
69
- version: 0.28.5
69
+ version: 0.29.0.rc1
70
70
  type: :development
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
73
73
  requirements:
74
74
  - - '='
75
75
  - !ruby/object:Gem::Version
76
- version: 0.28.5
76
+ version: 0.29.0.rc1
77
77
  description: Pluggable comments system for some components.
78
78
  email:
79
79
  - josepjaume@gmail.com
@@ -173,8 +173,6 @@ files:
173
173
  - config/locales/ar.yml
174
174
  - config/locales/bg-BG.yml
175
175
  - config/locales/bg.yml
176
- - config/locales/bn-BD.yml
177
- - config/locales/bs-BA.yml
178
176
  - config/locales/ca.yml
179
177
  - config/locales/cs-CZ.yml
180
178
  - config/locales/cs.yml
@@ -298,10 +296,10 @@ files:
298
296
  - lib/decidim/comments/test/shared_examples/has_comments_availability_attributes.rb
299
297
  - lib/decidim/comments/test/shared_examples/translatable_comment.rb
300
298
  - lib/decidim/comments/version.rb
301
- - lib/tasks/decidim_comments.rake
299
+ - lib/tasks/upgrade/decidim_comments.rake
302
300
  homepage: https://decidim.org
303
301
  licenses:
304
- - AGPL-3.0-or-later
302
+ - AGPL-3.0
305
303
  metadata:
306
304
  bug_tracker_uri: https://github.com/decidim/decidim/issues
307
305
  documentation_uri: https://docs.decidim.org/
@@ -316,14 +314,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
316
314
  requirements:
317
315
  - - "~>"
318
316
  - !ruby/object:Gem::Version
319
- version: 3.1.0
317
+ version: 3.2.0
320
318
  required_rubygems_version: !ruby/object:Gem::Requirement
321
319
  requirements:
322
- - - ">="
320
+ - - ">"
323
321
  - !ruby/object:Gem::Version
324
- version: '0'
322
+ version: 1.3.1
325
323
  requirements: []
326
- rubygems_version: 3.3.7
324
+ rubygems_version: 3.4.10
327
325
  signing_key:
328
326
  specification_version: 4
329
327
  summary: Decidim comments module
@@ -1 +0,0 @@
1
- bn:
@@ -1,15 +0,0 @@
1
- ---
2
- bs:
3
- decidim:
4
- components:
5
- comments:
6
- comment_details_title: Detalji o komentaru
7
- single_comment_warning_title: Vidite samo jedan komentar
8
- events:
9
- comments:
10
- comment_by_followed_user_group:
11
- email_intro: 'Grupa %{author_name} je ostavila komentar na %{resource_title}. Možete ga pročitati na ovoj strani:'
12
- user_group_mentioned:
13
- email_intro: Grupa kojoj pripadate je pomenuta
14
- email_outro: Dobili ste ovo obaveštenje jer ste član grupe %{group_name} koja je pomenuta u %{resource_title}.
15
- email_subject: Pomenuti ste u %{resource_title} kao član grupe %{group_name}
@@ -1,26 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- namespace :decidim_comments do
4
- desc "Adds participatory_process_id to comments if they are associated with a participatory process"
5
- task update_participatory_process_in_comments: :environment do
6
- puts "Updating comments..."
7
- ok = errors = 0
8
-
9
- log = ActiveSupport::Logger.new(Rails.root.join("log/update_participatory_process_in_comments.log"))
10
- Decidim::Comments::Comment.where(participatory_space: nil).find_each do |c|
11
- c.participatory_space = if c.root_commentable.is_a?(Decidim::Participable)
12
- c.root_commentable
13
- else
14
- c.commentable.try(:participatory_space)
15
- end
16
- c.save(validate: false)
17
- ok += 1
18
- rescue StandardError => e
19
- errors += 1
20
- log.info "Error updating comment ##{c.id}: #{e.message}"
21
- end
22
-
23
- puts "#{ok} comments updated."
24
- puts "#{errors} errors found. Check the file 'log/update_participatory_process_in_comments.log' for more information." if errors.positive?
25
- end
26
- end