decidim-comments 0.9.3 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -5
- data/app/assets/javascripts/decidim/comments/bundle.js +1 -540
- data/app/assets/javascripts/decidim/comments/bundle.js.map +1 -1
- data/app/frontend/application/apollo_client.ts +3 -11
- data/app/frontend/application/application.component.test.tsx +1 -1
- data/app/frontend/application/icon.component.test.tsx +15 -26
- data/app/frontend/application/icon.component.tsx +10 -11
- data/app/frontend/comments/add_comment_form.component.test.tsx +13 -13
- data/app/frontend/comments/add_comment_form.component.tsx +25 -25
- data/app/frontend/comments/comment.component.test.tsx +236 -35
- data/app/frontend/comments/comment.component.tsx +5 -5
- data/app/frontend/comments/comment_order_selector.component.test.tsx +1 -1
- data/app/frontend/comments/comment_order_selector.component.tsx +1 -1
- data/app/frontend/comments/comment_thread.component.test.tsx +2 -2
- data/app/frontend/comments/comment_thread.component.tsx +2 -2
- data/app/frontend/comments/comments.component.test.tsx +5 -5
- data/app/frontend/comments/comments.component.tsx +7 -7
- data/app/frontend/comments/down_vote_button.component.test.tsx +2 -2
- data/app/frontend/comments/down_vote_button.component.tsx +14 -14
- data/app/frontend/comments/up_vote_button.component.test.tsx +2 -2
- data/app/frontend/comments/up_vote_button.component.tsx +14 -14
- data/app/frontend/comments/vote_button.component.tsx +2 -2
- data/app/frontend/entry.ts +1 -1
- data/app/frontend/support/generate_comments_data.ts +2 -2
- data/app/frontend/support/generate_user_data.ts +1 -1
- data/app/frontend/support/generate_user_group_data.ts +1 -1
- data/app/frontend/support/resolve_graphql_query.ts +1 -1
- data/app/types/decidim/comments/commentable_mutation_type.rb +1 -1
- data/config/locales/uk.yml +18 -0
- data/lib/decidim/comments/api/comment_type.rb +1 -1
- data/lib/decidim/comments/engine.rb +6 -2
- data/lib/decidim/comments/mutation_extensions.rb +15 -17
- data/lib/decidim/comments/query_extensions.rb +8 -10
- data/lib/decidim/comments/version.rb +1 -1
- metadata +9 -9
@@ -31,7 +31,7 @@ module Decidim
|
|
31
31
|
|
32
32
|
field :formattedCreatedAt, !types.String, "The creation date of the comment in relative format", property: :friendly_created_at
|
33
33
|
|
34
|
-
field :author, !Decidim::AuthorInterface, "The comment's author" do
|
34
|
+
field :author, !Decidim::Core::AuthorInterface, "The comment's author" do
|
35
35
|
resolve lambda { |obj, _args, _ctx|
|
36
36
|
obj.user_group || obj.author
|
37
37
|
}
|
@@ -24,11 +24,15 @@ module Decidim
|
|
24
24
|
end
|
25
25
|
|
26
26
|
initializer "decidim_comments.query_extensions" do
|
27
|
-
|
27
|
+
Decidim::Api::QueryType.define do
|
28
|
+
QueryExtensions.define(self)
|
29
|
+
end
|
28
30
|
end
|
29
31
|
|
30
32
|
initializer "decidim_comments.mutation_extensions" do
|
31
|
-
|
33
|
+
Decidim::Api::MutationType.define do
|
34
|
+
MutationExtensions.define(self)
|
35
|
+
end
|
32
36
|
end
|
33
37
|
|
34
38
|
initializer "decidim.stats" do
|
@@ -10,28 +10,26 @@ module Decidim
|
|
10
10
|
# type - A GraphQL::BaseType to extend.
|
11
11
|
#
|
12
12
|
# Returns nothing.
|
13
|
-
def self.
|
14
|
-
type.
|
15
|
-
|
16
|
-
description "A commentable"
|
13
|
+
def self.define(type)
|
14
|
+
type.field :commentable, Decidim::Comments::CommentableMutationType do
|
15
|
+
description "A commentable"
|
17
16
|
|
18
|
-
|
19
|
-
|
17
|
+
argument :id, !types.String, "The commentable's ID"
|
18
|
+
argument :type, !types.String, "The commentable's class name. i.e. `Decidim::ParticipatoryProcess`"
|
20
19
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
20
|
+
resolve lambda { |_obj, args, _ctx|
|
21
|
+
args[:type].constantize.find(args[:id])
|
22
|
+
}
|
23
|
+
end
|
25
24
|
|
26
|
-
|
27
|
-
|
25
|
+
type.field :comment, Decidim::Comments::CommentMutationType do
|
26
|
+
description "A comment"
|
28
27
|
|
29
|
-
|
28
|
+
argument :id, !types.ID, "The comment's id"
|
30
29
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
end
|
30
|
+
resolve lambda { |_obj, args, _ctx|
|
31
|
+
Comment.find(args["id"])
|
32
|
+
}
|
35
33
|
end
|
36
34
|
end
|
37
35
|
end
|
@@ -10,18 +10,16 @@ module Decidim
|
|
10
10
|
# type - A GraphQL::BaseType to extend.
|
11
11
|
#
|
12
12
|
# Returns nothing.
|
13
|
-
def self.
|
14
|
-
type.
|
15
|
-
|
16
|
-
type !CommentableType
|
13
|
+
def self.define(type)
|
14
|
+
type.field :commentable do
|
15
|
+
type !CommentableType
|
17
16
|
|
18
|
-
|
19
|
-
|
17
|
+
argument :id, !types.String, "The commentable's ID"
|
18
|
+
argument :type, !types.String, "The commentable's class name. i.e. `Decidim::ParticipatoryProcess`"
|
20
19
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
end
|
20
|
+
resolve lambda { |_obj, args, _ctx|
|
21
|
+
args[:type].constantize.find(args[:id])
|
22
|
+
}
|
25
23
|
end
|
26
24
|
end
|
27
25
|
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.
|
4
|
+
version: 0.10.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-03-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.10.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.10.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.10.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.10.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.10.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.10.0
|
71
71
|
description: Pluggable comments system for some components.
|
72
72
|
email:
|
73
73
|
- josepjaume@gmail.com
|
@@ -203,7 +203,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
203
203
|
version: '0'
|
204
204
|
requirements: []
|
205
205
|
rubyforge_project:
|
206
|
-
rubygems_version: 2.7.
|
206
|
+
rubygems_version: 2.7.6
|
207
207
|
signing_key:
|
208
208
|
specification_version: 4
|
209
209
|
summary: Decidim comments module
|