ecoportal-api-v2 0.8.7 → 0.8.8

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: a332d0750443bc0d8be5b549032b9f62c493cbff07905dc353f0949248c5120a
4
- data.tar.gz: d89435fd4cebfef7662148f5fc335cc792353666c80e1f5ab07c6dc0a8f73744
3
+ metadata.gz: 2d7fd0373344854c22b4397e7e2d2645dd799695424f3fa30d006fca2081676d
4
+ data.tar.gz: 2d839f8ecb67512c2c5d00a2bd6832e53d304334f2c5a6bbc291958661e21130
5
5
  SHA512:
6
- metadata.gz: 611c6b781a09105bb22a24b85e3b9046513505691bef6256774837fa14a7e1c9ca6061795fe35068b5c5340e82f07d2281682ad2d05b06673495285fabcf1dfb
7
- data.tar.gz: 3b9f347aac2994262df8dd864b564010a37ec01a5d7ed2da4ecdc69bb49fff2ff85d8f858cb1761baa770e352131f9ee444fcacd765888ef7b3a338902b567e6
6
+ metadata.gz: 27425f592041428b0d07f9593c78f2a80095311e4890a3569ce212e37f067a3b36f2a3b147459e7dca368f7a737671ac9325df6ed40cec3d4a18f75d0ea18d28
7
+ data.tar.gz: c4cee01feb2c89179da4eda1d3699e5900812b52fb7d198a1447935ac4e89c347bee56ba69c5f6d1a407f968da21112cf0a490855811ddfd5048caace430c422
data/CHANGELOG.md CHANGED
@@ -1,9 +1,20 @@
1
1
  # Change Log
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
- ## [0.8.7] - 2021-05-xx
4
+ ## [0.8.8] - 2021-06-xx
5
5
 
6
6
  ### Added
7
+ - `Ecoportal::API::V2::Page::Component::ChartField::Benchmark`
8
+ - Support to convert selection options between numeric and text type.
9
+ - Add `Permit` object to `Page` and `Stage`
10
+
11
+ ### Changed
12
+ - Removed `Stages.ordered_stages`: detected bug with Enumerable iteration
13
+
14
+ ### Fixed
15
+
16
+ ## [0.8.7] - 2021-05-25
17
+
7
18
  ### Changed
8
19
  - Upgrade `ecoportal-api` gem
9
20
 
@@ -34,6 +34,7 @@ module Ecoportal
34
34
  end
35
35
  end
36
36
 
37
+ require 'ecoportal/api/v2/page/permit'
37
38
  require 'ecoportal/api/v2/page/component'
38
39
  require 'ecoportal/api/v2/page/components'
39
40
  require 'ecoportal/api/v2/page/section'
@@ -16,6 +16,7 @@ module Ecoportal
16
16
  embeds_one :sankey_config, klass: "Ecoportal::API::V2::Page::Component::ChartField::Sankey"
17
17
  embeds_one :indicator_config, klass: "Ecoportal::API::V2::Page::Component::ChartField::Indicator"
18
18
  embeds_one :faceted_series_config, klass: "Ecoportal::API::V2::Page::Component::ChartField::Multiseries"
19
+ embeds_one :benchmark_config, klass: "Ecoportal::API::V2::Page::Component::ChartField::Benchmark"
19
20
 
20
21
  embeds_many :series, klass: "Ecoportal::API::V2::Page::Component::ChartField::Serie"
21
22
 
@@ -35,6 +36,8 @@ module Ecoportal
35
36
  indicator_config
36
37
  when "faceted_series"
37
38
  faceted_series_config
39
+ when "benchmark"
40
+ benchmark_config
38
41
  end
39
42
  end
40
43
 
@@ -52,3 +55,4 @@ require 'ecoportal/api/v2/page/component/chart_field/heatmap'
52
55
  require 'ecoportal/api/v2/page/component/chart_field/sankey'
53
56
  require 'ecoportal/api/v2/page/component/chart_field/indicator'
54
57
  require 'ecoportal/api/v2/page/component/chart_field/multiseries'
58
+ require 'ecoportal/api/v2/page/component/chart_field/benchmark'
@@ -0,0 +1,28 @@
1
+ module Ecoportal
2
+ module API
3
+ class V2
4
+ class Page
5
+ class Component
6
+ class ChartField
7
+ class Benchmark < Common::Content::DoubleModel
8
+ passkey :id
9
+ passthrough :patch_ver
10
+
11
+ passthrough :register_id
12
+ passthrough :source_type
13
+ passthrough :benchmark_field, :benchmark_label
14
+ passthrough :across, :across_field
15
+ passthrough :against_field, :against_label
16
+ passthrough :grouped, :group_field
17
+
18
+ passthrough :calculation_mode
19
+ passthrough :min, :max
20
+
21
+ passthrough :filters
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -10,12 +10,14 @@ module Ecoportal
10
10
 
11
11
  embeds_many :options, klass: "Ecoportal::API::V2::Page::Component::SelectionOption", order_key: :weight
12
12
 
