decidim-comments 0.27.0.rc1 → 0.27.0.rc2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 15e0e5dd8fbb2fc7171061fa36077e83f956f3ada42b41dfa32cd8e8f60cdd0a
4
- data.tar.gz: 6cb4e67d56972f657983cc174806b8766d0916fb55b7ca783ee2e8a684859283
3
+ metadata.gz: be59c64c99af66a8d86b01f63174f834c568589cb4f380170d78d7bc36877a4c
4
+ data.tar.gz: 209df45679b3809c5129bd6ae62d2bdda0032e08b4d875e15f12f1ab8380082e
5
5
  SHA512:
6
- metadata.gz: a3a7482658e91430342214a3d668979c0450b1203c28725ab083c46773b6c39474f148a4489238c90187cda2407a81edbc1c7a1b9bd26944081ce36261f86e7e
7
- data.tar.gz: ee42d7e4922a5cbc826a1a98f73b1d1056d4ce6879a398da32ad6962d9987323f7b37b2e1fc57111251baf2185301cbdc0e370621107778afd2fb47263dc285b
6
+ metadata.gz: 1fc55e57d75a6a78a21e845cb0efe8ad274c968e5afc1faf76b167c41f5732a642ea4b59e74de3001cb2390951f15a2a5db919600d9886159fbb5693e0b8ad39
7
+ data.tar.gz: b07de20d543bfc8b11a5ac6b076d8ac6acacfb3c43945755717c0b5f0a3d7368e327bd1d45df74f206311940fd5f1ef0cbe3aa6ede5332d4b0006bd42a981759
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Decidim
4
4
  module Comments
5
- # A cell to display a form for edditing a comment.
5
+ # A cell to display a form for editing a comment.
6
6
  class EditCommentModalFormCell < Decidim::ViewModel
7
7
  delegate :current_user, :user_signed_in?, to: :controller
8
8
  alias comment model
@@ -48,14 +48,7 @@ module Decidim
48
48
  edit: true
49
49
  )
50
50
 
51
- mentioned_users = parsed.metadata[:user].users
52
- mentioned_groups = parsed.metadata[:user_group].groups
53
51
  CommentCreation.publish(@comment, parsed.metadata)
54
- send_notifications(mentioned_users, mentioned_groups)
55
- end
56
-
57
- def send_notifications(mentioned_users, mentioned_groups)
58
- NewCommentNotificationCreator.new(comment, mentioned_users, mentioned_groups).create
59
52
  end
60
53
  end
61
54
  end
@@ -218,6 +218,7 @@ export default class CommentsComponent {
218
218
  * @returns {Void} - Returns nothing
219
219
  */
220
220
  _fetchComments() {
221
+ $(".add-comment textarea", this.$element).prop("disabled", true);
221
222
  Rails.ajax({
222
223
  url: this.commentsUrl,
223
224
  type: "GET",
@@ -229,8 +230,11 @@ export default class CommentsComponent {
229
230
  ...(this.toggleTranslations && { "toggle_translations": this.toggleTranslations }),
230
231
  ...(this.lastCommentId && { "after": this.lastCommentId })
231
232
  }),
232
- success: this._pollComments()
233
- })
233
+ success: () => {
234
+ $(".add-comment textarea", this.$element).prop("disabled", false);
235
+ this._pollComments();
236
+ }
237
+ });
234
238
  }
235
239
 
