agilibox 1.9.12 → 1.9.17

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: 30abb8a54ea0a05b2754f7977520e8709ed2d46f126c2a6ee58432e52fb5a2f0
4
- data.tar.gz: e353109f751bbfb8fde4c71beff88ea84211720a584eb7d585d68c64caacf566
3
+ metadata.gz: d915e06c7f404c90124074fbd3d6cd670b6a518f7e9bf770be57b3ff8578016c
4
+ data.tar.gz: 4296515fd57d0d3d184dfb0907f32e4924afbc95e023cf210b6f2c4d3b87e08a
5
5
  SHA512:
6
- metadata.gz: 64aefab9b8873a5f6f0f862e1f05435bf28fa0dd5dbae03a7624328f31d07dedf651f192af8c3b89118d44d157397d9d7cfc8c477d4c95ac8c05863561cc2400
7
- data.tar.gz: dbfa164bdb05e6be77d21d53455dee070f08426176af20902931bbecf7f47bd016737c45ad85b2a33a4edb4aa296306df062327f89e71e7d2c010161343c3ca2
6
+ metadata.gz: 15a09252e2808322e8b764b0c48c2baf25574818af6d149dd35d7ab83c00ebc7738e8a4fada25bee183534fdeae3d5b01acc85bdc0673b56fe4f8bbd807beda7
7
+ data.tar.gz: 5e2827c129f389a9a43ece6ec345784f589d0b609270a5f8730c85c89107c2d267c9aa2184f5e4d8f1b1ecae5865443ecb5a1438c6eac67679fb6d48bc8b63ae
data/CHANGELOG.md CHANGED
@@ -2,6 +2,21 @@
2
2
 
3
3
  ## Next version
4
4
 
5
+ ## v1.9.17
6
+ - Fix capybara selector
7
+
8
+ ## v1.9.16
9
+ - Fix Rails 6.1 warnings
10
+
11
+ ## v1.9.15
12
+ - Add `modal:before-close` event
13
+
14
+ ## v1.9.14
15
+ - Fix syntax error on Ruby < 2.7
16
+
17
+ ## v1.9.13
18
+ - Add apparition capybara driver
19
+
5
20
  ## v1.9.12
6
21
  - Fix some Ruby 2.7 warnings
7
22
 
@@ -34,6 +34,7 @@ window.modal =
34
34
 
35
35
  close: (event) ->
36
36
  event.preventDefault() if event
37
+ $(document).trigger("modal:before-close")
37
38
  $("body").removeClass("modal-open")
38
39
  $("#modal").remove()
39
40
  $(document).trigger("modal:close")
@@ -31,7 +31,8 @@ module Agilibox::ApiControllerConcern
31
31
 
32
32
  def json_errors_hash_for_model(object)
33
33
  object.errors
34
- .map { |a, m| [a, message: m, full_message: object.errors.full_message(a, m)] }
34
+ .to_hash
35
+ .map { |a, m| [a, message: m.first, full_message: object.errors.full_message(a, m.first)] }
35
36
  .uniq(&:first)
36
37
  .to_h
37
38
  end
@@ -1,6 +1,6 @@
1
1
  class Agilibox::SmallData::FilterStrategyByDateOrDatetimePeriod < ::Agilibox::SmallData::FilterStrategyByKeyValue
2
2
  def initialize(*)
3
- if self.class == Agilibox::SmallData::FilterStrategyByDateOrDatetimePeriod
3
+ if instance_of?(Agilibox::SmallData::FilterStrategyByDateOrDatetimePeriod)
4
4
  raise "please use FilterStrategyByDatePeriod or FilterStrategyByDatetimePeriod"
5
5
  end
6
6
 
@@ -1,6 +1,6 @@
1
1
  class Agilibox::SmallData::FilterStrategyByKeyValues < ::Agilibox::SmallData::FilterStrategyByKeyValue
2
2
  def apply(query, value)
3
- value = value.split(" ") if value.is_a?(String)
3
+ value = value.split if value.is_a?(String)
4
4
  value = value.select(&:present?)
5
5
  column = column_for(query)
6
6
 
@@ -35,10 +35,10 @@ module Agilibox::BootstrapHelper
35
35
  &block
36
36
  )
37
37
  global_classes = Agilibox::BootstrapHelper.card_classes
38
- card_classes = ([global_classes[:card]] + card_class.to_s.split(" ")).compact.sort
39
- header_classes = ([global_classes[:header]] + header_class.to_s.split(" ")).compact.sort
40
- body_classes = ([global_classes[:body]] + body_class.to_s.split(" ")).compact.sort
41
- footer_classes = ([global_classes[:footer]] + footer_class.to_s.split(" ")).compact.sort
38
+ card_classes = ([global_classes[:card]] + card_class.to_s.split).compact.sort
39
+ header_classes = ([global_classes[:header]] + header_class.to_s.split).compact.sort
40
+ body_classes = ([global_classes[:body]] + body_class.to_s.split).compact.sort
41
+ footer_classes = ([global_classes[:footer]] + footer_class.to_s.split).compact.sort
42
42
 
43
43
  if header
