glib-web 4.10.2 → 4.10.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/concerns/glib/json/new_dynamic_text.rb +0 -0
  3. data/app/helpers/glib/app_feature_support_helper.rb +0 -0
  4. data/app/helpers/glib/dynamic_texts_helper.rb +0 -0
  5. data/app/helpers/glib/json_ui/abstract_builder.rb +20 -0
  6. data/app/helpers/glib/json_ui/action_builder/sheets.rb +0 -0
  7. data/app/helpers/glib/json_ui/analytics_helper.rb +0 -0
  8. data/app/helpers/glib/json_ui/generic_builders.rb +0 -0
  9. data/app/helpers/glib/json_ui/view_builder/fields.rb +1 -1
  10. data/app/helpers/glib/json_ui/view_builder/panels.rb +1 -1
  11. data/app/models/concerns/glib/enum_humanization.rb +1 -1
  12. data/app/models/glib/active_storage/attachment.rb +0 -0
  13. data/app/models/glib/active_storage/blob.rb +0 -0
  14. data/app/models/glib/dynamic_text_record.rb +0 -0
  15. data/app/models/glib/text.rb +0 -0
  16. data/app/validators/email_typo_validator.rb +0 -0
  17. data/app/validators/email_validator.rb +0 -0
  18. data/app/validators/url_validator.rb +0 -0
  19. data/app/views/json_ui/garage/actions/dialogs_oauth_post.json.jbuilder +0 -0
  20. data/app/views/json_ui/garage/forms/bulk_edit_post.json.jbuilder +0 -0
  21. data/app/views/json_ui/garage/forms/dynamic_select_data.json.jbuilder +0 -0
  22. data/app/views/json_ui/garage/forms/generic_post.json.jbuilder +0 -0
  23. data/app/views/json_ui/garage/forms/submission_flow.json.jbuilder +0 -0
  24. data/app/views/json_ui/garage/forms/submission_flow_post.json.jbuilder +0 -0
  25. data/app/views/json_ui/garage/forms/submission_indicator.json.jbuilder +0 -0
  26. data/app/views/json_ui/garage/forms/submission_indicator_post.json.jbuilder +0 -0
  27. data/app/views/json_ui/garage/home/blank.json.jbuilder +0 -0
  28. data/app/views/json_ui/garage/home/slow.json.jbuilder +0 -0
  29. data/app/views/json_ui/garage/lists/autoload_all.json.jbuilder +0 -0
  30. data/app/views/json_ui/garage/lists/autoload_as_needed.json.jbuilder +0 -0
  31. data/app/views/json_ui/garage/lists/chat_ui.json.jbuilder +0 -0
  32. data/app/views/json_ui/garage/lists/fab.json.jbuilder +0 -0
  33. data/app/views/json_ui/garage/notifications/web_socket.json.jbuilder +0 -0
  34. data/app/views/json_ui/garage/pages/custom_style_class.json.jbuilder +0 -0
  35. data/app/views/json_ui/garage/pages/full_width.json.jbuilder +0 -0
  36. data/app/views/json_ui/garage/pages/full_width_height.json.jbuilder +0 -0
  37. data/app/views/json_ui/garage/pages/layout.json.jbuilder +0 -0
  38. data/app/views/json_ui/garage/pages/loading_indicator.json.jbuilder +0 -0
  39. data/app/views/json_ui/garage/pages/nested_scroll.json.jbuilder +0 -0
  40. data/app/views/json_ui/garage/pages/redirect_onload.json.jbuilder +0 -0
  41. data/app/views/json_ui/garage/panels/_styled.json.jbuilder +0 -0
  42. data/app/views/json_ui/garage/panels/card.json.jbuilder +0 -0
  43. data/app/views/json_ui/garage/panels/custom.json.jbuilder +0 -0
  44. data/app/views/json_ui/garage/panels/outlined.json.jbuilder +0 -0
  45. data/app/views/json_ui/garage/services/dynamic_text.json.jbuilder +0 -0
  46. data/app/views/json_ui/garage/services/image.json.jbuilder +0 -0
  47. data/app/views/json_ui/garage/services/index.json.jbuilder +0 -0
  48. data/app/views/json_ui/garage/tables/_autoload_section.json.jbuilder +0 -0
  49. data/app/views/json_ui/garage/tables/autoload_all.json.jbuilder +0 -0
  50. data/app/views/json_ui/garage/tables/autoload_as_needed.json.jbuilder +0 -0
  51. data/app/views/json_ui/garage/tables/export_import.json.jbuilder +0 -0
  52. data/app/views/json_ui/garage/tables/index.json.jbuilder +0 -0
  53. data/app/views/json_ui/garage/views/calendar_data.json.jbuilder +0 -0
  54. data/app/views/json_ui/garage/views/controls.json.jbuilder +2 -2
  55. data/app/views/json_ui/garage/views/map_data.json.jbuilder +0 -0
  56. data/app/views/json_ui/garage/views/multimedia.json.jbuilder +0 -0
  57. data/app/views/layouts/json_ui/no_custom.html.erb +0 -0
  58. data/app/views/layouts/json_ui/renderer.html.erb +0 -1
  59. data/lib/generators/glib/install_generator.rb +0 -0
  60. data/lib/generators/templates/20191017062519_create_texts.rb +0 -0
  61. data/lib/generators/templates/20191024063257_add_scope_to_texts.rb +0 -0
  62. data/lib/generators/templates/20191112095018_add_lang_to_texts.rb +0 -0
  63. data/lib/generators/templates/20191126071051_create_active_storage_tables.active_storage.rb +0 -0
  64. data/lib/generators/templates/database.yml +0 -0
  65. data/lib/generators/templates/dynamic_text.rb +0 -0
  66. data/lib/glib/dynamic_text/config.rb +0 -0
  67. data/lib/glib/dynamic_text.rb +0 -0
  68. data/lib/glib/json_crawler/action_crawler.rb +0 -0
  69. data/lib/glib/json_crawler/action_crawlers/action_http.rb +0 -0
  70. data/lib/glib/json_crawler/action_crawlers/dialogs_alert.rb +0 -0
  71. data/lib/glib/json_crawler/action_crawlers/dialogs_close.rb +14 -0
  72. data/lib/glib/json_crawler/action_crawlers/menu.rb +0 -0
  73. data/lib/glib/json_crawler/action_crawlers/run_multiple.rb +0 -0
  74. data/lib/glib/json_crawler/action_crawlers/windows_open.rb +0 -0
  75. data/lib/glib/json_crawler/coverage.rb +0 -0
  76. data/lib/glib/json_crawler/http.rb +25 -2
  77. data/lib/glib/json_crawler/router.rb +2 -0
  78. data/lib/glib/json_crawler.rb +1 -0
  79. data/lib/glib/value.rb +0 -0
  80. data/lib/glib/version.rb +0 -0
  81. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 40fb8120f293f1162be2b6027432444a35b7b321f0db95a6efbcd8d7a52b964c
