ecoportal-api-v2 0.8.20 → 0.8.21
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -2
- data/lib/ecoportal/api/common/content/array_model.rb +4 -0
- data/lib/ecoportal/api/v2/page/component/action.rb +13 -0
- data/lib/ecoportal/api/v2/page/component/action_field.rb +4 -0
- data/lib/ecoportal/api/v2/page/component/checklist_field.rb +4 -0
- data/lib/ecoportal/api/v2/page/component/checklist_item.rb +4 -0
- data/lib/ecoportal/api/v2/page/component/date_field.rb +4 -0
- data/lib/ecoportal/api/v2/page/component/file.rb +4 -0
- data/lib/ecoportal/api/v2/page/component/files_field.rb +4 -0
- data/lib/ecoportal/api/v2/page/component/gauge_field.rb +3 -0
- data/lib/ecoportal/api/v2/page/component/geo_coordinates.rb +4 -0
- data/lib/ecoportal/api/v2/page/component/geo_field.rb +4 -0
- data/lib/ecoportal/api/v2/page/component/images_field.rb +5 -1
- data/lib/ecoportal/api/v2/page/component/people_field.rb +4 -0
- data/lib/ecoportal/api/v2/page/component/plain_text_field.rb +4 -0
- data/lib/ecoportal/api/v2/page/component/reference_field.rb +11 -0
- data/lib/ecoportal/api/v2/page/component/rich_text_field.rb +17 -0
- data/lib/ecoportal/api/v2/page/component/selection_field.rb +6 -0
- data/lib/ecoportal/api/v2/page/component/tag_field.rb +4 -0
- data/lib/ecoportal/api/v2/page/stages.rb +5 -5
- data/lib/ecoportal/api/v2_version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dfc9e699414df7fd4298148668b5b0a95759dc114758614d29da2ba7bc6472de
|
4
|
+
data.tar.gz: d589c4f84d7f0d55912d6542129bdebc74d599730a8980c1ec83b8317b7dd942
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 901028e62fb4e10920918815635a7b99b54fb058ab0c79514a338373aa3b9e6b200757f26912876c2b7bf97201e3958353795dea870e7dbc3154e4e1ad578954
|
7
|
+
data.tar.gz: 85951a26535f34d0cbbc66d35410c8059b83df436359fea19e478196db2b93496f8a17ac0fe048ef231309f2684546fac4cc037076ffb0603b54d03ccb0de22c
|
data/CHANGELOG.md
CHANGED
@@ -1,14 +1,27 @@
|
|
1
1
|
# Change Log
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
|
4
|
-
## [0.8.
|
4
|
+
## [0.8.21] - 2021-12-15
|
5
5
|
|
6
6
|
### Added
|
7
|
+
- To children of `Ecoportal::API::V2::Page::Component` added method `#to_s` (for exporting)
|
8
|
+
- `Ecoportal::API::V2::Page::Component::ReferenceField`
|
9
|
+
- added `#references` (the lookup results)
|
10
|
+
- added `#reference_ids` (the `ids` of the referenced oozes)
|
11
|
+
|
12
|
+
### Changed
|
13
|
+
- Re-exposed `Ecoportal::API::V2::Stages#ordered`
|
14
|
+
|
15
|
+
### Fixed
|
16
|
+
- `Ecoportal::API::V2::Page::Component::ImagesField#images` typo in `klass`
|
17
|
+
|
18
|
+
## [0.8.20] - 2021-12-09
|
19
|
+
|
7
20
|
### Changed
|
8
21
|
- `Ecoportal::API::V2::Pages::PageStage#permits` removed
|
9
22
|
- The reason is that it should be changed using the `Stage#permits` instead
|
10
23
|
- Upgraded `ecoportal-api` gem dependency
|
11
|
-
|
24
|
+
|
12
25
|
### Fixed
|
13
26
|
- `Ecoportal::API::V2::Page::Stage#sections` typo
|
14
27
|
|
@@ -29,6 +29,19 @@ module Ecoportal
|
|
29
29
|
passthrough :duration_in_days, read_only: true
|
30
30
|
passarray :file_container_ids
|
31
31
|
|
32
|
+
def to_s
|
33
|
+
stat = case
|
34
|
+
when overdue
|
35
|
+
"Overdue"
|
36
|
+
when complete
|
37
|
+
"Complete"
|
38
|
+
else
|
39
|
+
"Pending"
|
40
|
+
end
|
41
|
+
assignee = assigned_person_member["name"] || assigned_person_member["email"]
|
42
|
+
"#{name}, #{created_at.to_s}, #{stat}, #{assignee}"
|
43
|
+
end
|
44
|
+
|
32
45
|
end
|
33
46
|
end
|
34
47
|
end
|
@@ -15,7 +15,11 @@ module Ecoportal
|
|
15
15
|
|
16
16
|
passthrough :layout
|
17
17
|
passboolean :strech, :no_popup, :hide_options
|
18
|
-
embeds_many :images, klass: "Ecoportal::API::V2::Page::Image", order_key: :weight
|
18
|
+
embeds_many :images, klass: "Ecoportal::API::V2::Page::Component::Image", order_key: :weight
|
19
|
+
|
20
|
+
def to_s
|
21
|
+
images.count
|
22
|
+
end
|
19
23
|
|
20
24
|
# Quick config helper
|
21
25
|
# @param conf [Symbol, Array<Symbol>]
|
@@ -5,10 +5,21 @@ module Ecoportal
|
|
5
5
|
class Component
|
6
6
|
class ReferenceField < Page::Component
|
7
7
|
passthrough :register_id
|
8
|
+
passarray :references
|
8
9
|
passboolean :hide_create, :hide_attach
|
9
10
|
passboolean :hide_metadata, :hide_dashboards
|
10
11
|
passboolean :display_fields, :display_fields_in_lookup
|
11
12
|
|
13
|
+
def reference_ids
|
14
|
+
references.map do |ref|
|
15
|
+
ref["id"]
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def to_s(delimiter: "\n")
|
20
|
+
reference_ids.to_a.join(delimiter)
|
21
|
+
end
|
22
|
+
|
12
23
|
# Quick config helper
|
13
24
|
# @param conf [Symbol, Array<Symbol>]
|
14
25
|
# - `:show_fields` specify if the public register fields should be shown (requires `register_id`)
|
@@ -5,6 +5,23 @@ module Ecoportal
|
|
5
5
|
class Component
|
6
6
|
class RichTextField < Page::Component
|
7
7
|
passthrough :content
|
8
|
+
|
9
|
+
HTML_TAGS_REX = /<("[^"]*"|'[^']*'|[^'">])*>/
|
10
|
+
|
11
|
+
def to_s
|
12
|
+
remove_html_tags(content)
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def remove_html_tags(str)
|
18
|
+
str = str.gsub(HTML_TAGS_REX, ' ') if str
|
19
|
+
str = str.gsub(/[^[:print:]]/, '') if str
|
20
|
+
str = str.gsub(": ", ' ') if str
|
21
|
+
str = str.gsub(""", '"') if str
|
22
|
+
str = str.gsub("&", '&') if str
|
23
|
+
str
|
24
|
+
end
|
8
25
|
end
|
9
26
|
end
|
10
27
|
end
|
@@ -63,6 +63,12 @@ module Ecoportal
|
|
63
63
|
end
|
64
64
|
end
|
65
65
|
|
66
|
+
def to_s(name: true, delimiter: "\n")
|
67
|
+
[selected].flatten.compact.map do |opt|
|
68
|
+
name ? opt.name : opt.value
|
69
|
+
end.join(delimiter)
|
70
|
+
end
|
71
|
+
|
66
72
|
# Quick config helper
|
67
73
|
# @param conf [Symbol, Array<Symbol>]
|
68
74
|
# - `:flat` to display in flat mode
|
@@ -7,6 +7,10 @@ module Ecoportal
|
|
7
7
|
passboolean :single_select, :use_defaults
|
8
8
|
passthrough :tag_tree_id, :button_text
|
9
9
|
|
10
|
+
def to_s(delimiter: "\n")
|
11
|
+
root.tags.to_s(delimiter: delimiter)
|
12
|
+
end
|
13
|
+
|
10
14
|
# Quick config helper
|
11
15
|
# @param conf [Symbol, Array<Symbol>]
|
12
16
|
# - `:multiple` to allow multiple selection
|
@@ -19,11 +19,11 @@ module Ecoportal
|
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
22
|
+
def ordered
|
23
|
+
self.sort_by.with_index do |stage, index|
|
24
|
+
[stage.ordering, index]
|
25
|
+
end
|
26
|
+
end
|
27
27
|
|
28
28
|
end
|
29
29
|
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.
|
4
|
+
version: 0.8.21
|
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-12-
|
11
|
+
date: 2021-12-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|