agilibox 1.9.13 → 1.9.18
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 +15 -0
- data/app/assets/javascripts/agilibox/modals.coffee +1 -0
- data/app/controllers/concerns/agilibox/api_controller_concern.rb +2 -1
- data/app/filters/agilibox/small_data/filter_strategy_by_date_or_datetime_period.rb +1 -1
- data/app/filters/agilibox/small_data/filter_strategy_by_key_values.rb +1 -1
- data/app/helpers/agilibox/bootstrap_helper.rb +4 -4
- data/app/helpers/agilibox/font_awesome_helper.rb +2 -2
- data/app/helpers/agilibox/form_helper.rb +2 -2
- data/app/models/concerns/agilibox/search.rb +2 -0
- data/app/services/agilibox/service.rb +2 -2
- data/lib/agilibox/active_model_custom_error_messages.rb +20 -5
- data/lib/agilibox/cucumber_helpers/capybara_selectors.rb +2 -3
- data/lib/agilibox/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6aefdff535a2d584ecfee6f6ff392506fe81231df048b8001568203363c25b23
|
4
|
+
data.tar.gz: 3a8b08504c485d4d49feff5105457b6de694399f263d791e87cea0f2132fd62a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f87086447d9013cb86f0abb83a17dc2c21b85c926cf05cb2a6f142cbb32e03877438976a1f85f0575bdb650d4e0ea0f7a4dc280d3b2a39ed43514a6e9f8a1e99
|
7
|
+
data.tar.gz: 0ce28dbcb3994f4aba0c5894e4e54e660b3753cf6335ac8d1a33f7dcb8df09c636368514bbecd8be78d840a96b296b985590147234a6ff9fac63e9d68570291c
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,21 @@
|
|
2
2
|
|
3
3
|
## Next version
|
4
4
|
|
5
|
+
## v1.9.18
|
6
|
+
- Rails 6.1 compatibility
|
7
|
+
|
8
|
+
## v1.9.17
|
9
|
+
- Fix capybara selector
|
10
|
+
|
11
|
+
## v1.9.16
|
12
|
+
- Fix Rails 6.1 warnings
|
13
|
+
|
14
|
+
## v1.9.15
|
15
|
+
- Add `modal:before-close` event
|
16
|
+
|
17
|
+
## v1.9.14
|
18
|
+
- Fix syntax error on Ruby < 2.7
|
19
|
+
|
5
20
|
## v1.9.13
|
6
21
|
- Add apparition capybara driver
|
7
22
|
|
@@ -31,7 +31,8 @@ module Agilibox::ApiControllerConcern
|
|
31
31
|
|
32
32
|
def json_errors_hash_for_model(object)
|
33
33
|
object.errors
|
34
|
-
.
|
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
|
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
|
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
|
39
|
-
header_classes = ([global_classes[:header]] + header_class.to_s.split
|
40
|
-
body_classes = ([global_classes[:body]] + body_class.to_s.split
|
41
|
-
footer_classes = ([global_classes[:footer]] + footer_class.to_s.split
|
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")
|
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")
|
30
|
+
tag.span(class: "fa fa-times") + " " + ta(:cancel)
|
31
31
|
end
|
32
32
|
|
33
33
|
cancel = "" if back_url == false
|
@@ -12,6 +12,8 @@ module Agilibox::Search
|
|
12
12
|
words = q.to_s.parameterize.split("-")
|
13
13
|
fields = default_search_fields if fields.empty?
|
14
14
|
|
15
|
+
return all if words.empty?
|
16
|
+
|
15
17
|
sql_query = words.map.with_index { |_word, index|
|
16
18
|
fields.map { |field|
|
17
19
|
"(UNACCENT(CAST(#{field} AS TEXT)) ILIKE :w#{index})"
|
@@ -1,8 +1,23 @@
|
|
1
1
|
module Agilibox::ActiveModelCustomErrorMessages
|
2
|
-
|
3
|
-
|
4
|
-
|
2
|
+
# Rails <= 6.0
|
3
|
+
module ForErrors
|
4
|
+
def full_message(attribute, message)
|
5
|
+
return message[1..] if message[0] == "^"
|
6
|
+
super
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
ActiveModel::Errors.prepend(ForErrors)
|
11
|
+
|
12
|
+
# Rails >= 6.1
|
13
|
+
module ForError
|
14
|
+
def full_message
|
15
|
+
return message[1..] if message[0] == "^"
|
16
|
+
super
|
17
|
+
end
|
5
18
|
end
|
6
|
-
end
|
7
19
|
|
8
|
-
|
20
|
+
if Module.const_defined?("ActiveModel::Error")
|
21
|
+
ActiveModel::Error.prepend(ForError)
|
22
|
+
end
|
23
|
+
end
|
@@ -1,8 +1,7 @@
|
|
1
1
|
Capybara.add_selector(:agilibox_clickable) do
|
2
2
|
xpath do |locator, **options|
|
3
|
-
|
4
|
-
.
|
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
|
data/lib/agilibox/version.rb
CHANGED
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.
|
4
|
+
version: 1.9.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- agilidée
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails-i18n
|
@@ -244,7 +244,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
244
244
|
- !ruby/object:Gem::Version
|
245
245
|
version: '0'
|
246
246
|
requirements: []
|
247
|
-
rubygems_version: 3.1.
|
247
|
+
rubygems_version: 3.1.6
|
248
248
|
signing_key:
|
249
249
|
specification_version: 4
|
250
250
|
summary: Agilibox
|