ecoportal-api-oozes 0.6.1 → 0.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +86 -0
  3. data/ecoportal-api-oozes.gemspec +6 -6
  4. data/lib/ecoportal/api/common/content/collection_model.rb +25 -3
  5. data/lib/ecoportal/api/common/content/double_model.rb +27 -12
  6. data/lib/ecoportal/api/common/content/hash_diff_patch.rb +8 -1
  7. data/lib/ecoportal/api/v2.rb +27 -2
  8. data/lib/ecoportal/api/v2/page.rb +3 -3
  9. data/lib/ecoportal/api/v2/page/component.rb +11 -2
  10. data/lib/ecoportal/api/v2/page/component/action.rb +14 -3
  11. data/lib/ecoportal/api/v2/page/component/action_field.rb +40 -2
  12. data/lib/ecoportal/api/v2/page/component/chart_field.rb +54 -0
  13. data/lib/ecoportal/api/v2/page/component/chart_field/frequency.rb +29 -0
  14. data/lib/ecoportal/api/v2/page/component/chart_field/heatmap.rb +27 -0
  15. data/lib/ecoportal/api/v2/page/component/chart_field/indicator.rb +26 -0
  16. data/lib/ecoportal/api/v2/page/component/chart_field/multiseries.rb +31 -0
  17. data/lib/ecoportal/api/v2/page/component/chart_field/sankey.rb +27 -0
  18. data/lib/ecoportal/api/v2/page/component/chart_field/serie.rb +26 -0
  19. data/lib/ecoportal/api/v2/page/component/chart_field/series_config.rb +23 -0
  20. data/lib/ecoportal/api/v2/page/component/chart_fr_field.rb +32 -0
  21. data/lib/ecoportal/api/v2/page/component/checklist_field.rb +35 -2
  22. data/lib/ecoportal/api/v2/page/component/checklist_item.rb +10 -0
  23. data/lib/ecoportal/api/v2/page/component/date_field.rb +21 -0
  24. data/lib/ecoportal/api/v2/page/component/files_field.rb +1 -2
  25. data/lib/ecoportal/api/v2/page/component/gauge_field.rb +24 -1
  26. data/lib/ecoportal/api/v2/page/component/gauge_stop.rb +88 -0
  27. data/lib/ecoportal/api/v2/page/component/images_field.rb +1 -2
  28. data/lib/ecoportal/api/v2/page/component/people_field.rb +8 -1
  29. data/lib/ecoportal/api/v2/page/component/plain_text_field.rb +2 -0
  30. data/lib/ecoportal/api/v2/page/component/reference_field.rb +4 -0
  31. data/lib/ecoportal/api/v2/page/component/selection_field.rb +4 -5
  32. data/lib/ecoportal/api/v2/page/component/selection_option.rb +1 -0
  33. data/lib/ecoportal/api/v2/page/component/signature_field.rb +1 -1
  34. data/lib/ecoportal/api/v2/page/component/tag_field.rb +2 -0
  35. data/lib/ecoportal/api/v2/page/components.rb +2 -2
  36. data/lib/ecoportal/api/v2/page/section.rb +1 -0
  37. data/lib/ecoportal/api/v2/page/sections.rb +1 -1
  38. data/lib/ecoportal/api/v2/version.rb +1 -1
  39. metadata +60 -32
@@ -4,8 +4,7 @@ module Ecoportal
4
4
  class Page
5
5
  class Component
6
6
  class ImagesField < Page::Component
7
- #class_resolver :image_class, "Ecoportal::API::V2::Page::Image"
8
- embeds_multiple :images, klass: "Ecoportal::API::V2::Page::Image", order_key: :weight
7
+ embeds_many :images, klass: "Ecoportal::API::V2::Page::Image", order_key: :weight
9
8
  end
10
9
  end
11
10
  end
@@ -4,7 +4,14 @@ module Ecoportal
4
4
  class Page
5
5
  class Component
6
6
  class PeopleField < Page::Component
