glib-web 0.0.23 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +5 -5
  2. data/app/controllers/concerns/application/json/libs.rb +0 -0
  3. data/app/controllers/concerns/application/json/transformation.rb +0 -0
  4. data/app/controllers/concerns/application/json/ui.rb +0 -0
  5. data/app/controllers/concerns/application/json/validation.rb +0 -0
  6. data/app/controllers/glib/home_controller.rb +0 -0
  7. data/app/helpers/glib/json_ui/abstract_builder.rb +0 -0
  8. data/app/helpers/glib/json_ui/action_builder.rb +16 -0
  9. data/app/helpers/glib/json_ui/json_ui_helper.rb +0 -0
  10. data/app/helpers/glib/json_ui/list_builders.rb +24 -6
  11. data/app/helpers/glib/json_ui/menu_builder.rb +1 -1
  12. data/app/helpers/glib/json_ui/page_helper.rb +20 -3
  13. data/app/helpers/glib/json_ui/response_helper.rb +0 -0
  14. data/app/helpers/glib/json_ui/table_builders.rb +0 -0
  15. data/app/helpers/glib/json_ui/view_builder.rb +1 -0
  16. data/app/helpers/glib/json_ui/view_builder/fields.rb +0 -0
  17. data/app/helpers/glib/json_ui/view_builder/panels.rb +0 -0
  18. data/app/views/app/views/json_ui/vue/renderer.html.erb +0 -0
  19. data/app/views/json_ui/garage/_nav_menu.json.jbuilder +0 -0
  20. data/app/views/json_ui/garage/actions/index.json.jbuilder +0 -0
  21. data/app/views/json_ui/garage/forms/basic.json.jbuilder +0 -0
  22. data/app/views/json_ui/garage/forms/basic_post.json.jbuilder +0 -0
  23. data/app/views/json_ui/garage/forms/file_upload.json.jbuilder +0 -0
  24. data/app/views/json_ui/garage/forms/floating_submit.json.jbuilder +0 -0
  25. data/app/views/json_ui/garage/forms/generic_post.json.jbuilder +0 -0
  26. data/app/views/json_ui/garage/forms/index.json.jbuilder +0 -0
  27. data/app/views/json_ui/garage/forms/submit_indicator.json.jbuilder +0 -0
  28. data/app/views/json_ui/garage/forms/submit_indicator_post.json.jbuilder +0 -0
  29. data/app/views/json_ui/garage/home/index.json.jbuilder +0 -0
  30. data/app/views/json_ui/garage/lists/_infinite_scroll_section.json.jbuilder +0 -0
  31. data/app/views/json_ui/garage/lists/index.json.jbuilder +0 -0
  32. data/app/views/json_ui/garage/lists/infinite_scroll.json.jbuilder +0 -0
  33. data/app/views/json_ui/garage/lists/templating.json.jbuilder +0 -0
  34. data/app/views/json_ui/garage/pages/full_width_height.json.jbuilder +0 -0
  35. data/app/views/json_ui/garage/pages/index.json.jbuilder +0 -0
  36. data/app/views/json_ui/garage/pages/layout.json.jbuilder +0 -0
  37. data/app/views/json_ui/garage/pages/nav_buttons.json.jbuilder +0 -0
  38. data/app/views/json_ui/garage/pages/tab_bar.json.jbuilder +0 -0
  39. data/app/views/json_ui/garage/panels/carousel.json.jbuilder +0 -0
  40. data/app/views/json_ui/garage/panels/horizontal.json.jbuilder +0 -0
  41. data/app/views/json_ui/garage/panels/index.json.jbuilder +0 -0
  42. data/app/views/json_ui/garage/panels/split.json.jbuilder +0 -0
  43. data/app/views/json_ui/garage/panels/vertical.json.jbuilder +0 -0
  44. data/app/views/json_ui/garage/views/basic.json.jbuilder +0 -0
  45. data/app/views/json_ui/garage/views/carousels.json.jbuilder +0 -0
  46. data/app/views/json_ui/garage/views/images.json.jbuilder +0 -0
  47. data/app/views/json_ui/garage/views/index.json.jbuilder +0 -0
  48. data/app/views/json_ui/garage/views/map_data.json.jbuilder +0 -0
  49. data/config/routes.rb +0 -0
  50. data/lib/glib-web.rb +0 -0
  51. data/lib/glib/engine.rb +0 -0
  52. data/lib/glib/json_crawler.rb +0 -0
  53. data/lib/glib/json_crawler/action_crawler.rb +0 -0
  54. data/lib/glib/json_crawler/action_crawlers/action_http.rb +0 -0
  55. data/lib/glib/json_crawler/action_crawlers/nav_initiate.rb +3 -4
  56. data/lib/glib/json_crawler/action_crawlers/windows_open.rb +0 -0
  57. data/lib/glib/json_crawler/http.rb +4 -1
  58. data/lib/glib/json_crawler/router.rb +0 -0
  59. data/lib/glib/value.rb +0 -0
  60. data/lib/glib/version.rb +0 -0
  61. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: 3c09328c452d79c62455066bb59bf06256c26ee2afe268f03ccfafcfa57f9b99
