decidim-comments 0.19.1 → 0.23.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/decidim/comments/bundle.js +66 -66
  3. data/app/assets/javascripts/decidim/comments/bundle.js.map +1 -1
  4. data/app/cells/decidim/comments/comment_activity_cell.rb +2 -22
  5. data/app/cells/decidim/comments/comment_cell.rb +22 -0
  6. data/app/cells/decidim/comments/comment_m/footer.erb +5 -0
  7. data/app/cells/decidim/comments/comment_m/top.erb +7 -0
  8. data/app/cells/decidim/comments/comment_m_cell.rb +29 -0
  9. data/app/commands/decidim/comments/create_comment.rb +8 -8
  10. data/app/events/decidim/comments/comment_by_followed_user_group_event.rb +9 -0
  11. data/app/events/decidim/comments/comment_event.rb +15 -2
  12. data/app/events/decidim/comments/user_group_mentioned_event.rb +10 -0
  13. data/app/forms/decidim/comments/comment_form.rb +17 -1
  14. data/app/frontend/application/icon.component.tsx +16 -4
  15. data/app/frontend/comments/add_comment_form.component.test.tsx +34 -29
  16. data/app/frontend/comments/add_comment_form.component.tsx +48 -19
  17. data/app/frontend/comments/comment.component.test.tsx +36 -5
  18. data/app/frontend/comments/comment.component.tsx +311 -89
  19. data/app/frontend/comments/comment_order_selector.component.tsx +26 -7
  20. data/app/frontend/comments/comment_thread.component.test.tsx +9 -8
  21. data/app/frontend/comments/comment_thread.component.tsx +3 -1
  22. data/app/frontend/comments/comments.component.test.tsx +17 -14
  23. data/app/frontend/comments/comments.component.tsx +90 -9
  24. data/app/frontend/comments/down_vote_button.component.tsx +27 -9
  25. data/app/frontend/comments/up_vote_button.component.tsx +27 -9
  26. data/app/frontend/comments/vote_button.component.tsx +4 -0
  27. data/app/frontend/comments/vote_button_component.test.tsx +14 -8
  28. data/app/frontend/entry.ts +19 -0
  29. data/app/frontend/entry_test.ts +2 -0
  30. data/app/frontend/mutations/add_comment.mutation.graphql +2 -2
  31. data/app/frontend/mutations/down_vote.mutation.graphql +2 -2
  32. data/app/frontend/mutations/up_vote.mutation.graphql +2 -2
  33. data/app/frontend/queries/comments.query.graphql +3 -3
  34. data/app/frontend/support/schema.ts +326 -0
  35. data/app/helpers/decidim/comments/comment_cells_helper.rb +33 -0
  36. data/app/models/decidim/comments/comment.rb +96 -18
  37. data/app/models/decidim/comments/seed.rb +1 -1
  38. data/app/queries/decidim/comments/metrics/comments_metric_manage.rb +1 -6
  39. data/app/queries/decidim/comments/sorted_comments.rb +8 -2
  40. data/app/scrubbers/decidim/comments/user_input_scrubber.rb +20 -0
  41. data/app/services/decidim/comments/new_comment_notification_creator.rb +28 -3
  42. data/app/types/decidim/comments/commentable_interface.rb +3 -2
  43. data/app/types/decidim/comments/commentable_mutation_type.rb +6 -3
  44. data/config/locales/am-ET.yml +1 -0
  45. data/config/locales/ar.yml +10 -1
  46. data/config/locales/bg-BG.yml +6 -0
  47. data/config/locales/bg.yml +6 -0
  48. data/config/locales/ca.yml +24 -1
  49. data/config/locales/cs.yml +36 -13
  50. data/config/locales/da-DK.yml +1 -0
  51. data/config/locales/da.yml +1 -0
  52. data/config/locales/de.yml +23 -1
  53. data/config/locales/el-GR.yml +1 -0
  54. data/config/locales/el.yml +122 -0
  55. data/config/locales/en.yml +24 -1
  56. data/config/locales/eo.yml +1 -0
  57. data/config/locales/es-MX.yml +24 -1
  58. data/config/locales/es-PY.yml +24 -1
  59. data/config/locales/es.yml +24 -1
  60. data/config/locales/et-EE.yml +1 -0
  61. data/config/locales/et.yml +1 -0
  62. data/config/locales/eu.yml +4 -1
  63. data/config/locales/fi-plain.yml +24 -1
  64. data/config/locales/fi.yml +31 -8
  65. data/config/locales/fr-CA.yml +123 -0
  66. data/config/locales/fr.yml +25 -2
  67. data/config/locales/ga-IE.yml +1 -0
  68. data/config/locales/gl.yml +4 -1
  69. data/config/locales/hr-HR.yml +1 -0
  70. data/config/locales/hr.yml +1 -0
  71. data/config/locales/hu.yml +18 -2
  72. data/config/locales/id-ID.yml +4 -1
  73. data/config/locales/is-IS.yml +74 -0
  74. data/config/locales/is.yml +76 -0
  75. data/config/locales/it.yml +23 -1
  76. data/config/locales/ja-JP.yml +120 -0
  77. data/config/locales/ja.yml +121 -0
  78. data/config/locales/ko-KR.yml +1 -0
  79. data/config/locales/ko.yml +1 -0
  80. data/config/locales/lt-LT.yml +1 -0
  81. data/config/locales/lt.yml +1 -0
  82. data/config/locales/lv.yml +118 -0
  83. data/config/locales/mt-MT.yml +1 -0
  84. data/config/locales/mt.yml +1 -0
  85. data/config/locales/nl.yml +26 -3
  86. data/config/locales/no.yml +88 -1
  87. data/config/locales/om-ET.yml +1 -0
  88. data/config/locales/pl.yml +62 -40
  89. data/config/locales/pt-BR.yml +5 -2
  90. data/config/locales/pt.yml +47 -25
  91. data/config/locales/ro-RO.yml +124 -0
  92. data/config/locales/ru.yml +4 -1
  93. data/config/locales/sk-SK.yml +116 -0
  94. data/config/locales/sk.yml +120 -0
  95. data/config/locales/sl.yml +4 -0
  96. data/config/locales/so-SO.yml +1 -0
  97. data/config/locales/sr-CS.yml +20 -0
  98. data/config/locales/sv.yml +26 -3
  99. data/config/locales/ti-ER.yml +1 -0
  100. data/config/locales/tr-TR.yml +4 -1
  101. data/config/locales/uk.yml +4 -2
  102. data/config/locales/vi-VN.yml +1 -0
  103. data/config/locales/vi.yml +1 -0
  104. data/config/locales/zh-CN.yml +121 -0
  105. data/config/locales/zh-TW.yml +1 -0
  106. data/db/migrate/20200320105911_index_foreign_keys_in_decidim_comments_comments.rb +7 -0
  107. data/db/migrate/20200706123136_make_comments_handle_i18n.rb +41 -0
  108. data/db/migrate/20200828101910_add_commentable_counter_cache_to_comments.rb +9 -0
  109. data/lib/decidim/comments.rb +1 -0
  110. data/lib/decidim/comments/api/comment_type.rb +5 -1
  111. data/lib/decidim/comments/comment_serializer.rb +7 -2
  112. data/lib/decidim/comments/comment_vote_serializer.rb +5 -1
  113. data/lib/decidim/comments/commentable.rb +11 -0
  114. data/lib/decidim/comments/comments_helper.rb +28 -4
  115. data/lib/decidim/comments/engine.rb +13 -0
  116. data/lib/decidim/comments/markdown.rb +55 -0
  117. data/lib/decidim/comments/mutation_extensions.rb +8 -0
  118. data/lib/decidim/comments/query_extensions.rb +4 -0
  119. data/lib/decidim/comments/test/factories.rb +10 -1
  120. data/lib/decidim/comments/test/shared_examples/comment_event.rb +12 -2
  121. data/lib/decidim/comments/test/shared_examples/create_comment_context.rb +3 -2
  122. data/lib/decidim/comments/version.rb +1 -1
  123. metadata +72 -9
