decidim-comments 0.14.4 → 0.15.0
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/app/assets/javascripts/decidim/comments/bundle.js +1 -1
- data/app/assets/javascripts/decidim/comments/bundle.js.map +1 -1
- data/app/cells/decidim/comments/comment_activity_cell.rb +44 -0
- data/app/commands/decidim/comments/create_comment.rb +15 -6
- data/app/models/decidim/comments/comment.rb +12 -3
- data/app/models/decidim/comments/comment_vote.rb +1 -1
- data/app/models/decidim/comments/seed.rb +14 -3
- data/app/queries/decidim/comments/metrics/comments_metric_manage.rb +93 -0
- data/config/locales/ca.yml +6 -0
- data/config/locales/de.yml +6 -0
- data/config/locales/en.yml +6 -0
- data/config/locales/es-PY.yml +6 -0
- data/config/locales/es.yml +6 -0
- data/config/locales/eu.yml +6 -0
- data/config/locales/fi.yml +6 -0
- data/config/locales/fr.yml +6 -0
- data/config/locales/gl.yml +6 -0
- data/config/locales/hu.yml +6 -0
- data/config/locales/it.yml +6 -0
- data/config/locales/nl.yml +6 -0
- data/config/locales/pl.yml +6 -0
- data/config/locales/pt-BR.yml +6 -0
- data/config/locales/pt.yml +6 -0
- data/config/locales/sv.yml +6 -0
- data/db/migrate/20181003080320_fix_user_groups_ids_in_comments.rb +16 -0
- data/db/migrate/20181016142511_make_authors_polymorphic_for_comments.rb +27 -0
- data/db/migrate/20181019092928_make_author_polymorphic_for_comment_votes.rb +27 -0
- data/lib/decidim/comments/engine.rb +9 -0
- data/lib/decidim/comments/test/factories.rb +13 -0
- data/lib/decidim/comments/version.rb +1 -1
- metadata +14 -9
data/config/locales/hu.yml
CHANGED
@@ -16,6 +16,8 @@ hu:
|
|
16
16
|
decidim:
|
17
17
|
comments:
|
18
18
|
comments: Megjegyzések
|
19
|
+
last_activity:
|
20
|
+
new_comment_at_html: "<span>Új megjegyzés: %{link}</span>"
|
19
21
|
votes:
|
20
22
|
create:
|
21
23
|
error: Hiba történt a megjegyzésre való szavazáskor.
|
@@ -87,6 +89,10 @@ hu:
|
|
87
89
|
email_outro: Ezt az értesítést azért kaptad, mert korábban megemlítettek a(z) "%{resource_title}" témában.
|
88
90
|
email_subject: Megemlítettek a(z) %{resource_title} témában
|
89
91
|
notification_title: '<a href="%{author_path}">%{author_name} %{author_nickname}</a> megemlített itt: <a href="%{resource_path}">%{resource_title}</a>'
|
92
|
+
metrics:
|
93
|
+
comments:
|
94
|
+
object: Hozzászólások
|
95
|
+
title: Hozzászólások
|
90
96
|
errors:
|
91
97
|
messages:
|
92
98
|
cannot_have_comments: nem tudsz megjegyzéseket tenni
|
data/config/locales/it.yml
CHANGED
@@ -16,6 +16,8 @@ it:
|
|
16
16
|
decidim:
|
17
17
|
comments:
|
18
18
|
comments: Commenti
|
19
|
+
last_activity:
|
20
|
+
new_comment_at_html: "<span>Nuovo commento al %{link}</span>"
|
19
21
|
votes:
|
20
22
|
create:
|
21
23
|
error: Ci sono stati errori durante la votazione del commento.
|
@@ -87,6 +89,10 @@ it:
|
|
87
89
|
email_outro: Hai ricevuto questa notifica perché sei stato citato in %{resource_title}.
|
88
90
|
email_subject: Sei stato menzionato in %{resource_title}
|
89
91
|
notification_title: Sei stato citato in <a href="%{resource_path}">%{resource_title}</a> di <a href="%{author_path}">%{author_name} %{author_nickname}</a>
|
92
|
+
metrics:
|
93
|
+
comments:
|
94
|
+
object: Commenti
|
95
|
+
title: Commenti
|
90
96
|
errors:
|
91
97
|
messages:
|
92
98
|
cannot_have_comments: non si possono fare commenti
|
data/config/locales/nl.yml
CHANGED
@@ -16,6 +16,8 @@ nl:
|
|
16
16
|
decidim:
|
17
17
|
comments:
|
18
18
|
comments: Comments
|
19
|
+
last_activity:
|
20
|
+
new_comment_at_html: "<span>Nieuwe opmerking op %{link}</span>"
|
19
21
|
votes:
|
20
22
|
create:
|
21
23
|
error: Er zijn fouten geweest bij het stemmen van de reactie.
|
@@ -87,6 +89,10 @@ nl:
|
|
87
89
|
email_outro: Je hebt deze melding ontvangen omdat je bent getagd in %{resource_title}.
|
88
90
|
email_subject: Je bent getagd in %{resource_title}
|
89
91
|
notification_title: Je bent getagd in <a href="%{resource_path}">%{resource_title}</a> door <a href="%{author_path}">%{author_name} %{author_nickname}</a>
|
92
|
+
metrics:
|
93
|
+
comments:
|
94
|
+
object: opmerkingen
|
95
|
+
title: Comments
|
90
96
|
errors:
|
91
97
|
messages:
|
92
98
|
cannot_have_comments: Kan geen reacties hebben
|
data/config/locales/pl.yml
CHANGED
@@ -20,6 +20,8 @@ pl:
|
|
20
20
|
decidim:
|
21
21
|
comments:
|
22
22
|
comments: Komentarze
|
23
|
+
last_activity:
|
24
|
+
new_comment_at_html: "<span>Nowy komentarz na %{link}</span>"
|
23
25
|
votes:
|
24
26
|
create:
|
25
27
|
error: Podczas głosowania komentarza wystąpiły błędy.
|
@@ -91,6 +93,10 @@ pl:
|
|
91
93
|
email_outro: Otrzymałeś to powiadomienie, ponieważ wspomniano o nim w %{resource_title}.
|
92
94
|
email_subject: Wspomnieliś cie w %{resource_title}
|
93
95
|
notification_title: Wspomniałeś w <a href="%{resource_path}">%{resource_title}</a> przez <a href="%{author_path}">%{author_name} %{author_nickname}</a>
|
96
|
+
metrics:
|
97
|
+
comments:
|
98
|
+
object: komentarze
|
99
|
+
title: Komentarze
|
94
100
|
errors:
|
95
101
|
messages:
|
96
102
|
cannot_have_comments: Nie może mieć komentarzy
|
data/config/locales/pt-BR.yml
CHANGED
@@ -16,6 +16,8 @@ pt-BR:
|
|
16
16
|
decidim:
|
17
17
|
comments:
|
18
18
|
comments: Comentários
|
19
|
+
last_activity:
|
20
|
+
new_comment_at_html: "<span>Novo comentário em %{link}</span>"
|
19
21
|
votes:
|
20
22
|
create:
|
21
23
|
error: Houve erros ao votar o comentário.
|
@@ -87,6 +89,10 @@ pt-BR:
|
|
87
89
|
email_outro: Você recebeu esta notificação porque você foi mencionado em %{resource_title}.
|
88
90
|
email_subject: Você foi mencionado em %{resource_title}
|
89
91
|
notification_title: Você foi mencionado em <a href="%{resource_path}">%{resource_title}</a> por <a href="%{author_path}">%{author_name} %{author_nickname}</a>
|
92
|
+
metrics:
|
93
|
+
comments:
|
94
|
+
object: comentários
|
95
|
+
title: Comentários
|
90
96
|
errors:
|
91
97
|
messages:
|
92
98
|
cannot_have_comments: não pode ter comentários
|
data/config/locales/pt.yml
CHANGED
@@ -16,6 +16,8 @@ pt:
|
|
16
16
|
decidim:
|
17
17
|
comments:
|
18
18
|
comments: Comentários
|
19
|
+
last_activity:
|
20
|
+
new_comment_at_html: "<span>Novo comentário em %{link}</span>"
|
19
21
|
votes:
|
20
22
|
create:
|
21
23
|
error: Houve erros ao votar o comentário.
|
@@ -87,6 +89,10 @@ pt:
|
|
87
89
|
email_outro: Você recebeu esta notificação porque você foi mencionado em %{resource_title}.
|
88
90
|
email_subject: Você foi mencionado em %{resource_title}
|
89
91
|
notification_title: Você foi mencionado em <a href="%{resource_path}">%{resource_title}</a> por <a href="%{author_path}">%{author_name} %{author_nickname}</a>
|
92
|
+
metrics:
|
93
|
+
comments:
|
94
|
+
object: comentários
|
95
|
+
title: Comentários
|
90
96
|
errors:
|
91
97
|
messages:
|
92
98
|
cannot_have_comments: não pode ter comentários
|
data/config/locales/sv.yml
CHANGED
@@ -16,6 +16,8 @@ sv:
|
|
16
16
|
decidim:
|
17
17
|
comments:
|
18
18
|
comments: Kommentarer
|
19
|
+
last_activity:
|
20
|
+
new_comment_at_html: "<span>Ny kommentar på %{link}</span>"
|
19
21
|
votes:
|
20
22
|
create:
|
21
23
|
error: Det har blivit fel när du röstar om kommentaren.
|
@@ -87,6 +89,10 @@ sv:
|
|
87
89
|
email_outro: Du har fått denna notis eftersom du har nämnts i %{resource_title}.
|
88
90
|
email_subject: Du har nämnts i %{resource_title}
|
89
91
|
notification_title: Du har nämnts i <a href="%{resource_path}">%{resource_title}</a> av <a href="%{author_path}">%{author_name} %{author_nickname}</a>
|
92
|
+
metrics:
|
93
|
+
comments:
|
94
|
+
object: kommentarer
|
95
|
+
title: kommentarer
|
90
96
|
errors:
|
91
97
|
messages:
|
92
98
|
cannot_have_comments: kan inte ha kommentarer
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class FixUserGroupsIdsInComments < ActiveRecord::Migration[5.2]
|
4
|
+
# rubocop:disable Rails/SkipsModelValidations
|
5
|
+
def change
|
6
|
+
Decidim::UserGroup.find_each do |group|
|
7
|
+
old_id = group.extended_data["old_user_group_id"]
|
8
|
+
next unless old_id
|
9
|
+
|
10
|
+
Decidim::Comments::Comment
|
11
|
+
.where(decidim_user_group_id: old_id)
|
12
|
+
.update_all(decidim_user_group_id: group.id)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
# rubocop:enable Rails/SkipsModelValidations
|
16
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class MakeAuthorsPolymorphicForComments < ActiveRecord::Migration[5.2]
|
4
|
+
class Comment < ApplicationRecord
|
5
|
+
self.table_name = :decidim_comments_comments
|
6
|
+
end
|
7
|
+
def change
|
8
|
+
add_column :decidim_comments_comments, :decidim_author_type, :string
|
9
|
+
|
10
|
+
reversible do |direction|
|
11
|
+
direction.up do
|
12
|
+
execute <<~SQL.squish
|
13
|
+
UPDATE decidim_comments_comments
|
14
|
+
SET decidim_author_type = 'Decidim::UserBaseEntity'
|
15
|
+
SQL
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
add_index :decidim_comments_comments,
|
20
|
+
[:decidim_author_id, :decidim_author_type],
|
21
|
+
name: "index_decidim_comments_comments_on_decidim_author"
|
22
|
+
|
23
|
+
change_column_null :decidim_comments_comments, :decidim_author_id, false
|
24
|
+
change_column_null :decidim_comments_comments, :decidim_author_type, false
|
25
|
+
Comment.reset_column_information
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class MakeAuthorPolymorphicForCommentVotes < ActiveRecord::Migration[5.2]
|
4
|
+
class CommentVote < ApplicationRecord
|
5
|
+
self.table_name = :decidim_comments_comment_votes
|
6
|
+
end
|
7
|
+
def change
|
8
|
+
add_column :decidim_comments_comment_votes, :decidim_author_type, :string
|
9
|
+
|
10
|
+
reversible do |direction|
|
11
|
+
direction.up do
|
12
|
+
execute <<~SQL.squish
|
13
|
+
UPDATE decidim_comments_comment_votes
|
14
|
+
SET decidim_author_type = 'Decidim::UserBaseEntity'
|
15
|
+
SQL
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
add_index :decidim_comments_comment_votes,
|
20
|
+
[:decidim_author_id, :decidim_author_type],
|
21
|
+
name: "index_decidim_comments_comment_votes_on_decidim_author"
|
22
|
+
|
23
|
+
change_column_null :decidim_comments_comment_votes, :decidim_author_id, false
|
24
|
+
change_column_null :decidim_comments_comment_votes, :decidim_author_type, false
|
25
|
+
CommentVote.reset_column_information
|
26
|
+
end
|
27
|
+
end
|
@@ -42,6 +42,15 @@ module Decidim
|
|
42
42
|
end
|
43
43
|
end
|
44
44
|
end
|
45
|
+
|
46
|
+
initializer "decidim_comments.register_metrics" do
|
47
|
+
Decidim.metrics_registry.register(
|
48
|
+
:comments,
|
49
|
+
"Decidim::Comments::Metrics::CommentsMetricManage",
|
50
|
+
Decidim::MetricRegistry::NOT_HIGHLIGHTED,
|
51
|
+
6
|
52
|
+
)
|
53
|
+
end
|
45
54
|
end
|
46
55
|
end
|
47
56
|
end
|
@@ -8,6 +8,19 @@ FactoryBot.define do
|
|
8
8
|
commentable { build(:dummy_resource) }
|
9
9
|
root_commentable { commentable }
|
10
10
|
body { Faker::Lorem.paragraph }
|
11
|
+
|
12
|
+
trait :comment_on_comment do
|
13
|
+
author { build(:user, organization: root_commentable.organization) }
|
14
|
+
commentable do
|
15
|
+
build(
|
16
|
+
:comment,
|
17
|
+
author: author,
|
18
|
+
root_commentable: root_commentable,
|
19
|
+
commentable: root_commentable
|
20
|
+
)
|
21
|
+
end
|
22
|
+
root_commentable { build(:dummy_resource) }
|
23
|
+
end
|
11
24
|
end
|
12
25
|
|
13
26
|
factory :comment_vote, class: "Decidim::Comments::CommentVote" do
|
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.
|
4
|
+
version: 0.15.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: 2018-
|
13
|
+
date: 2018-11-12 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.
|
21
|
+
version: 0.15.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.
|
28
|
+
version: 0.15.0
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: jquery-rails
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
@@ -46,28 +46,28 @@ dependencies:
|
|
46
46
|
requirements:
|
47
47
|
- - '='
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: 0.
|
49
|
+
version: 0.15.0
|
50
50
|
type: :development
|
51
51
|
prerelease: false
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
54
|
- - '='
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version: 0.
|
56
|
+
version: 0.15.0
|
57
57
|
- !ruby/object:Gem::Dependency
|
58
58
|
name: decidim-dev
|
59
59
|
requirement: !ruby/object:Gem::Requirement
|
60
60
|
requirements:
|
61
61
|
- - '='
|
62
62
|
- !ruby/object:Gem::Version
|
63
|
-
version: 0.
|
63
|
+
version: 0.15.0
|
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.
|
70
|
+
version: 0.15.0
|
71
71
|
description: Pluggable comments system for some components.
|
72
72
|
email:
|
73
73
|
- josepjaume@gmail.com
|
@@ -83,6 +83,7 @@ files:
|
|
83
83
|
- app/assets/javascripts/decidim/comments/bundle.js
|
84
84
|
- app/assets/javascripts/decidim/comments/bundle.js.map
|
85
85
|
- app/assets/javascripts/decidim/comments/comments.js.erb
|
86
|
+
- app/cells/decidim/comments/comment_activity_cell.rb
|
86
87
|
- app/commands/decidim/comments/create_comment.rb
|
87
88
|
- app/commands/decidim/comments/vote_comment.rb
|
88
89
|
- app/events/decidim/comments/comment_by_followed_user_event.rb
|
@@ -137,6 +138,7 @@ files:
|
|
137
138
|
- app/models/decidim/comments/comment.rb
|
138
139
|
- app/models/decidim/comments/comment_vote.rb
|
139
140
|
- app/models/decidim/comments/seed.rb
|
141
|
+
- app/queries/decidim/comments/metrics/comments_metric_manage.rb
|
140
142
|
- app/queries/decidim/comments/sorted_comments.rb
|
141
143
|
- app/resolvers/decidim/comments/vote_comment_resolver.rb
|
142
144
|
- app/services/decidim/comments/comment_creation.rb
|
@@ -170,6 +172,9 @@ files:
|
|
170
172
|
- db/migrate/20170504085413_add_root_commentable_to_comments.rb
|
171
173
|
- db/migrate/20170510091348_update_root_commentable_for_comments.rb
|
172
174
|
- db/migrate/20170510091409_set_root_commentable_null_constraints.rb
|
175
|
+
- db/migrate/20181003080320_fix_user_groups_ids_in_comments.rb
|
176
|
+
- db/migrate/20181016142511_make_authors_polymorphic_for_comments.rb
|
177
|
+
- db/migrate/20181019092928_make_author_polymorphic_for_comment_votes.rb
|
173
178
|
- db/seeds.rb
|
174
179
|
- lib/decidim/comments.rb
|
175
180
|
- lib/decidim/comments/admin.rb
|
@@ -209,7 +214,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
209
214
|
version: '0'
|
210
215
|
requirements: []
|
211
216
|
rubyforge_project:
|
212
|
-
rubygems_version: 2.7.
|
217
|
+
rubygems_version: 2.7.6
|
213
218
|
signing_key:
|
214
219
|
specification_version: 4
|
215
220
|
summary: Decidim comments module
|