236
240
  /**
@@ -380,13 +380,9 @@ describe("CommentsComponent", () => {
380
380
  expect(subject.$element).toEqual($(selector));
381
381
  });
382
382
 
383
- it("starts polling for new comments", () => {
383
+ it("loads the comments through AJAX", () => {
384
384
  subject.mountComponent();
385
385
 
386
- expect(window.setTimeout).toHaveBeenLastCalledWith(expect.any(Function), 1000);
387
-
388
- jest.advanceTimersByTime(1000);
389
-
390
386
  expect(Rails.ajax).toHaveBeenCalledWith({
391
387
  url: "/comments",
392
388
  type: "GET",
@@ -396,10 +392,32 @@ describe("CommentsComponent", () => {
396
392
  order: "older",
397
393
  after: 456
398
394
  }),
399
- success: window.undefined
395
+ success: expect.any(Function)
400
396
  });
401
397
  });
402
398
 
399
+ it("disables the comment textarea", () => {
400
+ subject.mountComponent();
401
+
402
+ expect($(`${selector} .add-comment textarea`).prop("disabled")).toBeTruthy();
403
+ });
404
+
405
+ it("re-enables the comment textarea after a successful fetch", () => {
406
+ Rails.ajax.mockImplementationOnce((options) => options.success());
407
+
408
+ subject.mountComponent();
409
+
410
+ expect($(`${selector} .add-comment textarea`).prop("disabled")).toBeFalsy();
411
+ });
412
+
413
+ it("starts polling for new comments", () => {
414
+ Rails.ajax.mockImplementationOnce((options) => options.success());
415
+
416
+ subject.mountComponent();
417
+
418
+ expect(window.setTimeout).toHaveBeenLastCalledWith(expect.any(Function), 1000);
419
+ });
420
+
403
421
  describe("when mounted", () => {
404
422
  beforeEach(() => {
405
423
  spyOnAddComment("on");
@@ -454,6 +472,7 @@ describe("CommentsComponent", () => {
454
472
  describe("when interacting", () => {
455
473
  beforeEach(() => {
456
474
  spyOnAddComment();
475
+ Rails.ajax.mockImplementationOnce((options) => options.success());
457
476
  subject.mountComponent();
458
477
  });
459
478
 
@@ -1,2 +1 @@
1
- ---
2
1
  am:
@@ -1,2 +1 @@
1
- ---
2
1
  da:
@@ -1,2 +1 @@
1
- ---
2
1
  eo:
@@ -1,2 +1 @@
1
- ---
2
1
  et:
@@ -1,2 +1 @@
1
- ---
2
1
  hr:
@@ -1,2 +1 @@
1
- ---
2
1
  ko:
@@ -1,2 +1,177 @@
1
1
  ---
2
2
  lt:
3
+ activemodel:
4
+ models:
5
+ decidim/comments/comment_by_followed_user_event: Komentarai
6
+ decidim/comments/comment_created_event: Komentarai
7
+ decidim/comments/comment_upvoted_event: Komentaras palaikytas
8
+ decidim/comments/reply_created_event: Atsakymas į komentarą
9
+ decidim/comments/user_group_mentioned_event: Paminėjimas
10
+ decidim/comments/user_mentioned_event: Paminėti
11
+ activerecord:
12
+ models:
13
+ decidim/comments/comment:
14
+ one: Komentaras
15
+ few: Komentarai
16
+ many: Komentarai
17
+ other: Komentarai
18
+ decidim/comments/comment_vote:
19
+ one: Balsuoti
20
+ few: Balsai
21
+ many: Balsai
22
+ other: Balsai
23
+ decidim:
24
+ comments:
25
+ admin:
26
+ shared:
27
+ availability_fields:
28
+ enabled: Komentarai aktyvuoti
29
+ end_time: Komentarai aktyvuoti iki
30
+ start_time: Komentarai aktyvuoti nuo
31
+ comments:
32
+ create:
33
+ error: Kuriant šį komentarą iškilo problema.
34
+ delete:
35
+ error: Komentaro ištrinti nepavyko.
36
+ update:
37
+ error: Atnaujinant šį komentarą iškilo problema.
38
+ comments_count: Komentarų skaičius
39
+ comments_title: Komentarai
40
+ last_activity:
41
+ new_comment_at_html: "<span>Naujas komentaras %{link}</span>"
42
+ view: Rodyti
43
+ votes:
44
+ create:
45
+ error: Balsuojant už komentarą iškilo problema.
46
+ components:
47
+ add_comment_form:
48
+ account_message: <a href="%{sign_in_url}">Prisijunkite</a>arba<a href="%{sign_up_url}">registruokitės</a>norėdami komentuoti.
49
+ form:
50
+ body:
51
+ label: Komentaras
52
+ placeholder: Ką manote apie tai?
53
+ form_error: Tekstas būtinais ir negali viršyti %{length} simbolių.
54
+ submit: Publikuoti
55
+ user_group_id:
56
+ label: Komentuoti kaip
57
+ opinion:
58
+ label: Jūsų nuomonė šiuo klausimu
59
+ negative: Negatyvi
60
+ negative_selected: Jūsų nuomonė apie šią temą yra negatyvi
61
+ neutral: Neutrali
62
+ neutral_selected: Jūsų nuomonė apie šią temą yra neutrali
63
+ positive: Pozityvi
64
+ positive_selected: Jūsų nuomonė apie šią temą yra pozityvi
65
+ remaining_characters: "Liko %{count} simbolių"
66
+ remaining_characters_1: "Liko %{count} simbolių"
67
+ title: Pridėti komentarą
68
+ comment:
69
+ alignment:
70
+ against: Prieš
71
+ in_favor: Už
72
+ confirm_destroy: Ar tikrai norite ištrinti šį komentarą?
73
+ delete: Ištrinti
74
+ deleted_at: Komentaras ištrintas %{date}
75
+ deleted_user: Ištrintas dalyvis
76
+ edit: Redaguoti
77
+ edited: Redaguota
78
+ hide_replies: Paslėpti atsakymus
79
+ moderated_at: Komentaras moderuotas %{date}
80
+ reply: Atsakyti
81
+ report:
82
+ action: Raportuoti
83
+ already_reported: Šis turinys jau praneštas ir bus peržiūrėtas administratoriaus.
84
+ close: Uždaryti
85
+ description: Ar šis turinys netinkamas?
86
+ details: Papildomi komentarai
87
+ reasons:
88
+ does_not_belong: Pateikta informacija susijusi su neteisėta veikla, savižudybe, asmenine ar kita informacija netinkančia %{organization_name}.
89
+ offensive: Pateikiamoje informacijoje yra rasizmo, seksizmo, keiksmažodžių, asmeninių atakų, grasinimų ar kitokios neapykantos kalbos.
90
+ spam: Pateikiamoje informacijoje yra reklamos, antraščių mąsalo ar apgavysčių.
91
+ title: Pranešti apie netinkamą turinį
92
+ show_replies: Rodyti %{replies_count} atsakymus
93
+ single_comment_link_title: Gauti nuorodą
94
+ comment_order_selector:
95
+ order:
96
+ best_rated: Geriausiai įvertinti
97
+ most_discussed: Labiausiai aptarti
98
+ older: Ankstesni
99
+ recent: Paskutiniai
100
+ title: 'Rikiuoti pagal:'
101
+ comment_thread:
102
+ title: Pokalbis su %{authorName}
103
+ comments:
104
+ blocked_comments_for_unauthorized_user_warning: Norėdami komentuoti turite būti patvirtintas(-a), tačiau galite skaityti egzistuojančius komentarus.
105
+ blocked_comments_for_user_warning: Šiuo metu komentarų pateikti negalite, tačiau galite perskaityti ankstesnius komentarus.
106
+ blocked_comments_warning: Komentarai šiuo metu išjungti, tačiau galite perskaityti ankstesnius komentarus.
107
+ comment_details_title: Komentaro detalės
108
+ loading: Komentarai įkeliami...
109
+ single_comment_warning: <a href="%{url}">Peržiūrėti visus komentarus</a>
110
+ single_comment_warning_title: Matote vieną komentarą
111
+ title:
112
+ one: "%{count} komentaras"
113
+ few: "%{count} komentarai"
114
+ many: "%{count} komentarai"
115
+ other: "%{count} komentarai"
116
+ down_vote_button:
117
+ text: Nesutinku su šiuo komentaru
118
+ edit_comment_modal_form:
119
+ close: Uždaryti
120
+ form:
121
+ body:
122
+ label: Komentaras
123
+ placeholder: Ką apie tai manote?
124
+ submit: Siųsti
125
+ title: Taisyti komentarą
126
+ up_vote_button:
127
+ text: Sutinku su šiuo komentaru
128
+ events:
129
+ comments:
130
+ comment_by_followed_user:
131
+ email_intro: "%{author_name} pakomentavo %{resource_title}. Komentarą galite perskaityti:"
132
+ email_outro: Gavote šį pranešimą nes sekate %{author_name}. Galite pasirinkti nebesekti šio naudotojo jo profilio puslapyje.
133
+ email_subject: Naujas komentaras %{resource_title} iš %{author_name}
134
+ notification_title: Naujas komentaras <a href="%{resource_path}">%{resource_title}</a> iš <a href="%{author_path}">%{author_name}%{author_nickname}</a>.
135
+ comment_by_followed_user_group:
136
+ email_intro: 'Grupė %{author_name} paliko komentarą po %{resource_title}. Galite jį perskaityti šiame puslapyje:'
137
+ email_outro: Šį pranešimą gavote dėl to, kad sekate %{author_name}. Jūs galite nebesekti šios grupės pasirinkdami šį nustatymą jos profilio puslapyje.
138
+ email_subject: Naujas komentaras %{resource_title} iš %{author_name}
139
+ notification_title: Naujas komentaras <a href="%{resource_path}">%{resource_title}</a> iš <a href="%{author_path}">%{author_name}%{author_nickname}</a>.
140
+ comment_created:
141
+ email_intro: "%{resource_title} pateiktas komentaras. Komentarą galite perskaityti šiame puslapyje:"
142
+ email_outro: Šį pranešimą gavote dėl to, kad sekate „%{resource_title}“ arba jo autorių. Jūs galite jo nebesekti spustelėdami aukščiau esančią nuorodą.
143
+ email_subject: '%{author_name} paliko naują komentarą %{resource_title}'
144
+ notification_title: <a href="%{author_path}">%{author_name} %{author_nickname}</a> paliko naują komentarą <a href="%{resource_path}">%{resource_title}</a>
145
+ comment_downvoted:
146
+ email_intro: Jūsų komentaras %{resource_title} buvo nepakaikyas. Komentaras dabar turi %{upvotes} palaikymus ir %{downvotes} nepalaikymus.
147
+ email_outro: Šį pranešimą gavote dėl to, kad esate pasiūlymo autorius.
148
+ email_subject: Jūsų komentaras %{resource_title} buvo įvertintas neigiamai.
149
+ notification_title: Jūsų <a href="%{resource_path}"> komentaras</a> %{resource_title} buvo įvertintas neigiamai. Dabar jis turi %{upvotes} teigiamus ir %{downvotes} neigiamus įvertinimus.
150
+ comment_upvoted:
151
+ email_intro: Jūsų komentaras %{resource_title} buvo įvertintas teigiamai. Jis turi %{upvotes} teigiamus ir %{downvotes} neigiamus įvertinimus.
152
+ email_outro: Šį pranešimą gavote nes esate komentaro autorius.
153
+ email_subject: Komentaras %{resource_title} buvo įvertintas teigiamai.
154
+ notification_title: Jūsų <a href="%{resource_path}">komentaras</a> %{resource_title} buvo įvertintas teigiamai. Jis turi %{upvotes} teigiamus ir %{downvotes} neigiamus įvertinimus.
155
+ reply_created:
156
+ email_intro: "%{author_name} atsakė į komentarą %{resource_title}. Galite jį perskaityti:"
157
+ email_outro: Gavote šį pranešimą nes į Jūsų komentarą buvo atsakyta.
158
+ email_subject: "%{author_name} atsakė į komentarą %{resource_title}"
159
+ notification_title: <a href="%{author_path}">%{author_name}%{author_nickname}</a> atsakė į komentarą <a href="%{resource_path}">%{resource_title}</a>
160
+ user_group_mentioned:
161
+ email_intro: Grupė, kuriai priklausote, buvo paminėta
162
+ email_outro: Gavote šį pranešimą nes esate %{resource_title} paminėtos grupės %{group_name} narė(-ys).
163
+ email_subject: Buvote paminėtas %{resource_title} kaip %{group_name} narys
164
+ notification_title: Buvote paminėtas <a href="%{resource_path}">%{resource_title} <a href="%{author_path}">%{author_name}%{author_nickname}</a> kaip <a href="%{group_path}">%{group_name}%{group_nickname}</a> narį
165
+ user_mentioned:
166
+ email_intro: Buvote paminėta(-s)
167
+ email_outro: Gavote šį pranešimą nes buvote paminėta(-s) %{resource_title}.
168
+ email_subject: Buvote paminėta(-s) %{resource_title}
169
+ notification_title: Buvote paminėta(-s) <a href="%{resource_path}"> %{resource_title}</a><a href="%{author_path}">%{author_name}%{author_nickname}</a>
170
+ metrics:
171
+ comments:
172
+ description: Komentarų sugeneruotų dalyvių skaičius
173
+ object: komentarai
174
+ title: Komentarai
175
+ errors:
176
+ messages:
177
+ cannot_have_comments: negali būti komentuota
@@ -1,2 +1 @@
1
- ---
2
1
  mt:
@@ -4,6 +4,7 @@ nl:
4
4
  models:
5
5
  decidim/comments/comment_by_followed_user_event: Commentaar
6
6
  decidim/comments/comment_created_event: Commentaar
7
+ decidim/comments/comment_upvoted_event: Reactie omhoog gestemd
7
8
  decidim/comments/reply_created_event: Reactie antwoord
8
9
  decidim/comments/user_group_mentioned_event: Vermelding
9
10
  decidim/comments/user_mentioned_event: Vermelding
@@ -24,11 +25,14 @@ nl:
24
25
  end_time: Reacties ingeschakeld tot
25
26
  start_time: Commentaren ingeschakeld vanaf
26
27
  comments:
28
+ create:
29
+ error: Er is een probleem opgetreden bij het aanmaken van de reactie.
27
30
  delete:
28
31
  error: De reactie kon niet worden verwijderd.
29
32
  update:
30
33
  error: Er is een probleem opgetreden bij het bijwerken van de reactie.
31
34
  comments_count: Aantal reacties
35
+ comments_title: Reacties
32
36
  last_activity:
33
37
  new_comment_at_html: "<span>Nieuwe opmerking op %{link}</span>"
34
38
  view: Bekijk
@@ -68,6 +72,7 @@ nl:
68
72
  edit: Bewerk
69
73
  edited: Bewerkt
70
74
  hide_replies: Antwoorden verbergen
75
+ moderated_at: Reactie gemodereerd op %{date}
71
76
  reply: Antwoord
72
77
  report:
73
78
  action: Melden
@@ -99,6 +104,9 @@ nl:
99
104
  loading: Reacties laden...
100
105
  single_comment_warning: <a href="%{url}">Bekijk alle reacties</a>
101
106
  single_comment_warning_title: Je ziet een enkele reactie
107
+ title:
108
+ one: "%{count} reacties"
109
+ other: "%{count} reacties"
102
110
  down_vote_button:
103
111
  text: Ik ben het niet eens met deze reactie
104
112
  edit_comment_modal_form:
@@ -128,6 +136,16 @@ nl:
128
136
  email_outro: Je hebt deze melding ontvangen omdat je '%{resource_title}' of de auteur ervan volgt. Ontvolgen kan door te klikken op de vorige link.
129
137
  email_subject: Er is een nieuwe reactie van %{author_name} in %{resource_title}
130
138
  notification_title: Er is een nieuwe reactie van <a href="%{author_path}">%{author_name} %{author_nickname}</a> in <a href="%{resource_path}">%{resource_title}</a>
139
+ comment_downvoted:
140
+ email_intro: Je reactie in "%{resource_title}" kreeg een tegenstem. Het heeft nu een totaal van %{upvotes} stemmen 'voor' en %{downvotes} stemmen 'tegen'.
141
+ email_outro: Je hebt deze melding ontvangen omdat je de auteur bent van deze reactie.
142
+ email_subject: Je reactie in "%{resource_title}" kreeg een tegenstem.
143
+ notification_title: Je <a href="%{resource_path}">reactie</a> in "%{resource_title}" kreeg een tegenstem. Het heeft nu een totaal van %{upvotes} stemmen 'voor' en %{downvotes} stemmen 'tegen'.
144
+ comment_upvoted:
145
+ email_intro: Je reactie in "%{resource_title}" kreeg een stem 'voor'. Het heeft nu een totaal van %{upvotes} stemmen 'voor' en %{downvotes} stemmen 'tegen'.
146
+ email_outro: Je hebt deze melding ontvangen omdat je de auteur bent van deze reactie.
147
+ email_subject: Je reactie in "%{resource_title}" kreeg een stem 'voor'.
148
+ notification_title: Je <a href="%{resource_path}">reactie</a> in "%{resource_title}" kreeg een stem 'voor'. Het heeft nu een totaal van %{upvotes} stemmen 'voor' en %{downvotes} stemmen 'tegen'.
131
149
  reply_created:
132
150
  email_intro: "%{author_name} heeft gereageerd op jouw opmerking in %{resource_title}. Lees het via deze link:"
133
151
  email_outro: Je hebt deze melding ontvangen omdat je reactie beantwoord is.
@@ -1,2 +1 @@
1
- ---
2
1
  om:
@@ -1,5 +1,5 @@
1
1
  ---
2
- pt:
2
+ pt-BR:
3
3
  activemodel:
4
4
  models:
5
5
  decidim/comments/comment_by_followed_user_event: Comente
@@ -1,2 +1 @@
1
- ---
2
1
  so:
@@ -1,2 +1 @@
1
- ---
2
1
  sw:
@@ -1,2 +1 @@
1
- ---
2
1
  ti:
@@ -1,2 +1 @@
1
- ---
2
1
  val:
@@ -1,2 +1 @@
1
- ---
2
1
  vi:
@@ -1,2 +1 @@
1
- ---
2
1
  zh-TW:
@@ -4,7 +4,7 @@ module Decidim
4
4
  # This holds the decidim-comments version.
5
5
  module Comments
6
6
  def self.version
7
- "0.27.0.rc1"
7
+ "0.27.0.rc2"
8
8
  end
9
9
  end
10
10
  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.27.0.rc1
4
+ version: 0.27.0.rc2
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-27 00:00:00.000000000 Z
13
+ date: 2022-09-19 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.27.0.rc1
21
+ version: 0.27.0.rc2
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.27.0.rc1
28
+ version: 0.27.0.rc2
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.27.0.rc1
55
+ version: 0.27.0.rc2
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.27.0.rc1
62
+ version: 0.27.0.rc2
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.27.0.rc1
69
+ version: 0.27.0.rc2
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.27.0.rc1
76
+ version: 0.27.0.rc2
77
77
  description: Pluggable comments system for some components.
78
78
  email:
79
79
  - josepjaume@gmail.com