@@ -0,0 +1 @@
1
+ zh-TW:
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class IndexForeignKeysInDecidimCommentsComments < ActiveRecord::Migration[5.2]
4
+ def change
5
+ add_index :decidim_comments_comments, :decidim_user_group_id
6
+ end
7
+ end
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ class MakeCommentsHandleI18n < ActiveRecord::Migration[5.2]
4
+ class User < ApplicationRecord
5
+ self.table_name = :decidim_users
6
+ end
7
+
8
+ class Comment < ApplicationRecord
9
+ self.table_name = :decidim_comments_comments
10
+ end
11
+
12
+ class Organization < ApplicationRecord
13
+ self.table_name = :decidim_organizations
14
+ end
15
+
16
+ def change
17
+ add_column :decidim_comments_comments, :new_body, :jsonb
18
+
19
+ User.reset_column_information
20
+ Comment.reset_column_information
21
+ Organization.reset_column_information
22
+
23
+ Comment.find_each do |comment|
24
+ locale, org_id = User.where(id: comment.decidim_author_id).pluck(:locale, :decidim_organization_id).first
25
+ locale = locale.presence || Organization.find(org_id).default_locale
26
+
27
+ comment.new_body = {
28
+ locale => comment.body
29
+ }
30
+
31
+ comment.save!
32
+ end
33
+
34
+ remove_column :decidim_comments_comments, :body
35
+ rename_column :decidim_comments_comments, :new_body, :body
36
+
37
+ User.reset_column_information
38
+ Comment.reset_column_information
39
+ Organization.reset_column_information
40
+ end
41
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AddCommentableCounterCacheToComments < ActiveRecord::Migration[5.2]
4
+ def change
5
+ add_column :decidim_comments_comments, :comments_count, :integer, null: false, default: 0, index: true
6
+ Decidim::Comments::Comment.reset_column_information
7
+ Decidim::Comments::Comment.find_each(&:update_comments_count)
8
+ end
9
+ end
@@ -17,6 +17,7 @@ module Decidim
17
17
  autoload :CommentSerializer, "decidim/comments/comment_serializer"
