glib-web 4.34.7 → 4.35.1
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/libs.rb +3 -3
- data/app/controllers/concerns/glib/json/ui.rb +2 -3
- 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 +1 -1
- data/app/models/concerns/glib/nilify_blanks.rb +32 -0
- data/app/views/json_ui/garage/tables/layout.json.jbuilder +14 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cefea23c2039d47502f18d50116d608953d704316db5fd81150818d9a4d2fc04
|
4
|
+
data.tar.gz: 0c224f7552b8d7ced23dd166eb184afa257d0f821f3b7a838f214e35681a0a99
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4152bea87f6fd59ad0224ee40308c4366efbe62786572d2a4e439246c39de826217df01e2abd2a339b93d6370fb3d7e2694ada049ec965dfd6feaefefb2fd4e0
|
7
|
+
data.tar.gz: 98d35bb888090b3b3dae94cfb8567f7c9ea565f2e4a3eb78246f21b55bcbd92ad55ede6bcf08150912ba2ea33d4407bd8a5ff27e78c6650c82958e090ae82bee
|
@@ -114,14 +114,14 @@ module Glib::Json::Libs
|
|
114
114
|
session[REDIRECT_BACK_KEY] = url || url_for(params.to_unsafe_h.merge(format: nil))
|
115
115
|
end
|
116
116
|
|
117
|
-
def glib_handle_401(sign_in_url)
|
117
|
+
def glib_handle_401(sign_in_url, **redirect_options)
|
118
118
|
if !glib_json_dialog_mode? && request.get?
|
119
119
|
json_ui_save_return_url
|
120
120
|
end
|
121
121
|
|
122
122
|
respond_to do |format|
|
123
123
|
format.html do
|
124
|
-
redirect_to sign_in_url
|
124
|
+
redirect_to sign_in_url, **redirect_options
|
125
125
|
end
|
126
126
|
format.json do
|
127
127
|
render json: json_ui_401_response(sign_in_url), status: Rails.env.test? ? :unauthorized : :ok
|
@@ -130,7 +130,7 @@ module Glib::Json::Libs
|
|
130
130
|
if Rails.env.test?
|
131
131
|
render status: :unauthorized
|
132
132
|
else
|
133
|
-
redirect_to sign_in_url
|
133
|
+
redirect_to sign_in_url, **redirect_options
|
134
134
|
end
|
135
135
|
end
|
136
136
|
end
|
@@ -72,13 +72,12 @@ module Glib::Json::Ui
|
|
72
72
|
|
73
73
|
when_option = options[:when]
|
74
74
|
if when_option.is_a?(Proc)
|
75
|
-
should_render = when_option.call(self)
|
75
|
+
# should_render = when_option.call(self)
|
76
|
+
should_render = instance_exec(&when_option)
|
76
77
|
else
|
77
78
|
should_render = when_option == :always
|
78
79
|
end
|
79
80
|
|
80
|
-
# raise "should_render: #{should_render}"
|
81
|
-
|
82
81
|
if should_render || params[:_render] == 'v1'
|
83
82
|
@__json_ui_activated = true
|
84
83
|
request.variant = :ui
|
@@ -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,7 +1,7 @@
|
|
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.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ''
|
@@ -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
|