eco-helpers 2.6.2 → 2.6.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +22 -0
- data/eco-helpers.gemspec +2 -2
- data/lib/eco/api/common/version_patches/ecoportal_api/external_person.rb +10 -6
- data/lib/eco/api/microcases/set_supervisor.rb +0 -3
- data/lib/eco/api/usecases/default_cases/to_csv_detailed_case.rb +0 -2
- data/lib/eco/api/usecases/ooze_samples/helpers/rescuable.rb +4 -3
- data/lib/eco/api/usecases/ooze_samples/register_update_case.rb +2 -1
- data/lib/eco/cli_default/input_filters.rb +0 -5
- data/lib/eco/cli_default/people_filters.rb +4 -4
- data/lib/eco/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0ecd2c2f2849623bb76d4eb53883c5d7564cb1bf1a3c6365b4d96d3de8c9c68e
|
|
4
|
+
data.tar.gz: 8e4ef9ddee2ca1d9750b9df3aabda5200d93e4a30216306dbe44d68b175883be
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 68001b392d5eba8ee710bc315b88adc5c0111ff9b7b6e862e1037b31c10a4269e9453c0514eabb8768c46bf9e9e0128187d072e9eec5ed017b38920cde9fc3c0
|
|
7
|
+
data.tar.gz: 71904f2040ab00bf8cc4fd31b07fef8a80259de806ca63cff717c559c953ade2d99f76a4b336e9dbfc0c48a07ce94616fe49b9daf285cc488fcd3a8c8373281c
|
data/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,28 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
|
3
3
|
|
|
4
|
+
## [2.6.4] - 2024-03-xx
|
|
5
|
+
|
|
6
|
+
### Added
|
|
7
|
+
### Changed
|
|
8
|
+
- updated core **gem** `ecoportal-api`
|
|
9
|
+
- The `subordinates` core people property has been removed from the back-end
|
|
10
|
+
- This was due to some performance issues with org hierarchy model.
|
|
11
|
+
- As a consequence a temporary patch has been added temporarily in the current gem.
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
- `Eco::API::UseCases::OozeSamples::RegisterUpdateCase`
|
|
15
|
+
- initialize `@total_search_results`
|
|
16
|
+
|
|
17
|
+
## [2.6.3] - 2024-02-29
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
- upgrade `ecoportal-api-v2` **gem**
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
- `Eco::API::UseCases::OozeSamples::RegisterUpdateCase`
|
|
24
|
+
- `dry_run_feedback` fixed typo
|
|
25
|
+
|
|
4
26
|
## [2.6.2] - 2024-02-23
|
|
5
27
|
|
|
6
28
|
### Added
|
data/eco-helpers.gemspec
CHANGED
|
@@ -30,8 +30,8 @@ Gem::Specification.new do |spec|
|
|
|
30
30
|
spec.add_development_dependency "yard", ">= 0.9.34", "< 1"
|
|
31
31
|
spec.add_development_dependency "redcarpet", ">= 3.6.0", "< 4"
|
|
32
32
|
|
|
33
|
-
spec.add_dependency 'ecoportal-api', '>= 0.9.
|
|
34
|
-
spec.add_dependency 'ecoportal-api-v2', '>= 1.1.
|
|
33
|
+
spec.add_dependency 'ecoportal-api', '>= 0.9.7', '< 0.10'
|
|
34
|
+
spec.add_dependency 'ecoportal-api-v2', '>= 1.1.6', '< 1.2'
|
|
35
35
|
spec.add_dependency 'ecoportal-api-graphql', '>= 0.3.13', '< 0.4'
|
|
36
36
|
spec.add_dependency 'aws-sdk-s3', '>= 1.142.0', '< 2'
|
|
37
37
|
spec.add_dependency 'aws-sdk-ses', '>= 1.58.0', '< 2'
|
|
@@ -6,12 +6,16 @@ module Eco
|
|
|
6
6
|
attr_accessor :entry
|
|
7
7
|
|
|
8
8
|
def identify(section = :person)
|
|
9
|
-
if entry && section == :entry
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
return entry.to_s(:identify) if entry && section == :entry
|
|
10
|
+
str_id = id ? "id: '#{id}'; " : ""
|
|
11
|
+
"'#{name}' (#{str_id}ext_id: '#{external_id}'; email: '#{email}')"
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
attr_writer :subordinates
|
|
15
|
+
|
|
16
|
+
# 2024-03-04 patch for API property deletetion
|
|
17
|
+
def subordinates
|
|
18
|
+
@subordinates ||= 0
|
|
15
19
|
end
|
|
16
20
|
end
|
|
17
21
|
Ecoportal::API::V1::Person.include PersonPatch
|
|
@@ -38,17 +38,14 @@ module Eco
|
|
|
38
38
|
def descrease_subordinates(person, by = 1)
|
|
39
39
|
if person.is_a?(Ecoportal::API::V1::Person)
|
|
40
40
|
person.subordinates -= by
|
|
41
|
-
#person.subordinates = 0 if person.subordinates < 0
|
|
42
41
|
end
|
|
43
42
|
end
|
|
44
43
|
|
|
45
44
|
def increase_subordinates(person, by = 1)
|
|
46
45
|
if person.is_a?(Ecoportal::API::V1::Person)
|
|
47
|
-
#person.subordinates = 0 if person.subordinates < 0
|
|
48
46
|
person.subordinates += by
|
|
49
47
|
end
|
|
50
48
|
end
|
|
51
|
-
|
|
52
49
|
end
|
|
53
50
|
end
|
|
54
51
|
end
|
|
@@ -6,7 +6,6 @@ class Eco::API::UseCases::DefaultCases::ToCsvDetailedCase < Eco::API::UseCases::
|
|
|
6
6
|
|
|
7
7
|
def to_row(person)
|
|
8
8
|
data = super(person)
|
|
9
|
-
data << person.subordinates
|
|
10
9
|
data << person_supervisor(person)
|
|
11
10
|
data += user_abilities(person)
|
|
12
11
|
data += user_permissions_custom(person) if options.dig(:export, :options, :permissions_custom)
|
|
@@ -39,7 +38,6 @@ class Eco::API::UseCases::DefaultCases::ToCsvDetailedCase < Eco::API::UseCases::
|
|
|
39
38
|
|
|
40
39
|
def spot_header(person = people.first)
|
|
41
40
|
super(person) do |header|
|
|
42
|
-
header << "Subordinates"
|
|
43
41
|
header << "Supervisor Name"
|
|
44
42
|
header += abilities_header
|
|
45
43
|
header += abilities_header("custom") if options.dig(:export, :options, :permissions_custom)
|
|
@@ -8,12 +8,13 @@ module Eco
|
|
|
8
8
|
private
|
|
9
9
|
|
|
10
10
|
# Helper to prevent script from stopping
|
|
11
|
-
def with_rescue(reference)
|
|
11
|
+
def with_rescue(reference, trace_count: 1)
|
|
12
12
|
raise ArgumentError, "Expecting block, but not given" unless block_given?
|
|
13
13
|
yield
|
|
14
|
-
rescue StandardError =>
|
|
14
|
+
rescue StandardError => err
|
|
15
|
+
str_err = err.patch_full_message(trace_count: trace_count)
|
|
15
16
|
log(:error) {
|
|
16
|
-
[reference,
|
|
17
|
+
[reference, str_err].join(" => \n")
|
|
17
18
|
}
|
|
18
19
|
lines = []
|
|
19
20
|
lines << "\nThere was an error. Choose one option:\n"
|
|
@@ -151,7 +151,7 @@ class Eco::API::UseCases::OozeSamples::RegisterUpdateCase < Eco::API::UseCases::
|
|
|
151
151
|
@ooze_create_attempts += 1
|
|
152
152
|
|
|
153
153
|
if dry_run?
|
|
154
|
-
dry_run_feedback(
|
|
154
|
+
dry_run_feedback(draft)
|
|
155
155
|
false
|
|
156
156
|
else
|
|
157
157
|
apiv2.pages.create(draft, from: template_id).tap do |result|
|
|
@@ -204,6 +204,7 @@ class Eco::API::UseCases::OozeSamples::RegisterUpdateCase < Eco::API::UseCases::
|
|
|
204
204
|
end
|
|
205
205
|
|
|
206
206
|
def init_kpis
|
|
207
|
+
@total_search_oozes = 0
|
|
207
208
|
@retrieved_oozes = 0
|
|
208
209
|
@non_retrieved_oozes = 0
|
|
209
210
|
@dupped_search_oozes = 0
|
|
@@ -40,11 +40,6 @@ ASSETS.cli.config do |cnf|
|
|
|
40
40
|
end
|
|
41
41
|
end
|
|
42
42
|
|
|
43
|
-
#filters.add("-input-supervisors") do |people, session, options|
|
|
44
|
-
# options.deep_merge!(input: {filter: {subordinates: true}})
|
|
45
|
-
# people.newFrom people.to_a.select {|person| person.subordinates > 0}
|
|
46
|
-
#end
|
|
47
|
-
|
|
48
43
|
filters.add("-input-supervisor-id", "only those with certain supervisor id or external_id") do |input, session, options|
|
|
49
44
|
id = SCR.get_arg("-input-supervisor-id", with_param: true)
|
|
50
45
|
options.deep_merge!(input: {filter: {supervisor_id: id}})
|
|
@@ -21,10 +21,10 @@ ASSETS.cli.config do |cnf|
|
|
|
21
21
|
people.external_id_present(false)
|
|
22
22
|
end
|
|
23
23
|
|
|
24
|
-
filters.add("-supervisors", "only those that have subordinates") do |people, session, options|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
end
|
|
24
|
+
# filters.add("-supervisors", "only those that have subordinates") do |people, session, options|
|
|
25
|
+
# options.deep_merge!(people: {filter: {subordinates: true}})
|
|
26
|
+
# people.newFrom people.to_a.select {|person| person.subordinates > 0}
|
|
27
|
+
# end
|
|
28
28
|
|
|
29
29
|
filters.add("-supervisor-id", "only those with certain supervisor") do |people, session, options|
|
|
30
30
|
id = SCR.get_arg("-supervisor-id", with_param: true)
|
data/lib/eco/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: eco-helpers
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.6.
|
|
4
|
+
version: 2.6.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Oscar Segura
|
|
@@ -116,7 +116,7 @@ dependencies:
|
|
|
116
116
|
requirements:
|
|
117
117
|
- - ">="
|
|
118
118
|
- !ruby/object:Gem::Version
|
|
119
|
-
version: 0.9.
|
|
119
|
+
version: 0.9.7
|
|
120
120
|
- - "<"
|
|
121
121
|
- !ruby/object:Gem::Version
|
|
122
122
|
version: '0.10'
|
|
@@ -126,7 +126,7 @@ dependencies:
|
|
|
126
126
|
requirements:
|
|
127
127
|
- - ">="
|
|
128
128
|
- !ruby/object:Gem::Version
|
|
129
|
-
version: 0.9.
|
|
129
|
+
version: 0.9.7
|
|
130
130
|
- - "<"
|
|
131
131
|
- !ruby/object:Gem::Version
|
|
132
132
|
version: '0.10'
|
|
@@ -136,7 +136,7 @@ dependencies:
|
|
|
136
136
|
requirements:
|
|
137
137
|
- - ">="
|
|
138
138
|
- !ruby/object:Gem::Version
|
|
139
|
-
version: 1.1.
|
|
139
|
+
version: 1.1.6
|
|
140
140
|
- - "<"
|
|
141
141
|
- !ruby/object:Gem::Version
|
|
142
142
|
version: '1.2'
|
|
@@ -146,7 +146,7 @@ dependencies:
|
|
|
146
146
|
requirements:
|
|
147
147
|
- - ">="
|
|
148
148
|
- !ruby/object:Gem::Version
|
|
149
|
-
version: 1.1.
|
|
149
|
+
version: 1.1.6
|
|
150
150
|
- - "<"
|
|
151
151
|
- !ruby/object:Gem::Version
|
|
152
152
|
version: '1.2'
|