decidim-comments 0.17.2 → 0.18.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/decidim/comments/bundle.js +16 -16
  3. data/app/assets/javascripts/decidim/comments/bundle.js.map +1 -1
  4. data/app/commands/decidim/comments/vote_comment.rb +12 -2
  5. data/app/frontend/comments/add_comment_form.component.tsx +2 -0
  6. data/app/frontend/comments/comment.component.test.tsx +56 -0
  7. data/app/frontend/comments/comment.component.tsx +10 -8
  8. data/app/frontend/comments/comments.component.test.tsx +18 -0
  9. data/app/frontend/comments/comments.component.tsx +28 -5
  10. data/app/frontend/comments/down_vote_button.component.test.tsx +5 -5
  11. data/app/frontend/comments/down_vote_button.component.tsx +2 -2
  12. data/app/frontend/comments/up_vote_button.component.test.tsx +4 -4
  13. data/app/frontend/comments/up_vote_button.component.tsx +2 -2
  14. data/app/frontend/fragments/comment_data.fragment.graphql +1 -0
  15. data/app/frontend/queries/comments.query.graphql +1 -0
  16. data/app/frontend/support/generate_comments_data.ts +1 -0
  17. data/app/frontend/support/schema.ts +52 -0
  18. data/app/models/decidim/comments/comment.rb +14 -0
  19. data/app/types/decidim/comments/commentable_interface.rb +6 -0
  20. data/config/locales/ar-SA.yml +1 -0
  21. data/config/locales/ar.yml +108 -0
  22. data/config/locales/ca.yml +1 -0
  23. data/config/locales/cs.yml +1 -0
  24. data/config/locales/de.yml +1 -0
  25. data/config/locales/en.yml +1 -0
  26. data/config/locales/es-MX.yml +1 -0
  27. data/config/locales/es-PY.yml +1 -0
  28. data/config/locales/es.yml +1 -0
  29. data/config/locales/eu.yml +1 -0
  30. data/config/locales/fi-plain.yml +1 -0
  31. data/config/locales/fi.yml +1 -0
  32. data/config/locales/fr.yml +1 -0
  33. data/config/locales/gl.yml +1 -0
  34. data/config/locales/hu.yml +1 -0
  35. data/config/locales/id-ID.yml +1 -0
  36. data/config/locales/it.yml +1 -0
  37. data/config/locales/nl.yml +1 -0
  38. data/config/locales/pl.yml +1 -0
  39. data/config/locales/pt-BR.yml +1 -0
  40. data/config/locales/pt.yml +1 -0
  41. data/config/locales/sv.yml +1 -0
  42. data/config/locales/tr-TR.yml +1 -0
  43. data/lib/decidim/comments.rb +4 -0
  44. data/lib/decidim/comments/api/comment_type.rb +6 -0
  45. data/lib/decidim/comments/commentable.rb +5 -0
  46. data/lib/decidim/comments/version.rb +1 -1
  47. metadata +8 -7
@@ -65,6 +65,7 @@ en:
65
65
  comment_thread:
66
66
  title: Conversation with %{authorName}
67
67
  comments:
68
+ blocked_comments_for_user_warning: You are not able to comment at this moment, but you can read the previous ones.
68
69
  blocked_comments_warning: Comments are disabled at this time, but you can read the previous ones.
69
70
  loading: Loading comments ...
70
71
  title: "%{count} comments"
@@ -64,6 +64,7 @@ es-MX:
64
64
  comment_thread:
65
65
  title: Conversación con %{authorName}
66
66
  comments:
67
+ blocked_comments_for_user_warning: No puede hacer comentarios en este momento, pero puede leer los anteriores.
67
68
  blocked_comments_warning: Los comentarios están deshabilitados en este momento, pero puedes leer los anteriores.
68
69
  loading: Cargando los comentarios ...
69
70
  title: "%{count} comentarios"
@@ -64,6 +64,7 @@ es-PY:
64
64
  comment_thread:
65
65
  title: Conversación con %{authorName}
66
66
  comments:
67
+ blocked_comments_for_user_warning: No puede hacer comentarios en este momento, pero puede leer los anteriores.
67
68
  blocked_comments_warning: Los comentarios están deshabilitados en este momento, pero puedes leer los anteriores.
68
69
  loading: Cargando los comentarios ...
69
70
  title: "%{count} comentarios"
@@ -64,6 +64,7 @@ es:
64
64
  comment_thread:
65
65
  title: Conversación con %{authorName}
66
66
  comments:
67
+ blocked_comments_for_user_warning: No puedes hacer comentarios en este momento, pero puedes leer los anteriores.
67
68
  blocked_comments_warning: Los comentarios están deshabilitados en este momento, pero puedes leer los anteriores.
68
69
  loading: Cargando los comentarios ...
