decidim-blogs 0.20.1 → 0.21.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 504a7000d8f939d8a56f4751e272fae773852005937a4538bf586dbdd6bb04bc
4
- data.tar.gz: 796bd2ef34d332597d3cf20cbe03467f41e4a209b22ed4fe247ba67ecaf1ea1c
3
+ metadata.gz: 4ffb146f8393d89cf23c01f44b51d8e5caec159b6ba0147179a105b1a81f1a3c
4
+ data.tar.gz: c2ca7c30f1c2af6405abd47df267138634f87f4537405b6a07e4a49b6e6cb7e1
5
5
  SHA512:
6
- metadata.gz: b181591ed8d936b8ed5070749ee9ae4de29c9c6d9a7ac6466dc29776d6ff7059e293c88086dbabeb2190582f0ab1d94121e541157067c5d66f7ea8c9169327f8
7
- data.tar.gz: 450d30ccf508c9f3724344c760ca50df355fe483a65921ebcea124c7eafc220a52915f5203c744ebe4c2c15d96c8c74e708e4e8d185506a741aed3821cfd6f4f
6
+ metadata.gz: fd6f92894919716ded583a58d7e177c4e64edc2a0c2692e6d3712b300e4286ebef99af5ea74db64b3d8c35505829aa126d3849bd581126a8e2a1b94893edeacc
7
+ data.tar.gz: abd58ef1553ed0f47e541fd8301d963687f868da57ea029cf1b691e78ccc5dc96ca0a0acd2c67f1b15391b58f9878009780f5d0377a195394e8f3718958cf1fb
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Blogs
5
+ BlogsType = GraphQL::ObjectType.define do
6
+ interfaces [-> { Decidim::Core::ComponentInterface }]
7
+
8
+ name "Blogs"
9
+ description "A blogs component of a participatory space."
10
+
11
+ connection :posts, PostType.connection_type do
12
+ resolve ->(component, _args, _ctx) {
13
+ PostsTypeHelper.base_scope(component).includes(:component)
14
+ }
15
+ end
16
+
17
+ field(:post, PostType) do
18
+ argument :id, !types.ID
19
+
20
+ resolve ->(component, args, _ctx) {
21
+ PostsTypeHelper.base_scope(component).find_by(id: args[:id])
22
+ }
23
+ end
24
+ end
25
+
26
+ module PostsTypeHelper
27
+ def self.base_scope(component)
28
+ Post.where(component: component)
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Blogs
5
+ # This type represents a Post.
6
+ PostType = GraphQL::ObjectType.define do
7
+ interfaces [
8
+ -> { Decidim::Comments::CommentableInterface },
9
+ -> { Decidim::Core::AttachableInterface },
10
+ -> { Decidim::Core::AuthorableInterface }
11
+ ]
12
+
13
+ name "Post"
14
+ description "A post"
15
+
16
+ field :id, !types.ID, "The internal ID of this post"
17
+ field :title, Decidim::Core::TranslatedFieldType, "The title for this post"
18
+ field :body, Decidim::Core::TranslatedFieldType, "The body of this post"
19
+ field :createdAt, Decidim::Core::DateTimeType, "The time this post was created", property: :created_at
20
+ field :updatedAt, Decidim::Core::DateTimeType, "The time this post was updated", property: :updated_at
21
+ end
22
+ end
23
+ end
@@ -0,0 +1 @@
1
+ el:
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AddUserGroupAuthorToBlogs < ActiveRecord::Migration[5.2]
4
+ def change
5
+ add_column :decidim_blogs_posts, :decidim_user_group_id, :integer
6
+ end
7
+ end
@@ -8,6 +8,8 @@ Decidim.register_component(:blogs) do |component|
8
8
  component.icon = "decidim/blogs/icon.svg"
9
9
  component.permissions_class_name = "Decidim::Blog::Permissions"
10
10
 
