glib-web 4.34.6 → 4.35.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/app/controllers/concerns/glib/json/ui.rb +10 -1
- data/app/helpers/glib/json_ui/action_builder/windows.rb +1 -1
- data/app/helpers/glib/json_ui/menu_builder.rb +1 -0
- data/app/helpers/glib/json_ui/table_builders.rb +13 -0
- data/app/models/concerns/glib/nilify_blanks.rb +32 -0
- data/app/views/json_ui/garage/tables/layout.json.jbuilder +14 -1
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d6365a6460f12a480a714b89c4fc0984a7891afcd7d15ddbfd52c7f8e8fda473
|
4
|
+
data.tar.gz: e6fb2bce5238fe117caca23a5c3e5ab48b044b4d7b19f3235fc5957cb958d03e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1acfc0686e3741b7498c870509fe48ae98eb69a48dd8b5edb37d50fd02378726ce5b7a01dcb936d27341d3e8d935f2d0a3806b9b6b96938b9e03d0e373f1ae0b
|
7
|
+
data.tar.gz: 3a406081f720dd2f127f509abbada6aca991a966744783e78de5ee716aef39764653d52e0025b280fc02789e43ef5a42bbf62f07cf989b5f7fe6803eccb440fb
|
@@ -69,7 +69,16 @@ module Glib::Json::Ui
|
|
69
69
|
def __json_ui_start(options)
|
70
70
|
@__json_ui_activated = false
|
71
71
|
@__json_ui_rendering = nil
|
72
|
-
|
72
|
+
|
73
|
+
when_option = options[:when]
|
74
|
+
if when_option.is_a?(Proc)
|
75
|
+
# should_render = when_option.call(self)
|
76
|
+
should_render = instance_exec(&when_option)
|
77
|
+
else
|
78
|
+
should_render = when_option == :always
|
79
|
+
end
|
80
|
+
|
81
|
+
if should_render || params[:_render] == 'v1'
|
73
82
|
@__json_ui_activated = true
|
74
83
|
request.variant = :ui
|
75
84
|
|
@@ -60,6 +60,19 @@ module Glib
|
|
60
60
|
raise "Invalid properties: #{options.keys}" if options.size > 0
|
61
61
|
end
|
62
62
|
|
63
|
+
def footer(options = {})
|
64
|
+
json.footer do
|
65
|
+
json.backgroundColor options.delete(:backgroundColor)
|
66
|
+
json.cellViews do
|
67
|
+
options.delete(:cellViews)&.call page.view_builder
|
68
|
+
end
|
69
|
+
|
70
|
+
json.colSpans options.delete(:colSpans)
|
71
|
+
end
|
72
|
+
|
73
|
+
raise "Invalid properties: #{options.keys}" if options.size > 0
|
74
|
+
end
|
75
|
+
|
63
76
|
# def rows(array = nil)
|
64
77
|
# template = page.table_template_builder
|
65
78
|
# json.rows do
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module Glib
|
2
|
+
module NilifyBlanks
|
3
|
+
extend ActiveSupport::Concern
|
4
|
+
|
5
|
+
included do
|
6
|
+
class_attribute :_nilify_blanks_options, default: { only: nil, except: nil }
|
7
|
+
|
8
|
+
before_validation :_nilify_blanks
|
9
|
+
end
|
10
|
+
|
11
|
+
class_methods do
|
12
|
+
def nilify_blanks(options = {})
|
13
|
+
self._nilify_blanks_options = options
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
def _nilify_blanks
|
19
|
+
attrs = attributes
|
20
|
+
|
21
|
+
only = self.class._nilify_blanks_options[:only]
|
22
|
+
except = self.class._nilify_blanks_options[:except]
|
23
|
+
|
24
|
+
attrs = attrs.slice(*only.map(&:to_s)) if only.present?
|
25
|
+
attrs = attrs.except(*except.map(&:to_s)) if except.present?
|
26
|
+
|
27
|
+
attrs.each do |attr, val|
|
28
|
+
self[attr] = nil if val.is_a?(String) && val.blank?
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -25,7 +25,7 @@ page.table styleClass: 'table--grid', sections: [
|
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
-
header.label text:
|
28
|
+
header.label text: 'Markdown'
|
29
29
|
end
|
30
30
|
|
31
31
|
items = [1, 2, 3]
|
@@ -41,5 +41,18 @@ page.table styleClass: 'table--grid', sections: [
|
|
41
41
|
cell.markdown text: markdown
|
42
42
|
end
|
43
43
|
end
|
44
|
+
|
45
|
+
section.footer cellViews: ->(header) do
|
46
|
+
column_indexes.each do |i|
|
47
|
+
# order_key = "footer#{i}"
|
48
|
+
# order = @order_headings[order_key]
|
49
|
+
header.label text: "Footer#{i}"
|
50
|
+
# , onClick: ->(action) do
|
51
|
+
# action.windows_reload url: json_ui_garage_url(path: 'tables/layout', orders: reversed_order_params(order_key))
|
52
|
+
# end
|
53
|
+
end
|
54
|
+
|
55
|
+
header.label text: ''
|
56
|
+
end
|
44
57
|
end
|
45
58
|
]
|
metadata
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glib-web
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.35.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ''
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
date: 2019-10-04 00:00:00.000000000 Z
|
@@ -136,7 +136,7 @@ dependencies:
|
|
136
136
|
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
|
-
description:
|
139
|
+
description:
|
140
140
|
email: ''
|
141
141
|
executables: []
|
142
142
|
extensions: []
|
@@ -206,6 +206,7 @@ files:
|
|
206
206
|
- app/helpers/glib/json_ui/view_builder/panels.rb
|
207
207
|
- app/helpers/glib/urls_helper.rb
|
208
208
|
- app/models/concerns/glib/enum_humanization.rb
|
209
|
+
- app/models/concerns/glib/nilify_blanks.rb
|
209
210
|
- app/models/concerns/glib/soft_deletable.rb
|
210
211
|
- app/models/glib/active_storage/attachment.rb
|
211
212
|
- app/models/glib/active_storage/blob.rb
|
@@ -440,10 +441,10 @@ files:
|
|
440
441
|
- lib/glib/value.rb
|
441
442
|
- lib/glib/version.rb
|
442
443
|
- lib/tasks/db.rake
|
443
|
-
homepage:
|
444
|
+
homepage:
|
444
445
|
licenses: []
|
445
446
|
metadata: {}
|
446
|
-
post_install_message:
|
447
|
+
post_install_message:
|
447
448
|
rdoc_options: []
|
448
449
|
require_paths:
|
449
450
|
- lib
|
@@ -459,7 +460,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
459
460
|
version: '0'
|
460
461
|
requirements: []
|
461
462
|
rubygems_version: 3.4.6
|
462
|
-
signing_key:
|
463
|
+
signing_key:
|
463
464
|
specification_version: 4
|
464
465
|
summary: ''
|
465
466
|
test_files: []
|