glib-web 0.5.12 → 0.5.18

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +5 -5
  2. data/app/controllers/concerns/glib/json/traversal.rb +2 -1
  3. data/app/helpers/glib/json_ui/action_builder.rb +10 -0
  4. data/app/helpers/glib/json_ui/list_builders.rb +18 -4
  5. data/app/helpers/glib/json_ui/page_helper.rb +6 -0
  6. data/app/helpers/glib/json_ui/response_helper.rb +0 -0
  7. data/app/helpers/glib/json_ui/view_builder/fields.rb +1 -0
  8. data/app/helpers/glib/json_ui/view_builder/panels.rb +13 -0
  9. data/app/views/json_ui/garage/_nav_menu.json.jbuilder +0 -1
  10. data/app/views/json_ui/garage/actions/_http.json.jbuilder +9 -3
  11. data/app/views/json_ui/garage/actions/_sheets.json.jbuilder +0 -1
  12. data/app/views/json_ui/garage/actions/index.json.jbuilder +0 -0
  13. data/app/views/json_ui/garage/forms/dynamic_group.json.jbuilder +31 -16
  14. data/app/views/json_ui/garage/lists/{_infinite_scroll_section.json.jbuilder → _autoload_section.json.jbuilder} +4 -2
  15. data/app/views/json_ui/garage/lists/autoload_all.json.jbuilder +32 -0
  16. data/app/views/json_ui/garage/lists/{infinite_scroll.json.jbuilder → autoload_as_needed.json.jbuilder} +9 -12
  17. data/app/views/json_ui/garage/lists/chat_ui.json.jbuilder +96 -0
  18. data/app/views/json_ui/garage/lists/edit_actions.json.jbuilder +25 -1
  19. data/app/views/json_ui/garage/lists/fab.json.jbuilder +6 -8
  20. data/app/views/json_ui/garage/lists/index.json.jbuilder +9 -3
  21. data/app/views/json_ui/garage/notifications/android_post.json.jbuilder +56 -0
  22. data/app/views/json_ui/garage/notifications/index.json.jbuilder +11 -0
  23. data/app/views/json_ui/garage/tables/_autoload_section.json.jbuilder +6 -2
  24. data/app/views/json_ui/garage/tables/autoload_all.json.jbuilder +15 -10
  25. data/app/views/json_ui/garage/tables/autoload_as_needed.json.jbuilder +13 -2
  26. data/app/views/json_ui/garage/tables/index.json.jbuilder +3 -3
  27. data/app/views/json_ui/garage/views/banners.json.jbuilder +3 -3
  28. data/app/views/json_ui/garage/views/icons.json.jbuilder +1439 -11
  29. data/app/views/json_ui/garage/views/index.json.jbuilder +6 -3
  30. data/app/views/layouts/json_ui/renderer.html.erb +7 -4
  31. data/lib/generators/templates/20191024063257_add_scope_to_texts.rb +1 -1
  32. data/lib/generators/templates/20191126071051_create_active_storage_tables.active_storage.rb +1 -1
  33. data/lib/generators/templates/dynamic_text.rb +1 -1
  34. data/lib/glib-web.rb +5 -5
  35. data/lib/glib/engine.rb +1 -1
  36. data/lib/glib/json_crawler/action_crawlers/forms_submit.rb +4 -4
  37. data/lib/glib/json_crawler/http.rb +1 -1
  38. data/lib/glib/test_helpers.rb +3 -3
  39. data/lib/glib/value.rb +1 -1
  40. data/lib/glib/version.rb +2 -2
  41. data/lib/tasks/db.rake +11 -11
  42. metadata +7 -5
  43. data/app/views/app/views/json_ui/vue/renderer.html.erb +0 -35
@@ -22,12 +22,15 @@ json_ui_page json do |page|
22
22
  template.thumbnail title: 'Banners', onClick: ->(action) do
23
23
  action.windows_open url: json_ui_garage_url(path: 'views/banners')
