glib-web 0.14.4 → 0.15.0
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/new_dynamic_text.rb +0 -0
- data/app/controllers/concerns/glib/json/traversal.rb +6 -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/forms_helper.rb +0 -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/analytics_helper.rb +0 -0
- data/app/helpers/glib/json_ui/generic_builders.rb +0 -0
- data/app/helpers/glib/json_ui/page_helper.rb +12 -2
- data/app/helpers/glib/json_ui/table_builders.rb +0 -0
- data/app/helpers/glib/urls_helper.rb +0 -0
- 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.json.jbuilder +0 -0
- data/app/views/json_ui/garage/actions/_dialogs_show.json.jbuilder +0 -0
- data/app/views/json_ui/garage/actions/_panels.json.jbuilder +0 -0
- data/app/views/json_ui/garage/actions/_reload.json.jbuilder +0 -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/dialogs_oauth_post.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_data.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/floating_submit.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/{full_window_form.json.jbuilder → full_page_form.json.jbuilder} +2 -5
- data/app/views/json_ui/garage/forms/generic_post.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/index.json.jbuilder +5 -5
- data/app/views/json_ui/garage/forms/show_hide.json.jbuilder +69 -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/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/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 +0 -0
- 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/lifecycle_hooks.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/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/views/calendar_data.json.jbuilder +0 -0
- data/app/views/json_ui/garage/views/links.json.jbuilder +0 -0
- data/app/views/json_ui/garage/views/map_cluster_data.json.jbuilder +0 -0
- 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/config/routes.rb +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/crypt/utils.rb +0 -0
- data/lib/glib/crypt.rb +0 -0
- data/lib/glib/dynamic_text/config.rb +0 -0
- data/lib/glib/dynamic_text.rb +0 -0
- data/lib/glib/engine.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 +13 -1
- data/lib/glib/json_crawler/action_crawlers/menu.rb +0 -0
- data/lib/glib/json_crawler/action_crawlers/nav_initiate.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 +2 -0
- data/lib/glib/json_crawler/coverage.rb +0 -0
- data/lib/glib/json_crawler/router.rb +9 -3
- data/lib/glib/json_crawler.rb +0 -0
- data/lib/glib/mailer_tester.rb +0 -0
- data/lib/glib/value.rb +0 -0
- data/lib/glib/version.rb +0 -0
- data/lib/glib-web.rb +0 -0
- data/lib/tasks/db.rake +0 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 884f9ef9236368bb5739d56715d0aca1196e6d85f905ad258aaf2d7942333d07
|
4
|
+
data.tar.gz: 3c870f312d7cb7b921ca4ff244d247d7c9b7e7f94ae359cd93696f6544c9682c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34f43053111cf3304a15a0311fc0b85031554b7a0c3be65b7795ebab0d438850ad7550eb977c33cc099ba09ea2d06258880aed767b89398b6fe2a8d80327f7f9
|
7
|
+
data.tar.gz: f332e88b5d80b56c7b5fef95fce6551a7ca13a1a7a05b71626161b344d02f594a98c74b19e97d3247e4260c0cb5ab208ec83ac21d516d9ceb644706ddf1d6542
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -174,9 +174,19 @@ module Glib
|
|
174
174
|
end
|
175
175
|
|
176
176
|
def form(options = {})
|
177
|
-
|
178
|
-
|
177
|
+
form = Glib::JsonUi::ViewBuilder::Panels::Form.new(json, self)
|
178
|
+
form.childViews(->(view_builder) {})
|
179
|
+
panel_options = options.slice!(:url, :method, :local, :onSubmit, :paramNameForFormData, :model)
|
180
|
+
|
181
|
+
json.fullPageForm do
|
182
|
+
json.view 'panels/fullPageForm'
|
183
|
+
form.props(options)
|
179
184
|
end
|
185
|
+
|
186
|
+
# So that the containing fields have context (e.g. can use form's model for naming).
|
187
|
+
self.current_form = form
|
188
|
+
scroll panel_options
|
189
|
+
self.current_form = nil
|
180
190
|
end
|
181
191
|
|
182
192
|
def data(options = {})
|
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
|
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/views/json_ui/garage/forms/{full_window_form.json.jbuilder → full_page_form.json.jbuilder}
RENAMED
@@ -4,16 +4,13 @@ page = json_ui_page json
|
|
4
4
|
|
5
5
|
render "#{@path_prefix}/nav_menu", json: json, page: page
|
6
6
|
|
7
|
-
# The form will be automatically injected into the window.
|
8
|
-
#page.template 'full_window_form'
|
9
|
-
|
10
|
-
# TODO: This needs to produce page-level form attributes
|
11
7
|
page.form url: json_ui_garage_url(path: 'forms/basic_post'), method: 'post', padding: glib_json_padding_body, childViews: ->(form) do
|
12
|
-
# page.scroll padding: glib_json_padding_body, childViews: ->(form) do
|
13
8
|
form.fields_text name: 'user[name]', width: 'matchParent', label: 'Name'
|
14
9
|
form.fields_password name: 'user[password]', width: 'matchParent', label: 'Password'
|
15
10
|
end
|
16
11
|
|
17
12
|
page.footer padding: glib_json_padding_body, backgroundColor: '#b3bac2', childViews: ->(footer) do
|
13
|
+
footer.label text: 'This button will submit the form above because this whole page is wrapped in a giant form.'
|
14
|
+
footer.spacer height: 6
|
18
15
|
footer.fields_submit text: 'Submit'
|
19
16
|
end
|
File without changes
|
@@ -91,11 +91,11 @@ page.list sections: [
|
|
91
91
|
action.windows_open url: json_ui_garage_url(path: 'forms/styled_boxes')
|
92
92
|
end
|
93
93
|
end
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
94
|
+
section.rows builder: ->(template) do
|
95
|
+
template.thumbnail title: 'Full Page', onClick: ->(action) do
|
96
|
+
action.windows_open url: json_ui_garage_url(path: 'forms/full_page_form')
|
97
|
+
end
|
98
|
+
end
|
99
99
|
end, ->(section) do
|
100
100
|
section.header padding: glib_json_padding_list, childViews: ->(header) do
|
101
101
|
header.h2 text: 'Web Only'
|
@@ -152,3 +152,72 @@ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', p
|
|
152
152
|
form.fields_submit text: 'Submit'
|
153
153
|
form.spacer height: 40
|
154
154
|
end
|
155
|
+
|
156
|
+
# if text.length > 100
|
157
|
+
# inner_column.panels_form local: true, childViews: ->(form) do
|
158
|
+
# form.markdown \
|
159
|
+
# text: text,
|
160
|
+
# styleClasses: ['many-line'],
|
161
|
+
# showIf: {
|
162
|
+
# "!=": [
|
163
|
+
# {
|
164
|
+
# "var": 'expand[bundle_description]'
|
165
|
+
# },
|
166
|
+
# 'expand'
|
167
|
+
# ]
|
168
|
+
# }
|
169
|
+
# form.markdown \
|
170
|
+
# text: text,
|
171
|
+
# showIf: {
|
172
|
+
# "==": [
|
173
|
+
# {
|
174
|
+
# "var": 'expand[bundle_description]'
|
175
|
+
# },
|
176
|
+
# 'expand'
|
177
|
+
# ]
|
178
|
+
# }
|
179
|
+
# form.fields_check \
|
180
|
+
# width: 'matchParent',
|
181
|
+
# offIcon: 'expand_more',
|
182
|
+
# onIcon: 'expand_less',
|
183
|
+
# label: 'Read more',
|
184
|
+
# onLabel: 'Read less',
|
185
|
+
# checkValue: 'expand',
|
186
|
+
# uncheckValue: nil,
|
187
|
+
# name: 'expand[bundle_description]',
|
188
|
+
# disableDirtyCheck: true
|
189
|
+
# end
|
190
|
+
# else
|
191
|
+
# inner_column.markdown text: text
|
192
|
+
# end
|
193
|
+
|
194
|
+
# panel.panels_form width: 'matchParent', childViews: ->(visibility) do
|
195
|
+
# state = {
|
196
|
+
# has_content: false
|
197
|
+
# }
|
198
|
+
# style_classes ||= nil
|
199
|
+
# style_class ||= nil
|
200
|
+
# padding ||= nil
|
201
|
+
# id ||= nil
|
202
|
+
|
203
|
+
# visibility.banners_select \
|
204
|
+
# id: id,
|
205
|
+
# width: 'matchParent',
|
206
|
+
# styleClass: style_class || (style_classes ? nil : 'warning'),
|
207
|
+
# message: message,
|
208
|
+
# padding: padding,
|
209
|
+
# buttons: ->(menu) do
|
210
|
+
# yield(menu, state)
|
211
|
+
# end,
|
212
|
+
# showIf: {
|
213
|
+
# "==": [
|
214
|
+
# {
|
215
|
+
# "var": 'banner'
|
216
|
+
# },
|
217
|
+
# 'show'
|
218
|
+
# ]
|
219
|
+
# }
|
220
|
+
# visibility.fields_hidden name: 'banner', value: state[:has_content] ? 'show' : 'hide'
|
221
|
+
# end
|
222
|
+
|
223
|
+
|
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
|
File without changes
|
data/config/routes.rb
CHANGED
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/crypt/utils.rb
CHANGED
File without changes
|
data/lib/glib/crypt.rb
CHANGED
File without changes
|
File without changes
|
data/lib/glib/dynamic_text.rb
CHANGED
File without changes
|
data/lib/glib/engine.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
@@ -1,3 +1,4 @@
|
|
1
|
+
|
1
2
|
module Glib
|
2
3
|
module JsonCrawler
|
3
4
|
class FormsSubmit < ActionCrawler
|
@@ -24,7 +25,18 @@ module Glib
|
|
24
25
|
url = view['url']
|
25
26
|
fields = []
|
26
27
|
params = {}
|
27
|
-
|
28
|
+
child_views = view['childViews'] || []
|
29
|
+
|
30
|
+
# If this form is page level, we need to check the child views of the entire page.
|
31
|
+
if view['view'] == 'panels/fullPageForm'
|
32
|
+
child_views += @http.router.page_spec['header']&.[]('childViews') || []
|
33
|
+
child_views += @http.router.page_spec['body']&.[]('childViews') || []
|
34
|
+
child_views += @http.router.page_spec['footer']&.[]('childViews') || []
|
35
|
+
end
|
36
|
+
|
37
|
+
@http.router.crawl_multiple child_views, ->(child) do
|
38
|
+
next if child['template'].present?
|
39
|
+
|
28
40
|
name = child['view']
|
29
41
|
if name.start_with?('fields/')
|
30
42
|
fields << child
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Glib
|
2
2
|
module JsonCrawler
|
3
3
|
class Router
|
4
|
-
attr_reader :read_only_actions, :logger
|
4
|
+
attr_reader :read_only_actions, :logger, :page_spec
|
5
5
|
attr_accessor :host
|
6
6
|
|
7
7
|
def log(action, url, response = nil)
|
@@ -19,6 +19,7 @@ module Glib
|
|
19
19
|
@read_only_actions = Set.new
|
20
20
|
# default rails's development host
|
21
21
|
@host ||= 'localhost:3000'
|
22
|
+
@page_spec = nil
|
22
23
|
end
|
23
24
|
|
24
25
|
def step(http, args)
|
@@ -53,7 +54,8 @@ module Glib
|
|
53
54
|
JsonCrawler::NavInitiate.new(http, params, action)
|
54
55
|
when 'runMultiple-v1', 'runMultiple'
|
55
56
|
JsonCrawler::RunMultiple.new(http, params, action)
|
56
|
-
when 'windows/open-v1', 'dialogs/open-v1', 'windows/reload-v1', 'windows/open',
|
57
|
+
when 'windows/open-v1', 'dialogs/open-v1', 'windows/reload-v1', 'windows/open',
|
58
|
+
'dialogs/open', 'windows/reload', 'windows/openWeb', 'windows/openWeb-v1'
|
57
59
|
if allowed?(params['url'])
|
58
60
|
@read_only_actions.add([action, params['url']])
|
59
61
|
JsonCrawler::WindowsOpen.new(http, params, action)
|
@@ -66,7 +68,6 @@ module Glib
|
|
66
68
|
JsonCrawler::ActionHttp.new(:post, http, params, action)
|
67
69
|
when 'forms/submit-v1', 'forms/submit'
|
68
70
|
forms = @visitor.forms
|
69
|
-
# raise 'Submit action needs to be inside a form' if forms.size < 1
|
70
71
|
JsonCrawler::FormsSubmit.new(http, forms.last)
|
71
72
|
else
|
72
73
|
unless [
|
@@ -93,6 +94,11 @@ module Glib
|
|
93
94
|
@visitor.traverse_multiple views, block
|
94
95
|
end
|
95
96
|
|
97
|
+
def parse_page(spec)
|
98
|
+
@page_spec = spec
|
99
|
+
@visitor.parse_page spec
|
100
|
+
end
|
101
|
+
|
96
102
|
def allowed?(url)
|
97
103
|
regex = Regexp.new("#{host}.+(?<!\.pdf)$")
|
98
104
|
regex.match(url)
|
data/lib/glib/json_crawler.rb
CHANGED
File without changes
|
data/lib/glib/mailer_tester.rb
CHANGED
File without changes
|
data/lib/glib/value.rb
CHANGED
File without changes
|
data/lib/glib/version.rb
CHANGED
File without changes
|
data/lib/glib-web.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.15.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ''
|
@@ -153,7 +153,7 @@ files:
|
|
153
153
|
- app/views/json_ui/garage/forms/dynamic_select_data.json.jbuilder
|
154
154
|
- app/views/json_ui/garage/forms/file_upload.json.jbuilder
|
155
155
|
- app/views/json_ui/garage/forms/floating_submit.json.jbuilder
|
156
|
-
- app/views/json_ui/garage/forms/
|
156
|
+
- app/views/json_ui/garage/forms/full_page_form.json.jbuilder
|
157
157
|
- app/views/json_ui/garage/forms/generic_post.json.jbuilder
|
158
158
|
- app/views/json_ui/garage/forms/index.json.jbuilder
|
159
159
|
- app/views/json_ui/garage/forms/local_request.json.jbuilder
|
@@ -301,7 +301,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
301
301
|
- !ruby/object:Gem::Version
|
302
302
|
version: '0'
|
303
303
|
requirements: []
|
304
|
-
|
304
|
+
rubyforge_project:
|
305
|
+
rubygems_version: 2.7.6
|
305
306
|
signing_key:
|
306
307
|
specification_version: 4
|
307
308
|
summary: ''
|