glib-web 0.5.27 → 0.5.28
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 +1 -1
- data/app/helpers/glib/dynamic_texts_helper.rb +1 -1
- data/app/helpers/glib/json_ui/action_builder.rb +5 -0
- data/app/helpers/glib/json_ui/view_builder.rb +3 -0
- data/app/views/json_ui/garage/forms/_alert_post_data.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/index.json.jbuilder +6 -0
- data/app/views/json_ui/garage/forms/new_rich_text.json.jbuilder +40 -0
- data/app/views/json_ui/garage/forms/rich_text.json.jbuilder +3 -3
- data/lib/glib-web.rb +1 -0
- data/lib/glib/mailer_tester.rb +36 -0
- data/lib/glib/test_helpers.rb +0 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 61751b2891f690ea735f42e83237af9e51ffdc9af197edf99b781130bdc17b9f
|
4
|
+
data.tar.gz: 0f573d844cb04c3aaecaf3960e8f004a44773e54e68b9badce95196ce9e2098d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad5eea3ab4348323e71d9e984095aeb219430b3b47cdaaadb9ccff52f1848c320e44c3d0ca91aacca224ad272335bec0407577ae80bd90e0ef581aa70cc16e9e
|
7
|
+
data.tar.gz: 7889d94a639733b5b833eb08d8f68369186836697dcfb9c1d0baeca7edae41b4c3cb80beb85f7f7c4b303948bc35b0026d033f6e72c9856bffd675aca36ea293
|
@@ -112,7 +112,7 @@ module Glib::Json::NewDynamicText
|
|
112
112
|
def substitute_image_with(images)
|
113
113
|
view[prop] = view[prop].gsub(/\{\{image(\d)\}\}/) {
|
114
114
|
if image = images[$1.to_i - 1]
|
115
|
-
ApplicationController.helpers.
|
115
|
+
ApplicationController.helpers.glib_dynamic_image_url(image.blob.key)
|
116
116
|
else
|
117
117
|
"{{image#{$1}}}"
|
118
118
|
end
|
File without changes
|
@@ -76,6 +76,12 @@ json_ui_page json do |page|
|
|
76
76
|
template.thumbnail title: 'Rich Text Editor', onClick: ->(action) do
|
77
77
|
action.windows_open url: json_ui_garage_url(path: 'forms/rich_text')
|
78
78
|
end
|
79
|
+
end
|
80
|
+
|
81
|
+
section.rows builder: ->(template) do
|
82
|
+
template.thumbnail title: 'New Rich Text Editor', onClick: ->(action) do
|
83
|
+
action.windows_open url: json_ui_garage_url(path: 'forms/new_rich_text')
|
84
|
+
end
|
79
85
|
|
80
86
|
end
|
81
87
|
end, ->(section) do
|
@@ -0,0 +1,40 @@
|
|
1
|
+
json.title 'Forms'
|
2
|
+
|
3
|
+
json_ui_page json do |page|
|
4
|
+
render "#{@path_prefix}/nav_menu", json: json, page: page
|
5
|
+
|
6
|
+
page.form url: json_ui_garage_url(path: 'forms/basic_post'), method: 'post', padding: { top: 12, left: 20, right: 20, bottom: 12 }, childViews: ->(form) do
|
7
|
+
form.fields_text name: 'user[name]', width: 'matchParent', label: 'Name'
|
8
|
+
|
9
|
+
# images = [
|
10
|
+
# {
|
11
|
+
# value: "eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBFQT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--193dc0d939b9558fc4973fafbba91d989cbb04d4",
|
12
|
+
# fileUrl: "https://imageserver-demo.herokuapp.com/image/itinerarybuilder-demo/o6CKzNt67PWnkPdUEnWMt7pr?h=100&w=100"
|
13
|
+
# }
|
14
|
+
# ]
|
15
|
+
# form.fields_richText name: 'user[bio]', width: 'matchParent', label: 'Content', images: images, value: '<p>Test {{image1}}</p>'
|
16
|
+
|
17
|
+
json.child! do
|
18
|
+
json.view 'fields/newRichText-v1'
|
19
|
+
json.width 'matchParent'
|
20
|
+
json.label 'Content'
|
21
|
+
json.name 'user[bio]'
|
22
|
+
json.value '<p>Test {{image1}}</p>'
|
23
|
+
|
24
|
+
json.images do
|
25
|
+
json.child! do
|
26
|
+
json.value "eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBFQT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--193dc0d939b9558fc4973fafbba91d989cbb04d4"
|
27
|
+
# json.fileTitle "hita i hanom hg.jpg"
|
28
|
+
json.fileUrl "https://imageserver-demo.herokuapp.com/image/itinerarybuilder-demo/o6CKzNt67PWnkPdUEnWMt7pr?h=100&w=100"
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
json.imageUploader do
|
33
|
+
json.accepts(fileType: "image/*", maxFileSize: 5000)
|
34
|
+
json.directUploadUrl rails_direct_uploads_url
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
form.button text: 'Submit', onClick: ->(action) { action.forms_submit }
|
39
|
+
end
|
40
|
+
end
|
@@ -2,12 +2,12 @@ json.title 'Forms'
|
|
2
2
|
|
3
3
|
json_ui_page json do |page|
|
4
4
|
render "#{@path_prefix}/nav_menu", json: json, page: page
|
5
|
-
|
5
|
+
|
6
6
|
page.form url: json_ui_garage_url(path: 'forms/basic_post'), method: 'post', padding: { top: 12, left: 20, right: 20, bottom: 12 }, childViews: ->(form) do
|
7
7
|
form.fields_text name: 'user[name]', width: 'matchParent', label: 'Name'
|
8
8
|
|
9
9
|
# images = [
|
10
|
-
# {
|
10
|
+
# {
|
11
11
|
# value: "eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBFQT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--193dc0d939b9558fc4973fafbba91d989cbb04d4",
|
12
12
|
# fileUrl: "https://imageserver-demo.herokuapp.com/image/itinerarybuilder-demo/o6CKzNt67PWnkPdUEnWMt7pr?h=100&w=100"
|
13
13
|
# }
|
@@ -28,7 +28,7 @@ json_ui_page json do |page|
|
|
28
28
|
json.fileUrl "https://imageserver-demo.herokuapp.com/image/itinerarybuilder-demo/o6CKzNt67PWnkPdUEnWMt7pr?h=100&w=100"
|
29
29
|
end
|
30
30
|
end
|
31
|
-
|
31
|
+
|
32
32
|
json.imageUploader do
|
33
33
|
json.accepts(fileType: "image/*", maxFileSize: 5000)
|
34
34
|
json.directUploadUrl rails_direct_uploads_url
|
data/lib/glib-web.rb
CHANGED
@@ -0,0 +1,36 @@
|
|
1
|
+
module Glib
|
2
|
+
module MailerTester
|
3
|
+
extend ActiveSupport::Concern
|
4
|
+
|
5
|
+
included do
|
6
|
+
project_root = Rails.root
|
7
|
+
paths = Dir.glob(project_root + 'test/mailers/previews/*')
|
8
|
+
paths.each do |file|
|
9
|
+
require file
|
10
|
+
end
|
11
|
+
|
12
|
+
ActionMailer::Preview.subclasses.each do |preview_class|
|
13
|
+
preview = preview_class.new
|
14
|
+
|
15
|
+
preview_class.instance_methods(false).each do |mailer_method|
|
16
|
+
test "mailer for #{preview_class}##{mailer_method}" do
|
17
|
+
preview.send(mailer_method).deliver_now
|
18
|
+
|
19
|
+
logfile = File.join(log_dir, "#{preview_class.name.underscore}##{mailer_method}.txt")
|
20
|
+
|
21
|
+
# Use rstrip to avoid trailing space issues
|
22
|
+
expected = File.exist?(logfile) ? File.read(logfile).rstrip : ''
|
23
|
+
last_delivery = ActionMailer::Base.deliveries.last
|
24
|
+
result = last_delivery.html_part.body.raw_source.rstrip
|
25
|
+
|
26
|
+
logger = File.open(logfile, 'w')
|
27
|
+
logger.puts result
|
28
|
+
logger.close
|
29
|
+
|
30
|
+
assert_equal expected, result, "Result mismatch! #{logfile.sub(/\.txt$/, '')}"
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
data/lib/glib/test_helpers.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: 0.5.
|
4
|
+
version: 0.5.28
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ''
|
@@ -131,6 +131,7 @@ files:
|
|
131
131
|
- app/views/json_ui/garage/forms/generic_post.json.jbuilder
|
132
132
|
- app/views/json_ui/garage/forms/get_request.json.jbuilder
|
133
133
|
- app/views/json_ui/garage/forms/index.json.jbuilder
|
134
|
+
- app/views/json_ui/garage/forms/new_rich_text.json.jbuilder
|
134
135
|
- app/views/json_ui/garage/forms/pickers.json.jbuilder
|
135
136
|
- app/views/json_ui/garage/forms/rich_text.json.jbuilder
|
136
137
|
- app/views/json_ui/garage/forms/selects.json.jbuilder
|
@@ -224,6 +225,7 @@ files:
|
|
224
225
|
- lib/glib/json_crawler/coverage.rb
|
225
226
|
- lib/glib/json_crawler/http.rb
|
226
227
|
- lib/glib/json_crawler/router.rb
|
228
|
+
- lib/glib/mailer_tester.rb
|
227
229
|
- lib/glib/test_helpers.rb
|
228
230
|
- lib/glib/value.rb
|
229
231
|
- lib/glib/version.rb
|