24
24
  end
25
- template.thumbnail title: 'Icons', onClick: ->(action) do
26
- action.windows_open url: json_ui_garage_url(path: 'views/icons')
27
- end
28
25
  template.thumbnail title: 'Misc', onClick: ->(action) do
29
26
  action.windows_open url: json_ui_garage_url(path: 'views/misc')
30
27
  end
28
+
29
+ if !Rails.env.test? # Avoid slowing down tests
30
+ template.thumbnail title: 'Icons', onClick: ->(action) do
31
+ action.windows_open url: json_ui_garage_url(path: 'views/icons')
32
+ end
33
+ end
31
34
  end
32
35
  end,
33
36
  ->(section) do
@@ -4,16 +4,19 @@
4
4
  <head>
5
5
  <meta charset="utf-8" />
6
6
  <meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport" />
7
-
7
+
8
8
  <title>App</title>
9
9
  <%= csrf_meta_tags %>
10
-
10
+
11
11
  <%= javascript_pack_tag 'vue_renderer', defer: true %>
12
12
  <%#= javascript_include_tag 'vue_renderer_extras', defer: true %>
13
13
 
14
14
  <%= stylesheet_pack_tag 'vue_renderer' %>
15
15
 
16
- <link href="https://fonts.googleapis.com/css?family=Material+Icons" rel="stylesheet" />
16
+ <link href="//fonts.googleapis.com/css?family=Material+Icons" rel="stylesheet" />
17
+
18
+ <%# Without this, checkboxes and radio buttons will not display. %>
19
+ <link href="//cdn.materialdesignicons.com/2.1.99/css/materialdesignicons.min.css" rel="stylesheet" />
17
20
 
18
21
  <%= yield :head %>
19
22
  </head>
@@ -21,7 +24,7 @@
21
24
  <body>
22
25
  <noscript>Please enable JavaScript to view this web site.</noscript>
23
26
  <div id="app"></div>
24
-
27
+
25
28
  <script>
26
29
  var __page = <%= raw @__json_ui_orig_page%>;
27
30
  </script>
@@ -4,4 +4,4 @@ class AddScopeToTexts < ActiveRecord::Migration[6.0]
4
4
  remove_index :texts, :key
5
5
  add_index :texts, [:scope, :key], unique: true
6
6
  end
7
- end
7
+ end
@@ -20,7 +20,7 @@ class CreateActiveStorageTables < ActiveRecord::Migration[5.2]
20
20
 
21
21
  t.datetime :created_at, null: false
22
22
 
23
- t.index [ :record_type, :record_id, :name, :blob_id ], name: "index_active_storage_attachments_uniqueness", unique: true
23
+ t.index [ :record_type, :record_id, :name, :blob_id ], name: 'index_active_storage_attachments_uniqueness', unique: true
24
24
  t.foreign_key :active_storage_blobs, column: :blob_id
25
25
  end
26
26
  end
@@ -1,2 +1,2 @@
1
1
  dt_redis_url = ENV.fetch('<%= options[:redis_env_key] %>', 'redis://localhost:6379')
2
- $dt_redis = Redis.new(url: dt_redis_url)
2
+ $dt_redis = Redis.new(url: dt_redis_url)
@@ -1,8 +1,8 @@
1
- require "glib/version"
2
- require "glib/engine" if defined?(::Rails)
3
- require "glib/value"
4
- require "glib/json_crawler"
1
+ require 'glib/version'
2
+ require 'glib/engine' if defined?(::Rails)
3
+ require 'glib/value'
4
+ require 'glib/json_crawler'
5
5
 
6
6
  require 'glib/dynamic_text'
7
7
  require 'glib/crypt'
8
- require 'glib/test_helpers'
8
+ require 'glib/test_helpers'
@@ -4,4 +4,4 @@ module Glib
4
4
  # isolate_namespace Glib::Web
5
5
  end
6
6
  end
