decidim-comments 0.28.0 → 0.28.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/cells/decidim/comments/comment/actions.erb +4 -5
- data/app/cells/decidim/comments/comment/show.erb +7 -5
- data/app/cells/decidim/comments/comment_cell.rb +24 -4
- data/app/cells/decidim/comments/comment_thread/show.erb +1 -1
- data/app/cells/decidim/comments/comments/order_control.erb +2 -1
- data/app/cells/decidim/comments/comments/show.erb +1 -1
- data/app/cells/decidim/comments/comments/user_comments_blocked_warning.erb +2 -2
- data/app/cells/decidim/comments/comments_cell.rb +5 -1
- data/app/events/decidim/comments/comment_event.rb +4 -0
- data/app/models/decidim/comments/comment.rb +2 -2
- data/app/models/decidim/comments/comment_vote.rb +10 -0
- data/app/packs/src/decidim/comments/comments.component.test.js +4 -4
- data/app/packs/src/decidim/comments/comments.component_for_testing.js +1 -0
- data/config/locales/ar.yml +0 -1
- data/config/locales/bg.yml +169 -0
- data/config/locales/ca.yml +13 -8
- data/config/locales/cs.yml +3 -1
- data/config/locales/de.yml +6 -1
- data/config/locales/el.yml +0 -1
- data/config/locales/en.yml +6 -1
- data/config/locales/es-MX.yml +6 -1
- data/config/locales/es-PY.yml +6 -1
- data/config/locales/es.yml +14 -9
- data/config/locales/eu.yml +3 -1
- data/config/locales/fi-plain.yml +6 -1
- data/config/locales/fi.yml +6 -1
- data/config/locales/fr-CA.yml +6 -1
- data/config/locales/fr.yml +6 -1
- data/config/locales/gl.yml +0 -1
- data/config/locales/he-IL.yml +1 -0
- data/config/locales/hu.yml +5 -1
- data/config/locales/it.yml +0 -1
- data/config/locales/ja.yml +5 -1
- data/config/locales/lb.yml +0 -1
- data/config/locales/lt.yml +0 -1
- data/config/locales/lv.yml +0 -1
- data/config/locales/nl.yml +0 -1
- data/config/locales/no.yml +0 -1
- data/config/locales/pl.yml +5 -1
- data/config/locales/pt-BR.yml +0 -1
- data/config/locales/pt.yml +0 -1
- data/config/locales/ro-RO.yml +7 -4
- data/config/locales/sk.yml +0 -1
- data/config/locales/sq-AL.yml +41 -0
- data/config/locales/sr-CS.yml +0 -2
- data/config/locales/sv.yml +0 -1
- data/config/locales/tr-TR.yml +3 -1
- data/config/locales/zh-CN.yml +0 -1
- data/config/locales/zh-TW.yml +0 -1
- data/db/migrate/20240304092558_add_comment_vote_counter_cache_to_comments.rb +21 -0
- data/decidim-comments.gemspec +40 -0
- data/lib/decidim/api/comment_type.rb +2 -2
- data/lib/decidim/comments/test/factories.rb +20 -7
- data/lib/decidim/comments/test/shared_examples/comment_event.rb +34 -1
- data/lib/decidim/comments/test/shared_examples/comment_voted_event.rb +1 -1
- data/lib/decidim/comments/version.rb +1 -1
- metadata +14 -12
- data/config/environment.rb +0 -3
@@ -16,7 +16,7 @@ shared_context "when it is a comment event" do
|
|
16
16
|
let(:comment_author_name) { decidim_html_escape comment.author.name }
|
17
17
|
|
18
18
|
let(:extra) { { comment_id: comment.id } }
|
19
|
-
let(:resource_title) {
|
19
|
+
let(:resource_title) { decidim_sanitize_translated(resource.title) }
|
20
20
|
let(:user_group) do
|
21
21
|
user_group = create(:user_group, :verified, organization:, users: [comment_author])
|
22
22
|
comment.update!(user_group:)
|
@@ -42,4 +42,37 @@ shared_examples_for "a comment event" do
|
|
42
42
|
expect(subject.resource_text).to eq comment.formatted_body
|
43
43
|
end
|
44
44
|
end
|
45
|
+
|
46
|
+
describe "hidden_resource?" do
|
47
|
+
context "when comment is not moderated" do
|
48
|
+
it "returns false" do
|
49
|
+
expect(subject.hidden_resource?).to be false
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
context "when comment is moderated" do
|
54
|
+
let(:comment) { create(:comment, :moderated) }
|
55
|
+
|
56
|
+
it "returns true" do
|
57
|
+
expect(subject.hidden_resource?).to be true
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
context "when resource is not moderated" do
|
62
|
+
it "returns false" do
|
63
|
+
expect(subject.hidden_resource?).to be false
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
context "when resource is moderated" do
|
68
|
+
before do
|
69
|
+
create(:moderation, reportable: resource, hidden_at: 2.days.ago)
|
70
|
+
resource.reload
|
71
|
+
end
|
72
|
+
|
73
|
+
it "returns true" do
|
74
|
+
expect(subject.hidden_resource?).to be true
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
45
78
|
end
|
@@ -12,7 +12,7 @@ shared_examples_for "a comment voted event" do
|
|
12
12
|
let(:comment_vote_author) { comment_vote.author }
|
13
13
|
|
14
14
|
let(:extra) { { comment_id: comment.id, author_id: comment_vote_author.id, weight:, downvotes: 100, upvotes: 999 } }
|
15
|
-
let(:resource_title) {
|
15
|
+
let(:resource_title) { decidim_sanitize_translated(resource.title) }
|
16
16
|
let(:resource_text) { subject.resource_text }
|
17
17
|
|
18
18
|
let(:verb) { weight.positive? ? "upvoted" : "downvoted" }
|
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.
|
4
|
+
version: 0.28.2
|
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:
|
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.
|
21
|
+
version: 0.28.2
|
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.
|
28
|
+
version: 0.28.2
|
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.
|
55
|
+
version: 0.28.2
|
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.
|
62
|
+
version: 0.28.2
|
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.
|
69
|
+
version: 0.28.2
|
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.
|
76
|
+
version: 0.28.2
|
77
77
|
description: Pluggable comments system for some components.
|
78
78
|
email:
|
79
79
|
- josepjaume@gmail.com
|
@@ -168,7 +168,6 @@ files:
|
|
168
168
|
- app/views/decidim/comments/votes/create.js.erb
|
169
169
|
- app/views/decidim/comments/votes/error.js.erb
|
170
170
|
- config/assets.rb
|
171
|
-
- config/environment.rb
|
172
171
|
- config/locales/am-ET.yml
|
173
172
|
- config/locales/ar-SA.yml
|
174
173
|
- config/locales/ar.yml
|
@@ -201,6 +200,7 @@ files:
|
|
201
200
|
- config/locales/ga-IE.yml
|
202
201
|
- config/locales/gl.yml
|
203
202
|
- config/locales/gn-PY.yml
|
203
|
+
- config/locales/he-IL.yml
|
204
204
|
- config/locales/hr-HR.yml
|
205
205
|
- config/locales/hr.yml
|
206
206
|
- config/locales/hu.yml
|
@@ -264,7 +264,9 @@ files:
|
|
264
264
|
- db/migrate/20200828101910_add_commentable_counter_cache_to_comments.rb
|
265
265
|
- db/migrate/20210402124534_add_participatory_process_to_comments.rb
|
266
266
|
- db/migrate/20210529095942_add_deleted_at_column_to_comments.rb
|
267
|
+
- db/migrate/20240304092558_add_comment_vote_counter_cache_to_comments.rb
|
267
268
|
- db/seeds.rb
|
269
|
+
- decidim-comments.gemspec
|
268
270
|
- lib/decidim/api/add_comment_type.rb
|
269
271
|
- lib/decidim/api/comment_mutation_type.rb
|
270
272
|
- lib/decidim/api/comment_type.rb
|
@@ -310,16 +312,16 @@ require_paths:
|
|
310
312
|
- lib
|
311
313
|
required_ruby_version: !ruby/object:Gem::Requirement
|
312
314
|
requirements:
|
313
|
-
- - "
|
315
|
+
- - "~>"
|
314
316
|
- !ruby/object:Gem::Version
|
315
|
-
version:
|
317
|
+
version: 3.1.0
|
316
318
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
317
319
|
requirements:
|
318
320
|
- - ">="
|
319
321
|
- !ruby/object:Gem::Version
|
320
322
|
version: '0'
|
321
323
|
requirements: []
|
322
|
-
rubygems_version: 3.
|
324
|
+
rubygems_version: 3.3.7
|
323
325
|
signing_key:
|
324
326
|
specification_version: 4
|
325
327
|
summary: Decidim comments module
|
data/config/environment.rb
DELETED