glib-web 0.3.5 → 0.3.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 877c8d3fa3723d92cec140db3fb40b36c1249fb34e56fea4a6f72709f48782ec
4
- data.tar.gz: 99060f49c2c33c25bdc63146eef093e6a18182f49f5ccd85b19d9846e824643b
3
+ metadata.gz: cce5921c4af9524cc6878c67521f8430dfac0e019beb296326b8ee0c866a6cd8
4
+ data.tar.gz: ab5e417f1cdef79b23c282479f15d50fd708589a01758eea0c3c0327e096bc15
5
5
  SHA512:
6
- metadata.gz: 7ccb0b1bf5a12dde05268250eb1605823c239b4b91bc519afa715ef23b3c0523d43683e2c6390b6d0919a1749e710964a88222df90991e6275472dc474ad490f
7
- data.tar.gz: 8bc7a63b64d5c48fb2e259413cfd99cf7022a1071cd3ecb7e3edb6faca600039084e57222c21a5ca8e82702e84cf066bf8b51b46426e32dcd36ecb5e74ee08d8
6
+ metadata.gz: 567b6a172d515122068d7b3c71c4145417c8dda212ae4c5c8a195b150dc8e80990f218539aaf99df1f9e1d1cfb13f718030447e5983c5eca7cf7e2e3392657ab
7
+ data.tar.gz: 5d6eca808238984d03e4b242e2da9a02b090e9983a240e8d30b06282da3b961c6eed595b52e760a9cff06061526f3f207e53920515eefd3d165680097d57e538
@@ -4,7 +4,7 @@ module Glib
4
4
  def method_missing m, *args
5
5
  add_singleton_element_v1 'action', m, *args
6
6
  end
7
-
7
+
8
8
  class Action < JsonUiElement
9
9
  def analytics(value)
10
10
  if value.is_a?(String)
@@ -43,31 +43,31 @@ module Glib
43
43
  string :message
44
44
  action :onClose
45
45
  end
46
-
46
+
47
47
  # class Confirm < Action
48
48
  # string :message
49
49
  # action :onConfirm
50
50
  # action :onCancel
51
51
  # end
52
-
52
+
53
53
  class Options < Action
54
54
  string :message
55
-
55
+
56
56
  def buttons(block)
57
57
  json.buttons do
58
58
  block.call page.menu_builder
59
59
  end
60
60
  end
61
61
  end
62
-
62
+
63
63
  class Open < Action
64
64
  string :url, cache: true
65
65
  end
66
-
66
+
67
67
  class Close < Action
68
68
  action :onClose
69
69
  end
70
-
70
+
71
71
  # TODO: Deprecate
72
72
  # Consider renaming to ShowSnackbar
73
73
  class Snackbar < Action
@@ -76,9 +76,16 @@ module Glib
76
76
  string :horizontalPosition
77
77
  singleton_array :styleClass, :styleClasses
78
78
  end
79
-
79
+
80
+ class Notification < Action
81
+ string :title
82
+ string :body
83
+ string :tag
84
+ int :timeout
85
+ end
86
+
80
87
  end
81
-
88
+
82
89
  module Snackbars
83
90
  class Alert < Action
84
91
  string :message
@@ -88,20 +95,20 @@ module Glib
88
95
  string :horizontalPosition
89
96
  singleton_array :styleClass, :styleClasses
90
97
  end
91
-
98
+
92
99
  # class Confirm < Action
93
100
  # string :message
94
101
  # action :onConfirm
95
102
  # action :onCancel
96
-
103
+
97
104
  # string :verticalPosition
98
105
  # string :horizontalPosition
99
106
  # singleton_array :styleClass, :styleClasses
100
107
  # end
101
-
108
+
102
109
  class Options < Action
103
110
  string :message
104
-
111
+
105
112
  string :verticalPosition
106
113
  string :horizontalPosition
107
114
  singleton_array :styleClass, :styleClasses