18
18
  autoload :CommentVoteSerializer, "decidim/comments/comment_vote_serializer"
19
19
  autoload :Export, "decidim/comments/export"
20
+ autoload :Markdown, "decidim/comments/markdown"
20
21
 
21
22
  def self.data_portable_entities
22
23
  ["Decidim::Comments::Comment", "Decidim::Comments::CommentVote"]
@@ -25,7 +25,11 @@ module Decidim
25
25
  }
26
26
  end
27
27
 
28
- field :body, !types.String, "The comment message"
28
+ field :body, !types.String, "The comment message" do
29
+ resolve lambda { |obj, _args, _ctx|
30
+ obj.translated_body
31
+ }
32
+ end
29
33
 
30
34
  field :formattedBody, !types.String, "The comment message ready to display (it is expected to include HTML)", property: :formatted_body
31
35
 
@@ -11,7 +11,8 @@ module Decidim
11
11
  {
12
12
  id: resource.id,
13
13
  created_at: resource.created_at,
14
- body: resource.body,
14
+ body: resource.body.values.first,
15
+ locale: resource.body.keys.first,
15
16
  author: {
16
17
  id: resource.author.id,
17
18
  name: resource.author.name
@@ -31,7 +32,11 @@ module Decidim
31
32
  private
32
33
 
33
34
  def root_commentable_url
34
- @root_commentable_url ||= Decidim::ResourceLocatorPresenter.new(resource.root_commentable).url
35
+ @root_commentable_url ||= if resource.root_commentable&.respond_to?(:polymorphic_resource_url)
36
+ resource.root_commentable.polymorphic_resource_url
37
+ else
38
+ ResourceLocatorPresenter.new(resource.root_commentable).url
39
+ end
35
40
  end
36
41
  end
37
42
  end
@@ -37,7 +37,11 @@ module Decidim
37
37
  private
38
38
 
39
39
  def root_commentable_url
40
- @root_commentable_url ||= Decidim::ResourceLocatorPresenter.new(resource.comment.root_commentable).url
40
+ @root_commentable_url ||= if resource.comment.root_commentable&.respond_to?(:polymorphic_resource_url)
41
+ resource.comment.root_commentable.polymorphic_resource_url
42
+ else
43
+ ResourceLocatorPresenter.new(resource.comment.root_commentable).url
44
+ end
41
45
  end
42
46
  end
43
47
  end
@@ -51,6 +51,17 @@ module Decidim
51
51
  def user_allowed_to_comment?(_user)
52
52
  true
53
53
  end
54
+
55
+ # Public: Updates the comments counter cache. We have to do it these
56
+ # way in order to properly calculate the coutner with hidden
57
+ # comments.
58
+ #
59
+ # rubocop:disable Rails/SkipsModelValidations
60
+ def update_comments_count
61
+ comments_count = comments.not_hidden.count
62
+ update_columns(comments_count: comments_count, updated_at: Time.current)
63
+ end
64
+ # rubocop:enable Rails/SkipsModelValidations
54
65
  end
55
66
  end
56
67
  end
@@ -26,9 +26,13 @@ module Decidim
26
26
  commentable_type = resource.commentable_type
27
27
  commentable_id = resource.id.to_s
28
28
  node_id = "comments-for-#{commentable_type.demodulize}-#{commentable_id}"
29
- react_comments_component(node_id, commentableType: commentable_type,
30
- commentableId: commentable_id,
31
- locale: I18n.locale)
29
+ react_comments_component(
30
+ node_id, commentableType: commentable_type,
31
+ commentableId: commentable_id,
32
+ locale: I18n.locale,
33
+ toggleTranslations: machine_translations_toggled?,
34
+ commentsMaxLength: comments_max_length(resource)
35
+ )
32
36
  end
33
37
 
34
38
  # Private: Render Comments component using inline javascript
@@ -44,11 +48,31 @@ module Decidim
44
48
  {
45
49
  commentableType: "#{props[:commentableType]}",
46
50
  commentableId: "#{props[:commentableId]}",
47
- locale: "#{props[:locale]}"
51
+ locale: "#{props[:locale]}",
52
+ toggleTranslations: #{props[:toggleTranslations]},
53
+ commentsMaxLength: "#{props[:commentsMaxLength]}"
48
54
  }
49
55
  );
50
56
  })
