five-two-nw-olivander 0.1.2.31 → 0.1.2.33
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/datatables/olivander/datatable.rb +17 -12
- data/lib/olivander/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e7e8369317833a43657c260cc70760456db6b3cfe00fd07dfb0025cb60d6d97c
|
4
|
+
data.tar.gz: b3c5c50ec6df2e061e91f366b1bf3ac799189eb6da9b35cd2dc6ecff8985d58f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 724bf34bce912308d9c9c7567af14704e08a19393d4724325e5af7db4990ce63bbbc97f399fad5dca0f18b8ad1ec6590f8106b5612994784d1206f2cef996e4f
|
7
|
+
data.tar.gz: 82a7fc7c07cc0edf46ea06cb6c85c93fa0fced741b9ebdf8572d3ff21838b1403ea206fde329417a1de2803dbc269e86055c87c4ac8eb71fe45afa20bf1b1fff
|
@@ -22,6 +22,8 @@ module Olivander
|
|
22
22
|
column_attributes = klazz_attributes
|
23
23
|
column_attributes &&= only if only.size.positive?
|
24
24
|
column_attributes -= except if except.size.positive?
|
25
|
+
resources_sym = klazz.table_name.to_sym
|
26
|
+
bulk_action_list = self::ROUTE_BUILDER.resources[resources_sym]&.datatable_bulk_actions || []
|
25
27
|
|
26
28
|
default_hidden = %w[id created updated created_at updated_at deleted_at current_user current_action]
|
27
29
|
|
@@ -35,23 +37,26 @@ module Olivander
|
|
35
37
|
dc
|
36
38
|
end
|
37
39
|
|
40
|
+
if bulk_action_list.size.positive?
|
41
|
+
bulk_actions do
|
42
|
+
bulk_action_list.each do |ma|
|
43
|
+
if ma.confirm
|
44
|
+
bulk_action ma.sym, url_for(controller: ma.controller, action: "confirm_#{ma.action}")
|
45
|
+
else
|
46
|
+
bulk_action ma.sym, url_for(controller: ma.controller, action: ma.action), data: { turbo_frame: ma.turbo_frame }
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
38
52
|
datatable do
|
39
53
|
order(order_by[0], order_by[1]) if order_by.size == 2
|
40
|
-
|
54
|
+
Rails.logger.debug "bulk actions size: #{datatable._bulk_actions.size}"
|
55
|
+
Rails.logger.debug "bulk actions size: #{datatable._bulk_actions.size.positive?}"
|
56
|
+
# bulk_actions_col if datatable._bulk_actions.size.positive?
|
41
57
|
column_attributes.each do |key|
|
42
58
|
label = field_label_for(klazz, key)
|
43
59
|
sym = key.gsub('_id', '')
|
44
|
-
|
45
|
-
# modifiers = STRIP OFF ANY PUNCTUATION MARKS
|
46
|
-
# modifiers.each do |modifier|
|
47
|
-
# case !:
|
48
|
-
# visible = false
|
49
|
-
# case $:
|
50
|
-
# type = currency
|
51
|
-
# end
|
52
|
-
# end
|
53
|
-
|
54
|
-
|
55
60
|
visible = show.include?(key) || !(default_hidden.include?(key) || hide.include?(key))
|
56
61
|
if link_path.present? && sym == :id
|
57
62
|
link_col sym, link_path, 'id', visible: visible
|
data/lib/olivander/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: five-two-nw-olivander
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.2.
|
4
|
+
version: 0.1.2.33
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Dennis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-08-
|
11
|
+
date: 2023-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chartkick
|