4
- data.tar.gz: 839a67107c2a77d66fd0ad27dcc8cfb5e77f0754609f609447ec030f2357f07d
3
+ metadata.gz: e69d390e7aa529eb45c0cb1313ea2eaab6215f9bae0ce30c9a0eb4b072303c14
4
+ data.tar.gz: c03d46e44b24765844368c1d76e241380f6ef4cb419d3cf30b5d26a575794f2c
5
5
  SHA512:
6
- metadata.gz: 0e2d195b6f33253b5d2ab3ec2df96cf00d62d2fd56bf08d80f25577ad09526561006391b3c2ce370e80ce2ab18510b468dfa5b0ae46c72483feee395eace6a40
7
- data.tar.gz: 1bc81f15016ee532f0c9395d35318a487807fa5854a546796772dedeaee6edae0183881b997c9495e1a0a044bcb773103794c01b06642c202f3fe72a036a722b
6
+ metadata.gz: fa94ad210b099330240701b7f4a66594eda52ed81b3d18a6a2907085d182b2671134c6df44399b4f5801d1659849f93a4ede489d711704c4d8d570181f69679f
7
+ data.tar.gz: 4eb32759ee6d6ee5ba8c9fc0de3f9d5304c5fcd38804d37d17dcefc8c6feb4f8ccaedd7fb0f065586f72d56e7679ef1b9348b9f76b5bea8472c6377ea19ac251
File without changes
File without changes
@@ -339,8 +339,28 @@ module Glib
339
339
  end
340
340
 
341
341
  def to_color(value)
342
+ known_colors = [
343
+ 'primary',
344
+ 'secondary',
345
+ 'tertiary',
346
+ 'error',
347
+ 'warning',
348
+ 'info',
349
+ 'success',
350
+ 'thin-primary',
351
+ 'thin-secondary',
352
+ 'black',
353
+ 'white',
354
+ 'grey',
355
+ 'soft-grey',
356
+ 'highlight'
357
+ ]
342
358
  value = value&.to_s
343
359
 
360
+ if known_colors.include?(value)
361
+ return value
362
+ end
363
+
344
364
  if value
345
365
  if !Rails.env.production?
346
366
  if !value.match(/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/i)
File without changes
File without changes
File without changes
@@ -222,7 +222,7 @@ class Glib::JsonUi::ViewBuilder
222
222
  end
223
223
 
224
224
  class ChipGroup < AbstractField
225
- string :color
225
+ color :color
226
226
  array :options
227
227
  bool :multiple
228
228
  end
@@ -504,7 +504,7 @@ class Glib::JsonUi::ViewBuilder
504
504
 
505
505
  views :childViews
506
506
 
507
- required :innerPadding
507
+ # required :innerPadding
508
508
  end
509
509
 
510
510
  class Carousel < View
@@ -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
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
@@ -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: 'http://localhost:3000/glib/json_ui_garage?path=pages%2Findex'
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.popovers_close key: 'menu'
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
@@ -9,7 +9,6 @@
9
9
  <%= csrf_meta_tags %>
10
10
 
11
11
  <%= vite_javascript_tag 'vue_renderer', defer: true %>
12
- <%= vite_stylesheet_tag 'vue_renderer' %>
13
12
  <%# TODO: Remove this, for dev only %>
14
13
  <%# <script src="https://cdn.tailwindcss.com"></script> %>
15
14
  <link href="//fonts.googleapis.com/css?family=Material+Icons" rel="stylesheet" />
File without changes
File without changes
File without changes
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
@@ -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
- response = Response.new(raw_response.code.to_i, raw_response.headers, raw_response.media_type, raw_response.body)
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
@@ -107,6 +107,8 @@ module Glib
107
107
  JsonCrawler::FormsSubmit.new(http, params)
108
108
  when 'dialogs/alert-v1', 'dialogs/alert'
109
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)
110
112
  else
111
113
  unless [
112
114
  'http/delete-v1',
@@ -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.2
4
+ version: 4.10.5
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,8 +389,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
388
389
  - !ruby/object:Gem::Version
389
390
  version: '0'
390
391
  requirements: []
391
- rubyforge_project:
392
- rubygems_version: 2.7.6
392
+ rubygems_version: 3.4.6
393
393
  signing_key:
394
394
  specification_version: 4
395
395
  summary: ''