decidim-comments 0.26.2 → 0.27.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/app/cells/decidim/comments/comment_cell.rb +2 -2
- data/app/cells/decidim/comments/comments/comments_loading.erb +3 -0
- data/app/cells/decidim/comments/comments/show.erb +1 -0
- data/app/cells/decidim/comments/comments_cell.rb +7 -12
- data/app/commands/decidim/comments/create_comment.rb +1 -1
- data/app/commands/decidim/comments/delete_comment.rb +1 -1
- data/app/commands/decidim/comments/update_comment.rb +1 -1
- data/app/commands/decidim/comments/vote_comment.rb +1 -1
- data/app/controllers/decidim/comments/comments_controller.rb +13 -9
- data/app/helpers/decidim/comments/comment_cells_helper.rb +1 -1
- data/app/models/decidim/comments/comment.rb +7 -4
- data/app/models/decidim/comments/comment_vote.rb +1 -1
- data/app/packs/src/decidim/comments/comments.component.js +32 -13
- data/app/packs/src/decidim/comments/comments.component.test.js +9 -5
- data/app/permissions/decidim/comments/permissions.rb +5 -7
- data/app/queries/decidim/comments/sorted_comments.rb +1 -3
- data/app/services/decidim/comments/new_comment_notification_creator.rb +1 -1
- data/app/views/decidim/comments/comments/index.js.erb +1 -0
- data/app/views/decidim/comments/comments/reload.js.erb +1 -0
- data/config/locales/am-ET.yml +1 -0
- data/config/locales/ar.yml +1 -0
- data/config/locales/bg.yml +1 -0
- data/config/locales/ca.yml +1 -0
- data/config/locales/cs.yml +1 -0
- data/config/locales/da.yml +1 -0
- data/config/locales/de.yml +1 -0
- data/config/locales/el.yml +1 -0
- data/config/locales/eo.yml +1 -0
- data/config/locales/es-MX.yml +1 -0
- data/config/locales/es-PY.yml +1 -0
- data/config/locales/es.yml +1 -0
- data/config/locales/et.yml +1 -0
- data/config/locales/eu.yml +1 -0
- data/config/locales/fi-plain.yml +1 -0
- data/config/locales/fi.yml +1 -0
- data/config/locales/fr-CA.yml +1 -0
- data/config/locales/fr.yml +1 -0
- data/config/locales/ga-IE.yml +1 -0
- data/config/locales/gl.yml +1 -0
- data/config/locales/hr.yml +1 -0
- data/config/locales/hu.yml +1 -0
- data/config/locales/id-ID.yml +1 -0
- data/config/locales/is-IS.yml +2 -1
- data/config/locales/it.yml +1 -0
- data/config/locales/ja.yml +1 -0
- data/config/locales/ko.yml +1 -0
- data/config/locales/lb.yml +1 -0
- data/config/locales/lt.yml +1 -0
- data/config/locales/lv.yml +1 -0
- data/config/locales/mt.yml +1 -0
- data/config/locales/nl.yml +1 -0
- data/config/locales/no.yml +1 -0
- data/config/locales/om-ET.yml +1 -0
- data/config/locales/pl.yml +1 -0
- data/config/locales/pt-BR.yml +2 -1
- data/config/locales/pt.yml +1 -0
- data/config/locales/ro-RO.yml +1 -0
- data/config/locales/ru.yml +1 -0
- data/config/locales/si-LK.yml +1 -0
- data/config/locales/sk.yml +1 -0
- data/config/locales/sl.yml +1 -0
- data/config/locales/so-SO.yml +1 -0
- data/config/locales/sr-CS.yml +1 -0
- data/config/locales/sv.yml +1 -0
- data/config/locales/sw-KE.yml +1 -0
- data/config/locales/ti-ER.yml +1 -0
- data/config/locales/tr-TR.yml +1 -0
- data/config/locales/uk.yml +1 -0
- data/config/locales/val-ES.yml +1 -0
- data/config/locales/vi.yml +1 -0
- data/config/locales/zh-CN.yml +1 -0
- data/config/locales/zh-TW.yml +1 -0
- data/db/migrate/20181016142511_make_authors_polymorphic_for_comments.rb +1 -0
- data/db/migrate/20181019092928_make_author_polymorphic_for_comment_votes.rb +1 -0
- data/lib/decidim/comments/comment_serializer.rb +1 -1
- data/lib/decidim/comments/comment_vote_serializer.rb +1 -1
- data/lib/decidim/comments/test/shared_examples/translatable_comment.rb +1 -1
- data/lib/decidim/comments/version.rb +1 -1
- metadata +13 -12
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 15e0e5dd8fbb2fc7171061fa36077e83f956f3ada42b41dfa32cd8e8f60cdd0a
|
|
4
|
+
data.tar.gz: 6cb4e67d56972f657983cc174806b8766d0916fb55b7ca783ee2e8a684859283
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a3a7482658e91430342214a3d668979c0450b1203c28725ab083c46773b6c39474f148a4489238c90187cda2407a81edbc1c7a1b9bd26944081ce36261f86e7e
|
|
7
|
+
data.tar.gz: ee42d7e4922a5cbc826a1a98f73b1d1056d4ce6879a398da32ad6962d9987323f7b37b2e1fc57111251baf2185301cbdc0e370621107778afd2fb47263dc285b
|
|
@@ -186,11 +186,11 @@ module Decidim
|
|
|
186
186
|
end
|
|
187
187
|
|
|
188
188
|
def has_replies?
|
|
189
|
-
model.comment_threads.
|
|
189
|
+
model.comment_threads.not_hidden.not_deleted.exists?
|
|
190
190
|
end
|
|
191
191
|
|
|
192
192
|
def has_replies_in_children?
|
|
193
|
-
|
|
193
|
+
model.descendants.where(decidim_commentable_type: "Decidim::Comments::Comment").not_hidden.not_deleted.exists?
|
|
194
194
|
end
|
|
195
195
|
|
|
196
196
|
# action_authorization_button expects current_component to be available
|
|
@@ -22,6 +22,12 @@ module Decidim
|
|
|
22
22
|
render :single_comment_warning
|
|
23
23
|
end
|
|
24
24
|
|
|
25
|
+
def comments_loading
|
|
26
|
+
return if single_comment?
|
|
27
|
+
|
|
28
|
+
render :comments_loading
|
|
29
|
+
end
|
|
30
|
+
|
|
25
31
|
def blocked_comments_warning
|
|
26
32
|
return unless comments_blocked?
|
|
27
33
|
return unless user_comments_blocked?
|
|
@@ -43,11 +49,7 @@ module Decidim
|
|
|
43
49
|
end
|
|
44
50
|
|
|
45
51
|
def comments
|
|
46
|
-
|
|
47
|
-
[single_comment]
|
|
48
|
-
else
|
|
49
|
-
SortedComments.for(model, order_by: order)
|
|
50
|
-
end
|
|
52
|
+
single_comment? ? [single_comment] : []
|
|
51
53
|
end
|
|
52
54
|
|
|
53
55
|
def comments_count
|
|
@@ -97,17 +99,10 @@ module Decidim
|
|
|
97
99
|
commentableGid: model.to_signed_global_id.to_s,
|
|
98
100
|
commentsUrl: decidim_comments.comments_path,
|
|
99
101
|
rootDepth: root_depth,
|
|
100
|
-
lastCommentId: last_comment_id,
|
|
101
102
|
order: order
|
|
102
103
|
}
|
|
103
104
|
end
|
|
104
105
|
|
|
105
|
-
def last_comment_id
|
|
106
|
-
Decidim::Comments::Comment.where(
|
|
107
|
-
root_commentable: model
|
|
108
|
-
).order(:id).pluck(:id).last
|
|
109
|
-
end
|
|
110
|
-
|
|
111
106
|
def single_comment?
|
|
112
107
|
single_comment.present?
|
|
113
108
|
end
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
module Decidim
|
|
4
4
|
module Comments
|
|
5
5
|
# A command with all the business logic to update an existing comment
|
|
6
|
-
class UpdateComment <
|
|
6
|
+
class UpdateComment < Decidim::Command
|
|
7
7
|
# Public: Initializes the command.
|
|
8
8
|
#
|
|
9
9
|
# comment - Decidim::Comments::Comment
|
|
@@ -23,6 +23,12 @@ module Decidim
|
|
|
23
23
|
order_by: order,
|
|
24
24
|
after: params.fetch(:after, 0).to_i
|
|
25
25
|
)
|
|
26
|
+
@comments = @comments.reject do |comment|
|
|
27
|
+
next if comment.depth < 1
|
|
28
|
+
next if !comment.deleted? && !comment.hidden?
|
|
29
|
+
|
|
30
|
+
comment.commentable.descendants.where(decidim_commentable_type: "Decidim::Comments::Comment").not_hidden.not_deleted.blank?
|
|
31
|
+
end
|
|
26
32
|
@comments_count = commentable.comments_count
|
|
27
33
|
|
|
28
34
|
respond_to do |format|
|
|
@@ -136,14 +142,12 @@ module Decidim
|
|
|
136
142
|
|
|
137
143
|
def handle_success(comment)
|
|
138
144
|
@comment = comment
|
|
139
|
-
@comments_count =
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
end
|
|
146
|
-
end
|
|
145
|
+
@comments_count = case commentable
|
|
146
|
+
when Decidim::Comments::Comment
|
|
147
|
+
commentable.root_commentable.comments_count
|
|
148
|
+
else
|
|
149
|
+
commentable.comments_count
|
|
150
|
+
end
|
|
147
151
|
end
|
|
148
152
|
|
|
149
153
|
def commentable_gid
|
|
@@ -172,7 +176,7 @@ module Decidim
|
|
|
172
176
|
end
|
|
173
177
|
|
|
174
178
|
def commentable_path
|
|
175
|
-
return commentable.polymorphic_resource_path({}) if commentable
|
|
179
|
+
return commentable.polymorphic_resource_path({}) if commentable.respond_to?(:polymorphic_resource_path)
|
|
176
180
|
|
|
177
181
|
resource_locator(commentable).path
|
|
178
182
|
end
|
|
@@ -14,7 +14,7 @@ module Decidim
|
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
def resource_link_path
|
|
17
|
-
return root_commentable.polymorphic_resource_path(url_params) if root_commentable
|
|
17
|
+
return root_commentable.polymorphic_resource_path(url_params) if root_commentable.respond_to?(:polymorphic_resource_path)
|
|
18
18
|
|
|
19
19
|
resource_locator(root_commentable).path(url_params)
|
|
20
20
|
end
|
|
@@ -10,12 +10,13 @@ module Decidim
|
|
|
10
10
|
include Decidim::Authorable
|
|
11
11
|
include Decidim::Comments::Commentable
|
|
12
12
|
include Decidim::FriendlyDates
|
|
13
|
-
include Decidim::
|
|
13
|
+
include Decidim::DownloadYourData
|
|
14
14
|
include Decidim::Traceable
|
|
15
15
|
include Decidim::Loggable
|
|
16
16
|
include Decidim::Searchable
|
|
17
17
|
include Decidim::TranslatableResource
|
|
18
18
|
include Decidim::TranslatableAttributes
|
|
19
|
+
include Decidim::ActsAsTree
|
|
19
20
|
|
|
20
21
|
# Limit the max depth of a comment tree. If C is a comment and R is a reply:
|
|
21
22
|
# C (depth 0)
|
|
@@ -27,6 +28,8 @@ module Decidim
|
|
|
27
28
|
|
|
28
29
|
translatable_fields :body
|
|
29
30
|
|
|
31
|
+
parent_item_foreign_key :decidim_commentable_id
|
|
32
|
+
|
|
30
33
|
belongs_to :commentable, foreign_key: "decidim_commentable_id", foreign_type: "decidim_commentable_type", polymorphic: true
|
|
31
34
|
belongs_to :root_commentable, foreign_key: "decidim_root_commentable_id", foreign_type: "decidim_root_commentable_type", polymorphic: true, touch: true
|
|
32
35
|
belongs_to :participatory_space, foreign_key: "decidim_participatory_space_id", foreign_type: "decidim_participatory_space_type", polymorphic: true, optional: true
|
|
@@ -130,7 +133,7 @@ module Decidim
|
|
|
130
133
|
def reported_content_url
|
|
131
134
|
url_params = { anchor: "comment_#{id}" }
|
|
132
135
|
|
|
133
|
-
if root_commentable
|
|
136
|
+
if root_commentable.respond_to?(:polymorphic_resource_url)
|
|
134
137
|
root_commentable.polymorphic_resource_url(url_params)
|
|
135
138
|
else
|
|
136
139
|
ResourceLocatorPresenter.new(root_commentable).url(url_params)
|
|
@@ -155,7 +158,7 @@ module Decidim
|
|
|
155
158
|
# Expects all +resources+ to be of the same "commentable_type".
|
|
156
159
|
# If the result is not `Decidim::Comments::Commentable` returns `nil`.
|
|
157
160
|
def self.user_commentators_ids_in(resources)
|
|
158
|
-
if resources.first
|
|
161
|
+
if resources.first.is_a?(Decidim::Comments::Commentable)
|
|
159
162
|
commentable_type = resources.first.class.name
|
|
160
163
|
Decidim::Comments::Comment.select("DISTINCT decidim_author_id").not_hidden.not_deleted
|
|
161
164
|
.where(decidim_commentable_id: resources.pluck(:id))
|
|
@@ -167,7 +170,7 @@ module Decidim
|
|
|
167
170
|
end
|
|
168
171
|
|
|
169
172
|
def can_participate?(user)
|
|
170
|
-
return true unless root_commentable
|
|
173
|
+
return true unless root_commentable.respond_to?(:can_participate?)
|
|
171
174
|
|
|
172
175
|
root_commentable.can_participate?(user)
|
|
173
176
|
end
|
|
@@ -5,7 +5,7 @@ module Decidim
|
|
|
5
5
|
# A comment can include user votes. A user should be able to upVote, votes with
|
|
6
6
|
# weight 1 and downVote, votes with weight -1.
|
|
7
7
|
class CommentVote < ApplicationRecord
|
|
8
|
-
include Decidim::
|
|
8
|
+
include Decidim::DownloadYourData
|
|
9
9
|
|
|
10
10
|
belongs_to :comment, foreign_key: "decidim_comment_id", class_name: "Comment"
|
|
11
11
|
belongs_to :author, foreign_key: "decidim_author_id", foreign_type: "decidim_author_type", polymorphic: true
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
/* eslint id-length: ["error", { "exceptions": ["$"] }] */
|
|
2
|
+
/* eslint max-lines: ["error", {"max": 350, "skipBlankLines": true}] */
|
|
3
|
+
|
|
2
4
|
|
|
3
5
|
/**
|
|
4
6
|
* A plain Javascript component that handles the comments.
|
|
@@ -10,6 +12,8 @@
|
|
|
10
12
|
// This is necessary for testing purposes
|
|
11
13
|
const $ = window.$;
|
|
12
14
|
|
|
15
|
+
import Rails from "@rails/ujs";
|
|
16
|
+
|
|
13
17
|
import { createCharacterCounter } from "src/decidim/input_character_counter"
|
|
14
18
|
import ExternalLink from "src/decidim/external_link"
|
|
15
19
|
import updateExternalDomainLinks from "src/decidim/external_domain_warning"
|
|
@@ -23,6 +27,8 @@ export default class CommentsComponent {
|
|
|
23
27
|
this.order = config.order;
|
|
24
28
|
this.lastCommentId = config.lastCommentId;
|
|
25
29
|
this.pollingInterval = config.pollingInterval || 15000;
|
|
30
|
+
this.singleComment = config.singleComment;
|
|
31
|
+
this.toggleTranslations = config.toggleTranslations;
|
|
26
32
|
this.id = this.$element.attr("id") || this._getUID();
|
|
27
33
|
this.mounted = false;
|
|
28
34
|
}
|
|
@@ -36,6 +42,9 @@ export default class CommentsComponent {
|
|
|
36
42
|
if (this.$element.length > 0 && !this.mounted) {
|
|
37
43
|
this.mounted = true;
|
|
38
44
|
this._initializeComments(this.$element);
|
|
45
|
+
if (!this.singleComment) {
|
|
46
|
+
this._fetchComments();
|
|
47
|
+
}
|
|
39
48
|
|
|
40
49
|
$(".order-by__dropdown .is-submenu-item a", this.$element).on("click.decidim-comments", () => this._onInitOrder());
|
|
41
50
|
}
|
|
@@ -133,8 +142,6 @@ export default class CommentsComponent {
|
|
|
133
142
|
$text.get(0).addEventListener("emoji.added", this._onTextInput);
|
|
134
143
|
}
|
|
135
144
|
});
|
|
136
|
-
|
|
137
|
-
this._pollComments();
|
|
138
145
|
}
|
|
139
146
|
|
|
140
147
|
/**
|
|
@@ -200,20 +207,32 @@ export default class CommentsComponent {
|
|
|
200
207
|
this._stopPolling();
|
|
201
208
|
|
|
202
209
|
this.pollTimeout = setTimeout(() => {
|
|
203
|
-
|
|
204
|
-
url: this.commentsUrl,
|
|
205
|
-
type: "GET",
|
|
206
|
-
data: new URLSearchParams({
|
|
207
|
-
"commentable_gid": this.commentableGid,
|
|
208
|
-
"root_depth": this.rootDepth,
|
|
209
|
-
"order": this.order,
|
|
210
|
-
"after": this.lastCommentId
|
|
211
|
-
}),
|
|
212
|
-
success: this._pollComments()
|
|
213
|
-
})
|
|
210
|
+
this._fetchComments();
|
|
214
211
|
}, this.pollingInterval);
|
|
215
212
|
}
|
|
216
213
|
|
|
214
|
+
/**
|
|
215
|
+
* Sends an ajax request based on current
|
|
216
|
+
* params to get comments for the component
|
|
217
|
+
* @private
|
|
218
|
+
* @returns {Void} - Returns nothing
|
|
219
|
+
*/
|
|
220
|
+
_fetchComments() {
|
|
221
|
+
Rails.ajax({
|
|
222
|
+
url: this.commentsUrl,
|
|
223
|
+
type: "GET",
|
|
224
|
+
data: new URLSearchParams({
|
|
225
|
+
"commentable_gid": this.commentableGid,
|
|
226
|
+
"root_depth": this.rootDepth,
|
|
227
|
+
"order": this.order,
|
|
228
|
+
"after": this.lastCommentId,
|
|
229
|
+
...(this.toggleTranslations && { "toggle_translations": this.toggleTranslations }),
|
|
230
|
+
...(this.lastCommentId && { "after": this.lastCommentId })
|
|
231
|
+
}),
|
|
232
|
+
success: this._pollComments()
|
|
233
|
+
})
|
|
234
|
+
}
|
|
235
|
+
|
|
217
236
|
/**
|
|
218
237
|
* Stops polling for new comments.
|
|
219
238
|
* @private
|
|
@@ -13,6 +13,10 @@ window.$.ajax = jest.fn().mockImplementation((...args) => $.ajax(...args));
|
|
|
13
13
|
import Quill from "quill"
|
|
14
14
|
window.Quill = Quill
|
|
15
15
|
|
|
16
|
+
// Rails.ajax is used by the fetching/polling of the comments
|
|
17
|
+
import Rails from "@rails/ujs";
|
|
18
|
+
jest.mock("@rails/ujs");
|
|
19
|
+
|
|
16
20
|
// Fake timers for testing polling
|
|
17
21
|
jest.useFakeTimers();
|
|
18
22
|
|
|
@@ -383,16 +387,16 @@ describe("CommentsComponent", () => {
|
|
|
383
387
|
|
|
384
388
|
jest.advanceTimersByTime(1000);
|
|
385
389
|
|
|
386
|
-
expect(
|
|
390
|
+
expect(Rails.ajax).toHaveBeenCalledWith({
|
|
387
391
|
url: "/comments",
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
data: {
|
|
392
|
+
type: "GET",
|
|
393
|
+
data: new URLSearchParams({
|
|
391
394
|
"commentable_gid": "commentable-gid",
|
|
392
395
|
"root_depth": 0,
|
|
393
396
|
order: "older",
|
|
394
397
|
after: 456
|
|
395
|
-
}
|
|
398
|
+
}),
|
|
399
|
+
success: window.undefined
|
|
396
400
|
});
|
|
397
401
|
});
|
|
398
402
|
|
|
@@ -51,13 +51,11 @@ module Decidim
|
|
|
51
51
|
end
|
|
52
52
|
|
|
53
53
|
def commentable
|
|
54
|
-
@commentable ||=
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
end
|
|
60
|
-
end
|
|
54
|
+
@commentable ||= if comment
|
|
55
|
+
comment.root_commentable
|
|
56
|
+
else
|
|
57
|
+
context.fetch(:commentable, nil)
|
|
58
|
+
end
|
|
61
59
|
end
|
|
62
60
|
|
|
63
61
|
def comment
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
module Decidim
|
|
4
4
|
module Comments
|
|
5
5
|
# A class used to find comments for a commentable resource
|
|
6
|
-
class SortedComments <
|
|
6
|
+
class SortedComments < Decidim::Query
|
|
7
7
|
attr_reader :commentable
|
|
8
8
|
|
|
9
9
|
# Syntactic sugar to initialize the class and return the queried objects.
|
|
@@ -34,8 +34,6 @@ module Decidim
|
|
|
34
34
|
.includes(:author, :user_group, :up_votes, :down_votes)
|
|
35
35
|
|
|
36
36
|
case @options[:order_by]
|
|
37
|
-
when "older"
|
|
38
|
-
order_by_older(scope)
|
|
39
37
|
when "recent"
|
|
40
38
|
order_by_recent(scope)
|
|
41
39
|
when "best_rated"
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
var $comments = $("#" + rootCommentableId);
|
|
5
5
|
var component = $comments.data("comments");
|
|
6
6
|
|
|
7
|
+
$(".loading-comments").addClass("hide");
|
|
7
8
|
<% @comments.each do |comment| %>
|
|
8
9
|
var commentId = <%= comment.id.to_json %>;
|
|
9
10
|
var commentHtml = '<%== j(render comment).strip %>';
|
data/config/locales/am-ET.yml
CHANGED
data/config/locales/ar.yml
CHANGED
data/config/locales/bg.yml
CHANGED
data/config/locales/ca.yml
CHANGED
data/config/locales/cs.yml
CHANGED
data/config/locales/da.yml
CHANGED
data/config/locales/de.yml
CHANGED
data/config/locales/el.yml
CHANGED
data/config/locales/eo.yml
CHANGED
data/config/locales/es-MX.yml
CHANGED
data/config/locales/es-PY.yml
CHANGED
data/config/locales/es.yml
CHANGED
data/config/locales/et.yml
CHANGED
data/config/locales/eu.yml
CHANGED
data/config/locales/fi-plain.yml
CHANGED
data/config/locales/fi.yml
CHANGED
data/config/locales/fr-CA.yml
CHANGED
data/config/locales/fr.yml
CHANGED
data/config/locales/ga-IE.yml
CHANGED
data/config/locales/gl.yml
CHANGED
data/config/locales/hr.yml
CHANGED
data/config/locales/hu.yml
CHANGED
data/config/locales/id-ID.yml
CHANGED
data/config/locales/is-IS.yml
CHANGED
data/config/locales/it.yml
CHANGED
data/config/locales/ja.yml
CHANGED
data/config/locales/ko.yml
CHANGED
data/config/locales/lb.yml
CHANGED
data/config/locales/lt.yml
CHANGED
data/config/locales/lv.yml
CHANGED
data/config/locales/mt.yml
CHANGED
data/config/locales/nl.yml
CHANGED
data/config/locales/no.yml
CHANGED
data/config/locales/om-ET.yml
CHANGED
data/config/locales/pl.yml
CHANGED
data/config/locales/pt-BR.yml
CHANGED
data/config/locales/pt.yml
CHANGED
data/config/locales/ro-RO.yml
CHANGED
data/config/locales/ru.yml
CHANGED
data/config/locales/si-LK.yml
CHANGED
data/config/locales/sk.yml
CHANGED
data/config/locales/sl.yml
CHANGED
data/config/locales/so-SO.yml
CHANGED
data/config/locales/sr-CS.yml
CHANGED
data/config/locales/sv.yml
CHANGED
data/config/locales/sw-KE.yml
CHANGED
data/config/locales/ti-ER.yml
CHANGED
data/config/locales/tr-TR.yml
CHANGED
data/config/locales/uk.yml
CHANGED
data/config/locales/val-ES.yml
CHANGED
data/config/locales/vi.yml
CHANGED
data/config/locales/zh-CN.yml
CHANGED
data/config/locales/zh-TW.yml
CHANGED
|
@@ -32,7 +32,7 @@ module Decidim
|
|
|
32
32
|
private
|
|
33
33
|
|
|
34
34
|
def root_commentable_url
|
|
35
|
-
@root_commentable_url ||= if resource.root_commentable
|
|
35
|
+
@root_commentable_url ||= if resource.root_commentable.respond_to?(:polymorphic_resource_url)
|
|
36
36
|
resource.root_commentable.polymorphic_resource_url
|
|
37
37
|
else
|
|
38
38
|
ResourceLocatorPresenter.new(resource.root_commentable).url
|
|
@@ -37,7 +37,7 @@ module Decidim
|
|
|
37
37
|
private
|
|
38
38
|
|
|
39
39
|
def root_commentable_url
|
|
40
|
-
@root_commentable_url ||= if resource.comment.root_commentable
|
|
40
|
+
@root_commentable_url ||= if resource.comment.root_commentable.respond_to?(:polymorphic_resource_url)
|
|
41
41
|
resource.comment.root_commentable.polymorphic_resource_url
|
|
42
42
|
else
|
|
43
43
|
ResourceLocatorPresenter.new(resource.comment.root_commentable).url
|
|
@@ -5,7 +5,7 @@ require "spec_helper"
|
|
|
5
5
|
shared_examples_for "a translated comment event" do
|
|
6
6
|
describe "translated notifications" do
|
|
7
7
|
let(:en_body) { "This is Sparta!" }
|
|
8
|
-
let(:body) { {
|
|
8
|
+
let(:body) { { en: en_body, machine_translations: { ca: "C'est Sparta!" } } }
|
|
9
9
|
let(:participatory_process) { create :participatory_process, organization: organization }
|
|
10
10
|
let(:component) { create(:component, participatory_space: participatory_process) }
|
|
11
11
|
let(:commentable) { create(:dummy_resource, component: component) }
|
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.27.0.rc1
|
|
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: 2022-06-
|
|
13
|
+
date: 2022-06-27 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.27.0.rc1
|
|
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.27.0.rc1
|
|
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.
|
|
55
|
+
version: 0.27.0.rc1
|
|
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.
|
|
62
|
+
version: 0.27.0.rc1
|
|
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.
|
|
69
|
+
version: 0.27.0.rc1
|
|
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.
|
|
76
|
+
version: 0.27.0.rc1
|
|
77
77
|
description: Pluggable comments system for some components.
|
|
78
78
|
email:
|
|
79
79
|
- josepjaume@gmail.com
|
|
@@ -107,6 +107,7 @@ files:
|
|
|
107
107
|
- app/cells/decidim/comments/comment_thread_cell.rb
|
|
108
108
|
- app/cells/decidim/comments/comments/add_comment.erb
|
|
109
109
|
- app/cells/decidim/comments/comments/blocked_comments_warning.erb
|
|
110
|
+
- app/cells/decidim/comments/comments/comments_loading.erb
|
|
110
111
|
- app/cells/decidim/comments/comments/order_control.erb
|
|
111
112
|
- app/cells/decidim/comments/comments/show.erb
|
|
112
113
|
- app/cells/decidim/comments/comments/single_comment_warning.erb
|
|
@@ -296,14 +297,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
296
297
|
requirements:
|
|
297
298
|
- - ">="
|
|
298
299
|
- !ruby/object:Gem::Version
|
|
299
|
-
version: '
|
|
300
|
+
version: '3.0'
|
|
300
301
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
301
302
|
requirements:
|
|
302
|
-
- - "
|
|
303
|
+
- - ">"
|
|
303
304
|
- !ruby/object:Gem::Version
|
|
304
|
-
version:
|
|
305
|
+
version: 1.3.1
|
|
305
306
|
requirements: []
|
|
306
|
-
rubygems_version: 3.
|
|
307
|
+
rubygems_version: 3.2.22
|
|
307
308
|
signing_key:
|
|
308
309
|
specification_version: 4
|
|
309
310
|
summary: Decidim comments module
|