glib-web 2.6.0 → 2.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/concerns/glib/json/libs.rb +18 -0
- data/app/helpers/glib/json_ui/action_builder/dialogs.rb +2 -0
- data/app/helpers/glib/json_ui/action_builder/tours.rb +3 -0
- data/app/helpers/glib/json_ui/view_builder/fields.rb +2 -1
- data/app/views/json_ui/garage/forms/otp_field.json.jbuilder +7 -4
- data/app/views/json_ui/garage/forms/submit_on_change.json.jbuilder +37 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb13d4976eaaf07dbf2459dc8be1eee222ebd668c04f1886bec4ce8e0e497ec6
|
4
|
+
data.tar.gz: 6781da7837fadbe015c7df63adcc6956289900c2064aac27cf7d345888554ee9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a95897d9a5725703b1379689095563dab95d29cceba0f0c6394673d3d2cb4360efc0031915a59e1fe6265086baade6924fe1646c66732ba295d6d652b3e79bd
|
7
|
+
data.tar.gz: ef34016972a3b1be612213db6269505ea37292ddc1c37d1b6d5a3bc4adb3a1a5fccdcc5fa3d5020e64adcdf8e5f267a444386dc93c68844202bf1dc9cf954c15
|
@@ -36,6 +36,24 @@ module Glib::Json::Libs
|
|
36
36
|
json_ui_app_device_os == 'web'
|
37
37
|
end
|
38
38
|
|
39
|
+
def json_ui_etag
|
40
|
+
template = "#{controller_name}/#{action_name}"
|
41
|
+
|
42
|
+
# 1) It's necessary to pass in the template explicitly because of the switching between JSON
|
43
|
+
# and HTML rendering.
|
44
|
+
#
|
45
|
+
# 2) When a model is not provided, two pages the use the same template (e.g. `projects#show`)
|
46
|
+
# will produce the exact same ETAG, even though their content might be different. Presumably
|
47
|
+
# this is because the ETAG is calculated based on the static template as opposed to the
|
48
|
+
# generated output.
|
49
|
+
#
|
50
|
+
# However, this is not a problem because the browser will still treat these pages as
|
51
|
+
# separate because they have different URLs (e.g. `projects/1` vs `projects/2`), meaning
|
52
|
+
# that it will not accidentally use the cache from a different URL even though the ETAG
|
53
|
+
# is exactly the same.
|
54
|
+
fresh_when nil, template: template
|
55
|
+
end
|
56
|
+
|
39
57
|
def json_ui_render(template, args = {})
|
40
58
|
JSON.parse(render_to_string(template, locals: args))
|
41
59
|
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
class Glib::JsonUi::ActionBuilder
|
2
2
|
module Dialogs
|
3
3
|
class Alert < Action
|
4
|
+
string :title
|
4
5
|
string :message
|
5
6
|
action :onLoad
|
6
7
|
action :onClose
|
@@ -44,6 +45,7 @@ class Glib::JsonUi::ActionBuilder
|
|
44
45
|
bool :showClose
|
45
46
|
string :fullscreen
|
46
47
|
length :width
|
48
|
+
length :height
|
47
49
|
end
|
48
50
|
|
49
51
|
class Reload < Action
|
@@ -14,21 +14,24 @@ page.form \
|
|
14
14
|
form.spacer height: 6
|
15
15
|
form.fields_otp \
|
16
16
|
name: 'user[otp_summary1]',
|
17
|
-
|
17
|
+
length: 7,
|
18
|
+
type: 'text'
|
18
19
|
|
19
20
|
form.spacer height: 20
|
20
|
-
form.h2 text: 'OTP Custom Length'
|
21
|
+
form.h2 text: 'OTP Custom Length and input type number'
|
21
22
|
form.spacer height: 6
|
22
23
|
form.fields_otp \
|
23
24
|
name: 'user[otp_summary2]',
|
24
|
-
|
25
|
+
length: 3,
|
26
|
+
type: 'number'
|
25
27
|
|
26
28
|
form.spacer height: 20
|
27
29
|
form.h2 text: 'OTP with Long Field'
|
28
30
|
form.spacer height: 6
|
29
31
|
form.fields_otp \
|
30
32
|
name: 'user[otp_summary3]',
|
31
|
-
|
33
|
+
length: 20,
|
34
|
+
type: 'text'
|
32
35
|
|
33
36
|
form.spacer height: 20
|
34
37
|
form.fields_submit text: 'Submit'
|
@@ -17,8 +17,11 @@ page.scroll childViews: ->(scroll) do
|
|
17
17
|
checkValue: '16+',
|
18
18
|
uncheckValue: '0-16',
|
19
19
|
label: 'I am over 16 (has default value)',
|
20
|
+
paramNameForFormData: 'message',
|
20
21
|
onChange: ->(action) do
|
21
|
-
action.
|
22
|
+
action.dialogs_alert title: 'Submit data?', onClose: ->(subaction) do
|
23
|
+
action.forms_submit
|
24
|
+
end
|
22
25
|
end
|
23
26
|
|
24
27
|
form.fields_check \
|
@@ -43,7 +46,7 @@ page.scroll childViews: ->(scroll) do
|
|
43
46
|
onChange: ->(action) do
|
44
47
|
action.snackbars_select message: 'Submit data?', buttons: ->(menu) do
|
45
48
|
menu.button text: 'Yes, submit', onClick: ->(subaction) do
|
46
|
-
|
49
|
+
subaction.forms_submit
|
47
50
|
end
|
48
51
|
end
|
49
52
|
end
|
@@ -57,6 +60,7 @@ page.scroll childViews: ->(scroll) do
|
|
57
60
|
group.fields_radio value: 'senior', label: 'Senior'
|
58
61
|
group.fields_radio value: 'junior', label: 'Junior'
|
59
62
|
end,
|
63
|
+
paramNameForFormData: 'message',
|
60
64
|
onChange: ->(action) do
|
61
65
|
action.sheets_select message: 'Submit data?', buttons: ->(menu) do
|
62
66
|
menu.button text: 'Yes, submit', onClick: ->(subaction) do
|
@@ -78,6 +82,20 @@ page.scroll childViews: ->(scroll) do
|
|
78
82
|
end
|
79
83
|
end
|
80
84
|
|
85
|
+
|
86
|
+
form.spacer height: 20
|
87
|
+
form.h2 text: 'Textarea'
|
88
|
+
form.fields_textarea \
|
89
|
+
name: 'user[bio]',
|
90
|
+
width: 'matchParent',
|
91
|
+
onChange: ->(action) do
|
92
|
+
action.sheets_select message: 'Submit data?', buttons: ->(menu) do
|
93
|
+
menu.button text: 'Yes, submit', onClick: ->(subaction) do
|
94
|
+
action.forms_submit
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
81
99
|
form.spacer height: 20
|
82
100
|
form.h2 text: 'Text (Asynchronous)'
|
83
101
|
form.fields_text \
|
@@ -86,6 +104,23 @@ page.scroll childViews: ->(scroll) do
|
|
86
104
|
onChange: ->(action) do
|
87
105
|
action.http_post url: json_ui_garage_url(path: 'forms/generic_post')
|
88
106
|
end
|
107
|
+
|
108
|
+
form.spacer height: 20
|
109
|
+
rules = { fileType: 'image', maxFileSize: 5000, fileTypeErrorText: 'Invalid!', maxFileSizeErrorText: 'Too big!' }
|
110
|
+
form.fields_file \
|
111
|
+
name: 'user[photo][]',
|
112
|
+
width: 'matchParent',
|
113
|
+
label: 'Avatar',
|
114
|
+
accepts: rules,
|
115
|
+
directUploadUrl: rails_direct_uploads_url,
|
116
|
+
placeholderView: { type: 'avatar', width: 100, height: 100, url: 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxMREBUREhAWFhUWGBcVFRgXFxUVFxcWGRUWFxYVFRUYHSggGB0lHRgVITEhJSkrLi4uGB8zODMtNygtLisBCgoKBQUFDgUFDisZExkrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrK//AABEIAOMA3gMBIgACEQEDEQH/xAAbAAEAAgMBAQAAAAAAAAAAAAAABgcBAwQFAv/EAEAQAAECAwMKAwYEBAYDAAAAAAEAAgMRIQQSMQUGIjJBUWFxgZEHE6FCUnKxwdEUI2LwM4KSskNzg6LC4WOz8f/EABQBAQAAAAAAAAAAAAAAAAAAAAD/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwC6XuvCQRj7okcUe27UYoxt4TOKDDG3Knkjm3jeGCMdeoeaOcWmQwQZe6/Qc0a+6Lpx+6PbcqOSNbeF44oMMbcqeSOZeN4YIx1+h5oXEG6MEGXuv0HNGuui6cfuvMytl6zWTXi6XuN039hh1koflPxDe4nyILW/qfpO/pFB6oLDhMLTX0XLbLbChmcSNDZ8T2tPqVUNuy/aY38S0PI3A3W/0tkF5qC4bVnZYsPxLT8Ic71AWgZ72ICXmuP+m/7KpUQWzAzzsQP8Y9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xfIZe0lhgIq7DujgSZtw7eiA11+hptQvu6P7qsvIOrj2ojSAJOx7+qAW3KiuxAy9pfuiwwEa2HeqOBJmMO3OiAHX6Gm1C65QV2rLzPVx7IwgUdj3QfVp1eqWfVREGqy49PskfW7IiDZasOv3WYGr3REGuy49FiPrdkRBstWHX7rMHV7rKINVlx6LEXX7IiDZasBzWYOp3+qyiDVZcTyWIuv2+iIg2WrAc1mHqdD9URB8WXEr5fr9R9ERBttOr1Sz6vdZRBpsuPT7JH1uyIg2WrDqswdTuiINdlxPJYtOt0REH//2Q==' },
|
117
|
+
onChange: ->(action) do
|
118
|
+
action.sheets_select message: 'Submit data?', buttons: ->(menu) do
|
119
|
+
menu.button text: 'Yes, submit', onClick: ->(subaction) do
|
120
|
+
action.forms_submit
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|
89
124
|
end
|
90
125
|
|
91
126
|
end
|