4
- data.tar.gz: b8eafbcdd5befc44faddfc68d017a9605f2d972748c06cacb343380a4c07e4a3
2
+ SHA1:
3
+ metadata.gz: 2a53e5f3f6be6c7d47601f3a401ebbb9cdb2b8e0
4
+ data.tar.gz: e3ed2b12c3d9a19186864c35d5f771ce63dec2db
5
5
  SHA512:
6
- metadata.gz: c9daa8b2f96fceb227588ac0e346e5a752fb9d08d818ee627f33971fabd10eb4e6c92b0248252a8f97a5f5d548f55d3f790f13ee2f1f0e67f51707ec684a58c4
7
- data.tar.gz: 68ab224034c17978d9ee2ba7090b5d96a1ab3c06e0b007aa0e26669b9ea8c5dbbb213655fe15102d9f5ec8578408d7c62e1bd8cdb1a04497428ac3ea463c2a2e
6
+ metadata.gz: 39369b0bc54cb5ec96d03658a3c50ebb72b5b7a12eab67100ce9cd4e8f540e1c8690d5ee6d09c00c9909cf0ec4bb3a9ffc60ab2c62757ef816aead626e09892c
7
+ data.tar.gz: 56bec0256c4beb322736880f35d7c0ba4fa800d95aaebe820b5be367e31466d356f9a5030401f789dd772ae2468e7fd5604bf2881f825eb3a46e0de38d1c2381
File without changes
@@ -36,6 +36,7 @@ module Glib
36
36
  string :url
37
37
  end
38
38
 
39
+ # Consider renaming to ShowSnackbar
39
40
  class Snackbar < Action
40
41
  string :message
41
42
  end
@@ -57,8 +58,12 @@ module Glib
57
58
  string :url
58
59
  end
59
60
 
61
+ class OpenWeb < Action
62
+ string :url
63
+ end
60
64
  end
61
65
 
66
+ # Consider deprecating this. See Data
62
67
  module Auth
63
68
  class SaveCsrfToken < Action
64
69
  string :token
@@ -66,6 +71,17 @@ module Glib
66
71
  end
67
72
 
68
73
  end
74
+
75
+ # FUTURE
76
+ module Data
77
+ class SaveCsrfToken < Action
78
+ string :token
79
+ action :onSave
80
+ end
81
+
82
+ class Clear < Action
83
+ end
84
+ end
69
85
 
70
86
  module Http
71
87
  class Post < Action
@@ -28,6 +28,11 @@ module Glib
28
28
  end
29
29
 
30
30
  class Section < AbstractBuilder
31
+ def initialize json, page, template
32
+ super json, page
33
+ @template = template
34
+ end
35
+
31
36
  def header(options = {})
32
37
  json.header do
33
38
  json.padding options[:padding]
@@ -38,15 +43,28 @@ module Glib
38
43
  end
39
44
  end
40
45
 