7
- end
7
+ end
@@ -30,10 +30,10 @@ module Glib
30
30
  fields << child
31
31
 
32
32
  include_params = case name
33
- when 'fields/check', 'fields/check-v1'
34
- child['checkValue'] == child['value']
35
- else
36
- true
33
+ when 'fields/check', 'fields/check-v1'
34
+ child['checkValue'] == child['value']
35
+ else
36
+ true
37
37
  end
38
38
 
39
39
  params[child['name']] = child['value'] if include_params
@@ -3,7 +3,7 @@ module Glib
3
3
  class Http
4
4
  attr_accessor :history, :response_times, :user, :router
5
5
 
6
- URI_REGEXP = /\A#{URI::regexp}\z/
6
+ URI_REGEXP = /\A#{URI.regexp}\z/
7
7
 
8
8
  VALID_RESPONSE_CODES = [
9
9
  (200..299).to_a,
@@ -25,9 +25,9 @@ module Glib
25
25
  @__log_file ||= "#{self.method_name}.json"
26
26
  end
27
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) )
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
31
  end
32
32
  json
33
33
  end
@@ -4,4 +4,4 @@ module Glib
4
4
  class DEFAULT
5
5
  end
6
6
  end
7
- end
7
+ end
@@ -1,5 +1,5 @@
1
1
  module Glib
2
2
  module Web
3
- VERSION = "0.0.1"
3
+ VERSION = '0.0.1'
4
4
  end
5
- end
5
+ end
@@ -1,6 +1,6 @@
1
- desc "Run migration scripts in db/migrate"
1
+ desc 'Run migration scripts in db/migrate'
2
2
 
3
- Rake::Task["db:structure:dump"].clear
3
+ Rake::Task['db:structure:dump'].clear
4
4
 
5
5
  namespace :db do
6
6
  namespace :fixtures do
@@ -17,9 +17,9 @@ namespace :db do
17
17
  # allow to specify output directory by FIXTURES_PATH
18
18
 
19
19
  desc 'Dumps all models into fixtures.'
20
- task :dump => :environment do
20
+ task dump: :environment do
21
21
  models = Dir.glob(Rails.root + 'app/models/**.rb').map do |s|
22
- Pathname.new(s).basename.to_s.gsub(/\.rb$/,'').camelize
22
+ Pathname.new(s).basename.to_s.gsub(/\.rb$/, '').camelize
23
23
  end
24
24
 
25
25
  begin
@@ -33,20 +33,20 @@ namespace :db do
33
33
  end
34
34
 
35
35
  # specify FIXTURES_PATH to test/fixtures if you do test:unit
36
- dump_dir = ENV['FIXTURES_PATH'] || "test/fixtures/"
36
+ dump_dir = ENV['FIXTURES_PATH'] || 'test/fixtures/'
37
37
 
38
38
  excludes = YAML.load_file(File.join(Rails.root, 'config', 'excluded_fixtures.yml'))
39
39
 
40
- puts "Found models: " + models.join(', ')
41
- puts "Excluding: " + excludes.join(', ')
42
- puts "Dumping to: " + dump_dir
40
+ puts 'Found models: ' + models.join(', ')
41
+ puts 'Excluding: ' + excludes.join(', ')
42
+ puts 'Dumping to: ' + dump_dir
43
43
 
44
44
  models.each do |m|
45
45
  unless excludes.include?(m)
46
46
  model = m.constantize
47
47
  next unless model.ancestors.include?(ActiveRecord::Base)
48
48
 
49
- ids = model.column_names.select{ |k| k.ends_with?('_id') }.sort
49
+ ids = model.column_names.select { |k| k.ends_with?('_id') }.sort
50
50
 
51
51
  entries = if model.column_names.include?('id')
52
52
  model.unscoped.order(:id).all
@@ -63,7 +63,7 @@ namespace :db do
63
63
 
64
64
  entries.each do |a|
65
65
  attrs = Hash[a.attributes.sort]