69
70
  title: "%{count} comentarios"
@@ -64,6 +64,7 @@ eu:
64
64
  comment_thread:
65
65
  title: 'Solasaldia honekin: %{authorName}'
66
66
  comments:
67
+ blocked_comments_for_user_warning: Oraindik ez duzu iruzkinik egin, baina aurrekoak irakurri ditzakezu.
67
68
  blocked_comments_warning: Iruzkinak desgaituta daude une honetan, baina aurrekoak irakur ditzakezu.
68
69
  loading: Iruzkinak kargatzen...
69
70
  title: "%{count} iruzkin"
@@ -64,6 +64,7 @@ fi-pl:
64
64
  comment_thread:
65
65
  title: Keskustelu henkilön %{authorName} kanssa
66
66
  comments:
67
+ blocked_comments_for_user_warning: Et voi kommentoida tällä hetkellä, mutta voit lukea aikaisempia kommentteja.
67
68
  blocked_comments_warning: Kommentit on poistettu käytöstä tällä hetkellä, mutta voit lukea aikaisempia kommentteja.
68
69
  loading: Ladataan kommentteja ...
69
70
  title: "%{count} kommenttia"
@@ -64,6 +64,7 @@ fi:
64
64
  comment_thread:
65
65
  title: Keskustelu henkilön %{authorName} kanssa
66
66
  comments:
67
+ blocked_comments_for_user_warning: Et voi kommentoida tällä hetkellä, mutta voit lukea aikaisempia kommentteja.
67
68
  blocked_comments_warning: Kommentit on poistettu käytöstä tällä hetkellä, mutta voit lukea aikaisempia kommentteja.
68
69
  loading: Ladataan kommentteja ...
69
70
  title: "%{count} kommenttia"
@@ -64,6 +64,7 @@ fr:
64
64
  comment_thread:
65
65
  title: Conversation avec %{authorName}
66
66
  comments:
67
+ blocked_comments_for_user_warning: Vous n'êtes pas en mesure de commenter pour le moment, mais vous pouvez lire les précédents.
67
68
  blocked_comments_warning: Les commentaires sont actuellement désactivés, mais vous pouvez lire ceux déjà saisis.
68
69
  loading: Chargement des commentaires ...
69
70
  title: "%{count} commentaires"
@@ -64,6 +64,7 @@ gl:
64
64
  comment_thread:
65
65
  title: Conversa con %{authorName}
66
66
  comments:
67
+ blocked_comments_for_user_warning: Non podes comentar neste momento, pero podes ler os anteriores.
67
68
  blocked_comments_warning: Os comentarios están desactivados neste momento, pero podes ler os anteriores.
68
69
  loading: Cargando comentarios ...
69
70
  title: "%{count} comentarios"
@@ -64,6 +64,7 @@ hu:
64
64
  comment_thread:
65
65
  title: 'Beszélgetés vele: %{authorName}'
66
66
  comments:
67
+ blocked_comments_for_user_warning: Ebben a pillanatban nem tud megjegyzéseket tenni, de elolvashatja az előzőeket.
67
68
  blocked_comments_warning: A megjegyzések jelenleg le vannak tiltva, de a korábbiakat elolvashatod.
68
69
  loading: Hozzászólások betöltése ...
69
70
  title: "%{count} megjegyzés"
@@ -62,6 +62,7 @@ id:
62
62
  comment_thread:
63
63
  title: Percakapan dengan %{authorName}
64
64
  comments:
65
+ blocked_comments_for_user_warning: Anda tidak dapat berkomentar saat ini, tetapi Anda dapat membaca yang sebelumnya.
65
66
  blocked_comments_warning: Komentar dinonaktifkan saat ini, tetapi Anda dapat membaca yang sebelumnya.
66
67
  loading: Memuat komentar ...
67
68
  title: "%{count} komentar"
@@ -64,6 +64,7 @@ it:
64
64
  comment_thread:
65
65
  title: Conversazioni con %{authorName}
66
66
  comments:
67
+ blocked_comments_for_user_warning: Non sei in grado di commentare in questo momento, ma puoi leggere quelli precedenti.
67
68
  blocked_comments_warning: I commenti sono disabilitati in questo momento, ma puoi leggere quelli precedenti.
68
69
  loading: Sto caricando i commenti ...
69
70
  title: "%{count} commenti"
@@ -64,6 +64,7 @@ nl:
64
64
  comment_thread:
65
65
  title: Gesprek met %{authorName}
66
66
  comments:
67
+ blocked_comments_for_user_warning: U kunt op dit moment geen opmerkingen maken, maar u kunt de vorige wel lezen.
67
68
  blocked_comments_warning: Reacties zijn op dit moment uitgeschakeld, maar je kan de vorige berichten lezen.