11
+ component.query_type = "Decidim::Blogs::BlogsType"
12
+
11
13
  component.on(:before_destroy) do |instance|
12
14
  raise StandardError, "Can't remove this component" if Decidim::Blogs::Post.where(component: instance).any?
13
15
  end
@@ -4,7 +4,7 @@ module Decidim
4
4
  # This holds the decidim-pages version.
5
5
  module Blogs
6
6
  def self.version
7
- "0.20.1"
7
+ "0.21.0"
8
8
  end
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-blogs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.20.1
4
+ version: 0.21.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Isaac Massot Gil
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-27 00:00:00.000000000 Z
11
+ date: 2020-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: decidim-admin
@@ -16,42 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.20.1
19
+ version: 0.21.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.20.1
26
+ version: 0.21.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: decidim-comments
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 0.20.1
33
+ version: 0.21.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 0.20.1
40
+ version: 0.21.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: decidim-core
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 0.20.1
47
+ version: 0.21.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: 0.20.1
54
+ version: 0.21.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: httparty
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -100,56 +100,56 @@ dependencies:
100
100
  requirements:
101
101
  - - '='
102
102
  - !ruby/object:Gem::Version
103
- version: 0.20.1
103
+ version: 0.21.0
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - '='
109
109
  - !ruby/object:Gem::Version
110
- version: 0.20.1
110
+ version: 0.21.0
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: decidim-assemblies
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - '='
116
116
  - !ruby/object:Gem::Version
117
- version: 0.20.1
117
+ version: 0.21.0
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - '='
123
123
  - !ruby/object:Gem::Version
124
- version: 0.20.1
124
+ version: 0.21.0
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: decidim-dev
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - '='
130
130
  - !ruby/object:Gem::Version
131
- version: 0.20.1
131
+ version: 0.21.0
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - '='
137
137
  - !ruby/object:Gem::Version
138
- version: 0.20.1
138
+ version: 0.21.0
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: decidim-participatory_processes
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - '='
144
144
  - !ruby/object:Gem::Version
145
- version: 0.20.1
145
+ version: 0.21.0
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - '='
151
151
  - !ruby/object:Gem::Version
152
- version: 0.20.1
152
+ version: 0.21.0
153
153
  description: A Blog component for decidim's participatory spaces.
154
154
  email:
155
155
  - isaac.mg@coditramuntana.com
@@ -181,6 +181,8 @@ files:
181
181
  - app/models/decidim/blogs/post.rb
182
182
  - app/permissions/decidim/blog/permissions.rb
183
183
  - app/presenters/decidim/blogs/post_presenter.rb
184
+ - app/types/decidim/blogs/blogs_type.rb
185
+ - app/types/decidim/blogs/post_type.rb
184
186
  - app/views/decidim/blogs/admin/posts/_form.html.erb
185
187
  - app/views/decidim/blogs/admin/posts/edit.html.erb
186
188
  - app/views/decidim/blogs/admin/posts/index.html.erb
@@ -197,6 +199,7 @@ files:
197
199
  - config/locales/cs.yml
198
200
  - config/locales/de.yml
199
201
  - config/locales/el-GR.yml
202
+ - config/locales/el.yml
200
203
  - config/locales/en.yml
201
204
  - config/locales/eo-UY.yml
202
205
  - config/locales/es-MX.yml
@@ -224,6 +227,7 @@ files:
224
227
  - db/migrate/20171129131353_create_decidim_blogs_posts.rb
225
228
  - db/migrate/20171211084630_add_author_to_decidim_blogs_posts.rb
226
229
  - db/migrate/20181017084519_make_blogposts_authors_polymorphics.rb
230
+ - db/migrate/20191212162606_add_user_group_author_to_blogs.rb
227
231
  - lib/decidim/blogs.rb
228
232
  - lib/decidim/blogs/admin.rb
229
233
  - lib/decidim/blogs/admin_engine.rb