decidim-pages 0.23.6 → 0.24.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/locales/de.yml +1 -1
- data/lib/decidim/api/page_type.rb +15 -0
- data/lib/decidim/api/pages_type.rb +26 -0
- data/lib/decidim/pages.rb +1 -0
- data/lib/decidim/pages/api.rb +8 -0
- data/lib/decidim/pages/component.rb +1 -1
- data/lib/decidim/pages/version.rb +1 -1
- metadata +15 -14
- data/app/types/decidim/pages/page_type.rb +0 -16
- data/app/types/decidim/pages/pages_type.rb +0 -32
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff6f89016b4f498038ccba6eeb105df36f0082dc35584e523a1f901ac67d65bb
|
4
|
+
data.tar.gz: f1af2f4ef77a55d1fb775efcb4d41974c7daece184927f7da7a8b0fcc23f7489
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8540f7033ba1a41de5a23cf203ead737e023673ae728b5664e1d779da6a4271f12c6c4b09c3497c8dcab5becef7754b323ab1b3264e42daac648589e78d7965
|
7
|
+
data.tar.gz: 56338b41c6a8e39532c21d7387fcc3dadb0b1c6c0f492c26cb3f800768416ebaac4d5638376d4a73a0692cae4633980f5ca14688ee7124533f3d572be5545f21
|
data/config/locales/de.yml
CHANGED
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Pages
|
5
|
+
class PageType < Decidim::Api::Types::BaseObject
|
6
|
+
description "A page"
|
7
|
+
|
8
|
+
field :id, GraphQL::Types::ID, null: false
|
9
|
+
field :title, Decidim::Core::TranslatedFieldType, "The title of this page (same as the component name).", null: false
|
10
|
+
field :body, Decidim::Core::TranslatedFieldType, "The body of this page.", null: true
|
11
|
+
field :created_at, Decidim::Core::DateTimeType, "The time this page was created", null: false
|
12
|
+
field :updated_at, Decidim::Core::DateTimeType, "The time this page was updated", null: false
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Pages
|
5
|
+
class PagesType < Decidim::Api::Types::BaseObject
|
6
|
+
implements Decidim::Core::ComponentInterface
|
7
|
+
|
8
|
+
graphql_name "Pages"
|
9
|
+
description "A pages component of a participatory space."
|
10
|
+
|
11
|
+
field :pages, Decidim::Pages::PageType.connection_type, null: true, connection: true
|
12
|
+
|
13
|
+
def pages
|
14
|
+
Page.where(component: object).includes(:component)
|
15
|
+
end
|
16
|
+
|
17
|
+
field :page, Decidim::Pages::PageType, null: true do
|
18
|
+
argument :id, GraphQL::Types::ID, required: true
|
19
|
+
end
|
20
|
+
|
21
|
+
def page(**args)
|
22
|
+
Page.where(component: object).find_by(id: args[:id])
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/lib/decidim/pages.rb
CHANGED
@@ -58,7 +58,7 @@ Decidim.register_component(:pages) do |component|
|
|
58
58
|
Decidim::Pages::Page.create!(
|
59
59
|
component: component,
|
60
60
|
body: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
|
61
|
-
Decidim::Faker::Localized.paragraph(3)
|
61
|
+
Decidim::Faker::Localized.paragraph(sentence_count: 3)
|
62
62
|
end
|
63
63
|
)
|
64
64
|
end
|
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.24.0.rc1
|
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: 2021-
|
13
|
+
date: 2021-03-01 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.24.0.rc1
|
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.24.0.rc1
|
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.24.0.rc1
|
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.24.0.rc1
|
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.24.0.rc1
|
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.24.0.rc1
|
57
57
|
description: A pages component for decidim's participatory processes.
|
58
58
|
email:
|
59
59
|
- josepjaume@gmail.com
|
@@ -79,8 +79,6 @@ 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
|
84
82
|
- app/views/decidim/pages/admin/pages/_form.html.erb
|
85
83
|
- app/views/decidim/pages/admin/pages/edit.html.erb
|
86
84
|
- app/views/decidim/pages/application/show.html.erb
|
@@ -157,9 +155,12 @@ files:
|
|
157
155
|
- db/migrate/20170110145040_remove_commentable_flag_from_pages.rb
|
158
156
|
- db/migrate/20170220091402_remove_page_feature_titles.rb
|
159
157
|
- db/migrate/20180305133658_rename_features_to_components_at_pages.rb
|
158
|
+
- lib/decidim/api/page_type.rb
|
159
|
+
- lib/decidim/api/pages_type.rb
|
160
160
|
- lib/decidim/pages.rb
|
161
161
|
- lib/decidim/pages/admin.rb
|
162
162
|
- lib/decidim/pages/admin_engine.rb
|
163
|
+
- lib/decidim/pages/api.rb
|
163
164
|
- lib/decidim/pages/component.rb
|
164
165
|
- lib/decidim/pages/engine.rb
|
165
166
|
- lib/decidim/pages/version.rb
|
@@ -175,14 +176,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
175
176
|
requirements:
|
176
177
|
- - ">="
|
177
178
|
- !ruby/object:Gem::Version
|
178
|
-
version: '2.
|
179
|
+
version: '2.7'
|
179
180
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
180
181
|
requirements:
|
181
|
-
- - "
|
182
|
+
- - ">"
|
182
183
|
- !ruby/object:Gem::Version
|
183
|
-
version:
|
184
|
+
version: 1.3.1
|
184
185
|
requirements: []
|
185
|
-
rubygems_version: 3.
|
186
|
+
rubygems_version: 3.1.2
|
186
187
|
signing_key:
|
187
188
|
specification_version: 4
|
188
189
|
summary: Decidim pages module
|
@@ -1,16 +0,0 @@
|
|
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
|
@@ -1,32 +0,0 @@
|
|
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
|