eco-helpers 2.7.17 → 2.7.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -1
- data/lib/eco/api/usecases/graphql/samples/location/service/tree_diff.rb +13 -1
- data/lib/eco/api/usecases/graphql/samples/location/service/tree_to_list/converter/parser.rb +5 -5
- data/lib/eco/api/usecases/graphql/samples/location/service/tree_to_list/converter.rb +3 -5
- 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: 4f816f1f0ec131d756c11a4839629d57f90f2b9cc2a8a9008b54de0c57926272
|
4
|
+
data.tar.gz: 8e725e46c074927cf2db191471d29fe5dfce15c7aa121f9e49cfa30411f29bf2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8427745673ff4ab4d19477fff524cb9cab781b9b818c072943c600282cc5d519f06b3a5807e6a241787fb1c259a1697530c282ccf18c9849d8d4f09ca89e64b7
|
7
|
+
data.tar.gz: 22da605e9eaa15e84ea50a6431ad4e9f7b98239b981e5ec7b07dbd93d92d72387232c222656ec8a79ed725c60d5088c150edc4dbed4547ce10fd97e01d6be6ae
|
data/CHANGELOG.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
|
5
|
-
## [2.7.
|
5
|
+
## [2.7.19] - 2024-06-xx
|
6
6
|
|
7
7
|
### Added
|
8
8
|
|
@@ -10,6 +10,15 @@ All notable changes to this project will be documented in this file.
|
|
10
10
|
|
11
11
|
### Fixed
|
12
12
|
|
13
|
+
## [2.7.18] - 2024-07-01
|
14
|
+
|
15
|
+
### Changed
|
16
|
+
|
17
|
+
- `Eco::API::UseCases::GraphQL::Samples::Location::Service::TreeToList`
|
18
|
+
- Custom input node parsers: yield has_node and node as well.
|
19
|
+
- `Eco::API::UseCases::GraphQL::Samples::Location::Service::TreeDiff`
|
20
|
+
- Exclude archived nodes from the file as **default**
|
21
|
+
|
13
22
|
## [2.7.17] - 2024-06-22
|
14
23
|
|
15
24
|
### Added
|
@@ -102,10 +102,22 @@ module Eco::API::UseCases::GraphQL::Samples
|
|
102
102
|
# - `as_nodes_json`
|
103
103
|
# 2. `org_tree` is native from `Eco::Data::Locations::NodeBase::CsvConvert`
|
104
104
|
def file_nodes_list
|
105
|
-
@file_nodes_list ||= as_nodes_json(
|
105
|
+
@file_nodes_list ||= as_nodes_json(file_tree).tap do |list|
|
106
106
|
log(:info) { "Converted input csv file to list of #{list.count} hash-nodes" }
|
107
107
|
end
|
108
108
|
end
|
109
|
+
|
110
|
+
def file_tree
|
111
|
+
org_tree(input_csv).then do |tree|
|
112
|
+
next tree if include_file_archived?
|
113
|
+
|
114
|
+
tree.active_tree
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
def include_file_archived?
|
119
|
+
options.dig(:input, :file, :include, :archived)
|
120
|
+
end
|
109
121
|
end
|
110
122
|
end
|
111
123
|
end
|
@@ -14,11 +14,11 @@ module Eco::API::UseCases::GraphQL::Samples::Location::Service
|
|
14
14
|
return @node_parser_block if instance_variable_defined?(:@node_parser_block)
|
15
15
|
custom_before = custom_node_parser_before_block
|
16
16
|
custom_after = custom_node_parser_block
|
17
|
-
@node_parser_block = proc do |node_hash|
|
17
|
+
@node_parser_block = proc do |node_hash, node|
|
18
18
|
node_hash.tap do
|
19
|
-
custom_before&.call(node_hash)
|
20
|
-
default_node_parse(node_hash)
|
21
|
-
custom_after&.call(node_hash)
|
19
|
+
custom_before&.call(node_hash, node)
|
20
|
+
default_node_parse(node_hash, node)
|
21
|
+
custom_after&.call(node_hash, node)
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
@@ -35,7 +35,7 @@ module Eco::API::UseCases::GraphQL::Samples::Location::Service
|
|
35
35
|
end
|
36
36
|
|
37
37
|
# Generic parsing
|
38
|
-
def default_node_parse(node_hash)
|
38
|
+
def default_node_parse(node_hash, _node)
|
39
39
|
class_ids = to_classification_ids(node_hash['classifications'])
|
40
40
|
node_hash['classifications'] = class_ids
|
41
41
|
end
|
@@ -24,12 +24,10 @@ module Eco::API::UseCases::GraphQL::Samples::Location::Service
|
|
24
24
|
next key unless node_attr_maps.key?(key)
|
25
25
|
node_attr_maps[key]
|
26
26
|
end.tap do |node_hash|
|
27
|
-
node_parser_block&.call(node_hash)
|
28
|
-
yield(node_hash) if block_given?
|
27
|
+
node_parser_block&.call(node_hash, node)
|
28
|
+
yield(node_hash, node) if block_given?
|
29
29
|
end
|
30
|
-
end.
|
31
|
-
list.each(&node_parser_block)
|
32
|
-
end
|
30
|
+
end.compact.reject(&:empty?)
|
33
31
|
end
|
34
32
|
end
|
35
33
|
end
|
data/lib/eco/version.rb
CHANGED