7
- passarray :people_ids
7
+ passthrough :is_me_button, :attach_mode
8
+ passthrough :person_schema_id
9
+ pass_reader :viewable_fields
10
+ passthrough :singular, :requires_number
11
+ passarray :people_ids
12
+ pass_reader :cached_people
13
+ passthrough :attached_people_permissions_enabled, :apply_attached_people_permissions_to
14
+ passthrough :attached_people_permissions_editable, :attached_people_permissions_flags
8
15
 
9
16
  def add(id)
10
17
  people_ids << id
@@ -5,6 +5,8 @@ module Ecoportal
5
5
  class Component
6
6
  class PlainTextField < Page::Component
7
7
  passthrough :value
8
+ passthrough :multiline, :max_length
9
+ pass_reader :exact_index
8
10
  end
9
11
  end
10
12
  end
@@ -4,6 +4,10 @@ module Ecoportal
4
4
  class Page
5
5
  class Component
6
6
  class ReferenceField < Page::Component
7
+ passthrough :register_id
8
+ passthrough :hide_create, :hide_attach
9
+ passthrough :hide_metadata, :hide_dashboards
10
+ passthrough :display_fields, :display_fields_in_lookup
7
11
  end
8
12
  end
9
13
  end
@@ -4,10 +4,10 @@ module Ecoportal
4
4
  class Page
5
5
  class Component
6
6
  class SelectionField < Page::Component
7
- passthrough :multiple, :other, :other_desc
7
+ passthrough :multiple, :flat
8
+ passthrough :other, :other_desc
8
9
 
9
- #class_resolver :selection_option_class, "Ecoportal::API::V2::Page::Component::SelectionOption"
10
- embeds_multiple :options, klass: "Ecoportal::API::V2::Page::Component::SelectionOption", order_key: :weight
10
+ embeds_many :options, klass: "Ecoportal::API::V2::Page::Component::SelectionOption", order_key: :weight
11
11
 
12
12
  def select(value)
13
13
  opt = options.find {|opt| opt.value == value}
@@ -33,9 +33,8 @@ module Ecoportal
33
33
  end
34
34
  end
35
35
 
36
- # a server bug prevents to add new options to an existing field
37
36
  def add_option(name:, value:, pos: NOT_USED, before: NOT_USED, after: NOT_USED)
38
- opt_doc = Ecoportal::API::V2::Page::Component::SelectionOption.new_doc
37
+ opt_doc = options.items_class.new_doc
39
38
  options.upsert!(opt_doc, pos: pos, before: before, after: after) do |option|
40
39
  option.name = name
41
40
  option.value = value
@@ -4,6 +4,7 @@ module Ecoportal
4
4
  class Page
5
5
  class Component
6
6
  class SelectionOption < Common::Content::DoubleModel
7
+
7
8
  class << self
8
9
  def new_doc
