decidim-comments 0.31.8 → 0.32.0.rc1
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.
- checksums.yaml +4 -4
- data/README.md +18 -16
- data/app/cells/decidim/comments/comment/deletion_data.erb +3 -7
- data/app/cells/decidim/comments/comment/replies.erb +23 -3
- data/app/cells/decidim/comments/comment/show.erb +5 -19
- data/app/cells/decidim/comments/comment_cell.rb +10 -6
- data/app/cells/decidim/comments/comment_form/show.erb +1 -1
- data/app/cells/decidim/comments/comments/inline.erb +13 -10
- data/app/cells/decidim/comments/comments_cell.rb +7 -2
- data/app/cells/decidim/comments/two_columns_comments/column.erb +7 -2
- data/app/cells/decidim/comments/two_columns_comments/show.erb +7 -4
- data/app/cells/decidim/comments/two_columns_comments_cell.rb +30 -31
- data/app/controllers/decidim/comments/application_controller.rb +0 -2
- data/app/controllers/decidim/comments/comments_controller.rb +32 -7
- data/app/models/decidim/comments/seed.rb +17 -7
- data/app/packs/entrypoints/decidim_comments.js +6 -0
- data/app/packs/src/decidim/comments/comments.component.js +2 -44
- data/app/packs/src/decidim/comments/comments.component.test.js +65 -69
- data/app/packs/src/decidim/comments/comments.js +1 -1
- data/app/packs/src/decidim/comments/controllers/load_more_comments/controller.js +201 -0
- data/app/packs/src/decidim/comments/controllers/show_replies/controller.js +240 -0
- data/app/packs/stylesheets/comments.scss +63 -2
- data/app/queries/decidim/comments/sorted_comments.rb +77 -33
- data/app/views/decidim/comments/admin/shared/_availability_fields.html.erb +1 -1
- data/app/views/decidim/comments/comments/_load_more_comments.html.erb +22 -0
- data/app/views/decidim/comments/comments/create.js.erb +38 -4
- data/app/views/decidim/comments/comments/index.js.erb +58 -23
- data/app/views/decidim/comments/comments/load_more_comments.js.erb +74 -0
- data/app/views/decidim/comments/comments/reload.js.erb +0 -12
- data/app/views/decidim/comments/comments/update.js.erb +3 -13
- data/config/locales/ar.yml +4 -1
- data/config/locales/bg.yml +4 -1
- data/config/locales/bs-BA.yml +0 -1
- data/config/locales/ca-IT.yml +10 -8
- data/config/locales/ca.yml +10 -8
- data/config/locales/cs.yml +7 -8
- data/config/locales/de.yml +10 -8
- data/config/locales/el.yml +4 -1
- data/config/locales/en.yml +10 -7
- data/config/locales/es-MX.yml +10 -8
- data/config/locales/es-PY.yml +10 -8
- data/config/locales/es.yml +10 -8
- data/config/locales/eu.yml +25 -23
- data/config/locales/fi-plain.yml +10 -8
- data/config/locales/fi.yml +10 -8
- data/config/locales/fr-CA.yml +7 -4
- data/config/locales/fr.yml +7 -5
- data/config/locales/ga-IE.yml +0 -1
- data/config/locales/gl.yml +7 -75
- data/config/locales/hu.yml +4 -1
- data/config/locales/id-ID.yml +4 -1
- data/config/locales/is-IS.yml +5 -2
- data/config/locales/it.yml +4 -1
- data/config/locales/ja.yml +9 -7
- data/config/locales/lb.yml +4 -1
- data/config/locales/lt.yml +4 -1
- data/config/locales/lv.yml +4 -1
- data/config/locales/nl.yml +4 -1
- data/config/locales/no.yml +4 -1
- data/config/locales/pl.yml +4 -1
- data/config/locales/pt-BR.yml +10 -4
- data/config/locales/pt.yml +4 -1
- data/config/locales/ro-RO.yml +4 -5
- data/config/locales/ru.yml +4 -1
- data/config/locales/si-LK.yml +0 -1
- data/config/locales/sk.yml +4 -125
- data/config/locales/sl.yml +0 -1
- data/config/locales/sq-AL.yml +0 -1
- data/config/locales/sr-CS.yml +0 -1
- data/config/locales/sv.yml +4 -8
- data/config/locales/tr-TR.yml +4 -1
- data/config/locales/uk.yml +4 -1
- data/config/locales/zh-CN.yml +4 -1
- data/config/locales/zh-TW.yml +4 -1
- data/db/migrate/20260208201401_remove_user_group_comments.rb +13 -0
- data/decidim-comments.gemspec +6 -9
- data/lib/decidim/api/comment_mutation_type.rb +12 -4
- data/lib/decidim/api/commentable_interface.rb +1 -0
- data/lib/decidim/api/commentable_mutation_type.rb +4 -0
- data/lib/decidim/comments/commentable.rb +5 -0
- data/lib/decidim/comments/commentable_with_component.rb +9 -0
- data/lib/decidim/comments/engine.rb +11 -0
- data/lib/decidim/comments/mutation_extensions.rb +0 -12
- data/lib/decidim/comments/query_extensions.rb +0 -9
- data/lib/decidim/comments/test/shared_examples/translatable_comment.rb +1 -0
- data/lib/decidim/comments/version.rb +1 -1
- metadata +15 -14
- data/app/resolvers/decidim/comments/vote_comment_resolver.rb +0 -24
|
@@ -12,6 +12,7 @@ shared_examples_for "a translated comment event" do
|
|
|
12
12
|
let(:comment) { create(:comment, body:, commentable:) }
|
|
13
13
|
let(:en_version) { "<div><p>#{comment.body["en"]}</p></div>" }
|
|
14
14
|
let(:machine_translated) { "<div><p>#{comment.body["machine_translations"]["ca"]}</p></div>" }
|
|
15
|
+
let(:untranslated_content) { en_version }
|
|
15
16
|
|
|
16
17
|
it_behaves_like "a translated event"
|
|
17
18
|
end
|
metadata
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: decidim-comments
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.32.0.rc1
|
|
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:
|
|
11
10
|
bindir: bin
|
|
12
11
|
cert_chain: []
|
|
13
|
-
date:
|
|
12
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
14
13
|
dependencies:
|
|
15
14
|
- !ruby/object:Gem::Dependency
|
|
16
15
|
name: decidim-core
|
|
@@ -18,14 +17,14 @@ dependencies:
|
|
|
18
17
|
requirements:
|
|
19
18
|
- - '='
|
|
20
19
|
- !ruby/object:Gem::Version
|
|
21
|
-
version: 0.
|
|
20
|
+
version: 0.32.0.rc1
|
|
22
21
|
type: :runtime
|
|
23
22
|
prerelease: false
|
|
24
23
|
version_requirements: !ruby/object:Gem::Requirement
|
|
25
24
|
requirements:
|
|
26
25
|
- - '='
|
|
27
26
|
- !ruby/object:Gem::Version
|
|
28
|
-
version: 0.
|
|
27
|
+
version: 0.32.0.rc1
|
|
29
28
|
- !ruby/object:Gem::Dependency
|
|
30
29
|
name: redcarpet
|
|
31
30
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -52,28 +51,28 @@ dependencies:
|
|
|
52
51
|
requirements:
|
|
53
52
|
- - '='
|
|
54
53
|
- !ruby/object:Gem::Version
|
|
55
|
-
version: 0.
|
|
54
|
+
version: 0.32.0.rc1
|
|
56
55
|
type: :development
|
|
57
56
|
prerelease: false
|
|
58
57
|
version_requirements: !ruby/object:Gem::Requirement
|
|
59
58
|
requirements:
|
|
60
59
|
- - '='
|
|
61
60
|
- !ruby/object:Gem::Version
|
|
62
|
-
version: 0.
|
|
61
|
+
version: 0.32.0.rc1
|
|
63
62
|
- !ruby/object:Gem::Dependency
|
|
64
63
|
name: decidim-dev
|
|
65
64
|
requirement: !ruby/object:Gem::Requirement
|
|
66
65
|
requirements:
|
|
67
66
|
- - '='
|
|
68
67
|
- !ruby/object:Gem::Version
|
|
69
|
-
version: 0.
|
|
68
|
+
version: 0.32.0.rc1
|
|
70
69
|
type: :development
|
|
71
70
|
prerelease: false
|
|
72
71
|
version_requirements: !ruby/object:Gem::Requirement
|
|
73
72
|
requirements:
|
|
74
73
|
- - '='
|
|
75
74
|
- !ruby/object:Gem::Version
|
|
76
|
-
version: 0.
|
|
75
|
+
version: 0.32.0.rc1
|
|
77
76
|
description: Pluggable comments system for some components.
|
|
78
77
|
email:
|
|
79
78
|
- josepjaume@gmail.com
|
|
@@ -147,10 +146,11 @@ files:
|
|
|
147
146
|
- app/packs/src/decidim/comments/comments.js
|
|
148
147
|
- app/packs/src/decidim/comments/comments_dropdown.js
|
|
149
148
|
- app/packs/src/decidim/comments/comments_mobile_modal.js
|
|
149
|
+
- app/packs/src/decidim/comments/controllers/load_more_comments/controller.js
|
|
150
|
+
- app/packs/src/decidim/comments/controllers/show_replies/controller.js
|
|
150
151
|
- app/packs/stylesheets/comments.scss
|
|
151
152
|
- app/permissions/decidim/comments/permissions.rb
|
|
152
153
|
- app/queries/decidim/comments/sorted_comments.rb
|
|
153
|
-
- app/resolvers/decidim/comments/vote_comment_resolver.rb
|
|
154
154
|
- app/scrubbers/decidim/comments/user_input_scrubber.rb
|
|
155
155
|
- app/services/decidim/comments/comment_creation.rb
|
|
156
156
|
- app/services/decidim/comments/new_comment_notification_creator.rb
|
|
@@ -158,12 +158,14 @@ files:
|
|
|
158
158
|
- app/views/decidim/comments/comments/_comment.html.erb
|
|
159
159
|
- app/views/decidim/comments/comments/_delete.html.erb
|
|
160
160
|
- app/views/decidim/comments/comments/_edited_comment.html.erb
|
|
161
|
+
- app/views/decidim/comments/comments/_load_more_comments.html.erb
|
|
161
162
|
- app/views/decidim/comments/comments/_moderated.html.erb
|
|
162
163
|
- app/views/decidim/comments/comments/create.js.erb
|
|
163
164
|
- app/views/decidim/comments/comments/delete.js.erb
|
|
164
165
|
- app/views/decidim/comments/comments/deletion_error.js.erb
|
|
165
166
|
- app/views/decidim/comments/comments/error.js.erb
|
|
166
167
|
- app/views/decidim/comments/comments/index.js.erb
|
|
168
|
+
- app/views/decidim/comments/comments/load_more_comments.js.erb
|
|
167
169
|
- app/views/decidim/comments/comments/reload.js.erb
|
|
168
170
|
- app/views/decidim/comments/comments/update.js.erb
|
|
169
171
|
- app/views/decidim/comments/comments/update_error.js.erb
|
|
@@ -272,6 +274,7 @@ files:
|
|
|
272
274
|
- db/migrate/20210402124534_add_participatory_process_to_comments.rb
|
|
273
275
|
- db/migrate/20210529095942_add_deleted_at_column_to_comments.rb
|
|
274
276
|
- db/migrate/20240304092558_add_comment_vote_counter_cache_to_comments.rb
|
|
277
|
+
- db/migrate/20260208201401_remove_user_group_comments.rb
|
|
275
278
|
- db/seeds.rb
|
|
276
279
|
- decidim-comments.gemspec
|
|
277
280
|
- lib/decidim/api/add_comment_type.rb
|
|
@@ -313,7 +316,6 @@ metadata:
|
|
|
313
316
|
funding_uri: https://opencollective.com/decidim
|
|
314
317
|
homepage_uri: https://decidim.org
|
|
315
318
|
source_code_uri: https://github.com/decidim/decidim
|
|
316
|
-
post_install_message:
|
|
317
319
|
rdoc_options: []
|
|
318
320
|
require_paths:
|
|
319
321
|
- lib
|
|
@@ -321,15 +323,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
321
323
|
requirements:
|
|
322
324
|
- - "~>"
|
|
323
325
|
- !ruby/object:Gem::Version
|
|
324
|
-
version: 3.
|
|
326
|
+
version: 3.4.0
|
|
325
327
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
326
328
|
requirements:
|
|
327
329
|
- - ">="
|
|
328
330
|
- !ruby/object:Gem::Version
|
|
329
331
|
version: '0'
|
|
330
332
|
requirements: []
|
|
331
|
-
rubygems_version: 3.
|
|
332
|
-
signing_key:
|
|
333
|
+
rubygems_version: 3.6.9
|
|
333
334
|
specification_version: 4
|
|
334
335
|
summary: Decidim comments module
|
|
335
336
|
test_files: []
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Decidim
|
|
4
|
-
module Comments
|
|
5
|
-
# A GraphQL resolver to handle `upVote` and `downVote` mutations
|
|
6
|
-
# It creates a vote for a comment by the current user.
|
|
7
|
-
class VoteCommentResolver
|
|
8
|
-
def initialize(options = { weight: 1 })
|
|
9
|
-
@weight = options[:weight]
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
def call(obj, _args, ctx)
|
|
13
|
-
Decidim::Comments::VoteComment.call(obj, ctx[:current_user], weight: @weight) do
|
|
14
|
-
on(:ok) do |comment|
|
|
15
|
-
return comment
|
|
16
|
-
end
|
|
17
|
-
on(:invalid) do
|
|
18
|
-
return GraphQL::ExecutionError.new(I18n.t("votes.create.error", scope: "decidim.comments"))
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
end
|