eco-helpers 2.5.6 → 2.5.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ed268fb73bb35106da813f51a7b9469d0ee0fe167cee520ac44f98fed22c622b
4
- data.tar.gz: c6b6e0f72037f2a1dac9313293317a78a4d25c52568c7577f88efdafb37d7994
3
+ metadata.gz: 712a817db8970559d9d45923531ff092edc4eed7a6f937a51251ab7510b21e48
4
+ data.tar.gz: c00d489419212cfcb52de588b5b066c789e558e5d38b508e3946a3ba90d1a774
5
5
  SHA512:
6
- metadata.gz: 21d9f1703574866e548daa22f1e196b237a8415fb750fe53bb6c4cd63e5fa90002a9e2d5f90e5f3aaca769f639e6d9c02f40b0e7a7a123a15965af41bff91828
7
- data.tar.gz: a02e32a2945f0e4e7a5780e340e8ef400e434d00f2cf44d9969d8573bf84e94c5d35c4c0319e205e351837dc016eb9e389759db3d2291ceab493943af597170b
6
+ metadata.gz: 32e7c9cf3d1bb894e7402e7ee162cd823db5c79fe9853ac9a5d6856442b8b09334b1515e0fb61a87d301255f070a0567cf8424828b53db5e9b6cb831f0627159
7
+ data.tar.gz: e9db4bcaf310a3d77967497f05fb9bab8e8e76c2c328ba3c1a33a02d2c8df8cc730cde8f2534145d9d1d5774a88c83b5647151ee7cd0494babf7b031271a1c7f
data/CHANGELOG.md CHANGED
@@ -1,12 +1,19 @@
1
1
  # Change Log
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
- ## [2.5.7] - 2023-08-xx
4
+ ## [2.5.8] - 2023-08-xx
5
5
 
6
6
  ### Added
7
7
  ### Changed
8
8
  ### Fixed
9
9
 
10
+ ## [2.5.7] - 2023-08-15
11
+
12
+ ### Added
13
+ - `Eco::API::Session::Config#tagtree_id=` allows to define a target structure id
14
+ - This is for `live` retrieval of tagtree on people sync processes
15
+ - It only makes sense if graphql credentials are configured
16
+
10
17
  ## [2.5.6] - 2023-08-14
11
18
 
12
19
  ### Changed
@@ -6,24 +6,26 @@ module Eco
6
6
  class MissingTagtree < StandardError
7
7
  end
8
8
 
9
- attr_key :file
9
+ attr_key :file, :structure_id
10
10
 
11
11
  # @param include_archived [Boolean] whether or not it should include archived nodes.
12
12
  # @return [Eco::API::Organization::TagTree]
13
13
  def scope_tree(enviro: nil, include_archived: true, raise_on_missing: true)
14
14
  return @tagtree if instance_variable_defined?(:@tagtree) && @tagtree.enviro == enviro
15
15
 
16
- if tree_file = self.file
17
- if (tree = file_manager.load_json(tree_file)) && !tree.empty?
18
- @tagtree = Eco::API::Organization::TagTree.new(tree, enviro: enviro)
19
- end
20
- end
21
-
22
16
  kargs = {
23
17
  enviro: enviro,
24
18
  includeArchivedNodes: include_archived
25
19
  }
26
20
 
21
+ if tree_file = self.file
22
+ if (tree = file_manager.load_json(tree_file)) && !tree.empty?
23
+ @tagtree = Eco::API::Organization::TagTree.new(tree, enviro: enviro)
24
+ end
25
+ elsif self.structure_id
26
+ kargs.merge(id: self.structure_id)
27
+ end
28
+
27
29
  @tagtree ||= live_tree(**kargs).tap do |tree|
28
30
  unless tree && !tree.empty?
29
31
  msg = "Could not find a local or live locations structure."
@@ -234,6 +234,10 @@ module Eco
234
234
  tagtree_config.file = file
235
235
  end
236
236
 
237
+ def tagtree_id=(value)
238
+ tagtree_config.structure_id = value
239
+ end
240
+
237
241
  # It uses the `tagtree.json` file and in its absence, if `graphql` enabled, the largest `life_tagtree`
238
242
  # @note it does NOT include archived nodes by default.
239
243
  # - This is for legacy (most usecases don't)
data/lib/eco/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Eco
2
- VERSION = "2.5.6"
2
+ VERSION = "2.5.7"
3
3
  end
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.5.6
4
+ version: 2.5.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oscar Segura