51
57
  end
58
+
59
+ def comments_max_length(resource)
60
+ return 1000 unless resource.respond_to?(:component)
61
+ return component_comments_max_length(resource) if component_comments_max_length(resource)
62
+ return organization_comments_max_length(resource) if organization_comments_max_length(resource)
63
+
64
+ 1000
65
+ end
66
+
67
+ def component_comments_max_length(resource)
68
+ return unless resource.component&.settings.respond_to?(:comments_max_length)
69
+
70
+ resource.component.settings.comments_max_length if resource.component.settings.comments_max_length.positive?
71
+ end
72
+
73
+ def organization_comments_max_length(resource)
74
+ resource.component.organization.comments_max_length if resource.component.organization.comments_max_length.positive?
75
+ end
52
76
  end
53
77
  end
54
78
  end
@@ -59,6 +59,19 @@ module Decidim
59
59
  metric_operation.manager_class = "Decidim::Comments::Metrics::CommentParticipantsMetricMeasure"
60
60
  end
61
61
  end
62
+
63
+ initializer "decidim_comments.register_resources" do
64
+ Decidim.register_resource(:comment) do |resource|
65
+ resource.model_class_name = "Decidim::Comments::Comment"
66
+ resource.card = "decidim/comments/comment"
67
+ resource.searchable = true
68
+ end
69
+ end
70
+
71
+ initializer "decidim_comments.add_cells_view_paths" do
72
+ Cell::ViewModel.view_paths << File.expand_path("#{Decidim::Comments::Engine.root}/app/cells")
73
+ Cell::ViewModel.view_paths << File.expand_path("#{Decidim::Comments::Engine.root}/app/views") # for partials
74
+ end
62
75
  end