68
69
  loading: Reacties laden...
69
70
  title: "%{count} reacties"
@@ -68,6 +68,7 @@ pl:
68
68
  comment_thread:
69
69
  title: Rozmowa z %{authorName}
70
70
  comments:
71
+ blocked_comments_for_user_warning: Nie możesz teraz komentować, ale możesz przeczytać poprzednie.
71
72
  blocked_comments_warning: Komentarze są w tej chwili wyłączone, ale możesz przeczytać poprzednie.
72
73
  loading: Ładowanie komentarzy ...
73
74
  title: "%{count} komentarzy"
@@ -64,6 +64,7 @@ pt-BR:
64
64
  comment_thread:
65
65
  title: Conversa com %{authorName}
66
66
  comments:
67
+ blocked_comments_for_user_warning: Você não pode comentar neste momento, mas pode ler os anteriores.
67
68
  blocked_comments_warning: Os comentários estão desativados neste momento, mas você pode ler os anteriores.
68
69
  loading: Carregando comentários ...
69
70
  title: "%{count} comentários"
@@ -64,6 +64,7 @@ pt:
64
64
  comment_thread:
65
65
  title: Conversa com %{authorName}
66
66
  comments:
67
+ blocked_comments_for_user_warning: Você não pode comentar neste momento, mas pode ler os anteriores.
67
68
  blocked_comments_warning: Os comentários estão desativados neste momento, mas você pode ler os anteriores.
68
69
  loading: Carregando comentários ...
69
70
  title: "%{count} comentários"
@@ -64,6 +64,7 @@ sv:
64
64
  comment_thread:
65
65
  title: Samtal med %{authorName}
66
66
  comments:
67
+ blocked_comments_for_user_warning: Du kan inte kommentera just nu, men du kan läsa tidigare kommentarer.
67
68
  blocked_comments_warning: Kommentarer är inaktiverade just nu, men du kan läsa de föregående.
68
69
  loading: Laddar kommentarer...
69
70
  title: "%{count} kommentarer"
@@ -64,6 +64,7 @@ tr:
64
64
  comment_thread:
65
65
  title: '%{authorName}ile sohbet'
66
66
  comments:
67
+ blocked_comments_for_user_warning: Şu anda yorum yapamıyorsunuz, ancak öncekileri okuyabilirsiniz.
67
68
  blocked_comments_warning: Yorumlar şu anda devre dışı, ancak öncekileri okuyabilirsiniz.
68
69
  loading: Yorumlar yükleniyor ...
69
70
  title: "%{count} yorum"
@@ -21,5 +21,9 @@ module Decidim
21
21
  def self.data_portable_entities
22
22
  ["Decidim::Comments::Comment", "Decidim::Comments::CommentVote"]
23
23
  end
24
+
25
+ def self.newsletter_participant_entities
26
+ ["Decidim::Comments::Comment"]
27
+ end
24
28
  end
25
29
  end
@@ -74,6 +74,12 @@ module Decidim
74
74
  obj.reported_by?(ctx[:current_user])
75
75
  }
76
76
  end
77
+
78
+ field :userAllowedToComment, !types.Boolean, "Check if the current user can comment" do
79
+ resolve lambda { |obj, _args, ctx|
80
+ obj.root_commentable.commentable? && obj.root_commentable.user_allowed_to_comment?(ctx[:current_user])
81
+ }
82
+ end
77
83
  end
78
84
  end
79
85
  end
@@ -46,6 +46,11 @@ module Decidim
46
46
  def users_to_notify_on_comment_created
47
47
  Decidim::User.none
48
48
  end
49
+
50
+ # Public: Whether the object can have new comments or not.
51
+ def user_allowed_to_comment?(_user)
52
+ true
53
+ end
49
54
  end
50
55
  end
51
56
  end
@@ -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.17.2"
7
+ "0.18.0"
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.17.2
4
+ version: 0.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josep Jaume Rey Peroy
@@ -18,14 +18,14 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 0.17.2
21
+ version: 0.18.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.17.2
28
+ version: 0.18.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.17.2
49
+ version: 0.18.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.17.2
56
+ version: 0.18.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.17.2
63
+ version: 0.18.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.17.2
70
+ version: 0.18.0
71
71
  description: Pluggable comments system for some components.
72
72
  email:
73
73
  - josepjaume@gmail.com
@@ -148,6 +148,7 @@ files:
148
148
  - app/types/decidim/comments/commentable_mutation_type.rb
149
149
  - app/types/decidim/comments/commentable_type.rb
150
150
  - config/locales/ar-SA.yml
151
+ - config/locales/ar.yml
151
152
  - config/locales/ca.yml
152
153
  - config/locales/cs-CZ.yml
153
154
  - config/locales/cs.yml