@@ -111,15 +118,15 @@ module Glib
111
118
  block.call page.menu_builder
112
119
  end
113
120
  end
114
-
121
+
115
122
  end
116
-
123
+
117
124
  end
118
125
 
119
126
  module Forms
120
127
  class Submit < Action
121
128
  end
122
-
129
+
123
130
  end
124
131
 
125
132
  module Windows
@@ -130,16 +137,16 @@ module Glib
130
137
  class CloseAll < Action
131
138
  action :onClose
132
139
  end
133
-
140
+
134
141
  class Open < Action
135
142
  string :url, cache: true
136
143
  action :onOpen
137
144
  end
138
-
145
+
139
146
  class OpenWeb < Action
140
147
  string :url
141
148
  end
142
-
149
+
143
150
  class Reload < Action
144
151
  string :url, cache: true
145
152
  end
@@ -151,16 +158,16 @@ module Glib
151
158
  string :token
152
159
  action :onSave
153
160
  end
154
-
161
+
155
162
  end
156
-
163
+
157
164
  # FUTURE
158
165
  module Data
159
166
  class SaveCsrfToken < Action
160
167
  string :token
161
168
  action :onSave
162
169
  end
163
-
170
+
164
171
  class Clear < Action
165
172
  end
166
173
  end
@@ -170,17 +177,17 @@ module Glib
170
177
  string :url, cache: true
171
178
  hash :formData
172
179
  end
173
-
180
+
174
181
  class Patch < Action
175
182
  string :url, cache: true
176
183
  hash :formData
177
184
  end
178
-
185
+
179
186
  class Delete < Action
180
187
  string :url, cache: true
181
188
  hash :formData
182
189
  end
183
-
190
+
184
191
  end
185
192
 
186
193
  ###
@@ -2,11 +2,11 @@ json.title 'Notifications'
2
2
 
3
3
  json_ui_page json do |page|
4
4
  render "#{@path_prefix}/nav_menu", json: json, page: page, top_nav: true
5
-
5
+
6
6
  page.list firstSection: ->(section) do
7
7
  section.rows builder: ->(template) do
8
8
  template.thumbnail title: 'Send Desktop Notification', onClick: ->(action) do
9
- # TODO: Send and display desktop notification
9
+ action.dialogs_notification title: 'Hello World', body: 'Body Message'
10
10
  end
11
11
  end
12
12
  end
@@ -29,7 +29,7 @@ module Glib
29
29
  # Allow repeating urls because excluding them makes the test results really hard to analyze.
30
30
  # if history.include?(url)
31
31
 
32
- if url.blank?
32
+ if url.blank?
33
33
  nil
34
34
  else
35
35
  @context.assert_match URI_REGEXP, url
@@ -44,14 +44,15 @@ module Glib
44
44
  else
45
45
  response_times << response.headers['X-Runtime'].to_f
46
46
  @context.assert_includes VALID_RESPONSE_CODES, code, "Expected a valid response but was [#{response.code}] #{Rack::Utils::HTTP_STATUS_CODES[response.code.to_i]}:\n#{url}"
47
- if response.content_type == 'application/json'
47
+
48
+ if response.media_type == 'application/json'
48
49
  JSON.parse(response.body)
49
50
  else
50
51
  nil
51
52
  end
52
53
  end
53
54
  end
54
-
55
+
55
56
  end
56
57
 
57
58
  def post(url, controller, params)
@@ -90,7 +91,7 @@ module Glib
90
91
  @context.assert_includes VALID_RESPONSE_CODES, response.code.to_i, "Expected a valid response but was [#{response.code}] #{Rack::Utils::HTTP_STATUS_CODES[response.code.to_i]}:\n#{url}"
91
92
  JsonCrawler::Router.log(controller, url, response)
92
93
 
93
- if response.content_type == 'application/json'
94
+ if response.media_type == 'application/json'
94
95
  JSON.parse(response.body)
95
96
  else
96
97
  nil
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.3.5
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''