63
76
  end
64
77
  end
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "redcarpet"
4
+
5
+ module Decidim
6
+ module Comments
7
+ # This class parses a string from plain text (markdown) and
8
+ # renders it as HTML.
9
+ class Markdown < ::Redcarpet::Render::Base
10
+ delegate :render, to: :markdown
11
+
12
+ private
13
+
14
+ def markdown
15
+ @markdown ||= ::Redcarpet::Markdown.new(renderer)
16
+ end
17
+
18
+ def renderer
19
+ @renderer ||= Decidim::Comments::MarkdownRender.new
20
+ end
21
+ end
22
+
23
+ # Custom markdown renderer for Comments
24
+ class MarkdownRender < ::Redcarpet::Render::Safe
25
+ def initialize(extensions = {})
26
+ super({
27
+ autolink: true,
28
+ escape_html: false,
29
+ filter_html: true,
30
+ hard_wrap: true,
31
+ lax_spacing: false,
32
+ no_images: true,
33
+ no_styles: true
34
+ }.merge(extensions))
35
+ end
36
+
37
+ # renders quotes with a custom css class
38
+ def block_quote(quote)
39
+ %(<blockquote class="comment__quote">#{quote}</blockquote>)
40
+ end
41
+
42
+ # removes header tags in comments
43
+ def header(title, _level)
44
+ title
45
+ end
46
+
47
+ # prevents empty <p/> in comments
48
+ def paragraph(text)
49
+ return if text.blank?
50
+
51
+ "<p>#{text}</p>"
52
+ end
53
+ end
54
+ end
55
+ end
@@ -16,8 +16,12 @@ module Decidim
16
16
 
17
17
  argument :id, !types.String, "The commentable's ID"
18
18
  argument :type, !types.String, "The commentable's class name. i.e. `Decidim::ParticipatoryProcess`"
19
+ argument :locale, !types.String, "The locale for which to get the comments text"
20
+ argument :toggleTranslations, !types.Boolean, "Whether the user asked to toggle the machine translations or not."
19
21
 
20
22
  resolve lambda { |_obj, args, _ctx|
23
+ I18n.locale = args[:locale].presence
24
+ RequestStore.store[:toggle_machine_translations] = args[:toggleTranslations]
21
25
  args[:type].constantize.find(args[:id])
22
26
  }
23
27
  end
@@ -26,8 +30,12 @@ module Decidim
26
30
  description "A comment"
27
31
 
28
32
  argument :id, !types.ID, "The comment's id"
33
+ argument :locale, !types.String, "The locale for which to get the comments text"
34
+ argument :toggleTranslations, !types.Boolean, "Whether the user asked to toggle the machine translations or not."
29
35
 
30
36
  resolve lambda { |_obj, args, _ctx|
37
+ I18n.locale = args[:locale].presence
38
+ RequestStore.store[:toggle_machine_translations] = args[:toggleTranslations]
31
39
  Comment.find(args["id"])
32
40
  }
33
41
  end
@@ -16,8 +16,12 @@ module Decidim
16
16
 
17
17
  argument :id, !types.String, "The commentable's ID"
18
18
  argument :type, !types.String, "The commentable's class name. i.e. `Decidim::ParticipatoryProcess`"
19
+ argument :locale, !types.String, "The locale for which to get the comments text"
20
+ argument :toggleTranslations, !types.Boolean, "Whether the user asked to toggle the machine translations or not."
19
21
 
20
22
  resolve lambda { |_obj, args, _ctx|
23
+ I18n.locale = args[:locale].presence
24
+ RequestStore.store[:toggle_machine_translations] = args[:toggleTranslations]
21
25
  args[:type].constantize.find(args[:id])
22
26
  }
23
27
  end
@@ -7,7 +7,16 @@ FactoryBot.define do
7
7
  author { build(:user, organization: commentable.organization) }
8
8
  commentable { build(:dummy_resource) }
9
9
  root_commentable { commentable }
10
- body { Faker::Lorem.paragraph }
10
+ body { Decidim::Faker::Localized.paragraph }
11
+
12
+ after(:build) do |comment, evaluator|
13
+ comment.body = if evaluator.body.is_a?(String)
14
+ { comment.root_commentable.organization.default_locale || "en" => evaluator.body }
15
+ else
16
+ evaluator.body
17
+ end
18
+ comment.body = Decidim::ContentProcessor.parse_with_processor(:hashtag, comment.body, current_organization: comment.root_commentable.organization).rewrite
19
+ end
11
20
 
12
21
  trait :comment_on_comment do
13
22
  author { build(:user, organization: root_commentable.organization) }
@@ -12,10 +12,16 @@ shared_context "when it's a comment event" do
12
12
 
13
13
  let(:comment) { create :comment }
14
14
  let(:comment_author) { comment.author }
15
+ let(:normalized_comment_author) { comment.author }
15
16
  let(:comment_author_name) { decidim_html_escape comment.author.name }
16
17
 
17
18
  let(:extra) { { comment_id: comment.id } }
18
- let(:resource_title) { decidim_html_escape resource.title }
19
+ let(:resource_title) { decidim_html_escape(translated(resource.title)) }
20
+ let(:user_group) do
21
+ user_group = create(:user_group, :verified, organization: organization, users: [comment_author])
22
+ comment.update!(user_group: user_group)
23
+ user_group
24
+ end
19
25
  end
20
26
 
21
27
  shared_examples_for "a comment event" do
@@ -23,7 +29,11 @@ shared_examples_for "a comment event" do
23
29
 
24
30
  describe "author" do
25
31
  it "returns the comment author" do
26
- expect(subject.author).to eq(comment_author)
32
+ if defined? user_group_author
33
+ expect(subject.author).to eq(user_group_author)
34
+ else
35
+ expect(subject.author).to eq(comment_author)
36
+ end
27
37
  end
28
38
  end
29
39
 
@@ -16,7 +16,8 @@ RSpec.shared_context "when creating a comment" do
16
16
  "comment" => {
17
17
  "body" => body,
18
18
  "alignment" => alignment,
19
- "user_group_id" => user_group_id
19
+ "user_group_id" => user_group_id,
20
+ "commentable" => commentable
20
21
  }
21
22
  }