44
44
  header_html = content_tag(header_tag, class: header_classes) { header }
@@ -6,7 +6,7 @@ module Agilibox::FontAwesomeHelper
6
6
  fa_style = Agilibox::FontAwesomeHelper.default_fa_style_for_id(id)
7
7
  end
8
8
 
9
- css_classes = options.delete(:class).to_s.split(" ")
9
+ css_classes = options.delete(:class).to_s.split
10
10
  css_classes << "icon"
11
11
  css_classes << "fa-#{id}"
12
12
  css_classes << "fa#{fa_style.to_s[0]}"
@@ -15,7 +15,7 @@ module Agilibox::FontAwesomeHelper
15
15
 
16
16
  attributes = options.merge(class: css_classes.sort.join(" ")).sort.to_h
17
17
 
18
- tag.span(**attributes) {}
18
+ tag.span(**attributes)
19
19
  end
20
20
 
21
21
  class << self
@@ -23,11 +23,11 @@ module Agilibox::FormHelper
23
23
 
24
24
  tag.div(class: "actions form-actions") do
25
25
  submit = tag.button(type: :submit, class: "btn btn-sm btn-success form-submit") do
26
- tag.span(class: "fa fa-save") {} + " " + ta(submit_action)
26
+ tag.span(class: "fa fa-save") + " " + ta(submit_action)
27
27
  end
28
28
 
29
29
  cancel = tag.a(href: back_url, class: "btn btn-primary btn-sm form-cancel") do
30
- tag.span(class: "fa fa-times") {} + " " + ta(:cancel)
30
+ tag.span(class: "fa fa-times") + " " + ta(:cancel)
31
31
  end
32
32
 
33
33
  cancel = "" if back_url == false
@@ -2,8 +2,8 @@ class Agilibox::Service
2
2
  include Agilibox::InitializeWith
3
3
 
4
4
  if RUBY_VERSION >= "2.7.0"
5
- def self.call(...)
6
- new(...).call
5
+ def self.call(*args, **kwargs)
6
+ new(*args, **kwargs).call
7
7
  end
8
8
  else
9
9
  def self.call(*args)
@@ -31,10 +31,14 @@ class << Agilibox::CucumberConfig = Class.new
31
31
 
32
32
  def require_all_helpers!
33
33
  files = Dir.glob Agilibox::Engine.root.join("lib", "agilibox", "cucumber_helpers", "*.rb")
34
- files.delete_if { |f| f.match?(/chrome|cuprite|_steps/) }
34
+ files.delete_if { |f| f.match?(/apparition|chrome|cuprite|_steps/) }
35
35
  files.each { |file| require file }
36
36
  end
37
37
 
38
+ def require_apparition!
39
+ require Agilibox::Engine.root.join("lib", "agilibox", "cucumber_helpers", "apparition.rb")
40
+ end
41
+
38
42
  def require_chrome_headless!
39
43
  require Agilibox::Engine.root.join("lib", "agilibox", "cucumber_helpers", "chrome_headless.rb")
40
44
  end
@@ -0,0 +1,18 @@
1
+ require "capybara/apparition"
2
+
3
+ Capybara.register_driver :agilibox_apparition do |app|
4
+ Capybara::Apparition::Driver.new(app,
5
+ :browser_options => {
6
+ :"disable-gpu" => true,
7
+ :"no-sandbox" => nil,
8
+ },
9
+ :headless => (ENV["CHROME_HEADLESS"].to_s != "false"),
10
+ :inspector => true,
11
+ :js_errors => true,
12
+ :window_size => Agilibox::CucumberConfig.window_size,
13
+ )
14
+ end
15
+
16
+ Capybara.default_driver = :agilibox_apparition
17
+ Capybara.current_driver = :agilibox_apparition
18
+ Capybara.javascript_driver = :agilibox_apparition
@@ -1,8 +1,7 @@
1
1
  Capybara.add_selector(:agilibox_clickable) do
2
2
  xpath do |locator, **options|
3
- self.class.all
4
- .values_at(:link, :button, :label)
5
- .map { |selector| instance_exec(locator, **options, &selector.xpath) }
3
+ %i(link button label)
4
+ .map { |selector| expression_for(selector, locator, **options) }
6
5
  .reduce(:union)
7
6
  end
8
7
  end
@@ -1,3 +1,3 @@
1
1
  module Agilibox
2
- VERSION = "1.9.12"
2
+ VERSION = "1.9.17"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: agilibox
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.12
4
+ version: 1.9.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - agilidée
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-08 00:00:00.000000000 Z
11
+ date: 2021-02-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails-i18n
@@ -199,6 +199,7 @@ files:
199
199
  - lib/agilibox/cucumber_config.rb
200
200
  - lib/agilibox/cucumber_helpers/agilibox.rb
201
201
  - lib/agilibox/cucumber_helpers/ajax.rb
202
+ - lib/agilibox/cucumber_helpers/apparition.rb
202
203
  - lib/agilibox/cucumber_helpers/capybara.rb
203
204
  - lib/agilibox/cucumber_helpers/capybara_selectors.rb
204
205
  - lib/agilibox/cucumber_helpers/chrome_headless.rb