decidim-pages 0.15.2 → 0.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/types/decidim/pages/page_type.rb +16 -0
- data/app/types/decidim/pages/pages_type.rb +32 -0
- data/lib/decidim/pages/component.rb +2 -0
- data/lib/decidim/pages/version.rb +1 -1
- metadata +11 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b5bd7a5e1df612ef5bb77587b355d6586a201e937320b5fd108ee293feb97fe
|
4
|
+
data.tar.gz: 02a7e307e647c9fe855904e25bb91d5ded22c1ff2ddb1e48e990d8d403c741e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9982048fe82591a91bddec24b9067bf6540bd24cadeff02fb7c21f74ed78c6704deaa44e3df7d1b64b79fd4ee8074f47bb9990ea53a07c032507cc992a22df1
|
7
|
+
data.tar.gz: faea4f814610948ec5fccabe197d564940dd3ba55f71ecc1b130e40439f2338436186c067b40bf986ddc16ae3b4a4230856f4bcf044455a9062b83b8553f65ed
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Pages
|
5
|
+
PageType = GraphQL::ObjectType.define do
|
6
|
+
name "Page"
|
7
|
+
description "A page"
|
8
|
+
|
9
|
+
field :id, !types.ID
|
10
|
+
field :title, !Decidim::Core::TranslatedFieldType, "The title of this page (same as the component name)."
|
11
|
+
field :body, Decidim::Core::TranslatedFieldType, "The body of this page."
|
12
|
+
field :createdAt, !Decidim::Core::DateTimeType, "The time this page was created", property: :created_at
|
13
|
+
field :updatedAt, !Decidim::Core::DateTimeType, "The time this page was updated", property: :updated_at
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Pages
|
5
|
+
PagesType = GraphQL::ObjectType.define do
|
6
|
+
interfaces [-> { Decidim::Core::ComponentInterface }]
|
7
|
+
|
8
|
+
name "Pages"
|
9
|
+
description "A pages component of a participatory space."
|
10
|
+
|
11
|
+
connection :pages, PageType.connection_type do
|
12
|
+
resolve ->(component, _args, _ctx) {
|
13
|
+
PagesTypeHelper.base_scope(component).includes(:component)
|
14
|
+
}
|
15
|
+
end
|
16
|
+
|
17
|
+
field(:page, PageType) do
|
18
|
+
argument :id, !types.ID
|
19
|
+
|
20
|
+
resolve ->(component, args, _ctx) {
|
21
|
+
PagesTypeHelper.base_scope(component).find_by(id: args[:id])
|
22
|
+
}
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
module PagesTypeHelper
|
27
|
+
def self.base_scope(component)
|
28
|
+
Page.where(component: component)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -8,6 +8,8 @@ Decidim.register_component(:pages) do |component|
|
|
8
8
|
component.icon = "decidim/pages/icon.svg"
|
9
9
|
component.permissions_class_name = "Decidim::Pages::Permissions"
|
10
10
|
|
11
|
+
component.query_type = "Decidim::Pages::PagesType"
|
12
|
+
|
11
13
|
component.on(:create) do |instance|
|
12
14
|
Decidim::Pages::CreatePage.call(instance) do
|
13
15
|
on(:invalid) { raise "Can't create page" }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: decidim-pages
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.16.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: 2019-01-
|
13
|
+
date: 2019-01-09 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: decidim-core
|
@@ -18,42 +18,42 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - '='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 0.
|
21
|
+
version: 0.16.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.16.0
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: decidim-dev
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
32
32
|
requirements:
|
33
33
|
- - '='
|
34
34
|
- !ruby/object:Gem::Version
|
35
|
-
version: 0.
|
35
|
+
version: 0.16.0
|
36
36
|
type: :development
|
37
37
|
prerelease: false
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
40
|
- - '='
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: 0.
|
42
|
+
version: 0.16.0
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: decidim-participatory_processes
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
47
|
- - '='
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: 0.
|
49
|
+
version: 0.16.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.16.0
|
57
57
|
description: A pages component for decidim's participatory processes.
|
58
58
|
email:
|
59
59
|
- josepjaume@gmail.com
|
@@ -79,6 +79,8 @@ files:
|
|
79
79
|
- app/models/decidim/pages/page.rb
|
80
80
|
- app/permissions/decidim/pages/permissions.rb
|
81
81
|
- app/presenters/decidim/pages/admin_log/page_presenter.rb
|
82
|
+
- app/types/decidim/pages/page_type.rb
|
83
|
+
- app/types/decidim/pages/pages_type.rb
|
82
84
|
- app/views/decidim/pages/admin/pages/_form.html.erb
|
83
85
|
- app/views/decidim/pages/admin/pages/edit.html.erb
|
84
86
|
- app/views/decidim/pages/application/show.html.erb
|
@@ -134,7 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
134
136
|
version: '0'
|
135
137
|
requirements: []
|
136
138
|
rubyforge_project:
|
137
|
-
rubygems_version: 2.7.
|
139
|
+
rubygems_version: 2.7.6
|
138
140
|
signing_key:
|
139
141
|
specification_version: 4
|
140
142
|
summary: Decidim pages module
|