13
- def numeric!
14
- data_type = "num"
13
+ def numeric!(&block)
14
+ ordered_options.each {|opt| opt.numeric!(&block)}
15
+ self.data_type = "num"
15
16
  end
16
17
 
17
- def text!
18
- data_type = "str"
18
+ def text!(&block)
19
+ ordered_options.each {|opt| opt.text!(&block)}
20
+ self.data_type = "str"
19
21
  end
20
22
 
21
23
  def select(value)
@@ -4,7 +4,7 @@ module Ecoportal
4
4
  class Page
5
5
  class Component
6
6
  class SelectionOption < Common::Content::DoubleModel
7
-
7
+
8
8
  class << self
9
9
  def new_doc
10
10
  {
@@ -17,6 +17,15 @@ module Ecoportal
17
17
  passkey :id
18
18
  passthrough :patch_ver, :name, :value
19
19
  passthrough :weight, :selected
20
+
21
+ def numeric!
22
+ self.value = block_given?? yield(value) : value.to_i
23
+ end
24
+
25
+ def text!
26
+ self.value = block_given?? yield(value) : value.to_s
27
+ end
28
+
20
29
  end
21
30
  end
22
31
  end
@@ -0,0 +1,14 @@
1
+ module Ecoportal
2
+ module API
3
+ class V2
4
+ class Page
5
+ class Permit < Common::Content::DoubleModel
6
+ passkey :id
7
+ passthrough :patch_ver
8
+ passthrough :user_id, :user_name
9
+ passthrough :editable, :flags
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -5,9 +5,13 @@ module Ecoportal
5
5
  class Stage < Common::Content::DoubleModel
6
6
  passkey :id
7
7
  passthrough :patch_ver
8
- passthrough :name
8
+ passthrough :namem, :ordering
9
9
  passarray :subtags, order_matters: false
10
10
  passarray :section_ids
11
+ passthrough :complete, :status, :lock_after_completion
12
+ embeds_many :permits, klass: "Ecoportal::API::V2::Page::Permit"
13
+ passthrough :disable_direct_permissions
14
+ passthrough :creator_enabled, :creator_editable, :creator_flags
11
15
  passthrough :can
12
16
 
13
17
  def sections
@@ -13,11 +13,11 @@ module Ecoportal
13
13
  end
14
14
  end
15
15
 
16
- def ordered_stages
17
- stages.each_with_index.sort_by do |stage, index|
18
- (stage.ordering >= 9999) ? [index, index] : [stage.ordering, index]
19
- end.map(&:first)
20
- end
16
+ #def ordered
17
+ # self.each_with_index.sort_by do |stage, index|
18
+ # (stage.ordering >= 9999) ? [index, index] : [stage.ordering, index]
19
+ # end.map(&:first)
20
+ #end
21
21
 
22
22
  end
23
23
  end
@@ -4,11 +4,12 @@ module Ecoportal
4
4
  class Pages
5
5
  class PageStage < V2::Page
6
6
  passthrough :mould_counter, :archive
7
- passthrough :task_priority, :state
7
+ passthrough :task_priority, :state, :status
8
8
  passthrough :votes_enabled, :upvotes, :downvotes
9
9
 
10
- passarray :force_errors, :subtags, :permits, order_matters: false
11
- passthrough :evolution
10
+ embeds_many :permits, klass: "Ecoportal::API::V2::Page::Permit"
11
+ passarray :force_errors, :subtags, order_matters: false
12
+ #passthrough :evolution
12
13
  end
13
14
  end
14
15
  end
@@ -1,5 +1,5 @@
1
1
  module Ecoportal
2
2
  module API
3
- GEM2_VERSION = "0.8.7"
3
+ GEM2_VERSION = "0.8.8"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecoportal-api-v2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.7
4
+ version: 0.8.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oscar Segura
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-05-24 00:00:00.000000000 Z
11
+ date: 2021-08-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -184,6 +184,7 @@ files:
184
184
  - lib/ecoportal/api/v2/page/component/action.rb
185
185
  - lib/ecoportal/api/v2/page/component/action_field.rb
186
186
  - lib/ecoportal/api/v2/page/component/chart_field.rb
187
+ - lib/ecoportal/api/v2/page/component/chart_field/benchmark.rb
187
188
  - lib/ecoportal/api/v2/page/component/chart_field/frequency.rb
188
189
  - lib/ecoportal/api/v2/page/component/chart_field/heatmap.rb
189
190
  - lib/ecoportal/api/v2/page/component/chart_field/indicator.rb
@@ -213,6 +214,7 @@ files:
213
214
  - lib/ecoportal/api/v2/page/component/signature_field.rb
214
215
  - lib/ecoportal/api/v2/page/component/tag_field.rb
215
216
  - lib/ecoportal/api/v2/page/components.rb
217
+ - lib/ecoportal/api/v2/page/permit.rb
216
218
  - lib/ecoportal/api/v2/page/section.rb
217
219
  - lib/ecoportal/api/v2/page/sections.rb
218
220
  - lib/ecoportal/api/v2/page/stage.rb