66
- attrs.delete_if{ |k,v| v.nil? }
66
+ attrs.delete_if { |k, v| v.nil? }
67
67
 
68
68
  id = if attrs.include?('id')
69
69
  [a.id]
@@ -92,4 +92,4 @@ namespace :db do
92
92
  end
93
93
  end
94
94
  end
95
- end
95
+ end
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.5.12
4
+ version: 0.5.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
@@ -107,7 +107,6 @@ files:
107
107
  - app/validators/email_typo_validator.rb
108
108
  - app/validators/email_validator.rb
109
109
  - app/validators/url_validator.rb
110
- - app/views/app/views/json_ui/vue/renderer.html.erb
111
110
  - app/views/json_ui/garage/_nav_menu.json.jbuilder
112
111
  - app/views/json_ui/garage/actions/_dialogs.json.jbuilder
113
112
  - app/views/json_ui/garage/actions/_http.json.jbuilder
@@ -143,12 +142,15 @@ files:
143
142
  - app/views/json_ui/garage/home/blank.json.jbuilder
144
143
  - app/views/json_ui/garage/home/index.json.jbuilder
145
144
  - app/views/json_ui/garage/home/slow.json.jbuilder
146
- - app/views/json_ui/garage/lists/_infinite_scroll_section.json.jbuilder
145
+ - app/views/json_ui/garage/lists/_autoload_section.json.jbuilder
146
+ - app/views/json_ui/garage/lists/autoload_all.json.jbuilder
147
+ - app/views/json_ui/garage/lists/autoload_as_needed.json.jbuilder
148
+ - app/views/json_ui/garage/lists/chat_ui.json.jbuilder
147
149
  - app/views/json_ui/garage/lists/edit_actions.json.jbuilder
148
150
  - app/views/json_ui/garage/lists/fab.json.jbuilder
149
151
  - app/views/json_ui/garage/lists/index.json.jbuilder
150
- - app/views/json_ui/garage/lists/infinite_scroll.json.jbuilder
151
152
  - app/views/json_ui/garage/lists/templating.json.jbuilder
153
+ - app/views/json_ui/garage/notifications/android_post.json.jbuilder
152
154
  - app/views/json_ui/garage/notifications/index.json.jbuilder
153
155
  - app/views/json_ui/garage/notifications/web_socket.json.jbuilder
154
156
  - app/views/json_ui/garage/pages/flat_centered.json.jbuilder
@@ -242,7 +244,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
242
244
  version: '0'
243
245
  requirements: []
244
246
  rubyforge_project:
245
- rubygems_version: 2.6.8
247
+ rubygems_version: 2.7.6
246
248
  signing_key:
247
249
  specification_version: 4
248
250
  summary: ''
@@ -1,35 +0,0 @@
1
- <!-- Deprecated. Use layouts instead
2
- <!DOCTYPE html>
3
- <html>
4
-
5
- <head>
6
- <meta charset="utf-8" />
7
- <meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport" />
8
-
9
- <title>App</title>
10
- <%= csrf_meta_tags %>
11
-
12
- <%= javascript_pack_tag 'vue_renderer', defer: true %>
13
- <%#= javascript_include_tag 'vue_renderer_extras', defer: true %>
14
-
15
- <%= stylesheet_pack_tag 'vue_renderer' %>
16
- <% if (custom_css_path = options[:custom_css_path]) %>
17
- <%= stylesheet_link_tag custom_css_path, media: 'all' %>
18
- <% end %>
19
-
20
- <link href="https://fonts.googleapis.com/css?family=Material+Icons" rel="stylesheet" />
21
- </head>
22
-
23
- <body>
24
- <noscript>Please enable JavaScript to view this web site.</noscript>
25
- <div id="app"></div>
26
-
27
- <script>
28
- var __page = <%= raw @__json_ui_orig_page%>;
29
- </script>
30
-
31
- <% locals[:footer_block]&.call %>
32
- </body>
33
-
34
- </html>
35
- -->