9
10
  {
@@ -4,7 +4,7 @@ module Ecoportal
4
4
  class Page
5
5
  class Component
6
6
  class SignatureField < Page::Component
7
- passthrough :signed_by_id, :signature_url
7
+ passthrough :signed_by_id, :signed_by_name, :signature_url
8
8
  passdate :signature_updated_at
9
9
  end
10
10
  end
@@ -4,6 +4,8 @@ module Ecoportal
4
4
  class Page
5
5
  class Component
6
6
  class TagField < Page::Component
7
+ passthrough :single_select, :use_defaults
8
+ passthrough :tag_tree_id, :button_text
7
9
  end
8
10
  end
9
11
  end
@@ -21,14 +21,14 @@ module Ecoportal
21
21
 
22
22
  def get_by_name(name, type: nil)
23
23
  pool = type ? get_by_type(type) : self
24
-
24
+
25
25
  pool.select do |comp|
26
26
  comp.label.to_s.strip.downcase == name.to_s.strip.downcase
27
27
  end.first
28
28
  end
29
29
 
30
30
  def add(label:, type:)
31
- fld_doc = Ecoportal::API::V2::Page::Component.new_doc(type: type)
31
+ fld_doc = component_class.new_doc(type: type)
32
32
  upsert!(fld_doc) do |fld|
33
33
  fld.label = label
34
34
  yield(fld) if block_given?
@@ -29,6 +29,7 @@ module Ecoportal
29
29
  passthrough :patch_ver, :weight, :type
30
30
  passthrough :heading, :left_heading, :right_heading
31
31
  passarray :component_ids, :left_component_ids, :right_component_ids
32
+ passthrough :minimized
32
33
 
33
34
  def split?
34
35
  doc && doc["type"] == "split"
@@ -8,7 +8,7 @@ module Ecoportal
8
8
  self.klass = :section_class
9
9
 
10
10
  def add(name: nil, split: false, pos: NOT_USED, before: NOT_USED, after: NOT_USED)
11
- sec_doc = Ecoportal::API::V2::Page::Section.new_doc(split: split)
11
+ sec_doc = section_class.new_doc(split: split)
12
12
  upsert!(sec_doc, pos: pos, before: before, after: after) do |section|
13
13
  section.heading = name
14
14
  if prev = previous_section(section)
@@ -1,7 +1,7 @@
1
1
  module Ecoportal
2
2
  module API
3
3
  class V2
4
- GEM_VERSION = "0.6.1"
4
+ GEM_VERSION = "0.7.4"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,77 +1,95 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecoportal-api-oozes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.7.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oscar Segura
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-07-11 00:00:00.000000000 Z
11
+ date: 2021-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 2.1.3
20
+ - - "<"
18
21
  - !ruby/object:Gem::Version
19
- version: '2.1'
22
+ version: '2.2'
20
23
  type: :development
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
25
28
  - !ruby/object:Gem::Version
26
- version: '2.1'
29
+ version: 2.1.3
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '2.2'
27
33
  - !ruby/object:Gem::Dependency
28
- name: rake
34
+ name: rspec
29
35
  requirement: !ruby/object:Gem::Requirement
30
36
  requirements:
31
- - - "~>"
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '3.9'
40
+ - - "<"
32
41
  - !ruby/object:Gem::Version
33
- version: '12.0'
42
+ version: '4'
34
43
  type: :development
35
44
  prerelease: false
36
45
  version_requirements: !ruby/object:Gem::Requirement
37
46
  requirements:
38
- - - "~>"
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: '3.9'
50
+ - - "<"
39
51
  - !ruby/object:Gem::Version
40
- version: '12.0'
52
+ version: '4'
41
53
  - !ruby/object:Gem::Dependency
42
- name: rspec
54
+ name: rake
43
55
  requirement: !ruby/object:Gem::Requirement
44
56
  requirements:
45
- - - "~>"
57
+ - - ">="
46
58
  - !ruby/object:Gem::Version
47
- version: '3.0'
59
+ version: 12.3.0
60
+ - - "<"
61
+ - !ruby/object:Gem::Version
62
+ version: '13'
48
63
  type: :development
49
64
  prerelease: false
50
65
  version_requirements: !ruby/object:Gem::Requirement
51
66
  requirements:
52
- - - "~>"
67
+ - - ">="
53
68
  - !ruby/object:Gem::Version
54
- version: '3.0'
69
+ version: 12.3.0
70
+ - - "<"
71
+ - !ruby/object:Gem::Version
72
+ version: '13'
55
73
  - !ruby/object:Gem::Dependency
56
74
  name: yard
57
75
  requirement: !ruby/object:Gem::Requirement
58
76
  requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '0.9'
62
77
  - - ">="
63
78
  - !ruby/object:Gem::Version
64
79
  version: 0.9.18
80
+ - - "<"
81
+ - !ruby/object:Gem::Version
82
+ version: '0.10'
65
83
  type: :development
66
84
  prerelease: false
67
85
  version_requirements: !ruby/object:Gem::Requirement
68
86
  requirements:
69
- - - "~>"
70
- - !ruby/object:Gem::Version
71
- version: '0.9'
72
87
  - - ">="
73
88
  - !ruby/object:Gem::Version
74
89
  version: 0.9.18
90
+ - - "<"
91
+ - !ruby/object:Gem::Version
92
+ version: '0.10'
75
93
  - !ruby/object:Gem::Dependency
76
94
  name: redcarpet
77
95
  requirement: !ruby/object:Gem::Requirement
@@ -79,9 +97,9 @@ dependencies:
79
97
  - - ">="
80
98
  - !ruby/object:Gem::Version
81
99
  version: 3.5.0
82
- - - "~>"
100
+ - - "<"
83
101
  - !ruby/object:Gem::Version
84
- version: '3.5'
102
+ version: '3.6'
85
103
  type: :development
86
104
  prerelease: false
87
105
  version_requirements: !ruby/object:Gem::Requirement
@@ -89,9 +107,9 @@ dependencies:
89
107
  - - ">="
90
108
  - !ruby/object:Gem::Version
91
109
  version: 3.5.0
92
- - - "~>"
110
+ - - "<"
93
111
  - !ruby/object:Gem::Version
94
- version: '3.5'
112
+ version: '3.6'
95
113
  - !ruby/object:Gem::Dependency
96
114
  name: pry
97
115
  requirement: !ruby/object:Gem::Requirement
@@ -112,20 +130,20 @@ dependencies:
112
130
  requirements:
113
131
  - - ">="
114
132
  - !ruby/object:Gem::Version
115
- version: 0.6.0
116
- - - "~>"
133
+ version: 0.7.4
134
+ - - "<"
117
135
  - !ruby/object:Gem::Version
118
- version: '0.6'
136
+ version: '0.8'
119
137
  type: :runtime
120
138
  prerelease: false
121
139
  version_requirements: !ruby/object:Gem::Requirement
122
140
  requirements:
123
141
  - - ">="
124
142
  - !ruby/object:Gem::Version
125
- version: 0.6.0
126
- - - "~>"
143
+ version: 0.7.4
144
+ - - "<"
127
145
  - !ruby/object:Gem::Version
128
- version: '0.6'
146
+ version: '0.8'
129
147
  description:
130
148
  email:
131
149
  - rien@ecoportal.co.nz
@@ -165,12 +183,22 @@ files:
165
183
  - lib/ecoportal/api/v2/page/component.rb
166
184
  - lib/ecoportal/api/v2/page/component/action.rb
167
185
  - lib/ecoportal/api/v2/page/component/action_field.rb
186
+ - lib/ecoportal/api/v2/page/component/chart_field.rb
187
+ - lib/ecoportal/api/v2/page/component/chart_field/frequency.rb
188
+ - lib/ecoportal/api/v2/page/component/chart_field/heatmap.rb
189
+ - lib/ecoportal/api/v2/page/component/chart_field/indicator.rb
190
+ - lib/ecoportal/api/v2/page/component/chart_field/multiseries.rb
191
+ - lib/ecoportal/api/v2/page/component/chart_field/sankey.rb
192
+ - lib/ecoportal/api/v2/page/component/chart_field/serie.rb
193
+ - lib/ecoportal/api/v2/page/component/chart_field/series_config.rb
194
+ - lib/ecoportal/api/v2/page/component/chart_fr_field.rb
168
195
  - lib/ecoportal/api/v2/page/component/checklist_field.rb
169
196
  - lib/ecoportal/api/v2/page/component/checklist_item.rb
170
197
  - lib/ecoportal/api/v2/page/component/date_field.rb
171
198
  - lib/ecoportal/api/v2/page/component/file.rb
172
199
  - lib/ecoportal/api/v2/page/component/files_field.rb
173
200
  - lib/ecoportal/api/v2/page/component/gauge_field.rb
201
+ - lib/ecoportal/api/v2/page/component/gauge_stop.rb
174
202
  - lib/ecoportal/api/v2/page/component/geo_field.rb
175
203
  - lib/ecoportal/api/v2/page/component/image.rb
176
204
  - lib/ecoportal/api/v2/page/component/images_field.rb