ecoportal-api-v2 0.9.5 → 0.9.6

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: b4a2c3d92ddeb876e56bd7059d4ca1b3a9a9ce5537371b69a6eebf6f78c7e577
4
- data.tar.gz: c973b20893ac8e57b066d4cda1e685235caaf9dbda60dee8b5e943062eaee831
3
+ metadata.gz: 9502632e0f39a86587a093fb54bcadcd42b7a3db38ed98d5ec35ea5a56a9b257
4
+ data.tar.gz: 393ff91c773c047ffa031350a88af80f395847f326ec4b13011f33dc2477c6b5
5
5
  SHA512:
6
- metadata.gz: 4234c62329be25117a0e40fa7576f038e314480f10be190bf0c5492e9dfd4798683f7dec2a5e60cfd9cd5eaff63104e7ec49db2264b207915bd355b5bcc3585c
7
- data.tar.gz: fb7c035cbb19dfa76f63140c5dc2a256b826d88cfbbc5ddf2e14936c68b4dbeab42afec1687813606c363a3bc1ce9739b811f09aaab4905fa58b40405192ee6c
6
+ metadata.gz: c7733b21b7d7dec324c7561cb495e83ffc39f6e567eb5332613590ca914f611ec8361d6a356506f4f6eb846f0cbc5f7361e6235e9c1eb0b992ef7010dff0d093
7
+ data.tar.gz: 80d8a90e09c22ddd80854fa4d38ab6b7b6c0d533db3f694059818f20573c9a2f023888f3959fa8c67db8a37a6bbb9597a1d66fda0485e418c4197fcd1788d9e3
data/CHANGELOG.md CHANGED
@@ -1,11 +1,22 @@
1
1
  # Change Log
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
- ## [0.9.6] - 2022-11-xx
4
+ ## [0.9.7] - 2022-11-xx
5
5
 
6
6
  ### Added
7
7
  ### Changed
8
8
  ### Fixed
9
+ - `Ecoportal::API::V2::Page::Component#bindings`
10
+
11
+ ## [0.9.6] - 2022-11-18
12
+
13
+ ### Added
14
+ - `Ecoportal::API::V2::Page::Stage#components`
15
+ - `Ecoportal::API::V2::Page::Component#replace`
16
+ - `Ecoportal::API::V2::Page::Force::Binding#replace`
17
+
18
+ ### Fixed
19
+ - `Ecoportal::API::V2::Page::Component#bindings`
9
20
 
10
21
  ## [0.9.5] - 2022-11-17
11
22
 
@@ -139,7 +139,6 @@ module Ecoportal
139
139
  ooze.forces.each_with_object([]) do |force, out|
140
140
  out.push(*force.bindings.get_by_reference(self))
141
141
  end
142
- out
143
142
  end
144
143
 
145
144
  # @return [Array<Ecoportal::API::V2::Page::Force] the forces this component is bound to if any.
@@ -154,6 +153,22 @@ module Ecoportal
154
153
  forces.count > 0
155
154
  end
156
155
 
156
+ # If the field has bindings they are replaced by this new field
157
+ # @note careful with this, depending what's done in the force, this may brake the force.
158
+ def replace(fld)
159
+ if fld.section
160
+ fld.move(section: self.section, before: self)
161
+ else
162
+ self.section.add(fld, before: self)
163
+ end
164
+ replace_bindings(fld)
165
+ self.delete!
166
+ end
167
+
168
+ def replace_bindings(fld)
169
+ bindings.map {|b| b.replace(fld)}
170
+ end
171
+
157
172
  def delete!
158
173
  bindings.each {|b| b.delete!}
159
174
  self.unattach!
@@ -53,6 +53,12 @@ module Ecoportal
53
53
  self.component? ? component : section
54
54
  end
55
55
 
56
+ def replace(mem_sec)
57
+ self._parent.add(mem_sec, name: self.name, before: self) do |bind|
58
+ self.delete! if bind
59
+ end
60
+ end
61
+
56
62
  def delete!
57
63
  self._parent.delete!(self)
58
64
  end
@@ -21,6 +21,10 @@ module Ecoportal
21
21
  self._parent.ooze
22
22
  end
23
23
 
24
+ def components
25
+ sections.map(&:components).flatten(1).uniq
26
+ end
27
+
24
28
  # @yield [section] do some stuff with section.
25
29
  # @yieldparam section [Ecoportal::API::V2::Page::Section] one of the sections of this stage
26
30
  # @return [Array<Ecoportal::API::V2::Page::Section>] sections attached to this stage.
@@ -1,5 +1,5 @@
1
1
  module Ecoportal
2
2
  module API
3
- GEM2_VERSION = "0.9.5"
3
+ GEM2_VERSION = "0.9.6"
4
4
  end
5
5
  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.9.5
4
+ version: 0.9.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oscar Segura
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-11-17 00:00:00.000000000 Z
11
+ date: 2022-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler