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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 785edb20eef205b32bf03bb0b552194ba65278d7ec4b6aaed134753493711dc5
4
- data.tar.gz: e08627233efc9b7ca0000ca2ed815defaeb9d4c40813da4c7bb0e2fcef751dc4
3
+ metadata.gz: ff6f89016b4f498038ccba6eeb105df36f0082dc35584e523a1f901ac67d65bb
4
+ data.tar.gz: f1af2f4ef77a55d1fb775efcb4d41974c7daece184927f7da7a8b0fcc23f7489
5
5
  SHA512:
6
- metadata.gz: 4627e2680f6d0e61a67d4aa06781b96838317131c70b6dbe71def4fdbf976e43f6def5a2098087a5e40d40a3dfa1ce2a68494723ec7a50e43d815eecc0f293e7
7
- data.tar.gz: d4a7f123dbc86faa894cbeb0fc1afc2a34c291e0326f95b524a2fbace2ba6cb7b8922d7797f3987ccbeeacf3b924b2cdcc4212e76b515a96afee6121ba3a1607
6
+ metadata.gz: d8540f7033ba1a41de5a23cf203ead737e023673ae728b5664e1d779da6a4271f12c6c4b09c3497c8dcab5becef7754b323ab1b3264e42daac648589e78d7965
7
+ data.tar.gz: 56338b41c6a8e39532c21d7387fcc3dadb0b1c6c0f492c26cb3f800768416ebaac4d5638376d4a73a0692cae4633980f5ca14688ee7124533f3d572be5545f21
@@ -20,7 +20,7 @@ de:
20
20
  admin:
21
21
  models:
22
22
  components:
23
- body: Haupttext
23
+ body: Karosserie
24
24
  pages:
25
25
  edit:
26
26
  save: Aktualisieren
@@ -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
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "decidim/pages/admin"
4
+ require "decidim/pages/api"
4
5
  require "decidim/pages/engine"
5
6
  require "decidim/pages/admin_engine"
6
7
  require "decidim/pages/component"
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Pages
5
+ autoload :PageType, "decidim/api/page_type"
6
+ autoload :PagesType, "decidim/api/pages_type"
7
+ end
8
+ end
@@ -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
@@ -4,7 +4,7 @@ module Decidim
4
4
  # This holds the decidim-pages version.
5
5
  module Pages
6
6
  def self.version
7
- "0.23.6"
7
+ "0.24.0.rc1"
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-pages
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.23.6
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-05-10 00:00:00.000000000 Z
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.23.6
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.23.6
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.23.6
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.23.6
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.23.6
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.23.6
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.6'
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: '0'
184
+ version: 1.3.1
184
185
  requirements: []
185
- rubygems_version: 3.0.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