22
23
  end
@@ -27,5 +28,5 @@ RSpec.shared_context "when creating a comment" do
27
28
  current_organization: organization
28
29
  )
29
30
  end
30
- let(:command) { described_class.new(form, author, commentable) }
31
+ let(:command) { described_class.new(form, author) }
31
32
  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.19.1"
7
+ "0.23.0"
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-comments
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.19.1
4
+ version: 0.23.0
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: 2019-12-13 00:00:00.000000000 Z
13
+ date: 2020-11-05 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.19.1
21
+ version: 0.23.0
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.19.1
28
+ version: 0.23.0
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: jquery-rails
31
31
  requirement: !ruby/object:Gem::Requirement
@@ -40,34 +40,48 @@ dependencies:
40
40
  - - "~>"
41
41
  - !ruby/object:Gem::Version
42
42
  version: '4.3'
43
+ - !ruby/object:Gem::Dependency
44
+ name: redcarpet
45
+ requirement: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - "~>"
48
+ - !ruby/object:Gem::Version
49
+ version: '3.4'
50
+ type: :runtime
51
+ prerelease: false
52
+ version_requirements: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - "~>"
55
+ - !ruby/object:Gem::Version
56
+ version: '3.4'
43
57
  - !ruby/object:Gem::Dependency
44
58
  name: decidim-admin
45
59
  requirement: !ruby/object:Gem::Requirement
46
60
  requirements:
47
61
  - - '='
48
62
  - !ruby/object:Gem::Version
49
- version: 0.19.1
63
+ version: 0.23.0
50
64
  type: :development
51
65
  prerelease: false
52
66
  version_requirements: !ruby/object:Gem::Requirement
53
67
  requirements:
