glib-web 0.4.71 → 0.5.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 +5 -5
- data/app/controllers/concerns/glib/auth/policy.rb +0 -0
- data/app/controllers/concerns/glib/json/libs.rb +30 -7
- data/app/controllers/concerns/glib/json/new_dynamic_text.rb +0 -0
- data/app/controllers/concerns/glib/json/traversal.rb +0 -0
- data/app/controllers/glib/home_controller.rb +0 -0
- data/app/helpers/glib/dynamic_images_helper.rb +0 -0
- data/app/helpers/glib/dynamic_texts_helper.rb +0 -0
- data/app/helpers/glib/forms_helper.rb +0 -0
- data/app/helpers/glib/json_ui/abstract_builder.rb +0 -0
- data/app/helpers/glib/json_ui/action_builder.rb +0 -18
- data/app/helpers/glib/json_ui/action_builder/dialogs.rb +0 -0
- data/app/helpers/glib/json_ui/action_builder/http.rb +19 -0
- data/app/helpers/glib/json_ui/action_builder/sheets.rb +0 -0
- data/app/helpers/glib/json_ui/action_builder/snackbars.rb +0 -0
- data/app/helpers/glib/json_ui/action_builder/windows.rb +0 -0
- data/app/helpers/glib/json_ui/generic_builders.rb +0 -0
- data/app/helpers/glib/json_ui/list_builders.rb +0 -0
- data/app/helpers/glib/json_ui/menu_builder.rb +1 -0
- data/app/helpers/glib/json_ui/page_helper.rb +0 -0
- data/app/helpers/glib/json_ui/response_helper.rb +0 -0
- data/app/helpers/glib/json_ui/split_builders.rb +0 -0
- data/app/helpers/glib/json_ui/styling_helper.rb +0 -0
- data/app/helpers/glib/json_ui/table_builders.rb +0 -0
- data/app/helpers/glib/json_ui/view_builder.rb +0 -0
- data/app/helpers/glib/json_ui/view_builder/banners.rb +0 -0
- data/app/helpers/glib/json_ui/view_builder/fields.rb +0 -0
- data/app/helpers/glib/json_ui/view_builder/panels.rb +4 -3
- 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/policies/glib/application_policy.rb +0 -0
- data/app/validators/email_typo_validator.rb +23 -23
- data/app/validators/email_validator.rb +0 -0
- data/app/validators/url_validator.rb +0 -0
- data/app/views/app/views/json_ui/vue/renderer.html.erb +0 -0
- data/app/views/json_ui/garage/_nav_menu.json.jbuilder +0 -0
- data/app/views/json_ui/garage/actions/_dialogs.json.jbuilder +0 -0
- data/app/views/json_ui/garage/actions/_http.json.jbuilder +18 -0
- data/app/views/json_ui/garage/actions/_reload.json.jbuilder +17 -0
- data/app/views/json_ui/garage/actions/_sheets.json.jbuilder +0 -0
- data/app/views/json_ui/garage/actions/_snackbars.json.jbuilder +0 -0
- data/app/views/json_ui/garage/actions/_timeouts.json.jbuilder +0 -0
- data/app/views/json_ui/garage/actions/_windows.json.jbuilder +0 -0
- data/app/views/json_ui/garage/actions/index.json.jbuilder +3 -18
- data/app/views/json_ui/garage/forms/_alert_post_data.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/basic.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/basic_post.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/checkboxes.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/dynamic_group.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/dynamic_select.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/dynamic_select_data.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/file_upload.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/floating_submit.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/generic_post.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/get_request.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/index.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/pickers.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/rich_text.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/selects.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/show_hide.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/styled_boxes.json.jbuilder +0 -0
- 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/forms/text_validation.json.jbuilder +0 -0
- data/app/views/json_ui/garage/home/blank.json.jbuilder +0 -0
- data/app/views/json_ui/garage/home/index.json.jbuilder +0 -0
- data/app/views/json_ui/garage/home/slow.json.jbuilder +0 -0
- data/app/views/json_ui/garage/lists/_infinite_scroll_section.json.jbuilder +0 -0
- data/app/views/json_ui/garage/lists/edit_actions.json.jbuilder +0 -0
- data/app/views/json_ui/garage/lists/fab.json.jbuilder +0 -0
- data/app/views/json_ui/garage/lists/index.json.jbuilder +0 -0
- data/app/views/json_ui/garage/lists/infinite_scroll.json.jbuilder +0 -0
- data/app/views/json_ui/garage/lists/templating.json.jbuilder +1 -1
- data/app/views/json_ui/garage/notifications/web_socket.json.jbuilder +0 -0
- data/app/views/json_ui/garage/pages/flat_centered.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 +10 -11
- data/app/views/json_ui/garage/pages/index.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/nav_buttons.json.jbuilder +0 -0
- data/app/views/json_ui/garage/pages/tab_bar.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/carousel.json.jbuilder +0 -0
- data/app/views/json_ui/garage/panels/custom.json.jbuilder +0 -0
- data/app/views/json_ui/garage/panels/flow.json.jbuilder +0 -0
- data/app/views/json_ui/garage/panels/horizontal.json.jbuilder +0 -0
- data/app/views/json_ui/garage/panels/index.json.jbuilder +0 -0
- data/app/views/json_ui/garage/panels/outlined.json.jbuilder +0 -0
- data/app/views/json_ui/garage/panels/responsive.json.jbuilder +0 -0
- data/app/views/json_ui/garage/panels/split.json.jbuilder +0 -0
- data/app/views/json_ui/garage/panels/vertical.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/export_import.json.jbuilder +0 -0
- data/app/views/json_ui/garage/tables/horizontal_scroll.json.jbuilder +0 -0
- data/app/views/json_ui/garage/tables/index.json.jbuilder +0 -0
- data/app/views/json_ui/garage/tables/layout.json.jbuilder +0 -0
- data/app/views/json_ui/garage/views/banners.json.jbuilder +0 -0
- data/app/views/json_ui/garage/views/calendar_data.json.jbuilder +0 -0
- data/app/views/json_ui/garage/views/carousels.json.jbuilder +0 -0
- data/app/views/json_ui/garage/views/charts.json.jbuilder +0 -0
- data/app/views/json_ui/garage/views/images.json.jbuilder +0 -0
- data/app/views/json_ui/garage/views/index.json.jbuilder +0 -0
- data/app/views/json_ui/garage/views/links.json.jbuilder +0 -0
- data/app/views/json_ui/garage/views/map_data.json.jbuilder +0 -0
- data/app/views/json_ui/garage/views/misc.json.jbuilder +0 -0
- data/app/views/json_ui/garage/views/texts.json.jbuilder +0 -0
- data/config/routes.rb +2 -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-web.rb +1 -0
- data/lib/glib/crypt.rb +1 -1
- data/lib/glib/crypt/utils.rb +0 -0
- data/lib/glib/dynamic_text.rb +1 -1
- data/lib/glib/dynamic_text/config.rb +0 -0
- data/lib/glib/engine.rb +0 -0
- data/lib/glib/json_crawler.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/forms_submit.rb +0 -0
- data/lib/glib/json_crawler/action_crawlers/nav_initiate.rb +0 -0
- data/lib/glib/json_crawler/action_crawlers/windows_open.rb +7 -2
- data/lib/glib/json_crawler/coverage.rb +0 -0
- data/lib/glib/json_crawler/http.rb +4 -8
- data/lib/glib/json_crawler/router.rb +0 -4
- data/lib/glib/test_helpers.rb +40 -0
- data/lib/glib/value.rb +0 -0
- data/lib/glib/version.rb +0 -0
- data/lib/tasks/db.rake +0 -0
- metadata +6 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 92d880220ff29cbee352b8077c541e62b548796b4f1e7ef760f1f3b2967360be
|
|
4
|
+
data.tar.gz: 8d2f3393a965980996dc0408859f130551d7c840a88bd11435ecb48ee64aba99
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a75416c64751c7b4680104e9bcd199bfec7945bf34a4e7cdc58f4fb9deadc16aa1a79e54e0d50dd3f968e133f6583f39fa0ef4979f2bff0e952eabf4ebc65593
|
|
7
|
+
data.tar.gz: f9024d9668c9e6198db90494237f7ca0f2a87199fbe5c1c17d2410f3382b1cd6600c8862aeb700171ab08172704b59bfa6a93359cda6ba57a11bea77f2aa93f3
|
|
File without changes
|
|
@@ -46,14 +46,28 @@ module Glib::Json::Libs
|
|
|
46
46
|
end
|
|
47
47
|
end
|
|
48
48
|
|
|
49
|
-
def
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
def glib_json_handle_403
|
|
50
|
+
render file: Rails.root.join('public', '404.html'), status: :forbidden
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def glib_json_handle_404
|
|
54
|
+
raise ActionController::RoutingError.new('Not Found')
|
|
55
|
+
|
|
56
|
+
# if json_ui_activated?
|
|
57
|
+
# render file: Rails.root.join('public', '404.html'), status: :not_found
|
|
58
|
+
# else
|
|
59
|
+
# raise exception
|
|
60
|
+
# end
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def glib_json_handle_500(exception)
|
|
64
|
+
if json_ui_activated? && Rails.env.production?
|
|
65
|
+
Rollbar.error(exception) if defined?(Rollbar)
|
|
66
|
+
render file: Rails.root.join('public', '500.html'), status: :internal_server_error
|
|
52
67
|
else
|
|
53
68
|
raise exception
|
|
54
69
|
end
|
|
55
70
|
end
|
|
56
|
-
|
|
57
71
|
|
|
58
72
|
|
|
59
73
|
module ClassMethods
|
|
@@ -111,11 +125,20 @@ module Glib::Json::Libs
|
|
|
111
125
|
end
|
|
112
126
|
end
|
|
113
127
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
128
|
+
# Call this before other rescues. Later rescue_from statements will take precedence, so more specific
|
|
129
|
+
# rescues have to be declared later.
|
|
130
|
+
def json_libs_rescue_500
|
|
131
|
+
rescue_from StandardError do |exception|
|
|
132
|
+
glib_json_handle_500(exception)
|
|
117
133
|
end
|
|
118
134
|
end
|
|
119
135
|
|
|
136
|
+
def json_libs_rescue_404
|
|
137
|
+
# Removed because it doesn't seem to offer anything extra
|
|
138
|
+
# rescue_from ActiveRecord::RecordNotFound do |exception|
|
|
139
|
+
# glib_json_handle_404
|
|
140
|
+
# end
|
|
141
|
+
end
|
|
142
|
+
|
|
120
143
|
end
|
|
121
144
|
end
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -75,24 +75,6 @@ module Glib
|
|
|
75
75
|
end
|
|
76
76
|
end
|
|
77
77
|
|
|
78
|
-
module Http
|
|
79
|
-
class Post < Action
|
|
80
|
-
string :url, cache: true
|
|
81
|
-
hash :formData
|
|
82
|
-
end
|
|
83
|
-
|
|
84
|
-
class Patch < Action
|
|
85
|
-
string :url, cache: true
|
|
86
|
-
hash :formData
|
|
87
|
-
end
|
|
88
|
-
|
|
89
|
-
class Delete < Action
|
|
90
|
-
string :url, cache: true
|
|
91
|
-
hash :formData
|
|
92
|
-
end
|
|
93
|
-
|
|
94
|
-
end
|
|
95
|
-
|
|
96
78
|
###
|
|
97
79
|
end
|
|
98
80
|
end
|
|
File without changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
class Glib::JsonUi::ActionBuilder
|
|
2
|
+
module Http
|
|
3
|
+
class Post < Action
|
|
4
|
+
string :url, cache: true
|
|
5
|
+
hash :formData
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
class Patch < Action
|
|
9
|
+
string :url, cache: true
|
|
10
|
+
hash :formData
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
class Delete < Action
|
|
14
|
+
string :url, cache: true
|
|
15
|
+
hash :formData
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
end
|
|
19
|
+
end
|
|
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
|
data/app/models/glib/text.rb
CHANGED
|
File without changes
|
|
File without changes
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
class EmailTypoValidator < ActiveModel::EachValidator
|
|
2
2
|
COMMON_FORMAT = {
|
|
3
3
|
'\.\.' => '.',
|
|
4
|
-
'
|
|
5
|
-
'
|
|
6
|
-
'
|
|
7
|
-
'
|
|
8
|
-
'
|
|
9
|
-
'
|
|
10
|
-
'
|
|
11
|
-
'
|
|
12
|
-
'@hitmail
|
|
13
|
-
'@htomail
|
|
14
|
-
'@hotnail
|
|
15
|
-
'@hotmil
|
|
16
|
-
'@hotmal
|
|
17
|
-
'@hoymail
|
|
18
|
-
'@hormail
|
|
19
|
-
'@hotmsil
|
|
20
|
-
'@gail
|
|
21
|
-
'@gnail
|
|
22
|
-
'@gmil
|
|
23
|
-
'@gmal
|
|
24
|
-
'@gmai
|
|
25
|
-
'@yahho
|
|
26
|
-
'@yaho
|
|
4
|
+
'\.con\z' => '.com',
|
|
5
|
+
'\.coj\z' => '.com',
|
|
6
|
+
'\.vom\z' => '.com',
|
|
7
|
+
'\.xom\z' => '.com',
|
|
8
|
+
'\.com[a-z]\z' => '.com',
|
|
9
|
+
'\.con\.' => '.com.',
|
|
10
|
+
'\.orf\z' => '.org',
|
|
11
|
+
'\.orf\.' => '.org.',
|
|
12
|
+
'@hitmail\.' => '@hotmail.',
|
|
13
|
+
'@htomail\.' => '@hotmail.',
|
|
14
|
+
'@hotnail\.' => '@hotmail.',
|
|
15
|
+
'@hotmil\.' => '@hotmail.',
|
|
16
|
+
'@hotmal\.' => '@hotmail.',
|
|
17
|
+
'@hoymail\.' => '@hotmail.',
|
|
18
|
+
'@hormail\.' => '@hotmail.',
|
|
19
|
+
'@hotmsil\.' => '@hotmail.',
|
|
20
|
+
'@gail\.' => '@gmail.',
|
|
21
|
+
'@gnail\.' => '@gmail.',
|
|
22
|
+
'@gmil\.' => '@gmail.',
|
|
23
|
+
'@gmal\.' => '@gmail.',
|
|
24
|
+
'@gmai\.' => '@gmail.',
|
|
25
|
+
'@yahho\.' => '@yahoo.',
|
|
26
|
+
'@yaho\.' => '@yahoo.',
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
def validate_each(record, attribute, value)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
section.header padding: glib_json_padding_list, childViews: ->(header) do
|
|
3
|
+
header.h3 text: 'HTTP'
|
|
4
|
+
end
|
|
5
|
+
|
|
6
|
+
section.rows builder: ->(template) do
|
|
7
|
+
template.thumbnail title: 'http/post', onClick: ->(action) do
|
|
8
|
+
action.http_post url: json_ui_garage_url(path: 'forms/basic_post'), formData: { 'user[name]' => 'New Joe' }
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
template.thumbnail title: 'http/patch', onClick: ->(action) do
|
|
12
|
+
action.http_patch url: json_ui_garage_url(path: 'forms/basic_post'), formData: { 'user[name]' => 'Edit Joe' }
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
template.thumbnail title: 'http/delete', onClick: ->(action) do
|
|
16
|
+
action.http_delete url: json_ui_garage_url(path: 'forms/basic_post'), formData: { 'user[name]' => 'Delete Joe' }
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
section.header padding: glib_json_padding_list, childViews: ->(header) do
|
|
2
|
+
header.h3 text: 'Reload'
|
|
3
|
+
header.spacer height: 6
|
|
4
|
+
header.label text: 'Reload does not open a new page/screen. Click reload a few times, then click back and notice that it goes back to the page before the reload.'
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
section.rows builder: ->(template) do
|
|
8
|
+
template.thumbnail title: "windows/reload (timestamp: #{DateTime.current.to_i})", onClick: ->(action) do
|
|
9
|
+
action.windows_reload
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
reload_counter = params[:reload_counter].to_i
|
|
13
|
+
reload_counter = 0 if reload_counter > 5
|
|
14
|
+
template.thumbnail title: "windows/reload with URL (counter: #{reload_counter})", onClick: ->(action) do
|
|
15
|
+
action.windows_reload url: json_ui_garage_url(path: 'actions/index', reload_counter: reload_counter + 1)
|
|
16
|
+
end
|
|
17
|
+
end
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -15,24 +15,9 @@ json_ui_page json do |page|
|
|
|
15
15
|
end, ->(section) do
|
|
16
16
|
render "#{@path_prefix}/actions/timeouts", section: section
|
|
17
17
|
end, ->(section) do
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
header.label text: 'Reload does not open a new page/screen. Click reload a few times, then click back and notice that it goes back to the page before the reload.'
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
section.rows builder: ->(template) do
|
|
25
|
-
template.thumbnail title: "windows/reload (timestamp: #{DateTime.current.to_i})", onClick: ->(action) do
|
|
26
|
-
action.windows_reload
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
reload_counter = params[:reload_counter].to_i
|
|
30
|
-
reload_counter = 0 if reload_counter > 5
|
|
31
|
-
template.thumbnail title: "windows/reload with URL (counter: #{reload_counter})", onClick: ->(action) do
|
|
32
|
-
action.windows_reload url: json_ui_garage_url(path: 'actions/index', reload_counter: reload_counter + 1)
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
end
|
|
18
|
+
render "#{@path_prefix}/actions/http", section: section
|
|
19
|
+
end, ->(section) do
|
|
20
|
+
render "#{@path_prefix}/actions/reload", section: section
|
|
36
21
|
end
|
|
37
22
|
]
|
|
38
23
|
end
|
|
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
|
|
@@ -14,7 +14,7 @@ json_ui_page json do |page|
|
|
|
14
14
|
end
|
|
15
15
|
template.thumbnail title: 'Item with subtitle', subtitle: 'Item subtitle'
|
|
16
16
|
template.thumbnail title: 'Item with chips', chips: ->(menu) do
|
|
17
|
-
menu.button text: '
|
|
17
|
+
menu.button text: 'Finished', styleClass: 'info'
|
|
18
18
|
menu.button props: { text: 'Succeeded', styleClass: 'success' }
|
|
19
19
|
end
|
|
20
20
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
json.title 'Pages'
|
|
2
2
|
|
|
3
|
-
json_ui_page json
|
|
4
|
-
|
|
3
|
+
page = json_ui_page json
|
|
4
|
+
render "#{@path_prefix}/nav_menu", json: json, page: page
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
page.header padding: glib_json_padding_body, backgroundColor: '#b3bac2', childViews: ->(header) do
|
|
7
|
+
header.h1 text: 'Header'
|
|
8
|
+
end
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
page.body height: 'matchParent', padding: glib_json_padding_body, childViews: ->(body) do
|
|
11
|
+
body.button width: 'matchParent', height: 'matchParent', text: 'Full Width/Height'
|
|
12
|
+
end
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
end
|
|
14
|
+
page.footer height: 80, padding: glib_json_padding_body, backgroundColor: '#b3bac2', childViews: ->(footer) do
|
|
15
|
+
footer.h1 text: 'Footer'
|
|
17
16
|
end
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/config/routes.rb
CHANGED
|
@@ -2,5 +2,7 @@ Glib::Web::Engine.routes.draw do
|
|
|
2
2
|
scope module: :glib do
|
|
3
3
|
get 'json_ui_garage', to: 'home#json_ui_garage'
|
|
4
4
|
post 'json_ui_garage', to: 'home#json_ui_garage'
|
|
5
|
+
patch 'json_ui_garage', to: 'home#json_ui_garage'
|
|
6
|
+
delete 'json_ui_garage', to: 'home#json_ui_garage'
|
|
5
7
|
end
|
|
6
8
|
end
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/lib/glib-web.rb
CHANGED
data/lib/glib/crypt.rb
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
require_relative './crypt/utils'
|
|
1
|
+
require_relative './crypt/utils'
|
data/lib/glib/crypt/utils.rb
CHANGED
|
File without changes
|
data/lib/glib/dynamic_text.rb
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
require_relative './dynamic_text/config'
|
|
1
|
+
require_relative './dynamic_text/config'
|
|
File without changes
|
data/lib/glib/engine.rb
CHANGED
|
File without changes
|
data/lib/glib/json_crawler.rb
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -12,11 +12,16 @@ module Glib
|
|
|
12
12
|
crawl json['footer']&.[]('childViews')
|
|
13
13
|
|
|
14
14
|
json['rightNavButtons']&.each do |button|
|
|
15
|
-
|
|
15
|
+
if button['buttons'].present?
|
|
16
|
+
button['buttons'].each do |inner_button|
|
|
17
|
+
click inner_button
|
|
18
|
+
end
|
|
19
|
+
else
|
|
20
|
+
click button
|
|
21
|
+
end
|
|
16
22
|
end
|
|
17
23
|
end
|
|
18
24
|
end
|
|
19
|
-
|
|
20
25
|
end
|
|
21
26
|
end
|
|
22
27
|
end
|
|
File without changes
|
|
@@ -40,14 +40,6 @@ module Glib
|
|
|
40
40
|
fetch(:delete, url, action, {})
|
|
41
41
|
end
|
|
42
42
|
|
|
43
|
-
def controller
|
|
44
|
-
@context.integration_session.controller
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
def action_name
|
|
48
|
-
controller.action_name.to_sym
|
|
49
|
-
end
|
|
50
|
-
|
|
51
43
|
private
|
|
52
44
|
Response = Struct.new :code, :headers, :media_type, :body do
|
|
53
45
|
def initialize(*)
|
|
@@ -83,6 +75,10 @@ module Glib
|
|
|
83
75
|
@context.send(method, url, params: params, headers: http_header)
|
|
84
76
|
raw_response = @context.response
|
|
85
77
|
response = Response.new(raw_response.code.to_i, raw_response.headers, raw_response.media_type, raw_response.body)
|
|
78
|
+
|
|
79
|
+
if (controller = @context.controller)
|
|
80
|
+
Glib::JsonCrawler::Coverage.coverage_files.add(controller.class.instance_method(controller.action_name).source_location.first)
|
|
81
|
+
end
|
|
86
82
|
rescue => ex
|
|
87
83
|
if !inspect_result
|
|
88
84
|
case ex
|
|
@@ -19,10 +19,6 @@ module Glib
|
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
def step(http, args)
|
|
22
|
-
if (controller = http.controller)
|
|
23
|
-
Glib::JsonCrawler::Coverage.coverage_files.add(controller.class.instance_method(http.action_name).source_location.first)
|
|
24
|
-
end
|
|
25
|
-
|
|
26
22
|
case args['view']
|
|
27
23
|
when 'fields/submit-v1', 'fields/submit'
|
|
28
24
|
@depth += 1
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
module Glib
|
|
2
|
+
module TestHelpers
|
|
3
|
+
def response_assert_equal
|
|
4
|
+
expected = __get_previous_result_from_git
|
|
5
|
+
result = __log(response.body)
|
|
6
|
+
assert_equal JSON.parse(expected), JSON.parse(result), "Result mismatch! #{__git_is_available? ? `git diff #{__log_dir}/#{__log_file}` : ''}"
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
private
|
|
10
|
+
def __git_is_available?
|
|
11
|
+
@__git_is_available ||= (`git status 2>&1` =~ /fatal/).nil?
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def __log_dir
|
|
15
|
+
if @__log_dir.nil?
|
|
16
|
+
@__log_dir = File.expand_path("controllers/#{self.class.to_s.underscore}_results", File.dirname(__FILE__))
|
|
17
|
+
unless File.directory?(@__log_dir)
|
|
18
|
+
FileUtils.mkdir_p(@__log_dir)
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
@__log_dir
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def __log_file
|
|
25
|
+
@__log_file ||= "#{self.method_name}.json"
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def __log json
|
|
29
|
+
File.open("#{File.join(__log_dir, __log_file)}", "w") do |f|
|
|
30
|
+
f << JSON.pretty_generate( JSON.parse(json) )
|
|
31
|
+
end
|
|
32
|
+
json
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def __get_previous_result_from_git
|
|
36
|
+
`git checkout -- "#{File.join(__log_dir, __log_file)}" > /dev/null 2>&1` if __git_is_available?
|
|
37
|
+
File.exists?(File.join(__log_dir, __log_file)) ? File.open(File.join(__log_dir, __log_file)).read : "\{\}"
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
data/lib/glib/value.rb
CHANGED
|
File without changes
|
data/lib/glib/version.rb
CHANGED
|
File without changes
|
data/lib/tasks/db.rake
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: 0.
|
|
4
|
+
version: 0.5.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- ''
|
|
@@ -79,6 +79,7 @@ files:
|
|
|
79
79
|
- app/helpers/glib/json_ui/abstract_builder.rb
|
|
80
80
|
- app/helpers/glib/json_ui/action_builder.rb
|
|
81
81
|
- app/helpers/glib/json_ui/action_builder/dialogs.rb
|
|
82
|
+
- app/helpers/glib/json_ui/action_builder/http.rb
|
|
82
83
|
- app/helpers/glib/json_ui/action_builder/sheets.rb
|
|
83
84
|
- app/helpers/glib/json_ui/action_builder/snackbars.rb
|
|
84
85
|
- app/helpers/glib/json_ui/action_builder/windows.rb
|
|
@@ -107,6 +108,8 @@ files:
|
|
|
107
108
|
- app/views/app/views/json_ui/vue/renderer.html.erb
|
|
108
109
|
- app/views/json_ui/garage/_nav_menu.json.jbuilder
|
|
109
110
|
- app/views/json_ui/garage/actions/_dialogs.json.jbuilder
|
|
111
|
+
- app/views/json_ui/garage/actions/_http.json.jbuilder
|
|
112
|
+
- app/views/json_ui/garage/actions/_reload.json.jbuilder
|
|
110
113
|
- app/views/json_ui/garage/actions/_sheets.json.jbuilder
|
|
111
114
|
- app/views/json_ui/garage/actions/_snackbars.json.jbuilder
|
|
112
115
|
- app/views/json_ui/garage/actions/_timeouts.json.jbuilder
|
|
@@ -209,6 +212,7 @@ files:
|
|
|
209
212
|
- lib/glib/json_crawler/coverage.rb
|
|
210
213
|
- lib/glib/json_crawler/http.rb
|
|
211
214
|
- lib/glib/json_crawler/router.rb
|
|
215
|
+
- lib/glib/test_helpers.rb
|
|
212
216
|
- lib/glib/value.rb
|
|
213
217
|
- lib/glib/version.rb
|
|
214
218
|
- lib/tasks/db.rake
|
|
@@ -230,8 +234,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
230
234
|
- !ruby/object:Gem::Version
|
|
231
235
|
version: '0'
|
|
232
236
|
requirements: []
|
|
233
|
-
|
|
234
|
-
rubygems_version: 2.6.8
|
|
237
|
+
rubygems_version: 3.1.2
|
|
235
238
|
signing_key:
|
|
236
239
|
specification_version: 4
|
|
237
240
|
summary: ''
|