agilibox 1.11.0 → 2.0.0
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 +5 -0
- data/app/controllers/concerns/agilibox/api_controller_concern.rb +3 -3
- data/app/filters/agilibox/small_data/filter.rb +1 -1
- data/app/helpers/agilibox/filters_helper.rb +2 -2
- data/app/helpers/agilibox/form_helper.rb +5 -5
- data/app/helpers/agilibox/link_helper.rb +2 -2
- data/app/libs/agilibox/mini_model_serializer/serialize.rb +1 -1
- data/app/libs/agilibox/mini_model_serializer/serializer.rb +4 -4
- data/app/libs/agilibox/monkey.rb +8 -8
- data/app/serializers/agilibox/serializers/xlsx.rb +7 -9
- data/app/sms/agilibox/sms/application_sms.rb +3 -3
- data/lib/agilibox/config.rb +2 -2
- data/lib/agilibox/cucumber_helpers/common_steps.rb +2 -2
- data/lib/agilibox/engine.rb +10 -0
- data/lib/agilibox/form_back_url.rb +1 -2
- data/lib/agilibox/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed05b27ec31b31ad6010e9c9977889712896676653142fb5258260b9b1ecebb2
|
4
|
+
data.tar.gz: a35841da1a137938d7bd7433d6c7de752a1d13c8d2448c65799cf288b8f3804c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d32717f5f9d83fbb0438018c746e1f21ad55d197bb5bdd1aa78b257fbec3b576c907006c46c94b39faf03f0de7d7bdfaef5465d6b3889c7b66144be71ceb712
|
7
|
+
data.tar.gz: ea1322427b7fa25716e060ccd10999b052a87226aaf07b889c7f01f9ee8a970ae49b38f1b1d6d757e5c16a6ba3b37f5a6167354b8025885b7f0de5dc70ff7839
|
data/CHANGELOG.md
CHANGED
@@ -4,12 +4,12 @@ module Agilibox::ApiControllerConcern
|
|
4
4
|
private
|
5
5
|
|
6
6
|
def render_json(json = {}, options = {})
|
7
|
-
json.reverse_merge!(current_user:
|
8
|
-
options.reverse_merge!(current_user:
|
7
|
+
json.reverse_merge!(current_user:)
|
8
|
+
options.reverse_merge!(current_user:)
|
9
9
|
|
10
10
|
json = Agilibox::MiniModelSerializer::Serialize.call(json, options)
|
11
11
|
|
12
|
-
render options.merge(json:
|
12
|
+
render options.merge(json:)
|
13
13
|
end
|
14
14
|
|
15
15
|
def render_json_error(any_object, options = {})
|
@@ -29,7 +29,7 @@ module Agilibox::FiltersHelper
|
|
29
29
|
filter_reset_button + filter_submit_button
|
30
30
|
end
|
31
31
|
|
32
|
-
def filters_form(options = {}, &
|
32
|
+
def filters_form(options = {}, &)
|
33
33
|
if options.key?(:buttons)
|
34
34
|
buttons = options.delete(:buttons)
|
35
35
|
else
|
@@ -41,7 +41,7 @@ module Agilibox::FiltersHelper
|
|
41
41
|
:wrapper => :inline_form,
|
42
42
|
}.merge(options)
|
43
43
|
|
44
|
-
html = simple_form_for(:filters, options, &
|
44
|
+
html = simple_form_for(:filters, options, &)
|
45
45
|
|
46
46
|
if buttons
|
47
47
|
html = html.gsub("</form>", "#{form_hidden_submit + filter_buttons}</form>").html_safe
|
@@ -3,7 +3,7 @@ module Agilibox::FormHelper
|
|
3
3
|
|
4
4
|
# Hidden submit to be the default triggered on <enter> keypress on a form
|
5
5
|
def form_hidden_submit
|
6
|
-
tag(
|
6
|
+
tag.input(type: "submit", class: "hidden-submit")
|
7
7
|
end
|
8
8
|
|
9
9
|
def form_buttons(opts = {})
|
@@ -36,7 +36,7 @@ module Agilibox::FormHelper
|
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
|
-
def horizontal_form_for(obj, opts = {}, &
|
39
|
+
def horizontal_form_for(obj, opts = {}, &)
|
40
40
|
opts = {
|
41
41
|
:wrapper => "horizontal_form",
|
42
42
|
:html => {
|
@@ -44,11 +44,11 @@ module Agilibox::FormHelper
|
|
44
44
|
},
|
45
45
|
}.deep_merge(opts)
|
46
46
|
|
47
|
-
simple_form_for(obj, opts, &
|
47
|
+
simple_form_for(obj, opts, &)
|
48
48
|
end
|
49
49
|
|
50
50
|
def search_form(action: request.fullpath)
|
51
|
-
render "agilibox/search/form", action:
|
51
|
+
render "agilibox/search/form", action:
|
52
52
|
end
|
53
53
|
|
54
54
|
def checkboxes_dropdown(f, input, collection, label = t("actions.select"))
|
@@ -67,6 +67,6 @@ module Agilibox::FormHelper
|
|
67
67
|
|
68
68
|
return if query_values.empty?
|
69
69
|
|
70
|
-
query_values.sum { |k, v| tag.input(type: "hidden", name: k, value: v) }
|
70
|
+
query_values.sum("".html_safe) { |k, v| tag.input(type: "hidden", name: k, value: v) }
|
71
71
|
end
|
72
72
|
end
|
@@ -9,9 +9,9 @@ module Agilibox::LinkHelper
|
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
|
-
def icon_link_to(icon, name, options = nil, html_options = nil, &
|
12
|
+
def icon_link_to(icon, name, options = nil, html_options = nil, &)
|
13
13
|
name = "#{icon(icon)} #{name}".html_safe
|
14
|
-
link_to(name, options, html_options, &
|
14
|
+
link_to(name, options, html_options, &)
|
15
15
|
end
|
16
16
|
|
17
17
|
def web_link(text, opts = {})
|
@@ -8,7 +8,7 @@ class Agilibox::MiniModelSerializer::Serialize
|
|
8
8
|
|
9
9
|
def call
|
10
10
|
if object.is_a?(Hash)
|
11
|
-
object.map { |k, v| [k.to_s, serialize(v)] }
|
11
|
+
object.map.to_h { |k, v| [k.to_s, serialize(v)] }
|
12
12
|
elsif object.is_a?(Enumerable)
|
13
13
|
object.map { |e| serialize(e) }
|
14
14
|
elsif (serializer = "#{object.class}Serializer".safe_constantize)
|
@@ -4,20 +4,20 @@ class Agilibox::MiniModelSerializer::Serializer < Agilibox::MiniModelSerializer:
|
|
4
4
|
end
|
5
5
|
|
6
6
|
def call
|
7
|
-
serialize
|
7
|
+
serialize(attributes.index_with { |k| send(k) })
|
8
8
|
end
|
9
9
|
|
10
10
|
private
|
11
11
|
|
12
|
-
def method_missing(m,
|
12
|
+
def method_missing(m, ...)
|
13
13
|
if respond_to_missing?(m)
|
14
|
-
object.send(m,
|
14
|
+
object.send(m, ...)
|
15
15
|
else
|
16
16
|
super
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
|
-
def respond_to_missing?(m,
|
20
|
+
def respond_to_missing?(m, include_private = false)
|
21
21
|
super || object.respond_to?(m, true)
|
22
22
|
end
|
23
23
|
end
|
data/app/libs/agilibox/monkey.rb
CHANGED
@@ -2,29 +2,29 @@ module Agilibox::Monkey
|
|
2
2
|
extend ActiveSupport::Concern
|
3
3
|
|
4
4
|
class_methods do
|
5
|
-
def prepend_instances(&
|
6
|
-
m = Module.new(&
|
5
|
+
def prepend_instances(&)
|
6
|
+
m = Module.new(&)
|
7
7
|
send(:prepend, m)
|
8
8
|
end
|
9
9
|
|
10
|
-
def prepend_class(&
|
11
|
-
m = Module.new(&
|
10
|
+
def prepend_class(&)
|
11
|
+
m = Module.new(&)
|
12
12
|
singleton_class.send(:prepend, m)
|
13
13
|
end
|
14
14
|
|
15
|
-
def prepend_instance_method(name, &
|
15
|
+
def prepend_instance_method(name, &)
|
16
16
|
check_instance_method_exist!(name)
|
17
17
|
|
18
18
|
m = Module.new
|
19
|
-
m.send(:define_method, name, &
|
19
|
+
m.send(:define_method, name, &)
|
20
20
|
send(:prepend, m)
|
21
21
|
end
|
22
22
|
|
23
|
-
def prepend_class_method(name, &
|
23
|
+
def prepend_class_method(name, &)
|
24
24
|
check_class_method_exist!(name)
|
25
25
|
|
26
26
|
m = Module.new
|
27
|
-
m.send(:define_method, name, &
|
27
|
+
m.send(:define_method, name, &)
|
28
28
|
singleton_class.send(:prepend, m)
|
29
29
|
end
|
30
30
|
|
@@ -3,17 +3,15 @@ class Agilibox::Serializers::XLSX < Agilibox::Serializers::Base
|
|
3
3
|
headers, *data = formatted_data
|
4
4
|
|
5
5
|
SpreadsheetArchitect.to_xlsx(
|
6
|
-
headers
|
7
|
-
data
|
6
|
+
headers:,
|
7
|
+
data:,
|
8
8
|
freeze_headers: true,
|
9
9
|
range_styles: range_styles(data[0]),
|
10
10
|
)
|
11
11
|
end
|
12
12
|
|
13
13
|
def render_file(file_path)
|
14
|
-
File.
|
15
|
-
f.write(render_inline)
|
16
|
-
end
|
14
|
+
File.binwrite(file_path, render_inline)
|
17
15
|
end
|
18
16
|
|
19
17
|
private
|
@@ -25,14 +23,14 @@ class Agilibox::Serializers::XLSX < Agilibox::Serializers::Base
|
|
25
23
|
end
|
26
24
|
|
27
25
|
def date_range_styles(row)
|
28
|
-
row.each_index.select { row[_1].is_a?(Date) }.map do
|
29
|
-
{range: {rows: :all, columns:
|
26
|
+
row.each_index.select { row[_1].is_a?(Date) }.map do |c|
|
27
|
+
{range: {rows: :all, columns: c}, styles: {format_code: "dd/mm/yyyy"}}
|
30
28
|
end
|
31
29
|
end
|
32
30
|
|
33
31
|
def time_range_styles(row)
|
34
|
-
row.each_index.select { row[_1].is_a?(Time) }.map do
|
35
|
-
{range: {rows: :all, columns:
|
32
|
+
row.each_index.select { row[_1].is_a?(Time) }.map do |c|
|
33
|
+
{range: {rows: :all, columns: c}, styles: {format_code: "dd/mm/yyyy hh:mm:ss"}}
|
36
34
|
end
|
37
35
|
end
|
38
36
|
end
|
@@ -27,15 +27,15 @@ class Agilibox::SMS::ApplicationSMS
|
|
27
27
|
class << self
|
28
28
|
private :new
|
29
29
|
|
30
|
-
def method_missing(m,
|
30
|
+
def method_missing(m, ...)
|
31
31
|
if respond_to_missing?(m)
|
32
|
-
new(action_name: m).public_send(m,
|
32
|
+
new(action_name: m).public_send(m, ...)
|
33
33
|
else
|
34
34
|
super
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
|
-
def respond_to_missing?(m,
|
38
|
+
def respond_to_missing?(m, include_private = false)
|
39
39
|
super || public_instance_methods.include?(m)
|
40
40
|
end
|
41
41
|
end # class << self
|
data/lib/agilibox/config.rb
CHANGED
@@ -5,7 +5,7 @@ class << Agilibox
|
|
5
5
|
@parent_controller ||= [
|
6
6
|
"ApplicationController",
|
7
7
|
"ActionController::Base",
|
8
|
-
].
|
8
|
+
].filter_map(&:safe_constantize).first
|
9
9
|
end
|
10
10
|
|
11
11
|
attr_writer :parent_mailer
|
@@ -14,6 +14,6 @@ class << Agilibox
|
|
14
14
|
@parent_mailer ||= [
|
15
15
|
"ApplicationMailer",
|
16
16
|
"ActionMailer::Base",
|
17
|
-
].
|
17
|
+
].filter_map(&:safe_constantize).first
|
18
18
|
end
|
19
19
|
end
|
@@ -63,7 +63,7 @@ Then("I do not see {string} element") do |selector|
|
|
63
63
|
end
|
64
64
|
|
65
65
|
Then("I see {int} times {string} element") do |count, selector|
|
66
|
-
expect(page).to have_selector(selector, count:
|
66
|
+
expect(page).to have_selector(selector, count:)
|
67
67
|
end
|
68
68
|
|
69
69
|
Then("I see {string} in modal") do |text|
|
@@ -95,7 +95,7 @@ When("I select {string}") do |value|
|
|
95
95
|
end
|
96
96
|
|
97
97
|
When("I select {string} from {string}") do |value, from|
|
98
|
-
select value, from:
|
98
|
+
select value, from:
|
99
99
|
end
|
100
100
|
|
101
101
|
When(/^I select2 "([^"]*)" from "([^"]*)"$/) do |value, selector|
|
data/lib/agilibox/engine.rb
CHANGED
@@ -8,6 +8,16 @@ module Agilibox
|
|
8
8
|
class Engine < ::Rails::Engine
|
9
9
|
isolate_namespace Agilibox
|
10
10
|
|
11
|
+
initializer "inflections" do
|
12
|
+
ActiveSupport::Inflector.inflections(:en) do |inflect|
|
13
|
+
inflect.acronym "FCM"
|
14
|
+
inflect.acronym "SMS"
|
15
|
+
inflect.acronym "SNS"
|
16
|
+
inflect.acronym "UUID"
|
17
|
+
inflect.acronym "XLSX"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
11
21
|
initializer "agilibox_mime_types" do
|
12
22
|
Mime::Type.register "application/vnd.ms-excel", :xls
|
13
23
|
Mime::Type.register "application/vnd.ms-excel", :xlsx
|
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:
|
4
|
+
version: 2.0.0
|
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: 2022-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails-i18n
|
@@ -257,14 +257,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
257
257
|
requirements:
|
258
258
|
- - ">="
|
259
259
|
- !ruby/object:Gem::Version
|
260
|
-
version:
|
260
|
+
version: 3.1.0
|
261
261
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
262
262
|
requirements:
|
263
263
|
- - ">="
|
264
264
|
- !ruby/object:Gem::Version
|
265
265
|
version: '0'
|
266
266
|
requirements: []
|
267
|
-
rubygems_version: 3.
|
267
|
+
rubygems_version: 3.3.7
|
268
268
|
signing_key:
|
269
269
|
specification_version: 4
|
270
270
|
summary: Agilibox
|