agilibox 1.9.5 → 1.9.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -0
- data/app/controllers/concerns/agilibox/api_controller_concern.rb +1 -1
- data/app/filters/agilibox/small_data/filter.rb +1 -1
- data/app/filters/agilibox/small_data/filter_strategy_by_key_value.rb +1 -0
- data/app/helpers/agilibox/bootstrap_helper.rb +2 -2
- data/app/helpers/agilibox/filters_helper.rb +2 -2
- data/app/helpers/agilibox/font_awesome_helper.rb +1 -1
- data/app/helpers/agilibox/form_helper.rb +5 -5
- data/app/helpers/agilibox/pagination_helper.rb +2 -2
- data/app/helpers/agilibox/text_helper.rb +13 -12
- data/app/libs/agilibox/fcm/notifier.rb +1 -0
- data/app/libs/agilibox/fcm/request.rb +1 -1
- data/app/libs/agilibox/mini_model_serializer/serializer.rb +1 -1
- data/app/libs/agilibox/phone_number_sanitizer.rb +1 -1
- data/app/serializers/agilibox/serializers/xlsx.rb +2 -1
- data/app/services/agilibox/service.rb +8 -2
- data/app/sms/agilibox/sms/application_sms.rb +1 -1
- data/lib/agilibox/active_model_type_cast.rb +1 -1
- data/lib/agilibox/errors_middleware.rb +1 -0
- data/lib/agilibox/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef22857fe40bc1f1f2784bc4ee30f004dfbef4813ca38901b77ec28d27565f45
|
4
|
+
data.tar.gz: b107e6d93659b93399d5cedaafad060ee7acdecfc342397d2aac796ba61050a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1705f009f619fd427478ef8cc8f875229dcb8648363c085e3b43594f553fcb60a753974ca6e6cf7125fc11401ece9d3ac6dc7f8025b4c3af3fe2405483c0d507
|
7
|
+
data.tar.gz: 6dda6ceaa7aac2a49e8388faeaac9b2bb96a4de48359aa2f7e42d4d1d8a60d6cbb69e8eb299453b0a1d755402475363a4a760a4989a772981cc32cc62d9cae7b
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,22 @@
|
|
2
2
|
|
3
3
|
## Next version
|
4
4
|
|
5
|
+
## v1.9.10
|
6
|
+
- Fix some Ruby 2.7 warnings
|
7
|
+
|
8
|
+
## v1.9.9
|
9
|
+
- Add error to ErrorsMiddleware
|
10
|
+
|
11
|
+
## v1.9.8
|
12
|
+
- Fix `tags` helper
|
13
|
+
|
14
|
+
## v1.9.7
|
15
|
+
- Change XLSX export
|
16
|
+
|
17
|
+
## v1.9.6
|
18
|
+
- Fix info helper with false
|
19
|
+
- Update Rubocop + fix offences
|
20
|
+
|
5
21
|
## 1.9.5
|
6
22
|
- Fix warnings on Rails 6
|
7
23
|
|
@@ -37,7 +37,7 @@ module Agilibox::ApiControllerConcern
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def json_error_string_for_model(object)
|
40
|
-
json_errors_hash_for_model(object).values.
|
40
|
+
json_errors_hash_for_model(object).values.pluck(:full_message).join(", ")
|
41
41
|
end
|
42
42
|
|
43
43
|
def render_not_found
|
@@ -43,7 +43,7 @@ class Agilibox::SmallData::Filter
|
|
43
43
|
end
|
44
44
|
|
45
45
|
def respond_to_missing?(method, *)
|
46
|
-
strategies.key?(method.to_s) || strategies.key?(method.to_s.chomp("="))
|
46
|
+
super || strategies.key?(method.to_s) || strategies.key?(method.to_s.chomp("="))
|
47
47
|
end
|
48
48
|
|
49
49
|
def read
|
@@ -13,8 +13,8 @@ module Agilibox::BootstrapHelper
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def bs_progress_bar(percentage)
|
16
|
-
|
17
|
-
|
16
|
+
tag.div(class: "progress") do
|
17
|
+
tag.div(class: "progress-bar", style: "width:#{percentage}%") do
|
18
18
|
"#{percentage}%"
|
19
19
|
end
|
20
20
|
end
|
@@ -7,7 +7,7 @@ module Agilibox::FiltersHelper
|
|
7
7
|
text = options.delete(:text) || t("actions.filter")
|
8
8
|
icon = options.delete(:icon) || :filter
|
9
9
|
|
10
|
-
|
10
|
+
tag.button(**options) do
|
11
11
|
icon(icon) + " " + text
|
12
12
|
end
|
13
13
|
end
|
@@ -20,7 +20,7 @@ module Agilibox::FiltersHelper
|
|
20
20
|
text = options.delete(:text) || t("actions.reset")
|
21
21
|
icon = options.delete(:icon) || :undo
|
22
22
|
|
23
|
-
|
23
|
+
tag.button(**options) do
|
24
24
|
icon(icon) + " " + text
|
25
25
|
end
|
26
26
|
end
|
@@ -21,13 +21,13 @@ module Agilibox::FormHelper
|
|
21
21
|
submit_action = :save
|
22
22
|
end
|
23
23
|
|
24
|
-
|
25
|
-
submit =
|
26
|
-
|
24
|
+
tag.div(class: "actions form-actions") do
|
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)
|
27
27
|
end
|
28
28
|
|
29
|
-
cancel =
|
30
|
-
|
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)
|
31
31
|
end
|
32
32
|
|
33
33
|
cancel = "" if back_url == false
|
@@ -1,11 +1,11 @@
|
|
1
1
|
module Agilibox::PaginationHelper
|
2
2
|
def paginate(objects, options = {})
|
3
3
|
options = {theme: "twitter-bootstrap-3"}.merge(options)
|
4
|
-
super(objects, options).gsub(/>(\s+)</, "><").html_safe
|
4
|
+
super(objects, **options).gsub(/>(\s+)</, "><").html_safe
|
5
5
|
end
|
6
6
|
|
7
7
|
def pagination_infos(collection)
|
8
|
-
|
8
|
+
tag.p(class: "pagination-infos") { page_entries_info(collection) }
|
9
9
|
end
|
10
10
|
|
11
11
|
def pagination_and_infos(collection)
|
@@ -47,8 +47,8 @@ module Agilibox::TextHelper
|
|
47
47
|
number_with_precision(n, opts).tr(" ", nbsp)
|
48
48
|
end
|
49
49
|
|
50
|
-
def date(d,
|
51
|
-
I18n.l(d,
|
50
|
+
def date(d, **args)
|
51
|
+
I18n.l(d, **args) unless d.nil?
|
52
52
|
end
|
53
53
|
|
54
54
|
def boolean_icon(bool)
|
@@ -93,13 +93,16 @@ module Agilibox::TextHelper
|
|
93
93
|
value = value_or_options
|
94
94
|
end
|
95
95
|
|
96
|
+
value = t("yes") if value == true
|
97
|
+
value = t("no") if value == false
|
98
|
+
|
96
99
|
if value.blank?
|
97
100
|
value = options[:default]
|
98
101
|
return if value == :hide
|
99
102
|
end
|
100
103
|
|
101
104
|
label = options[:label] || object.t(attribute)
|
102
|
-
|
105
|
+
info_tag = options[:tag] || :div
|
103
106
|
separator = options[:separator] || " : "
|
104
107
|
separator = " :<br/>".html_safe if separator == :br
|
105
108
|
helper = options[:helper]
|
@@ -108,8 +111,6 @@ module Agilibox::TextHelper
|
|
108
111
|
klass = object.is_a?(Module) ? object : object.class
|
109
112
|
object_type = klass.to_s.split("::").last.underscore
|
110
113
|
|
111
|
-
value = t("yes") if value == true
|
112
|
-
value = t("no") if value == false
|
113
114
|
value = object.tv(attribute) if nested
|
114
115
|
value = send(helper, value) if helper
|
115
116
|
value = number(value) if value.is_a?(Numeric)
|
@@ -117,10 +118,10 @@ module Agilibox::TextHelper
|
|
117
118
|
value = l(value) if value.is_a?(Date)
|
118
119
|
value = value.to_s
|
119
120
|
|
120
|
-
html_label =
|
121
|
+
html_label = tag.strong(class: "info-label") { label }
|
121
122
|
span_css_class = "info-value #{object_type}-#{attribute}"
|
122
|
-
html_value =
|
123
|
-
separator_html =
|
123
|
+
html_value = tag.span(class: span_css_class) { value }
|
124
|
+
separator_html = tag.span(class: "info-separator") { separator }
|
124
125
|
|
125
126
|
if value.blank?
|
126
127
|
container_css_class = "info blank"
|
@@ -128,7 +129,7 @@ module Agilibox::TextHelper
|
|
128
129
|
container_css_class = "info"
|
129
130
|
end
|
130
131
|
|
131
|
-
content_tag(
|
132
|
+
content_tag(info_tag, class: container_css_class) do
|
132
133
|
[html_label, separator_html, html_value].join.html_safe
|
133
134
|
end
|
134
135
|
end # def info
|
@@ -137,9 +138,9 @@ module Agilibox::TextHelper
|
|
137
138
|
def tags(object)
|
138
139
|
return "" if object.tag_list.empty?
|
139
140
|
|
140
|
-
object.tag_list.map { |
|
141
|
-
|
142
|
-
"#{icon :tag} #{
|
141
|
+
object.tag_list.map { |tag_name|
|
142
|
+
tag.span(class: "tag label label-primary") {
|
143
|
+
"#{icon :tag} #{tag_name}".html_safe
|
143
144
|
}
|
144
145
|
}.join(" ").html_safe
|
145
146
|
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
class Agilibox::Serializers::XLSX < Agilibox::Serializers::Base
|
2
2
|
def render_inline
|
3
|
-
|
3
|
+
headers, *data = formatted_data
|
4
|
+
SpreadsheetArchitect.to_xlsx(headers: headers, data: data, freeze_headers: true)
|
4
5
|
end
|
5
6
|
|
6
7
|
def render_file(file_path)
|
@@ -1,8 +1,14 @@
|
|
1
1
|
class Agilibox::Service
|
2
2
|
include Agilibox::InitializeWith
|
3
3
|
|
4
|
-
|
5
|
-
|
4
|
+
if RUBY_VERSION >= "2.7.0"
|
5
|
+
def self.call(...)
|
6
|
+
new(...).call
|
7
|
+
end
|
8
|
+
else
|
9
|
+
def self.call(*args)
|
10
|
+
new(*args).call
|
11
|
+
end
|
6
12
|
end
|
7
13
|
|
8
14
|
def call(*)
|
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.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- agilidée
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-12-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails-i18n
|
@@ -228,7 +228,7 @@ homepage: https://github.com/agilidee/agilibox
|
|
228
228
|
licenses:
|
229
229
|
- MIT
|
230
230
|
metadata: {}
|
231
|
-
post_install_message:
|
231
|
+
post_install_message:
|
232
232
|
rdoc_options: []
|
233
233
|
require_paths:
|
234
234
|
- lib
|
@@ -243,8 +243,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
243
243
|
- !ruby/object:Gem::Version
|
244
244
|
version: '0'
|
245
245
|
requirements: []
|
246
|
-
rubygems_version: 3.
|
247
|
-
signing_key:
|
246
|
+
rubygems_version: 3.1.4
|
247
|
+
signing_key:
|
248
248
|
specification_version: 4
|
249
249
|
summary: Agilibox
|
250
250
|
test_files: []
|