41
- def rows(array = nil)
42
- template = page.list_template_builder
46
+ # def rows(array = nil)
47
+ # template = page.list_template_builder
48
+ # json.rows do
49
+ # if array
50
+ # array.each do |object|
51
+ # yield template, object
52
+ # end
53
+ # else
54
+ # yield template
55
+ # end
56
+ # end
57
+ # end
58
+
59
+ def rows(options = {})
60
+ block = options[:builder]
43
61
  json.rows do
44
- if array
45
- array.each do |row|
46
- yield template, row
62
+ if (objects = options[:objects])
63
+ objects.each do |object|
64
+ block&.call @template, object
47
65
  end
48
66
  else
49
- yield template
67
+ block&.call @template
50
68
  end
51
69
  end
52
70
  end
@@ -9,7 +9,7 @@ module Glib
9
9
  end
10
10
 
11
11
  class Button < MenuItem
12
- string :title
12
+ string :text
13
13
  icon :icon
14
14
  action :onClick
15
15
  end
@@ -7,7 +7,8 @@ module Glib
7
7
 
8
8
  class Page
9
9
  attr_reader :json, :context, :view_builder, :action_builder, :menu_builder
10
- attr_reader :list_section_builder, :list_template_builder
10
+ attr_reader :list_section_builder, :drawer_content_builder
11
+
11
12
  attr_reader :table_section_builder, :table_template_builder
12
13
 
13
14
  # See Panels::Form
@@ -20,8 +21,10 @@ module Glib
20
21
  @view_builder = ViewBuilder.new(json, self)
21
22
  @action_builder = ActionBuilder.new(json, self)
22
23
  @menu_builder = MenuBuilder.new(json, self)
23
- @list_section_builder = ListBuilders::Section.new(json, self)
24
- @list_template_builder = ListBuilders::Template.new(json, self)
24
+
25
+ @list_section_builder = ListBuilders::Section.new(json, self, ListBuilders::Template.new(json, self))
26
+ @drawer_content_builder = ListBuilders::Section.new(json, self, @menu_builder)
27
+
25
28
  @table_section_builder = TableBuilders::Section.new(json, self)
26
29
  @table_template_builder = TableBuilders::Template.new(json, self)
27
30
  end
@@ -32,6 +35,20 @@ module Glib
32
35
  end
33
36
  end
34
37
 
38
+ def leftDrawer(options = {})
39
+ # json.leftDrawer do
40
+ # json.title options[:title]
41
+ # json.items do
42
+ # yield @menu_builder
43
+ # end
44
+ # end
45
+
46
+ json.leftDrawer do
47
+ options[:content]&.call drawer_content_builder
48
+ end
49
+
50
+ end
51
+
35
52
  def header(options = {})
36
53
  json.header do
37
54
  json.padding options[:padding]
@@ -20,6 +20,7 @@ module Glib
20
20
 
21
21
  class H1 < View
22
22
  string :text
23
+ action :onClick
23
24
  end
24
25
 
25
26
  class H2 < View
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -3,10 +3,9 @@ module Glib
3
3
  class NavInitiate < ActionCrawler
4
4
  def initialize http, args, controller
5
5
  @http = http
6
- json = @http.get args['url'], controller
7
-
8
- unless json.nil?
9
- crawl json['leftDrawer']&.[]('items')
6
+ if (json = @http.get args['url'], controller) && (left_drawer = json['leftDrawer'])
7
+ crawl left_drawer['header']&.[]('childViews')
8
+ crawl left_drawer['rows']
10
9
  end
11
10
  end
12
11
  end
@@ -26,7 +26,10 @@ module Glib
26
26
  'Client-Version' => user[:version],
27
27
  }
28
28
 
29
- if url.blank? || history.include?(url)
29
+ # Allow repeating urls because excluding them makes the test results really hard to analyze.
30
+ # if history.include?(url)
31
+
32
+ if url.blank?
30
33
  nil
31
34
  else
32
35
  @context.assert_match URI_REGEXP, url
File without changes
File without changes
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.0.23
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
108
  version: '0'
109
109
  requirements: []
110
110
  rubyforge_project:
111
- rubygems_version: 2.7.6
111
+ rubygems_version: 2.6.8
112
112
  signing_key:
113
113
  specification_version: 4
114
114
  summary: ''