54
68
  - - '='
55
69
  - !ruby/object:Gem::Version
56
- version: 0.19.1
70
+ version: 0.23.0
57
71
  - !ruby/object:Gem::Dependency
58
72
  name: decidim-dev
59
73
  requirement: !ruby/object:Gem::Requirement
60
74
  requirements:
61
75
  - - '='
62
76
  - !ruby/object:Gem::Version
63
- version: 0.19.1
77
+ version: 0.23.0
64
78
  type: :development
65
79
  prerelease: false
66
80
  version_requirements: !ruby/object:Gem::Requirement
67
81
  requirements:
68
82
  - - '='
69
83
  - !ruby/object:Gem::Version
70
- version: 0.19.1
84
+ version: 0.23.0
71
85
  description: Pluggable comments system for some components.
72
86
  email:
73
87
  - josepjaume@gmail.com
@@ -84,12 +98,18 @@ files:
84
98
  - app/assets/javascripts/decidim/comments/bundle.js.map
85
99
  - app/assets/javascripts/decidim/comments/comments.js.erb
86
100
  - app/cells/decidim/comments/comment_activity_cell.rb
101
+ - app/cells/decidim/comments/comment_cell.rb
102
+ - app/cells/decidim/comments/comment_m/footer.erb
103
+ - app/cells/decidim/comments/comment_m/top.erb
104
+ - app/cells/decidim/comments/comment_m_cell.rb
87
105
  - app/commands/decidim/comments/create_comment.rb
88
106
  - app/commands/decidim/comments/vote_comment.rb
89
107
  - app/events/decidim/comments/comment_by_followed_user_event.rb
108
+ - app/events/decidim/comments/comment_by_followed_user_group_event.rb
90
109
  - app/events/decidim/comments/comment_created_event.rb
91
110
  - app/events/decidim/comments/comment_event.rb
92
111
  - app/events/decidim/comments/reply_created_event.rb
112
+ - app/events/decidim/comments/user_group_mentioned_event.rb
93
113
  - app/events/decidim/comments/user_mentioned_event.rb
94
114
  - app/forms/decidim/comments/comment_form.rb
95
115
  - app/frontend/application/apollo_client.ts
@@ -135,6 +155,7 @@ files:
135
155
  - app/frontend/support/require_all.ts
136
156
  - app/frontend/support/resolve_graphql_query.ts
137
157
  - app/frontend/support/schema.ts
158
+ - app/helpers/decidim/comments/comment_cells_helper.rb
138
159
  - app/models/decidim/comments/application_record.rb
139
160
  - app/models/decidim/comments/comment.rb
140
161
  - app/models/decidim/comments/comment_vote.rb
@@ -143,40 +164,78 @@ files:
143
164
  - app/queries/decidim/comments/metrics/comments_metric_manage.rb
144
165
  - app/queries/decidim/comments/sorted_comments.rb
145
166
  - app/resolvers/decidim/comments/vote_comment_resolver.rb
167
+ - app/scrubbers/decidim/comments/user_input_scrubber.rb
146
168
  - app/services/decidim/comments/comment_creation.rb
147
169
  - app/services/decidim/comments/new_comment_notification_creator.rb
148
170
  - app/types/decidim/comments/commentable_interface.rb
149
171
  - app/types/decidim/comments/commentable_mutation_type.rb
150
172
  - app/types/decidim/comments/commentable_type.rb
173
+ - config/locales/am-ET.yml
151
174
  - config/locales/ar-SA.yml
152
175
  - config/locales/ar.yml
176
+ - config/locales/bg-BG.yml
177
+ - config/locales/bg.yml
153
178
  - config/locales/ca.yml
154
179
  - config/locales/cs-CZ.yml
155
180
  - config/locales/cs.yml
181
+ - config/locales/da-DK.yml
182
+ - config/locales/da.yml
156
183
  - config/locales/de.yml
184
+ - config/locales/el-GR.yml
185
+ - config/locales/el.yml
157
186
  - config/locales/en.yml
158
187
  - config/locales/eo-UY.yml
