glib-web 4.10.1 → 4.10.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/controllers/concerns/glib/json/new_dynamic_text.rb +0 -0
- data/app/helpers/glib/app_feature_support_helper.rb +0 -0
- data/app/helpers/glib/dynamic_texts_helper.rb +0 -0
- data/app/helpers/glib/json_ui/action_builder/sheets.rb +0 -0
- data/app/helpers/glib/json_ui/analytics_helper.rb +0 -0
- data/app/helpers/glib/json_ui/generic_builders.rb +0 -0
- data/app/helpers/glib/json_ui/view_builder/panels.rb +7 -0
- data/app/models/concerns/glib/enum_humanization.rb +1 -1
- data/app/models/glib/active_storage/attachment.rb +0 -0
- data/app/models/glib/active_storage/blob.rb +0 -0
- data/app/models/glib/dynamic_text_record.rb +0 -0
- data/app/models/glib/text.rb +0 -0
- data/app/validators/email_typo_validator.rb +0 -0
- data/app/validators/email_validator.rb +0 -0
- data/app/validators/url_validator.rb +0 -0
- data/app/views/json_ui/garage/actions/dialogs_oauth_post.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/bulk_edit_post.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/dynamic_group.json.jbuilder +45 -40
- data/app/views/json_ui/garage/forms/dynamic_select_data.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/generic_post.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/selects.json.jbuilder +7 -2
- data/app/views/json_ui/garage/forms/submission_flow.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/submission_flow_post.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/submission_indicator.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/submission_indicator_post.json.jbuilder +0 -0
- data/app/views/json_ui/garage/home/blank.json.jbuilder +0 -0
- data/app/views/json_ui/garage/home/slow.json.jbuilder +0 -0
- data/app/views/json_ui/garage/lists/autoload_all.json.jbuilder +0 -0
- data/app/views/json_ui/garage/lists/autoload_as_needed.json.jbuilder +0 -0
- data/app/views/json_ui/garage/lists/chat_ui.json.jbuilder +0 -0
- data/app/views/json_ui/garage/lists/fab.json.jbuilder +0 -0
- data/app/views/json_ui/garage/notifications/web_socket.json.jbuilder +0 -0
- data/app/views/json_ui/garage/pages/custom_style_class.json.jbuilder +0 -0
- data/app/views/json_ui/garage/pages/full_width.json.jbuilder +0 -0
- data/app/views/json_ui/garage/pages/full_width_height.json.jbuilder +0 -0
- data/app/views/json_ui/garage/pages/layout.json.jbuilder +0 -0
- data/app/views/json_ui/garage/pages/loading_indicator.json.jbuilder +0 -0
- data/app/views/json_ui/garage/pages/nested_scroll.json.jbuilder +0 -0
- data/app/views/json_ui/garage/pages/redirect_onload.json.jbuilder +0 -0
- data/app/views/json_ui/garage/panels/_styled.json.jbuilder +0 -0
- data/app/views/json_ui/garage/panels/card.json.jbuilder +0 -0
- data/app/views/json_ui/garage/panels/custom.json.jbuilder +0 -0
- data/app/views/json_ui/garage/panels/outlined.json.jbuilder +0 -0
- data/app/views/json_ui/garage/services/dynamic_text.json.jbuilder +0 -0
- data/app/views/json_ui/garage/services/image.json.jbuilder +0 -0
- data/app/views/json_ui/garage/services/index.json.jbuilder +0 -0
- data/app/views/json_ui/garage/tables/_autoload_section.json.jbuilder +0 -0
- data/app/views/json_ui/garage/tables/autoload_all.json.jbuilder +0 -0
- data/app/views/json_ui/garage/tables/autoload_as_needed.json.jbuilder +0 -0
- data/app/views/json_ui/garage/tables/export_import.json.jbuilder +0 -0
- data/app/views/json_ui/garage/tables/index.json.jbuilder +0 -0
- data/app/views/json_ui/garage/tables/panel_content.json.jbuilder +65 -25
- data/app/views/json_ui/garage/test_page/form.json.jbuilder +5 -5
- data/app/views/json_ui/garage/views/calendar_data.json.jbuilder +0 -0
- data/app/views/json_ui/garage/views/controls.json.jbuilder +2 -2
- data/app/views/json_ui/garage/views/map_data.json.jbuilder +0 -0
- data/app/views/json_ui/garage/views/multimedia.json.jbuilder +0 -0
- data/app/views/layouts/json_ui/no_custom.html.erb +0 -0
- data/lib/generators/glib/install_generator.rb +0 -0
- data/lib/generators/templates/20191017062519_create_texts.rb +0 -0
- data/lib/generators/templates/20191024063257_add_scope_to_texts.rb +0 -0
- data/lib/generators/templates/20191112095018_add_lang_to_texts.rb +0 -0
- data/lib/generators/templates/20191126071051_create_active_storage_tables.active_storage.rb +0 -0
- data/lib/generators/templates/database.yml +0 -0
- data/lib/generators/templates/dynamic_text.rb +0 -0
- data/lib/glib/dynamic_text/config.rb +0 -0
- data/lib/glib/dynamic_text.rb +0 -0
- data/lib/glib/json_crawler/action_crawler.rb +0 -0
- data/lib/glib/json_crawler/action_crawlers/action_http.rb +0 -0
- data/lib/glib/json_crawler/action_crawlers/dialogs_alert.rb +0 -0
- data/lib/glib/json_crawler/action_crawlers/dialogs_close.rb +14 -0
- data/lib/glib/json_crawler/action_crawlers/menu.rb +0 -0
- data/lib/glib/json_crawler/action_crawlers/run_multiple.rb +0 -0
- data/lib/glib/json_crawler/action_crawlers/windows_open.rb +0 -0
- data/lib/glib/json_crawler/coverage.rb +0 -0
- data/lib/glib/json_crawler/http.rb +25 -2
- data/lib/glib/json_crawler/router.rb +4 -0
- data/lib/glib/json_crawler.rb +1 -0
- data/lib/glib/value.rb +0 -0
- data/lib/glib/version.rb +0 -0
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 840b2cb71ab488fdfff13806866763bd9e73c22c7cab85cff48a093643f7d898
|
|
4
|
+
data.tar.gz: 1a513b44d185b802b61b54f1053246b5308e38f536fb4cef32a1123695b7ab3d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0c48d7a4a27523b0ada18199e771f028879ce44a8587513416b46885cbf6fb1a695c64a0e3e30facf049cea0039c313e4cd8a0d7f8551dc744b6ecccb54a533a
|
|
7
|
+
data.tar.gz: a7717b61cd9e9ba90aeec57991fca3e39c387eaabf175d9d6585973a034198af5231562d72abe85844bb0f668f0088dfd5d63611b158a9a911f05ffb95b32d3c
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -572,6 +572,13 @@ class Glib::JsonUi::ViewBuilder
|
|
|
572
572
|
# end
|
|
573
573
|
end
|
|
574
574
|
|
|
575
|
+
class Pagination < View
|
|
576
|
+
int :length
|
|
577
|
+
int :value
|
|
578
|
+
action :onChange
|
|
579
|
+
string :paramNameForFieldName
|
|
580
|
+
end
|
|
581
|
+
|
|
575
582
|
module ModelPanel
|
|
576
583
|
attr_reader :model_name # See Panels::Form.field_name
|
|
577
584
|
attr_reader :assoc_order_index
|
|
@@ -21,7 +21,7 @@ module Glib
|
|
|
21
21
|
if enum_value
|
|
22
22
|
translation_key = "activerecord.attributes.#{model_name.i18n_key}.#{enum_name.to_s.pluralize}.#{enum_value}"
|
|
23
23
|
|
|
24
|
-
if default_translation.nil? && Rails.env.development?
|
|
24
|
+
if default_translation.nil? && (Rails.env.development? || Rails.env.test?)
|
|
25
25
|
text = I18n.t(translation_key, raise: I18n::MissingTranslationData)
|
|
26
26
|
else
|
|
27
27
|
text = I18n.t(translation_key, default: default_translation)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/app/models/glib/text.rb
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -28,7 +28,7 @@ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', p
|
|
|
28
28
|
template.fields_text width: 'matchParent', name: 'question', label: 'Question', placeholder: 'Question'
|
|
29
29
|
|
|
30
30
|
form.panels_responsive id: 'responsive_{{entry_index}}', childViews: ->(column) do
|
|
31
|
-
options = [:rating, :yes_no]
|
|
31
|
+
options = [:rating, :yes_no, :choices]
|
|
32
32
|
template.fields_select \
|
|
33
33
|
width: 'matchParent',
|
|
34
34
|
name: 'type',
|
|
@@ -36,56 +36,61 @@ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', p
|
|
|
36
36
|
placeholder: 'Answer Type',
|
|
37
37
|
options: options.map { |o| { text: o.to_s.humanize, value: o } },
|
|
38
38
|
onChangeAndLoad: ->(action) do
|
|
39
|
-
action.
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
39
|
+
action.runMultiple childActions: ->(multiple) do
|
|
40
|
+
multiple.logics_set \
|
|
41
|
+
cacheData: true, # This is so that the the new data is retained when the `dynamicGroup` gets re-rendered.
|
|
42
|
+
debug: true,
|
|
43
|
+
targetId: 'responsive_{{entry_index}}', dataBuilder: ->(set) do
|
|
44
|
+
set.panels_responsive width: 'matchParent', accessory: ->(accessory) do
|
|
45
|
+
accessory.footer childViews: ->(footer) do
|
|
46
|
+
footer.fields_check \
|
|
47
|
+
width: 'matchParent',
|
|
48
|
+
id: 'check_{{entry_index}}',
|
|
49
|
+
name: 'enabled',
|
|
50
|
+
label: 'Enable',
|
|
51
|
+
checkValue: true
|
|
52
|
+
|
|
53
|
+
footer.panels_split width: 'matchParent', content: ->(split) do
|
|
54
|
+
split.right childViews: ->(right) do
|
|
55
|
+
right.label text: 'This should be right-aligned'
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end, onSet: ->(subaction) do
|
|
61
|
+
subaction.logics_set \
|
|
62
|
+
targetId: 'check_{{entry_index}}',
|
|
63
|
+
conditionalData: {
|
|
64
|
+
value: {
|
|
65
|
+
"==": [{ "var": 'user[evaluation][{{entry_index}}][type]' }, 'rating']
|
|
66
|
+
}
|
|
67
|
+
}
|
|
50
68
|
end
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
69
|
+
|
|
70
|
+
multiple.logics_set \
|
|
71
|
+
targetId: 'choices_panel',
|
|
72
|
+
debug: true,
|
|
55
73
|
conditionalData: {
|
|
56
|
-
|
|
57
|
-
"==": [{ "var": 'user[evaluation][{{entry_index}}][type]' }, '
|
|
74
|
+
displayed: {
|
|
75
|
+
"==": [{ "var": 'user[evaluation][{{entry_index}}][type]' }, 'choices']
|
|
58
76
|
}
|
|
59
77
|
}
|
|
60
78
|
end
|
|
61
|
-
|
|
62
|
-
# action.components_findClosest view: 'panels/responsive', onFind: ->(find) do
|
|
63
|
-
# find.logics_set dataBuilder: ->(set) do
|
|
64
|
-
# set.panels_responsive accessory: ->(accessory) do
|
|
65
|
-
# accessory.footer childViews: ->(footer) do
|
|
66
|
-
# # TODO: Is there a way to only show this if the selected option is "rating".
|
|
67
|
-
# # I.e. `showIf: { "==": [{ "var": 'user[evaluation][{{index}}][type]' }, 'rating'] }`
|
|
68
|
-
# footer.fields_check \
|
|
69
|
-
# width: 'matchParent',
|
|
70
|
-
# name: 'enabled',
|
|
71
|
-
# label: 'Enable',
|
|
72
|
-
# checkValue: '1'
|
|
73
|
-
# end
|
|
74
|
-
# end
|
|
75
|
-
# end
|
|
76
|
-
# end
|
|
77
79
|
end
|
|
78
80
|
end, accessory: ->(accessory) do
|
|
79
81
|
accessory.footer childViews: ->(footer) do
|
|
82
|
+
|
|
80
83
|
end
|
|
81
84
|
end
|
|
82
85
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
template.panels_vertical id: 'choices_panel', childViews: ->(vertical) do
|
|
87
|
+
(1..5).each do |i|
|
|
88
|
+
vertical.fields_text \
|
|
89
|
+
width: 'matchParent',
|
|
90
|
+
name: "choices[#{i}]",
|
|
91
|
+
label: "Choice #{i}"
|
|
92
|
+
end
|
|
93
|
+
end
|
|
89
94
|
|
|
90
95
|
template.spacer height: 14
|
|
91
96
|
end
|
|
File without changes
|
|
File without changes
|
|
@@ -17,13 +17,16 @@ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', p
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
form.panels_responsive childViews: ->(column) do
|
|
20
|
+
options = languages.map do |k, v|
|
|
21
|
+
{ value: k, text: v }
|
|
22
|
+
end
|
|
20
23
|
form.fields_select \
|
|
21
24
|
name: 'user[city]',
|
|
22
25
|
width: 'matchParent',
|
|
23
26
|
clearable: true,
|
|
24
27
|
label: 'City1',
|
|
25
28
|
placeholder: 'This is a placeholder',
|
|
26
|
-
options:
|
|
29
|
+
options: options,
|
|
27
30
|
value: 'canberra',
|
|
28
31
|
onChange: ->(action) do
|
|
29
32
|
action.components_findClosest view: 'panels/responsive', onFind: ->(find) do
|
|
@@ -47,11 +50,13 @@ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', p
|
|
|
47
50
|
|
|
48
51
|
form.spacer height: 6
|
|
49
52
|
|
|
53
|
+
options = languages.map { |k, v| { value: k, text: v, deselect: [-1] } }
|
|
54
|
+
options << { value: -1, text: 'None of the above', deselect: languages.keys }
|
|
50
55
|
form.fields_select \
|
|
51
56
|
name: 'user[cities][]',
|
|
52
57
|
width: 'matchParent',
|
|
53
58
|
label: 'Cities',
|
|
54
|
-
options:
|
|
59
|
+
options: options,
|
|
55
60
|
value: ['melbourne', 'sydney'],
|
|
56
61
|
multiple: true,
|
|
57
62
|
onChange: ->(action) do
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -3,34 +3,74 @@ json.title 'Tables'
|
|
|
3
3
|
page = json_ui_page json
|
|
4
4
|
render "#{@path_prefix}/nav_menu", json: json, page: page
|
|
5
5
|
|
|
6
|
-
page.
|
|
7
|
-
->(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
6
|
+
page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
|
|
7
|
+
scroll.panels_form childViews: ->(form) do
|
|
8
|
+
form.panels_table styleClass: 'table--grid', sections: [
|
|
9
|
+
->(section) do
|
|
10
|
+
section.header cellViews: ->(header) do
|
|
11
|
+
header.panels_horizontal childViews: ->(horizontal) do
|
|
12
|
+
horizontal.fields_check name: 'check_all', checkValue: true, onChange: ->(action) do
|
|
13
|
+
action.runMultiple childActions: ->(multiple) do
|
|
14
|
+
check_ids = (0..2).map { |i| "item_#{i}" }
|
|
15
|
+
# action.logics_set targetIds: check_ids, conditionalData: {
|
|
16
|
+
# value: { 'var': 'check_all' }
|
|
17
|
+
# }
|
|
18
|
+
check_ids.each_with_index do |check_id, index|
|
|
19
|
+
record_id = "id_#{index}"
|
|
20
|
+
multiple.logics_set targetId: check_id, conditionalData: {
|
|
21
|
+
value: { "if": [ { 'var': 'check_all' }, record_id, nil ]}
|
|
22
|
+
}
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
header.label text: 'Vertical'
|
|
28
|
+
header.label text: 'Horizontal'
|
|
29
|
+
header.label text: 'Unordered List'
|
|
21
30
|
end
|
|
22
31
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
32
|
+
items = [1, 2, 3]
|
|
33
|
+
section.rows objects: items, builder: ->(row, item, index) do
|
|
34
|
+
row.default colStyles: [{ width: 200, backgroundColor: '#eeeeee' }], cellViews: ->(cell) do
|
|
35
|
+
cell.panels_horizontal childViews: ->(horizontal) do
|
|
36
|
+
horizontal.fields_check \
|
|
37
|
+
id: "item_#{index}",
|
|
38
|
+
name: 'user[items][]',
|
|
39
|
+
checkValue: "id_#{index}", # In the real-world, this is going to be the ID of a DB record.
|
|
40
|
+
onChangeAndLoad: ->(action) do
|
|
41
|
+
# TODO: Fix fields_check so it can support arrays
|
|
42
|
+
action.logics_set targetId: 'submit_button', conditionalData: {
|
|
43
|
+
text: {
|
|
44
|
+
'printf': [
|
|
45
|
+
'Submit {0} items',
|
|
46
|
+
{ 'countNonNull': [{ 'var': 'user[items][]' }] }
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
cell.panels_vertical childViews: ->(vertical) do
|
|
54
|
+
vertical.h3 text: "Title #{item}"
|
|
55
|
+
vertical.spacer height: 4
|
|
56
|
+
vertical.label text: "Subtitle #{item}"
|
|
57
|
+
end
|
|
28
58
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
59
|
+
cell.panels_horizontal childViews: ->(vertical) do
|
|
60
|
+
vertical.label text: "Left #{item}"
|
|
61
|
+
vertical.spacer width: 10
|
|
62
|
+
vertical.label text: "Right #{item}"
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
cell.panels_ul childViews: ->(ul) do
|
|
66
|
+
ul.label text: "Item A#{item}"
|
|
67
|
+
ul.label text: "Item B#{item}"
|
|
68
|
+
end
|
|
69
|
+
end
|
|
32
70
|
end
|
|
33
71
|
end
|
|
34
|
-
|
|
72
|
+
]
|
|
73
|
+
|
|
74
|
+
form.fields_submit id: 'submit_button', text: 'Submit'
|
|
35
75
|
end
|
|
36
|
-
|
|
76
|
+
end
|
|
@@ -23,9 +23,9 @@ page.body childViews: ->(body) do
|
|
|
23
23
|
end
|
|
24
24
|
end
|
|
25
25
|
hori.spacer width: 4
|
|
26
|
-
hori.button text: 'logics/set', onClick: ->(action) do
|
|
27
|
-
|
|
28
|
-
end
|
|
26
|
+
# hori.button text: 'logics/set', onClick: ->(action) do
|
|
27
|
+
# action.logics_set targetId: 'date', conditionalData: { value: { "+": [{ "var": ['user[date]'] }, 60 * 60 * 24 * 3] } }
|
|
28
|
+
# end
|
|
29
29
|
hori.spacer width: 4
|
|
30
30
|
hori.button text: 'components/replace', onClick: ->(action) do
|
|
31
31
|
action.runMultiple childActions: ->(saction) do
|
|
@@ -73,8 +73,8 @@ page.body childViews: ->(body) do
|
|
|
73
73
|
validation = { required: { message: 'Required' } }
|
|
74
74
|
options = ['option1', 'option2', 'option3', 'option4'].map { |option| { 'text'=> option.humanize, 'value' => option } }
|
|
75
75
|
|
|
76
|
-
form.fields_date width: 'matchParent', name: 'user[date]', id: 'date', value: Date.new(2024, 7, 24), validation: validation
|
|
77
|
-
form.hr width: 'matchParent'
|
|
76
|
+
# form.fields_date width: 'matchParent', name: 'user[date]', id: 'date', value: Date.new(2024, 7, 24), validation: validation
|
|
77
|
+
# form.hr width: 'matchParent'
|
|
78
78
|
form.fields_select clearable: true, multiple: true, width: 'matchParent', name: 'user[select][]', id: 'select', options: options, value: ['option1', 'option2'], validation: validation
|
|
79
79
|
form.hr width: 'matchParent'
|
|
80
80
|
form.panels_flow innerPadding: { bottom: 0 }, width: 'matchParent', id: 'select1', childViews: ->(flow) do
|
|
File without changes
|
|
@@ -39,10 +39,10 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
|
|
|
39
39
|
dialog.body padding: glib_json_padding_body, childViews: ->(view) do
|
|
40
40
|
view.panels_responsive styleClass: 'popover-menu', width: 200, childViews: ->(res) do
|
|
41
41
|
res.label text: 'Item 1', styleClass: 'popover-menu-item', onClick: ->(saction) do
|
|
42
|
-
saction.windows_open url: '
|
|
42
|
+
saction.windows_open url: json_ui_garage_url(path: 'pages/index')
|
|
43
43
|
end
|
|
44
44
|
res.label text: 'Item 2', styleClass: 'popover-menu-item', onClick: ->(saction) do
|
|
45
|
-
saction.
|
|
45
|
+
saction.windows_open url: json_ui_garage_url(path: 'home/blank')
|
|
46
46
|
end
|
|
47
47
|
res.label text: 'Item 3', styleClass: 'popover-menu-item', onClick: ->(saction) do
|
|
48
48
|
saction.popovers_close key: 'menu'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/lib/glib/dynamic_text.rb
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
module Glib
|
|
2
|
+
module JsonCrawler
|
|
3
|
+
class DialogsClose < ActionCrawler
|
|
4
|
+
def initialize(http, args, action)
|
|
5
|
+
super(http)
|
|
6
|
+
|
|
7
|
+
@http.router.log action, nil
|
|
8
|
+
if (on_close = args.fetch('onClose', nil))
|
|
9
|
+
perform(on_close)
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -14,6 +14,7 @@ module Glib
|
|
|
14
14
|
def initialize(context, user, router)
|
|
15
15
|
@context = context
|
|
16
16
|
@history = []
|
|
17
|
+
@content_history = []
|
|
17
18
|
@response_times = []
|
|
18
19
|
@user = user
|
|
19
20
|
@router = router
|
|
@@ -51,6 +52,12 @@ module Glib
|
|
|
51
52
|
def fetch(method, url, action, params = {}, inspect_result = true)
|
|
52
53
|
return nil if url.blank?
|
|
53
54
|
|
|
55
|
+
if (last_record = @content_history.last)
|
|
56
|
+
previous_url = last_record[:url]
|
|
57
|
+
else
|
|
58
|
+
previous_url = nil
|
|
59
|
+
end
|
|
60
|
+
|
|
54
61
|
if method == :get
|
|
55
62
|
return nil if history.include?(url)
|
|
56
63
|
|
|
@@ -64,7 +71,8 @@ module Glib
|
|
|
64
71
|
http_header = {
|
|
65
72
|
'Client-DeviceOS' => user[:device],
|
|
66
73
|
'Client-Version' => user[:version],
|
|
67
|
-
'X-CSRF-Token' => user[:token]
|
|
74
|
+
'X-CSRF-Token' => user[:token],
|
|
75
|
+
'Referer' => previous_url
|
|
68
76
|
}
|
|
69
77
|
http_header.merge!(params[:headers]) if params[:headers].present?
|
|
70
78
|
|
|
@@ -76,7 +84,15 @@ module Glib
|
|
|
76
84
|
begin
|
|
77
85
|
@context.send(method, url, params: params, headers: http_header)
|
|
78
86
|
raw_response = @context.response
|
|
79
|
-
|
|
87
|
+
body = raw_response.body
|
|
88
|
+
response = Response.new(raw_response.code.to_i, raw_response.headers, raw_response.media_type, body)
|
|
89
|
+
|
|
90
|
+
if method == :get
|
|
91
|
+
@content_history << {
|
|
92
|
+
url: url,
|
|
93
|
+
response: body
|
|
94
|
+
}
|
|
95
|
+
end
|
|
80
96
|
|
|
81
97
|
if (controller = @context.controller)
|
|
82
98
|
Glib::JsonCrawler::Coverage.coverage_files.add(controller.class.instance_method(controller.action_name).source_location.first)
|
|
@@ -90,7 +106,14 @@ module Glib
|
|
|
90
106
|
end
|
|
91
107
|
|
|
92
108
|
if !response
|
|
109
|
+
crash_log_file = Rails.root.join('tmp', "crash-#{DateTime.current.to_fs(:number)}.log")
|
|
110
|
+
puts
|
|
93
111
|
puts "Crashed on #{url}"
|
|
112
|
+
puts "Referrer: #{previous_url}"
|
|
113
|
+
if last_record
|
|
114
|
+
File.write(crash_log_file, last_record[:response])
|
|
115
|
+
puts "Previous page's content logged to #{crash_log_file}"
|
|
116
|
+
end
|
|
94
117
|
raise
|
|
95
118
|
end
|
|
96
119
|
end
|
|
@@ -21,6 +21,8 @@ module Glib
|
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
def assert_target_ids_exist(args)
|
|
24
|
+
# This saves targetId so that later we can check to make sure that it indeed exists
|
|
25
|
+
# within the page.
|
|
24
26
|
if (target_ids = args['targetIds'])
|
|
25
27
|
target_ids.each do |target_id|
|
|
26
28
|
@visitor.defer_action(nil, target_id)
|
|
@@ -105,6 +107,8 @@ module Glib
|
|
|
105
107
|
JsonCrawler::FormsSubmit.new(http, params)
|
|
106
108
|
when 'dialogs/alert-v1', 'dialogs/alert'
|
|
107
109
|
JsonCrawler::DialogsAlert.new(http, params, action)
|
|
110
|
+
when 'dialogs/close-v1', 'dialogs/close', 'popovers/close', 'popovers/close-v1'
|
|
111
|
+
JsonCrawler::DialogsClose.new(http, params, action)
|
|
108
112
|
else
|
|
109
113
|
unless [
|
|
110
114
|
'http/delete-v1',
|
data/lib/glib/json_crawler.rb
CHANGED
|
@@ -8,6 +8,7 @@ require_relative './json_crawler/action_crawlers/windows_open'
|
|
|
8
8
|
require_relative './json_crawler/action_crawlers/action_http'
|
|
9
9
|
require_relative './json_crawler/action_crawlers/forms_submit'
|
|
10
10
|
require_relative './json_crawler/action_crawlers/dialogs_alert'
|
|
11
|
+
require_relative './json_crawler/action_crawlers/dialogs_close'
|
|
11
12
|
require_relative './json_crawler/action_crawlers/dialogs_show'
|
|
12
13
|
require_relative './json_crawler/action_crawlers/menu'
|
|
13
14
|
require_relative './json_crawler/action_crawlers/run_multiple'
|
data/lib/glib/value.rb
CHANGED
|
File without changes
|
data/lib/glib/version.rb
CHANGED
|
File without changes
|
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.10.
|
|
4
|
+
version: 4.10.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- ''
|
|
@@ -354,6 +354,7 @@ files:
|
|
|
354
354
|
- lib/glib/json_crawler/action_crawler.rb
|
|
355
355
|
- lib/glib/json_crawler/action_crawlers/action_http.rb
|
|
356
356
|
- lib/glib/json_crawler/action_crawlers/dialogs_alert.rb
|
|
357
|
+
- lib/glib/json_crawler/action_crawlers/dialogs_close.rb
|
|
357
358
|
- lib/glib/json_crawler/action_crawlers/dialogs_show.rb
|
|
358
359
|
- lib/glib/json_crawler/action_crawlers/forms_submit.rb
|
|
359
360
|
- lib/glib/json_crawler/action_crawlers/menu.rb
|
|
@@ -388,7 +389,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
388
389
|
- !ruby/object:Gem::Version
|
|
389
390
|
version: '0'
|
|
390
391
|
requirements: []
|
|
391
|
-
|
|
392
|
+
rubyforge_project:
|
|
393
|
+
rubygems_version: 2.7.6
|
|
392
394
|
signing_key:
|
|
393
395
|
specification_version: 4
|
|
394
396
|
summary: ''
|