kono_utils_bootstrap_view4 0.2 → 0.3
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/app/concepts/kono_utils/object/cell/base.rb +10 -0
- data/app/concepts/kono_utils/object/cell/buttons/show.rb +23 -0
- data/app/concepts/kono_utils/object/cell/forms/fields/date_time_field.rb +1 -1
- data/app/concepts/kono_utils/object/view/forms/fields/nested_wrappers/forms_containers/table_layout.erb +1 -1
- data/app/concepts/kono_utils/object/view/index/row_buttons.erb +2 -1
- data/lib/kono_utils_bootstrap_view4/configuration.rb +8 -0
- data/lib/kono_utils_bootstrap_view4/engine.rb +10 -1
- data/lib/kono_utils_bootstrap_view4/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b5bdd8ddcea66e345b2ed25e26aabf373277f7334c6b7edaf82ba05ab71011d1
|
4
|
+
data.tar.gz: 2410cbf0a6d46ded157eb57f5970ee53bbc263451ea17a54a947a528c94dad62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c72f29263f5e92614fca30a725899d3ed8e6286770c0efe9695ef2e53270ea6f9262dcc0ee65ab623b338799fa0c4000db79e0f7abf6b75f4959053ab110f423
|
7
|
+
data.tar.gz: 2181dc4a1ac3fd4d3cfc83ced1f6400a20478ea911074b704f6f07d8b6fac2b3543134460ff14bf6b87d2e9657c5828970546cf798efe3dbf13fcd049e659137
|
@@ -33,6 +33,16 @@ module KonoUtils
|
|
33
33
|
parent_controller.send(:destroy_custom_polymorphic_path, *rec)
|
34
34
|
end
|
35
35
|
|
36
|
+
def show_custom_polymorphic_path(*rec)
|
37
|
+
parent_controller.send(:show_custom_polymorphic_path, *rec)
|
38
|
+
end
|
39
|
+
|
40
|
+
def show(&block)
|
41
|
+
ActiveSupport::Notifications.instrument "kono_utils_bootstrap_view4.#{self.class.name.underscore.gsub("/", ".")}", this: :data do
|
42
|
+
super
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
36
46
|
##
|
37
47
|
# Registra il contenuto con una chiave, e lo renderizza poi dove è più necessario
|
38
48
|
# @param [String] name
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module KonoUtils
|
2
|
+
module Object
|
3
|
+
module Cell
|
4
|
+
module Buttons # namespace
|
5
|
+
class Show < Base
|
6
|
+
|
7
|
+
def url_to
|
8
|
+
options[:url_to] || show_custom_polymorphic_path(model)
|
9
|
+
end
|
10
|
+
|
11
|
+
def specific_button_class
|
12
|
+
'btn-info'
|
13
|
+
end
|
14
|
+
|
15
|
+
def button_content
|
16
|
+
options.fetch(:content, fa_icon("eye"))
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -32,7 +32,7 @@ module KonoUtils
|
|
32
32
|
#
|
33
33
|
def input_value
|
34
34
|
value = form.object.send(attribute_name)
|
35
|
-
value.
|
35
|
+
value.respond_to?(:rfc2822) ? "date: moment('#{value.rfc2822}')," : ''
|
36
36
|
end
|
37
37
|
|
38
38
|
def input_picker_format
|
@@ -1,2 +1,3 @@
|
|
1
|
+
<%= concept("cell/buttons/show", model) if policy(model).show? %>
|
1
2
|
<%= concept("cell/buttons/edit", model) if policy(model).edit? %>
|
2
|
-
<%= concept("cell/buttons/delete", model) if policy(model).destroy? %>
|
3
|
+
<%= concept("cell/buttons/delete", model) if policy(model).destroy? %>
|
@@ -4,8 +4,16 @@ class KonoUtilsBootstrapView4::Configuration
|
|
4
4
|
#@return [ActiveSupport::TaggedLogging] log di kono utils bootstrap, default estende quello di rails
|
5
5
|
attr_reader :logger
|
6
6
|
|
7
|
+
##
|
8
|
+
# Se attivo, abilitiamo le metriche con un un ActiveSupport::Notifications.instrument
|
9
|
+
# durante la show della cella
|
10
|
+
#@return [Boolean]
|
11
|
+
attr_accessor :cell_metrics
|
12
|
+
|
7
13
|
def initialize
|
8
14
|
@moment_js_locales = I18n.available_locales
|
15
|
+
|
16
|
+
@cell_metrics = false
|
9
17
|
# inizializzo logger, come quello che mi verrebbe passato
|
10
18
|
self.logger = ActiveSupport::TaggedLogging.new(ActiveSupport::Logger.new(STDOUT))
|
11
19
|
end
|
@@ -34,6 +34,16 @@ module KonoUtilsBootstrapView4
|
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
|
+
initializer 'kono_utils_bootstrap_view4.append_instrumentation', :group => :all do |app|
|
38
|
+
if KonoUtilsBootstrapView4.configuration.cell_metrics
|
39
|
+
app.config.after_initialize do
|
40
|
+
ActiveSupport::Notifications.subscribe /kono_utils_bootstrap_view4/ do |event|
|
41
|
+
Rails.logger.info "[KUBV4] #{event.name} - #{event.duration} ms - (#{event.allocations} allocations)"
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
37
47
|
##
|
38
48
|
# Abbiamo rimosso possibili JS, lasciamo per documentazione
|
39
49
|
initializer 'kono_utils_bootstrap_view4.append_cell_assets', :group => :all do |app|
|
@@ -51,7 +61,6 @@ module KonoUtilsBootstrapView4
|
|
51
61
|
end
|
52
62
|
end
|
53
63
|
|
54
|
-
|
55
64
|
Rails.logger.warn { "config.assets.initialize_on_precompile should be true" } unless app.config.assets.initialize_on_precompile == true
|
56
65
|
end
|
57
66
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kono_utils_bootstrap_view4
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.3'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marino Bonetti
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-07-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -39,7 +39,7 @@ dependencies:
|
|
39
39
|
version: '1.1'
|
40
40
|
- - ">="
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: 1.1.
|
42
|
+
version: 1.1.4
|
43
43
|
type: :runtime
|
44
44
|
prerelease: false
|
45
45
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -49,7 +49,7 @@ dependencies:
|
|
49
49
|
version: '1.1'
|
50
50
|
- - ">="
|
51
51
|
- !ruby/object:Gem::Version
|
52
|
-
version: 1.1.
|
52
|
+
version: 1.1.4
|
53
53
|
- !ruby/object:Gem::Dependency
|
54
54
|
name: kaminari
|
55
55
|
requirement: !ruby/object:Gem::Requirement
|
@@ -185,6 +185,7 @@ files:
|
|
185
185
|
- app/concepts/kono_utils/object/cell/buttons/edit.rb
|
186
186
|
- app/concepts/kono_utils/object/cell/buttons/list.rb
|
187
187
|
- app/concepts/kono_utils/object/cell/buttons/reset_search.rb
|
188
|
+
- app/concepts/kono_utils/object/cell/buttons/show.rb
|
188
189
|
- app/concepts/kono_utils/object/cell/create/base.rb
|
189
190
|
- app/concepts/kono_utils/object/cell/create/page_title.rb
|
190
191
|
- app/concepts/kono_utils/object/cell/create/side_title.rb
|