188
+ - config/locales/eo.yml
159
189
  - config/locales/es-MX.yml
160
190
  - config/locales/es-PY.yml
161
191
  - config/locales/es.yml
192
+ - config/locales/et-EE.yml
193
+ - config/locales/et.yml
162
194
  - config/locales/eu.yml
163
195
  - config/locales/fi-pl.yml
164
196
  - config/locales/fi-plain.yml
165
197
  - config/locales/fi.yml
198
+ - config/locales/fr-CA.yml
166
199
  - config/locales/fr.yml
200
+ - config/locales/ga-IE.yml
167
201
  - config/locales/gl.yml
202
+ - config/locales/hr-HR.yml
203
+ - config/locales/hr.yml
168
204
  - config/locales/hu.yml
169
205
  - config/locales/id-ID.yml
206
+ - config/locales/is-IS.yml
207
+ - config/locales/is.yml
170
208
  - config/locales/it.yml
209
+ - config/locales/ja-JP.yml
210
+ - config/locales/ja.yml
211
+ - config/locales/ko-KR.yml
212
+ - config/locales/ko.yml
213
+ - config/locales/lt-LT.yml
214
+ - config/locales/lt.yml
215
+ - config/locales/lv.yml
216
+ - config/locales/mt-MT.yml
217
+ - config/locales/mt.yml
171
218
  - config/locales/nl.yml
172
219
  - config/locales/no.yml
220
+ - config/locales/om-ET.yml
173
221
  - config/locales/pl.yml
174
222
  - config/locales/pt-BR.yml
175
223
  - config/locales/pt.yml
224
+ - config/locales/ro-RO.yml
176
225
  - config/locales/ru.yml
226
+ - config/locales/sk-SK.yml
227
+ - config/locales/sk.yml
228
+ - config/locales/sl.yml
229
+ - config/locales/so-SO.yml
230
+ - config/locales/sr-CS.yml
177
231
  - config/locales/sv.yml
232
+ - config/locales/ti-ER.yml
178
233
  - config/locales/tr-TR.yml
179
234
  - config/locales/uk.yml
235
+ - config/locales/vi-VN.yml
236
+ - config/locales/vi.yml
237
+ - config/locales/zh-CN.yml
238
+ - config/locales/zh-TW.yml
180
239
  - db/migrate/20161130143508_create_comments.rb
181
240
  - db/migrate/20161214082645_add_depth_to_comments.rb
182
241
  - db/migrate/20161216102820_add_alignment_to_comments.rb
@@ -188,6 +247,9 @@ files:
188
247
  - db/migrate/20181003080320_fix_user_groups_ids_in_comments.rb
189
248
  - db/migrate/20181016142511_make_authors_polymorphic_for_comments.rb
190
249
  - db/migrate/20181019092928_make_author_polymorphic_for_comment_votes.rb
250
+ - db/migrate/20200320105911_index_foreign_keys_in_decidim_comments_comments.rb
251
+ - db/migrate/20200706123136_make_comments_handle_i18n.rb
252
+ - db/migrate/20200828101910_add_commentable_counter_cache_to_comments.rb
191
253
  - db/seeds.rb
192
254
  - lib/decidim/comments.rb
193
255
  - lib/decidim/comments/admin.rb
@@ -201,6 +263,7 @@ files:
201
263
  - lib/decidim/comments/comments_helper.rb
202
264
  - lib/decidim/comments/engine.rb
203
265
  - lib/decidim/comments/export.rb
266
+ - lib/decidim/comments/markdown.rb
204
267
  - lib/decidim/comments/mutation_extensions.rb
205
268
  - lib/decidim/comments/query_extensions.rb
206
269
  - lib/decidim/comments/test.rb
@@ -220,7 +283,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
220
283
  requirements:
221
284
  - - ">="
222
285
  - !ruby/object:Gem::Version
223
- version: '2.5'
286
+ version: '2.6'
224
287
  required_rubygems_version: !ruby/object:Gem::Requirement
225
288
  requirements:
226
289
  - - ">="