ecoportal-api-oozes 0.6.0 → 0.7.3
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +71 -1
- data/ecoportal-api-oozes.gemspec +6 -6
- data/lib/ecoportal/api/common/content/collection_model.rb +20 -3
- data/lib/ecoportal/api/common/content/double_model.rb +4 -4
- data/lib/ecoportal/api/v2.rb +27 -2
- data/lib/ecoportal/api/v2/page/component.rb +3 -2
- data/lib/ecoportal/api/v2/page/component/action.rb +14 -3
- data/lib/ecoportal/api/v2/page/component/action_field.rb +39 -1
- data/lib/ecoportal/api/v2/page/component/checklist_field.rb +34 -1
- data/lib/ecoportal/api/v2/page/component/checklist_item.rb +10 -0
- data/lib/ecoportal/api/v2/page/component/date_field.rb +3 -0
- data/lib/ecoportal/api/v2/page/component/gauge_field.rb +24 -1
- data/lib/ecoportal/api/v2/page/component/gauge_stop.rb +26 -0
- data/lib/ecoportal/api/v2/page/component/people_field.rb +8 -1
- data/lib/ecoportal/api/v2/page/component/plain_text_field.rb +2 -0
- data/lib/ecoportal/api/v2/page/component/reference_field.rb +4 -0
- data/lib/ecoportal/api/v2/page/component/selection_field.rb +2 -2
- data/lib/ecoportal/api/v2/page/component/selection_option.rb +1 -0
- data/lib/ecoportal/api/v2/page/component/signature_field.rb +1 -1
- data/lib/ecoportal/api/v2/page/component/tag_field.rb +2 -0
- data/lib/ecoportal/api/v2/page/section.rb +1 -0
- data/lib/ecoportal/api/v2/version.rb +1 -1
- metadata +51 -32
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d9c761acea6fa4c7a6cef0c0b56716906368032d14e891fbcad192487a3d46f4
|
4
|
+
data.tar.gz: b16661800fd19357336f645832fe0a053105febdc2e58a4556d66c2c084742a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2931d29722ac006672127d5c675ae3522c84b118075f244ec96c3b0d1534d2170595bfbcc4e0f616de9162f46f085f2e02bce50426ba55e331f3380ef20961d7
|
7
|
+
data.tar.gz: 40ca60459ecc7cf9569d49a8c57a3866176b867f7dbd620941e2b975f48e9071c53cea0a6e28dab1f8fe245ca048e4108351bf16ca2b05494952c202581d36ac
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,77 @@
|
|
1
1
|
# Change Log
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
|
4
|
-
## [0.
|
4
|
+
## [0.7.3] - 2020-10-xx
|
5
|
+
|
6
|
+
### Added
|
7
|
+
- `Ecoportal::API::Common::Content::CollectionModel#delete!` finally scoped how delete should work :)
|
8
|
+
- `Ecoportal::API::V2.new` better feedback on key error.
|
9
|
+
- `Ecoportal::API::V2::Page::Component::SignatureField` added property `signed_by_name`
|
10
|
+
- `Ecoportal::API::V2::Page::Component#required` this field property is currently supported
|
11
|
+
- `Ecoportal::API::V2::Page::Component::DateField` more supported properties:
|
12
|
+
* `show_time`, `today_button`, `past_only`, `create_event`, `remind_me_in`, `renews`, `renews_every`, `renews_unit`, `renews_until`
|
13
|
+
- `Ecoportal::API::V2::Page::Component::ChecklistField`
|
14
|
+
* added more methods: `add_item`, `ordered_items`
|
15
|
+
- `Ecoportal::API::V2::Page::Component::GaugeField`
|
16
|
+
* more supported properties: `max`, `active_color` and `stops`
|
17
|
+
- for `stops` added class `Ecoportal::API::V2::Page::Component::GaugeStop`
|
18
|
+
* added more methods: `add_stop`, `ordered_stops`
|
19
|
+
- `Ecoportal::API::V2::Page::Component::ReferenceField` more supported properties:
|
20
|
+
* `register_id`, `hide_create`, `hide_attach`, `hide_metadata`, `hide_dashboards`, `display_fields`, `display_fields_in_lookup`
|
21
|
+
- `Ecoportal::API::V2::Page::Component::ActionField`
|
22
|
+
* more supported properties:`create_actions`, `required_number_of_completed_actions`, `permits_and_rules_integration`, `add_subscribed`, `add_subscribed_to_tasks`
|
23
|
+
* added more methods: `add_task`, `ordered_tasks`
|
24
|
+
- `Ecoportal::API::V2::Page::Component::Action` modified, provided that some properties are `read_only`
|
25
|
+
- `Ecoportal::API::V2::Page::Component::PeopleField` more supported properties:
|
26
|
+
* `is_me_button`, `attach_mode`, `person_schema_id`, `viewable_fields`, `singular`, `requires_number`, `cached_people`, `attached_people_permissions_enabled`, `apply_attached_people_permissions_to`, `attached_people_permissions_editable`, `attached_people_permissions_flags`
|
27
|
+
- `Ecoportal::API::V2::Page::Component::PlainTextField` more supported properties:
|
28
|
+
* `multiline`, `max_length`, `exact_index`
|
29
|
+
- `Ecoportal::API::V2::Page::Component::SelectionField` more supported properties:
|
30
|
+
* `flat`
|
31
|
+
- `Ecoportal::API::V2::Page::Component::TagField` more supported properties:
|
32
|
+
* `single_select`, `use_defaults`, `tag_tree_id`, `button_text`
|
33
|
+
- `Ecoportal::API::V2::Page::Section` more supported properties:
|
34
|
+
* `minimized`
|
35
|
+
|
36
|
+
|
37
|
+
### Changed
|
38
|
+
- upgraded `ecoportal-api` dependency
|
39
|
+
|
40
|
+
### Fixed
|
41
|
+
- `Ecoportal::API::Common::Content::CollectionModel#upsert!` was not actually moving the element to the new position when it already existed
|
42
|
+
|
43
|
+
## [0.7.2] - 2020-10-07
|
44
|
+
|
45
|
+
### Added
|
46
|
+
- automatic key builder
|
47
|
+
- helper: `Ecoportal::API::V2::v2key` method
|
48
|
+
- `user_key:` and `org_key:` as constructor methods for `Ecoportal::API::V2`
|
49
|
+
### Changed
|
50
|
+
### Fixed
|
51
|
+
|
52
|
+
## [0.7.1] - 2020-10-07
|
53
|
+
|
54
|
+
### Added
|
55
|
+
### Changed
|
56
|
+
- updated dependencies
|
57
|
+
### Fixed
|
58
|
+
|
59
|
+
|
60
|
+
## [0.7.0] - 2020-09-10
|
61
|
+
|
62
|
+
### Added
|
63
|
+
### Changed
|
64
|
+
- updated dependencies
|
65
|
+
### Fixed
|
66
|
+
|
67
|
+
## [0.6.1] - 2020-07-11
|
68
|
+
|
69
|
+
### Added
|
70
|
+
- `Ecoportal::API::Common::Content::DoubleModel#pretty_print`
|
71
|
+
### Changed
|
72
|
+
### Fixed
|
73
|
+
|
74
|
+
## [0.6.0] - 2020-07-11
|
5
75
|
|
6
76
|
### Added
|
7
77
|
### Changed
|
data/ecoportal-api-oozes.gemspec
CHANGED
@@ -20,12 +20,12 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
21
21
|
spec.require_paths = ["lib"]
|
22
22
|
|
23
|
-
spec.add_development_dependency "bundler", "
|
24
|
-
spec.add_development_dependency "
|
25
|
-
spec.add_development_dependency "
|
26
|
-
spec.add_development_dependency "yard", "
|
27
|
-
spec.add_development_dependency "redcarpet", "
|
23
|
+
spec.add_development_dependency "bundler", ">= 2.1.3", "< 2.2"
|
24
|
+
spec.add_development_dependency "rspec", ">= 3.9", "< 4"
|
25
|
+
spec.add_development_dependency "rake", ">= 12.3.0", "< 13"
|
26
|
+
spec.add_development_dependency "yard", ">= 0.9.18", "< 0.10"
|
27
|
+
spec.add_development_dependency "redcarpet", ">= 3.5.0", "< 3.6"
|
28
28
|
spec.add_development_dependency "pry"
|
29
29
|
|
30
|
-
spec.add_dependency 'ecoportal-api',
|
30
|
+
spec.add_dependency 'ecoportal-api', '>= 0.7.4', '< 0.8'
|
31
31
|
end
|
@@ -134,6 +134,7 @@ module Ecoportal
|
|
134
134
|
end
|
135
135
|
end
|
136
136
|
|
137
|
+
# Get an element usign the `key`.
|
137
138
|
def [](value)
|
138
139
|
items_by_key[get_key(value)]
|
139
140
|
end
|
@@ -161,6 +162,15 @@ module Ecoportal
|
|
161
162
|
end
|
162
163
|
end
|
163
164
|
|
165
|
+
def delete!(value)
|
166
|
+
unless value.is_a?(Hash) || value.is_a?(Content::DoubleModel)
|
167
|
+
raise "'Content::DoubleModel' or 'Hash' doc required"
|
168
|
+
end
|
169
|
+
if item = self[value]
|
170
|
+
_doc_delete(item.doc)
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
164
174
|
protected
|
165
175
|
|
166
176
|
def order_matters?; self.class.order_matters; end
|
@@ -220,6 +230,13 @@ module Ecoportal
|
|
220
230
|
super
|
221
231
|
end
|
222
232
|
|
233
|
+
def _doc_delete(value)
|
234
|
+
if current_pos = _doc_key(value)
|
235
|
+
_doc_items.delete_at(current_pos)
|
236
|
+
on_change
|
237
|
+
end
|
238
|
+
end
|
239
|
+
|
223
240
|
def _doc_upsert(value, pos: NOT_USED, before: NOT_USED, after: NOT_USED)
|
224
241
|
current_pos = _doc_key(value)
|
225
242
|
pos = case
|
@@ -228,7 +245,7 @@ module Ecoportal
|
|
228
245
|
when used_param?(before)
|
229
246
|
_doc_key(before)
|
230
247
|
when used_param?(after)
|
231
|
-
puts "to add after #{after.id}"
|
248
|
+
#puts "to add after #{after.id}"
|
232
249
|
if i = _doc_key(after)
|
233
250
|
i + 1
|
234
251
|
end
|
@@ -237,10 +254,10 @@ module Ecoportal
|
|
237
254
|
pos ||= current_pos
|
238
255
|
|
239
256
|
if current_pos && pos
|
240
|
-
_doc_items.
|
257
|
+
_doc_items.delete_at(current_pos)
|
241
258
|
pos = (pos <= current_pos)? pos : pos - 1
|
242
259
|
end
|
243
|
-
|
260
|
+
|
244
261
|
pos = (pos && pos < _doc_items.length)? pos : _doc_items.length
|
245
262
|
|
246
263
|
pos.tap do |i|
|
@@ -252,10 +252,10 @@ module Ecoportal
|
|
252
252
|
end
|
253
253
|
end
|
254
254
|
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
255
|
+
def pretty_print
|
256
|
+
puts JSON.pretty_generate(as_json)
|
257
|
+
self
|
258
|
+
end
|
259
259
|
|
260
260
|
def replace_doc(new_doc)
|
261
261
|
raise UnlinkedModel.new(from: "#{self.class}#replace_doc", key: _key) unless linked?
|
data/lib/ecoportal/api/v2.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'base64'
|
2
|
+
|
1
3
|
module Ecoportal
|
2
4
|
module API
|
3
5
|
# @attr_reader client [Common::Client] a `Common::Client` object that holds the configuration of the api connection.
|
@@ -8,19 +10,33 @@ module Ecoportal
|
|
8
10
|
|
9
11
|
VERSION = "v2"
|
10
12
|
|
13
|
+
class << self
|
14
|
+
def v2key (ukey, gkey)
|
15
|
+
Base64.urlsafe_encode64({
|
16
|
+
organization: gkey,
|
17
|
+
user: ukey
|
18
|
+
}.to_json)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
11
22
|
class_resolver :registers_class, "Ecoportal::API::V2::Registers"
|
12
23
|
class_resolver :pages_class, "Ecoportal::API::V2::Pages"
|
13
24
|
|
14
25
|
attr_reader :client, :logger
|
15
26
|
|
16
27
|
# Creates an `V2` object to scope version specific api requests.
|
28
|
+
# @note
|
29
|
+
# - you should use either `api_key` or `user_key` and `org_key`
|
17
30
|
# @param api_key [String] the key version to stablish the api connection.
|
31
|
+
# @param user_key [String] the user key used for the api connection (requires `org_key`).
|
32
|
+
# @param org_key [String] the org key used for the api connection (requires `user_key`).
|
18
33
|
# @param host [String] api server domain.
|
19
34
|
# @param logger [Logger] an object with `Logger` interface to generate logs.
|
20
|
-
def initialize(api_key, host: "live.ecoportal.com", logger: default_logger)
|
35
|
+
def initialize(api_key = nil, user_key: nil, org_key: nil, host: "live.ecoportal.com", logger: default_logger)
|
36
|
+
v2key = get_key(api_key: api_key, user_key: user_key, org_key: org_key)
|
21
37
|
@logger = logger
|
22
38
|
@client = Common::Content::Client.new(
|
23
|
-
api_key:
|
39
|
+
api_key: v2key,
|
24
40
|
host: host,
|
25
41
|
version: self.class::VERSION,
|
26
42
|
logger: @logger
|
@@ -39,6 +55,15 @@ module Ecoportal
|
|
39
55
|
pages_class.new(client)
|
40
56
|
end
|
41
57
|
|
58
|
+
private
|
59
|
+
|
60
|
+
def get_key(api_key: nil, user_key: nil, org_key: nil)
|
61
|
+
return self.class.v2key(user_key, org_key) if user_key && org_key
|
62
|
+
return api_key if api_key #|| ENV['X_ECOPORTAL_API_KEY']
|
63
|
+
raise "You need to provide either an api_key or user_key" unless user_key
|
64
|
+
raise "You need to provide an org_key as well (not just a user_key)" unless org_key
|
65
|
+
end
|
66
|
+
|
42
67
|
end
|
43
68
|
end
|
44
69
|
end
|
@@ -53,7 +53,8 @@ module Ecoportal
|
|
53
53
|
people_field_class
|
54
54
|
when "checklist"
|
55
55
|
checklist_field_class
|
56
|
-
when "page_action"
|
56
|
+
when "page_action","checklist_task"
|
57
|
+
#doc["type"] = "checklist_task"
|
57
58
|
action_field_class
|
58
59
|
when "file"
|
59
60
|
files_field_class
|
@@ -75,7 +76,7 @@ module Ecoportal
|
|
75
76
|
passkey :id
|
76
77
|
passthrough :patch_ver, :undeletable
|
77
78
|
passthrough :type, :label, :tooltip, :global_binding
|
78
|
-
passthrough :hidden, :accent, :deindex
|
79
|
+
passthrough :hidden, :accent, :deindex, :required
|
79
80
|
passthrough :hide_view, :hidden_on_reports, :hidden_on_mobile
|
80
81
|
|
81
82
|
def ref
|
@@ -4,11 +4,22 @@ module Ecoportal
|
|
4
4
|
class Page
|
5
5
|
class Component
|
6
6
|
class Action < Common::Content::DoubleModel
|
7
|
+
class << self
|
8
|
+
def new_doc
|
9
|
+
{
|
10
|
+
"id" => new_uuid,
|
11
|
+
"weight" => 9999
|
12
|
+
}
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
7
16
|
passkey :id
|
8
17
|
passthrough :patch_ver, :name
|
9
|
-
passthrough :weight, :complete, :
|
10
|
-
passdate :due_date
|
11
|
-
|
18
|
+
passthrough :weight, :complete, :other_information
|
19
|
+
passdate :due_date
|
20
|
+
pass_reader :overdue
|
21
|
+
passdate :created_at, read_only: true #, :completed_at
|
22
|
+
pass_reader :created_by, :assigned_person_member_id
|
12
23
|
end
|
13
24
|
end
|
14
25
|
end
|
@@ -4,8 +4,46 @@ module Ecoportal
|
|
4
4
|
class Page
|
5
5
|
class Component
|
6
6
|
class ActionField < Page::Component
|
7
|
-
|
7
|
+
passthrough :create_actions
|
8
|
+
passthrough :required_number_of_completed_actions
|
9
|
+
passthrough :permits_and_rules_integration, :add_subscribed, :add_subscribed_to_tasks
|
10
|
+
|
8
11
|
embeds_multiple :actions, klass: "Ecoportal::API::V2::Page::Component::Action", order_key: :weight
|
12
|
+
|
13
|
+
# Adds a task with `name` short description
|
14
|
+
# @return [Ecoportal::API::V2::Page::Component::Action]
|
15
|
+
def add_task (name)
|
16
|
+
task_doc = Ecoportal::API::V2::Page::Component::Action.new_doc
|
17
|
+
actions.upsert!(task_doc) do |task|
|
18
|
+
task.name = name
|
19
|
+
if prev = previous_task(task)
|
20
|
+
task.weight = prev.weight
|
21
|
+
end
|
22
|
+
yield(task) if block_given?
|
23
|
+
fix_task_weights!
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def ordered_tasks
|
28
|
+
actions.each_with_index.sort_by do |task, index|
|
29
|
+
(task.weight >= 9999) ? [index, index] : [task.weight, index]
|
30
|
+
end.map(&:first)
|
31
|
+
end
|
32
|
+
|
33
|
+
private
|
34
|
+
|
35
|
+
def fix_task_weights!
|
36
|
+
ordered_tasks.each_with_index do |task, index|
|
37
|
+
task.weight = index
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def previous_task(value)
|
42
|
+
tasks = ordered_tasks
|
43
|
+
pos = tasks.index(value) - 1
|
44
|
+
return if pos < 0
|
45
|
+
tasks[pos]
|
46
|
+
end
|
9
47
|
end
|
10
48
|
end
|
11
49
|
end
|
@@ -4,8 +4,41 @@ module Ecoportal
|
|
4
4
|
class Page
|
5
5
|
class Component
|
6
6
|
class ChecklistField < Page::Component
|
7
|
-
#class_resolver :checklist_item_class, "Ecoportal::API::V2::Page::Component::ChecklistItem"
|
8
7
|
embeds_multiple :items, klass: "Ecoportal::API::V2::Page::Component::ChecklistItem", order_key: :weight
|
8
|
+
|
9
|
+
def add_item(label:, pos: NOT_USED, before: NOT_USED, after: NOT_USED)
|
10
|
+
itm_doc = Ecoportal::API::V2::Page::Component::ChecklistItem.new_doc
|
11
|
+
items.upsert!(itm_doc, pos: pos, before: before, after: after) do |item|
|
12
|
+
item.label = label
|
13
|
+
if prev = previous_item(item)
|
14
|
+
item.weight = prev.weight
|
15
|
+
end
|
16
|
+
yield(item) if block_given?
|
17
|
+
fix_item_weights!
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def ordered_items
|
22
|
+
items.each_with_index.sort_by do |item, index|
|
23
|
+
(item.weight >= 9999) ? [index, index] : [item.weight, index]
|
24
|
+
end.map(&:first)
|
25
|
+
end
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
def fix_item_weights!
|
30
|
+
ordered_items.each_with_index do |item, index|
|
31
|
+
item.weight = index
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def previous_item(value)
|
36
|
+
itms = ordered_items
|
37
|
+
pos = itms.index(value) - 1
|
38
|
+
return if pos < 0
|
39
|
+
itms[pos]
|
40
|
+
end
|
41
|
+
|
9
42
|
end
|
10
43
|
end
|
11
44
|
end
|
@@ -4,6 +4,16 @@ module Ecoportal
|
|
4
4
|
class Page
|
5
5
|
class Component
|
6
6
|
class ChecklistItem < Common::Content::DoubleModel
|
7
|
+
|
8
|
+
class << self
|
9
|
+
def new_doc
|
10
|
+
{
|
11
|
+
"id" => new_uuid,
|
12
|
+
"weight" => 9999
|
13
|
+
}
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
7
17
|
passkey :id
|
8
18
|
passthrough :patch_ver, :label
|
9
19
|
passthrough :weight, :checked
|
@@ -5,6 +5,9 @@ module Ecoportal
|
|
5
5
|
class Component
|
6
6
|
class DateField < Page::Component
|
7
7
|
passthrough :value
|
8
|
+
passthrough :show_time, :today_button, :past_only
|
9
|
+
passthrough :create_event, :remind_me_in
|
10
|
+
passthrough :renews, :renews_every, :renews_unit, :renews_until
|
8
11
|
end
|
9
12
|
end
|
10
13
|
end
|
@@ -4,10 +4,33 @@ module Ecoportal
|
|
4
4
|
class Page
|
5
5
|
class Component
|
6
6
|
class GaugeField < Page::Component
|
7
|
-
passthrough :value
|
7
|
+
passthrough :value, :max
|
8
|
+
passthrough :active_color
|
9
|
+
|
10
|
+
embeds_multiple :stops, klass: "Ecoportal::API::V2::Page::Component::GaugeStop", order_key: :threshold
|
11
|
+
|
12
|
+
# Adds a stop at `threshold` with `color`
|
13
|
+
# @return [Ecoportal::API::V2::Page::Component::GaugeStop]
|
14
|
+
def add_stop (threshold: 0.0, color: '#e256d1')
|
15
|
+
stop_doc = Ecoportal::API::V2::Page::Component::GaugeStop.new_doc
|
16
|
+
stops.upsert!(stop_doc) do |stop|
|
17
|
+
stop.threshold = threshold
|
18
|
+
stop.color = color
|
19
|
+
yield(stop) if block_given?
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def ordered_stops
|
24
|
+
stops.each_with_index.sort_by do |stop, index|
|
25
|
+
(stop.threshold >= 9999) ? [index, index] : [stop.threshold, index]
|
26
|
+
end.map(&:first)
|
27
|
+
end
|
28
|
+
|
8
29
|
end
|
9
30
|
end
|
10
31
|
end
|
11
32
|
end
|
12
33
|
end
|
13
34
|
end
|
35
|
+
|
36
|
+
require 'ecoportal/api/v2/page/component/gauge_stop'
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module Ecoportal
|
2
|
+
module API
|
3
|
+
class V2
|
4
|
+
class Page
|
5
|
+
class Component
|
6
|
+
class GaugeStop < Common::Content::DoubleModel
|
7
|
+
|
8
|
+
class << self
|
9
|
+
def new_doc
|
10
|
+
{
|
11
|
+
"id" => new_uuid,
|
12
|
+
"threshold" => nil,
|
13
|
+
"color" => nil
|
14
|
+
}
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
passkey :id
|
19
|
+
passthrough :patch_ver, :threshold
|
20
|
+
passthrough :color
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -4,7 +4,14 @@ module Ecoportal
|
|
4
4
|
class Page
|
5
5
|
class Component
|
6
6
|
class PeopleField < Page::Component
|
7
|
-
|
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
|
@@ -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,7 +4,8 @@ module Ecoportal
|
|
4
4
|
class Page
|
5
5
|
class Component
|
6
6
|
class SelectionField < Page::Component
|
7
|
-
passthrough :multiple, :
|
7
|
+
passthrough :multiple, :flat
|
8
|
+
passthrough :other, :other_desc
|
8
9
|
|
9
10
|
#class_resolver :selection_option_class, "Ecoportal::API::V2::Page::Component::SelectionOption"
|
10
11
|
embeds_multiple :options, klass: "Ecoportal::API::V2::Page::Component::SelectionOption", order_key: :weight
|
@@ -33,7 +34,6 @@ module Ecoportal
|
|
33
34
|
end
|
34
35
|
end
|
35
36
|
|
36
|
-
# a server bug prevents to add new options to an existing field
|
37
37
|
def add_option(name:, value:, pos: NOT_USED, before: NOT_USED, after: NOT_USED)
|
38
38
|
opt_doc = Ecoportal::API::V2::Page::Component::SelectionOption.new_doc
|
39
39
|
options.upsert!(opt_doc, pos: pos, before: before, after: after) do |option|
|
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.
|
4
|
+
version: 0.7.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oscar Segura
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-02-01 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.
|
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:
|
29
|
+
version: 2.1.3
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '2.2'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
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: '
|
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: '
|
52
|
+
version: '4'
|
41
53
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
54
|
+
name: rake
|
43
55
|
requirement: !ruby/object:Gem::Requirement
|
44
56
|
requirements:
|
45
|
-
- - "
|
57
|
+
- - ">="
|
46
58
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
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:
|
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.
|
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.
|
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.
|
116
|
-
- - "
|
133
|
+
version: 0.7.4
|
134
|
+
- - "<"
|
117
135
|
- !ruby/object:Gem::Version
|
118
|
-
version: '0.
|
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.
|
126
|
-
- - "
|
143
|
+
version: 0.7.4
|
144
|
+
- - "<"
|
127
145
|
- !ruby/object:Gem::Version
|
128
|
-
version: '0.
|
146
|
+
version: '0.8'
|
129
147
|
description:
|
130
148
|
email:
|
131
149
|
- rien@ecoportal.co.nz
|
@@ -171,6 +189,7 @@ files:
|
|
171
189
|
- lib/ecoportal/api/v2/page/component/file.rb
|
172
190
|
- lib/ecoportal/api/v2/page/component/files_field.rb
|
173
191
|
- lib/ecoportal/api/v2/page/component/gauge_field.rb
|
192
|
+
- lib/ecoportal/api/v2/page/component/gauge_stop.rb
|
174
193
|
- lib/ecoportal/api/v2/page/component/geo_field.rb
|
175
194
|
- lib/ecoportal/api/v2/page/component/image.rb
|
176
195
|
- lib/ecoportal/api/v2/page/component/images_field.rb
|