decidim-comments 0.31.0 → 0.31.2
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/cells/decidim/comments/comment/alignment_badge.erb +1 -1
- data/app/cells/decidim/comments/comment_s_cell.rb +1 -1
- data/app/events/decidim/comments/comment_event.rb +4 -0
- data/config/locales/eu.yml +1 -1
- data/config/locales/fr-CA.yml +16 -0
- data/config/locales/fr.yml +16 -0
- data/config/locales/pt-BR.yml +63 -0
- data/config/locales/ro-RO.yml +8 -0
- data/config/locales/sv.yml +11 -5
- data/db/data/20260208135000_change_users_in_action_logs_comments.rb +29 -0
- data/lib/decidim/comments/comment_serializer.rb +2 -2
- data/lib/decidim/comments/query_extensions.rb +13 -1
- data/lib/decidim/comments/test/shared_examples/comment_event.rb +32 -0
- data/lib/decidim/comments/version.rb +1 -1
- metadata +9 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ed69ccfce24028b8a0ab5aef6d428449f4c9eada24c3a9d1e007454cce3fe9e9
|
|
4
|
+
data.tar.gz: aca46052376b13afd68a98a33acb219af8bd1c47241c13c72c0a433ad0395f6c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 41f4159c504ec772d7829e01b27af6071ca636788aba5684673954257a218f7ee8e288ebb40785460975bfa5f86f5647ba4213f96874658504dc9447dd76fd47
|
|
7
|
+
data.tar.gz: 48d2de98a4510eff7abebcee5c3ba945d5754e01ec440da4a21a7b358eae8c6e30ab254fd58613f12fc8ee1b78cd840dd9b0d762dc730dee964a2750e83f65c4
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<
|
|
1
|
+
<p class="<%= alignment_badge_classes %> comment__content--label"><%= alignment_badge_label %></p>
|
data/config/locales/eu.yml
CHANGED
|
@@ -189,7 +189,7 @@ eu:
|
|
|
189
189
|
notification_title: <a href="%{author_path}">%{author_name} %{author_nickname}</a> -k zure iruzkinari erantzun dio hemen <a href="%{resource_path}">%{resource_title}</a>
|
|
190
190
|
user_mentioned:
|
|
191
191
|
email_intro: Aipatu zaituzte
|
|
192
|
-
email_outro: 'Jakinarazpen hau jaso duzu hemen: %{resource_title}
|
|
192
|
+
email_outro: 'Jakinarazpen hau jaso duzu hemen aipatu zaituztelako: %{resource_title}.'
|
|
193
193
|
email_subject: 'Hemen: %{resource_title} aipatu zaituzte'
|
|
194
194
|
notification_title: 'Hemen: <a href="%{group_path}">%{group_name} %{group_nickname}</a> egile honek: <a href="%{author_path}">%{author_name} %{author_nickname}</a> aipatu zaitu'
|
|
195
195
|
errors:
|
data/config/locales/fr-CA.yml
CHANGED
|
@@ -110,16 +110,19 @@ fr-CA:
|
|
|
110
110
|
recent: Les plus récents
|
|
111
111
|
title: 'Classement par :'
|
|
112
112
|
comments:
|
|
113
|
+
against: Contre
|
|
113
114
|
blocked_comments_for_unauthorized_user_warning: Vous devez valider votre inscription pour commenter maintenant, mais vous pouvez lire les commentaires précédents.
|
|
114
115
|
blocked_comments_for_user_warning: Vous n'êtes pas en mesure de commenter pour le moment, mais vous pouvez lire les précédents.
|
|
115
116
|
blocked_comments_warning: Les commentaires sont actuellement désactivés, seuls les administrateurs peuvent répondre ou en poster de nouveaux.
|
|
116
117
|
comment_details_title: Détails du commentaire
|
|
118
|
+
in_favor: Pour
|
|
117
119
|
loading: Chargement des commentaires ...
|
|
118
120
|
single_comment_warning: <a href="%{url}">Voir tous les commentaires</a>
|
|
119
121
|
single_comment_warning_title: Vous ne voyez qu'un seul commentaire
|
|
120
122
|
title:
|
|
121
123
|
one: "%{count} commentaire"
|
|
122
124
|
other: "%{count} commentaires"
|
|
125
|
+
top_comment_label: Ayant le plus de votes positifs
|
|
123
126
|
down_vote_button:
|
|
124
127
|
label:
|
|
125
128
|
one: Bouton "Je n'aime pas". %{count} "je n'aime pas"
|
|
@@ -138,6 +141,19 @@ fr-CA:
|
|
|
138
141
|
one: Bouton "J'aime". %{count} "J'aime"
|
|
139
142
|
other: Bouton "J'aime". %{count} "J'aime"
|
|
140
143
|
text: Je suis d'accord avec ce commentaire
|
|
144
|
+
download_your_data:
|
|
145
|
+
help:
|
|
146
|
+
comment_votes:
|
|
147
|
+
id: L'id du vote
|
|
148
|
+
comments:
|
|
149
|
+
body: Le commentaire lui-même
|
|
150
|
+
commentable_id: L'identifiant unique de l"élément commenté
|
|
151
|
+
commentable_type: Le type de l'élément commenté (si c'était un résultat, une proposition, etc.)
|
|
152
|
+
created_at: La date de création de ce commentaire
|
|
153
|
+
depth: L'endroit où ce commentaire se trouve dans l'arborescence des commentaires (si c'est une réponse ou une réponse d'une réponse)
|
|
154
|
+
id: L'identifiant de ce commentaire
|
|
155
|
+
locale: La langue que le participant a utilisé en créant ce commentaire
|
|
156
|
+
root_commentable_url: L'URL de la ressource liée à ce commentaire
|
|
141
157
|
events:
|
|
142
158
|
comments:
|
|
143
159
|
comment_by_followed_user:
|
data/config/locales/fr.yml
CHANGED
|
@@ -110,16 +110,19 @@ fr:
|
|
|
110
110
|
recent: Les plus récents
|
|
111
111
|
title: 'Classement par :'
|
|
112
112
|
comments:
|
|
113
|
+
against: Contre
|
|
113
114
|
blocked_comments_for_unauthorized_user_warning: Vous devez faire vérifier votre compte pour commenter, mais vous pouvez lire les commentaires précédents.
|
|
114
115
|
blocked_comments_for_user_warning: Vous n'êtes pas en mesure de commenter pour le moment, mais vous pouvez lire les précédents.
|
|
115
116
|
blocked_comments_warning: Les commentaires sont actuellement désactivés, seuls les administrateurs peuvent répondre ou en poster de nouveaux.
|
|
116
117
|
comment_details_title: Détails du commentaire
|
|
118
|
+
in_favor: Pour
|
|
117
119
|
loading: Chargement des commentaires ...
|
|
118
120
|
single_comment_warning: <a href="%{url}">Voir tous les commentaires</a>
|
|
119
121
|
single_comment_warning_title: Vous ne voyez qu'un seul commentaire
|
|
120
122
|
title:
|
|
121
123
|
one: "%{count} commentaire"
|
|
122
124
|
other: "%{count} commentaires"
|
|
125
|
+
top_comment_label: Ayant le plus de votes positifs
|
|
123
126
|
down_vote_button:
|
|
124
127
|
label:
|
|
125
128
|
one: Bouton "Je n'aime pas". %{count} "je n'aime pas"
|
|
@@ -138,6 +141,19 @@ fr:
|
|
|
138
141
|
one: Bouton "J'aime". %{count} "J'aime"
|
|
139
142
|
other: Bouton "J'aime". %{count} "J'aime"
|
|
140
143
|
text: Je suis d'accord avec ce commentaire
|
|
144
|
+
download_your_data:
|
|
145
|
+
help:
|
|
146
|
+
comment_votes:
|
|
147
|
+
id: L'id du vote
|
|
148
|
+
comments:
|
|
149
|
+
body: Le commentaire lui-même
|
|
150
|
+
commentable_id: L'identifiant unique de l"élément commenté
|
|
151
|
+
commentable_type: Le type de l'élément commenté (si c'était un résultat, une proposition, etc.)
|
|
152
|
+
created_at: La date de création de ce commentaire
|
|
153
|
+
depth: L'endroit où ce commentaire se trouve dans l'arborescence des commentaires (si c'est une réponse ou une réponse d'une réponse)
|
|
154
|
+
id: L'identifiant de ce commentaire
|
|
155
|
+
locale: La langue que le participant a utilisé en créant ce commentaire
|
|
156
|
+
root_commentable_url: L'URL de la ressource liée à ce commentaire
|
|
141
157
|
events:
|
|
142
158
|
comments:
|
|
143
159
|
comment_by_followed_user:
|
data/config/locales/pt-BR.yml
CHANGED
|
@@ -21,20 +21,38 @@ pt-BR:
|
|
|
21
21
|
changeset:
|
|
22
22
|
comments: Comentários
|
|
23
23
|
comments:
|
|
24
|
+
admin:
|
|
25
|
+
shared:
|
|
26
|
+
availability_fields:
|
|
27
|
+
enabled: Comentários ativados
|
|
28
|
+
end_time: Comentários ativados até
|
|
29
|
+
start_time: Comentários ativados de
|
|
30
|
+
comment_thread:
|
|
31
|
+
accessibility_label: Tópico de comentário iniciado por %{full_name} em %{date}
|
|
24
32
|
comments:
|
|
25
33
|
create:
|
|
26
34
|
error: Houveram erros ao criar o comentário.
|
|
35
|
+
delete:
|
|
36
|
+
error: O comentário não pode ser excluído.
|
|
27
37
|
update:
|
|
28
38
|
error: Houve um erro ao atualizar o comentário.
|
|
39
|
+
comments_title: Comentário
|
|
40
|
+
last_activity:
|
|
41
|
+
new_comment: 'Novo comentário:'
|
|
29
42
|
votes:
|
|
30
43
|
create:
|
|
31
44
|
error: Houve erros ao votar o comentário.
|
|
32
45
|
components:
|
|
33
46
|
add_comment_form:
|
|
47
|
+
account_message: Faça o acesso ou crie uma conta para adicionar o seu comentário.
|
|
48
|
+
add_comment: Adicionar comentário
|
|
34
49
|
form:
|
|
35
50
|
body:
|
|
36
51
|
label: Comente
|
|
37
52
|
placeholder: O que você pensa sobre isso?
|
|
53
|
+
form_error: O texto é obrigatório e não pode ser maior que %{length} caracteres.
|
|
54
|
+
submit_reply: Publicar resposta
|
|
55
|
+
submit_root_comment: Publicar comentário
|
|
38
56
|
opinion:
|
|
39
57
|
label: Sua opinião sobre este tópico
|
|
40
58
|
negative: Negativo
|
|
@@ -50,12 +68,22 @@ pt-BR:
|
|
|
50
68
|
alignment:
|
|
51
69
|
against: Contra
|
|
52
70
|
in_favor: A favor
|
|
71
|
+
answers:
|
|
72
|
+
one: "%{count} resposta"
|
|
73
|
+
other: "%{count} respostas"
|
|
74
|
+
cancel_reply: Cancelar resposta
|
|
75
|
+
comment_label: Comentário %{comment_id}
|
|
76
|
+
comment_label_reply: Comentário %{comment_id} (responder ao comentário %{parent_comment_id})
|
|
53
77
|
confirm_destroy: Tem certeza que deseja excluir este comentário?
|
|
78
|
+
controls_label: Controles de comentários
|
|
54
79
|
delete: Deletar
|
|
55
80
|
deleted_at: Comentário excluído em %{date}
|
|
56
81
|
deleted_user: Usuário excluído
|
|
57
82
|
edit: Editar
|
|
58
83
|
edited: Editado
|
|
84
|
+
hide_replies:
|
|
85
|
+
one: Ocultar resposta
|
|
86
|
+
other: Ocultar {count} respostas
|
|
59
87
|
moderated_at: Comentário moderado em %{date}
|
|
60
88
|
reply: Resposta
|
|
61
89
|
report:
|
|
@@ -65,6 +93,7 @@ pt-BR:
|
|
|
65
93
|
description: Este conteúdo é impróprio?
|
|
66
94
|
details: Comentários adicionais
|
|
67
95
|
reasons:
|
|
96
|
+
does_not_belong: Contém atividades ilegais, ameaças suicidas, informações pessoais ou outra coisa que você acha que não pertence ao %{organization_name}.
|
|
68
97
|
offensive: Contém racismo, sexismo, insultos, ataques pessoais, ameaças de morte, pedidos de suicídio ou qualquer tipo de discurso de ódio.
|
|
69
98
|
spam: Contém clickbait, publicidade, fraudes ou script bots.
|
|
70
99
|
title: Reportar conteúdo impróprio
|
|
@@ -72,6 +101,7 @@ pt-BR:
|
|
|
72
101
|
one: Mostrar resposta
|
|
73
102
|
other: Mostrar %{count} respostas
|
|
74
103
|
single_comment_link_title: Obter o link
|
|
104
|
+
sort_by: 'Classificar por: '
|
|
75
105
|
comment_order_selector:
|
|
76
106
|
order:
|
|
77
107
|
best_rated: Melhores avaliações
|
|
@@ -80,15 +110,23 @@ pt-BR:
|
|
|
80
110
|
recent: Recente
|
|
81
111
|
title: 'Ordenar por:'
|
|
82
112
|
comments:
|
|
113
|
+
against: Contra
|
|
83
114
|
blocked_comments_for_unauthorized_user_warning: Você precisa ser verificado para comentar neste momento, mas pode ler os anteriores.
|
|
84
115
|
blocked_comments_for_user_warning: Você não pode comentar neste momento, mas pode ler os anteriores.
|
|
116
|
+
blocked_comments_warning: Comentários estão atualmente desativados, somente administradores podem responder ou postar novos.
|
|
85
117
|
comment_details_title: Detalhes do comentário
|
|
118
|
+
in_favor: A favor
|
|
86
119
|
loading: Carregando comentários ...
|
|
120
|
+
single_comment_warning: <a href="%{url}">Ver todos os comentários</a>
|
|
87
121
|
single_comment_warning_title: Você está vendo um único comentário
|
|
88
122
|
title:
|
|
89
123
|
one: "%{count} comentário"
|
|
90
124
|
other: "%{count} comentários"
|
|
125
|
+
top_comment_label: Mais votado
|
|
91
126
|
down_vote_button:
|
|
127
|
+
label:
|
|
128
|
+
one: Botão "Não gostei". %{count} não gostei
|
|
129
|
+
other: Botão "Não gostei". %{count} não gostaram
|
|
92
130
|
text: Eu discordo deste comentário
|
|
93
131
|
edit_comment_modal_form:
|
|
94
132
|
close: Fechar
|
|
@@ -99,7 +137,29 @@ pt-BR:
|
|
|
99
137
|
submit: Enviar
|
|
100
138
|
title: Editar seu comentário
|
|
101
139
|
up_vote_button:
|
|
140
|
+
label:
|
|
141
|
+
one: Botão "Gostei". %{count} gostei
|
|
142
|
+
other: Botão "Gostei". %{count} gostaram
|
|
102
143
|
text: Eu concordo com este comentário
|
|
144
|
+
download_your_data:
|
|
145
|
+
help:
|
|
146
|
+
comment_votes:
|
|
147
|
+
comment: A identificação do comentário votado
|
|
148
|
+
created_at: A data em que esta votação foi criada
|
|
149
|
+
id: A identificação da votação
|
|
150
|
+
updated_at: A data da última atualização desta votação
|
|
151
|
+
weight: O peso da votação (1 a favor do voto, -1 contra o voto)
|
|
152
|
+
comments:
|
|
153
|
+
alignment: Se este comentário foi um favorito, contra ou neutro
|
|
154
|
+
author: O nome do usuário que fez este comentário
|
|
155
|
+
body: O comentário em si
|
|
156
|
+
commentable_id: A identificação única do cometário
|
|
157
|
+
commentable_type: O tipo do comentário (se for um resultado, uma proposta, etc.)
|
|
158
|
+
created_at: A data em que este comentário foi criado
|
|
159
|
+
depth: O lugar onde este comentário está nos três comentários (se for uma resposta ou uma resposta de uma resposta)
|
|
160
|
+
id: O identificador para este comentário
|
|
161
|
+
locale: A localidade (linguagem) que o usuário teve ao deixar este comentário
|
|
162
|
+
root_commentable_url: A URL do recurso ligado a este comentário
|
|
103
163
|
events:
|
|
104
164
|
comments:
|
|
105
165
|
comment_by_followed_user:
|
|
@@ -132,3 +192,6 @@ pt-BR:
|
|
|
132
192
|
email_outro: Você recebeu esta notificação porque você foi mencionado em %{resource_title}.
|
|
133
193
|
email_subject: Você foi mencionado em %{resource_title}
|
|
134
194
|
notification_title: Você foi mencionado em <a href="%{resource_path}">%{resource_title}</a> por <a href="%{author_path}">%{author_name} %{author_nickname}</a>
|
|
195
|
+
errors:
|
|
196
|
+
messages:
|
|
197
|
+
cannot_have_comments: não pode ter comentários
|
data/config/locales/ro-RO.yml
CHANGED
|
@@ -130,6 +130,10 @@ ro:
|
|
|
130
130
|
other: "%{count} comentarii"
|
|
131
131
|
top_comment_label: Cele mai votate
|
|
132
132
|
down_vote_button:
|
|
133
|
+
label:
|
|
134
|
+
one: Buton dezaprobare. O dezaprobare
|
|
135
|
+
few: Buton dezaprobare. %{count} dezaprobări
|
|
136
|
+
other: Buton dezaprobare. %{count} dezaprobări
|
|
133
137
|
text: Nu sunt de acord cu acest comentariu
|
|
134
138
|
edit_comment_modal_form:
|
|
135
139
|
close: Închideți
|
|
@@ -140,6 +144,10 @@ ro:
|
|
|
140
144
|
submit: Actualizați
|
|
141
145
|
title: Modificați comentariul dumneavoastră
|
|
142
146
|
up_vote_button:
|
|
147
|
+
label:
|
|
148
|
+
one: Buton apreciere. %{count} apreciază
|
|
149
|
+
few: Buton apreciere. %{count} apreciază
|
|
150
|
+
other: Buton apreciere. %{count} apreciază
|
|
143
151
|
text: Sunt de acord cu acest comentariu
|
|
144
152
|
download_your_data:
|
|
145
153
|
help:
|
data/config/locales/sv.yml
CHANGED
|
@@ -28,7 +28,7 @@ sv:
|
|
|
28
28
|
end_time: Kommentarer aktiverade till och med
|
|
29
29
|
start_time: Kommentarer aktiverade från och med
|
|
30
30
|
comment_thread:
|
|
31
|
-
accessibility_label:
|
|
31
|
+
accessibility_label: Kommentartråd startad av %{full_name}, %{date}
|
|
32
32
|
comments:
|
|
33
33
|
create:
|
|
34
34
|
error: Det gick inte att skapa kommentaren.
|
|
@@ -49,7 +49,7 @@ sv:
|
|
|
49
49
|
form:
|
|
50
50
|
body:
|
|
51
51
|
label: Kommentera
|
|
52
|
-
placeholder: Vad tycker du
|
|
52
|
+
placeholder: Vad tycker du?
|
|
53
53
|
form_error: Texten är obligatorisk och får inte vara längre än %{length} tecken.
|
|
54
54
|
submit_reply: Publicera svar
|
|
55
55
|
submit_root_comment: Publicera kommentar
|
|
@@ -104,10 +104,10 @@ sv:
|
|
|
104
104
|
sort_by: 'Sortera efter: '
|
|
105
105
|
comment_order_selector:
|
|
106
106
|
order:
|
|
107
|
-
best_rated:
|
|
107
|
+
best_rated: Högst betyg
|
|
108
108
|
most_discussed: Mest diskuterade
|
|
109
|
-
older:
|
|
110
|
-
recent:
|
|
109
|
+
older: Gamla
|
|
110
|
+
recent: Nya
|
|
111
111
|
title: 'Sortera efter:'
|
|
112
112
|
comments:
|
|
113
113
|
against: Mot
|
|
@@ -124,6 +124,9 @@ sv:
|
|
|
124
124
|
other: "%{count} kommentarer"
|
|
125
125
|
top_comment_label: Mest stöd
|
|
126
126
|
down_vote_button:
|
|
127
|
+
label:
|
|
128
|
+
one: Ogilla-knapp. %{count} ogillar
|
|
129
|
+
other: Ogilla-knapp. %{count} ogillar
|
|
127
130
|
text: Jag instämmer inte i denna kommentar
|
|
128
131
|
edit_comment_modal_form:
|
|
129
132
|
close: Stäng
|
|
@@ -134,6 +137,9 @@ sv:
|
|
|
134
137
|
submit: Skicka
|
|
135
138
|
title: Redigera din kommentar
|
|
136
139
|
up_vote_button:
|
|
140
|
+
label:
|
|
141
|
+
one: Gilla-knapp. %{count} gillar
|
|
142
|
+
other: Gilla-knapp. %{count} gillar
|
|
137
143
|
text: Jag instämmer i denna kommentar
|
|
138
144
|
download_your_data:
|
|
139
145
|
help:
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class ChangeUsersInActionLogsComments < ActiveRecord::Migration[7.2]
|
|
4
|
+
class ActionLog < ApplicationRecord
|
|
5
|
+
self.table_name = :decidim_action_logs
|
|
6
|
+
|
|
7
|
+
belongs_to :user, class_name: "Decidim::UserBaseEntity"
|
|
8
|
+
|
|
9
|
+
belongs_to :resource,
|
|
10
|
+
polymorphic: true,
|
|
11
|
+
optional: true
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def up
|
|
15
|
+
ActionLog.where(resource_type: "Decidim::Comments::Comment").find_each do |action_log|
|
|
16
|
+
next unless action_log.resource
|
|
17
|
+
|
|
18
|
+
author = action_log.resource.author
|
|
19
|
+
|
|
20
|
+
next unless author.is_a?(Decidim::User)
|
|
21
|
+
next unless author.group?
|
|
22
|
+
|
|
23
|
+
action_log.user_id = author.id
|
|
24
|
+
action_log.extra["user"] ||= {}
|
|
25
|
+
action_log.extra["user"].merge!("name" => author.name, "nickname" => author.nickname)
|
|
26
|
+
action_log.save!
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -14,8 +14,8 @@ module Decidim
|
|
|
14
14
|
body: resource.body.values.first,
|
|
15
15
|
locale: resource.body.keys.first,
|
|
16
16
|
author: {
|
|
17
|
-
id: resource.author.id,
|
|
18
|
-
name: resource.author.name
|
|
17
|
+
id: resource.author.try(:id),
|
|
18
|
+
name: resource.author.try(:name)
|
|
19
19
|
},
|
|
20
20
|
alignment: resource.alignment,
|
|
21
21
|
depth: resource.depth,
|
|
@@ -20,9 +20,21 @@ module Decidim
|
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
def commentable(id:, locale:, toggle_translations:, type:)
|
|
23
|
+
raise GraphQL::ExecutionError, "#{locale} is not a valid locale" unless available_locales.include?(locale)
|
|
24
|
+
|
|
23
25
|
I18n.locale = locale.presence
|
|
24
26
|
RequestStore.store[:toggle_machine_translations] = toggle_translations
|
|
25
|
-
type.constantize.
|
|
27
|
+
type.constantize.find_by(id:)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
private
|
|
31
|
+
|
|
32
|
+
def available_locales
|
|
33
|
+
if context[:current_organization].present?
|
|
34
|
+
context[:current_organization].available_locales
|
|
35
|
+
else
|
|
36
|
+
I18n.available_locales.map(&:to_s)
|
|
37
|
+
end
|
|
26
38
|
end
|
|
27
39
|
end
|
|
28
40
|
end
|
|
@@ -66,4 +66,36 @@ shared_examples_for "a comment event" do
|
|
|
66
66
|
end
|
|
67
67
|
end
|
|
68
68
|
end
|
|
69
|
+
|
|
70
|
+
describe "deleted_resource?" do
|
|
71
|
+
context "when comment is not moderated" do
|
|
72
|
+
it "returns false" do
|
|
73
|
+
expect(subject.deleted_resource?).to be false
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
context "when comment is moderated" do
|
|
78
|
+
let(:comment) { create(:comment, deleted_at: Time.zone.now) }
|
|
79
|
+
|
|
80
|
+
it "returns true" do
|
|
81
|
+
expect(subject.deleted_resource?).to be true
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
context "when resource is not moderated" do
|
|
86
|
+
it "returns false" do
|
|
87
|
+
expect(subject.deleted_resource?).to be false
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
context "when resource is moderated" do
|
|
92
|
+
before do
|
|
93
|
+
resource.update(deleted_at: Time.zone.now)
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
it "returns true" do
|
|
97
|
+
expect(subject.deleted_resource?).to be true
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
end
|
|
69
101
|
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.31.
|
|
4
|
+
version: 0.31.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: 2026-02-26 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.31.
|
|
21
|
+
version: 0.31.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.31.
|
|
28
|
+
version: 0.31.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.31.
|
|
55
|
+
version: 0.31.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.31.
|
|
62
|
+
version: 0.31.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.31.
|
|
69
|
+
version: 0.31.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.31.
|
|
76
|
+
version: 0.31.2
|
|
77
77
|
description: Pluggable comments system for some components.
|
|
78
78
|
email:
|
|
79
79
|
- josepjaume@gmail.com
|
|
@@ -254,6 +254,7 @@ files:
|
|
|
254
254
|
- config/locales/zh-CN.yml
|
|
255
255
|
- config/locales/zh-TW.yml
|
|
256
256
|
- db/data/20251117070404_update_user_groups_references.rb
|
|
257
|
+
- db/data/20260208135000_change_users_in_action_logs_comments.rb
|
|
257
258
|
- db/migrate/20161130143508_create_comments.rb
|
|
258
259
|
- db/migrate/20161214082645_add_depth_to_comments.rb
|
|
259
260
|
- db/migrate/20161216102820_add_alignment_to_comments.rb
|