eco-helpers 2.0.29 → 2.0.30
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 +7 -4
- data/lib/eco/api/common/loaders/base.rb +1 -1
- data/lib/eco/api/common/people/default_parsers/xls_parser.rb +18 -3
- data/lib/eco/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3488b397afbd0ba2691eb14dd6983891737a973e1a6f1ba31e61d8233f4d5764
|
4
|
+
data.tar.gz: 3faa75a89cf0602b92e270bbf77b61452e64d38b6fa3949a537b7b705a58b7e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a2e5cb8179c1aa5b171d01586675c5c8d71ab3acc6bb400f66f41610339ac1a5265370774bc27d6e2963b775e56e7f238a9ea928d1ab7f136e970e662108c03
|
7
|
+
data.tar.gz: 5c5895f563af52455c318976f854c39e48773a46b38851f4ba37343fafb68faffa0049dc6ccb7054db24f44ff54b1abceac07808ec7c522d3e97e9d55e086e6c
|
data/CHANGELOG.md
CHANGED
@@ -1,12 +1,18 @@
|
|
1
1
|
# Change Log
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
|
4
|
-
## [2.0.
|
4
|
+
## [2.0.30] - 2021-07-xx
|
5
5
|
|
6
6
|
### Added
|
7
|
+
* `Eco::API::Common::People::DefaultParsers::XLSParser` uses as default the `fields_map.json` to identify the headers.
|
7
8
|
|
8
9
|
### Changed
|
9
10
|
|
11
|
+
### Fixed
|
12
|
+
* `Eco::API::Common::People::DefaultParsers::XLSParser` should return all `String` values
|
13
|
+
|
14
|
+
## [2.0.29] - 2021-07-08
|
15
|
+
|
10
16
|
### Fixed
|
11
17
|
- `Eco::API::Common::People::PersonEntryAttributeMapper#details_attrs`
|
12
18
|
* What a mess this was doing to the `csv` export :/
|
@@ -75,9 +81,6 @@ All notable changes to this project will be documented in this file.
|
|
75
81
|
* when in `dry-run` it fakes the `id` with a counter
|
76
82
|
- `Eco::API::Common::People::PersonFactory` gets `subordinates` initialized to `0` (when **creating** a `new` person)
|
77
83
|
|
78
|
-
### Fixed
|
79
|
-
|
80
|
-
|
81
84
|
## [2.0.25] - 2021-06-23
|
82
85
|
|
83
86
|
### Added
|
@@ -6,7 +6,12 @@ class Eco::API::Common::People::DefaultParsers::XLSParser < Eco::API::Common::Lo
|
|
6
6
|
|
7
7
|
def parser(file, deps)
|
8
8
|
@file = file
|
9
|
-
rows.tap
|
9
|
+
rows.tap do |rws|
|
10
|
+
@file = nil
|
11
|
+
rws.each do |row|
|
12
|
+
to_string!(row)
|
13
|
+
end
|
14
|
+
end
|
10
15
|
end
|
11
16
|
|
12
17
|
def serializer(array_hash, deps)
|
@@ -15,8 +20,18 @@ class Eco::API::Common::People::DefaultParsers::XLSParser < Eco::API::Common::Lo
|
|
15
20
|
|
16
21
|
private
|
17
22
|
|
23
|
+
def to_string!(row)
|
24
|
+
row.transform_values! do |val|
|
25
|
+
next nil unless val
|
26
|
+
next val if val.is_a?(String)
|
27
|
+
val.to_s
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
|
18
32
|
def headers
|
19
|
-
|
33
|
+
logger.warn("Headers detection is using your fields_map.json file (native behaviour)")
|
34
|
+
session.fields_mapper.list(:external).uniq
|
20
35
|
end
|
21
36
|
|
22
37
|
def sheet_name
|
@@ -34,7 +49,7 @@ class Eco::API::Common::People::DefaultParsers::XLSParser < Eco::API::Common::Lo
|
|
34
49
|
|
35
50
|
def rows(target = headers)
|
36
51
|
begin
|
37
|
-
spreadheet.parse(header_search: target)
|
52
|
+
spreadheet.parse(header_search: target, clean: true)
|
38
53
|
rescue Roo::HeaderRowNotFoundError => e
|
39
54
|
missing = JSON.parse(e.message)
|
40
55
|
logger.warn("The input file is missing these headers: #{missing}")
|
data/lib/eco/version.rb
CHANGED