glib-web 4.26.2 → 4.27.0
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 +4 -4
- data/app/controllers/concerns/glib/json/new_dynamic_text.rb +0 -0
- data/app/controllers/glib/blob_url_generators_controller.rb +25 -0
- data/app/helpers/glib/app_feature_support_helper.rb +0 -0
- data/app/helpers/glib/dynamic_texts_helper.rb +0 -0
- data/app/helpers/glib/json_ui/action_builder/windows.rb +17 -1
- data/app/helpers/glib/json_ui/analytics_helper.rb +0 -0
- data/app/helpers/glib/json_ui/generic_builders.rb +0 -0
- data/app/helpers/glib/json_ui/page_helper.rb +9 -0
- data/app/helpers/glib/json_ui/response_helper.rb +2 -1
- data/app/helpers/glib/json_ui/view_builder/fields.rb +3 -1
- data/app/models/glib/active_storage/attachment.rb +0 -0
- data/app/models/glib/active_storage/blob.rb +0 -0
- data/app/models/glib/dynamic_text_record.rb +0 -0
- data/app/models/glib/text.rb +0 -0
- data/app/validators/email_typo_validator.rb +0 -0
- data/app/validators/email_validator.rb +0 -0
- data/app/validators/url_validator.rb +0 -0
- data/app/views/json_ui/garage/actions/dialogs_oauth_post.json.jbuilder +0 -0
- data/app/views/json_ui/garage/actions/partial_update.json.jbuilder +1 -1
- data/app/views/json_ui/garage/forms/bulk_edit_post.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/dynamic_group.json.jbuilder +17 -17
- data/app/views/json_ui/garage/forms/generic_post.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/partial_update_response.json.jbuilder +1 -1
- data/app/views/json_ui/garage/forms/rich_text.json.jbuilder +11 -9
- data/app/views/json_ui/garage/forms/rich_text_preview.json.jbuilder +1 -1
- data/app/views/json_ui/garage/forms/submission_flow.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/submission_flow_post.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/submission_indicator.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/submission_indicator_post.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/update_options.json.jbuilder +1 -1
- data/app/views/json_ui/garage/home/blank.json.jbuilder +0 -0
- data/app/views/json_ui/garage/home/slow.json.jbuilder +0 -0
- data/app/views/json_ui/garage/lists/autoload_all.json.jbuilder +0 -0
- data/app/views/json_ui/garage/lists/autoload_as_needed.json.jbuilder +0 -0
- data/app/views/json_ui/garage/lists/chat_ui.json.jbuilder +0 -0
- data/app/views/json_ui/garage/lists/fab.json.jbuilder +0 -0
- data/app/views/json_ui/garage/notifications/web_socket.json.jbuilder +0 -0
- data/app/views/json_ui/garage/pages/custom_style_class.json.jbuilder +0 -0
- data/app/views/json_ui/garage/pages/full_width.json.jbuilder +0 -0
- data/app/views/json_ui/garage/pages/full_width_height.json.jbuilder +0 -0
- data/app/views/json_ui/garage/pages/layout.json.jbuilder +0 -0
- data/app/views/json_ui/garage/pages/loading_indicator.json.jbuilder +0 -0
- data/app/views/json_ui/garage/pages/nested_scroll.json.jbuilder +0 -0
- data/app/views/json_ui/garage/pages/redirect_onload.json.jbuilder +0 -0
- data/app/views/json_ui/garage/panels/_styled.json.jbuilder +0 -0
- data/app/views/json_ui/garage/panels/card.json.jbuilder +0 -0
- data/app/views/json_ui/garage/panels/custom.json.jbuilder +0 -0
- data/app/views/json_ui/garage/panels/outlined.json.jbuilder +0 -0
- data/app/views/json_ui/garage/services/dynamic_text.json.jbuilder +0 -0
- data/app/views/json_ui/garage/services/image.json.jbuilder +0 -0
- data/app/views/json_ui/garage/services/index.json.jbuilder +0 -0
- data/app/views/json_ui/garage/tables/_autoload_section.json.jbuilder +0 -0
- data/app/views/json_ui/garage/tables/autoload_all.json.jbuilder +0 -0
- data/app/views/json_ui/garage/tables/autoload_as_needed.json.jbuilder +0 -0
- data/app/views/json_ui/garage/tables/export_import.json.jbuilder +0 -0
- data/app/views/json_ui/garage/views/calendar_data.json.jbuilder +0 -0
- data/app/views/json_ui/garage/views/map_data.json.jbuilder +0 -0
- data/app/views/json_ui/garage/views/multimedia.json.jbuilder +0 -0
- data/app/views/layouts/json_ui/no_custom.html.erb +0 -0
- data/config/routes.rb +1 -0
- data/lib/generators/glib/install_generator.rb +0 -0
- data/lib/generators/templates/20191017062519_create_texts.rb +0 -0
- data/lib/generators/templates/20191024063257_add_scope_to_texts.rb +0 -0
- data/lib/generators/templates/20191112095018_add_lang_to_texts.rb +0 -0
- data/lib/generators/templates/20191126071051_create_active_storage_tables.active_storage.rb +0 -0
- data/lib/generators/templates/database.yml +0 -0
- data/lib/generators/templates/dynamic_text.rb +0 -0
- data/lib/glib/dynamic_text/config.rb +0 -0
- data/lib/glib/dynamic_text.rb +0 -0
- data/lib/glib/json_crawler/action_crawler.rb +0 -0
- data/lib/glib/json_crawler/action_crawlers/action_http.rb +0 -0
- data/lib/glib/json_crawler/action_crawlers/dialogs_alert.rb +0 -0
- data/lib/glib/json_crawler/action_crawlers/menu.rb +0 -0
- data/lib/glib/json_crawler/action_crawlers/run_multiple.rb +0 -0
- data/lib/glib/json_crawler/action_crawlers/windows_open.rb +0 -0
- data/lib/glib/json_crawler/coverage.rb +0 -0
- data/lib/glib/value.rb +0 -0
- data/lib/glib/version.rb +0 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 17fdb68b8e21715a0c7fe064894696fa9ccb8f7286e2004ac13932f093d973a8
|
4
|
+
data.tar.gz: 043015ec09765b8d5fc96879afca2a5e6ab19d9724500114484db07df67f20bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f91ee974e08fca7b74650cbac4800ee26c7e2369a7fd4a70c3a768e9a7b9b6043e032cf8941edce0220db6379f8f56d590c3b690c0dbecfad870aad89cfa832
|
7
|
+
data.tar.gz: 4ed196f353784d6228d4cc656f3c9742eb6db9990c29fa4a4d537afe679b37040da8ed80819e6c3b09a3dc37101bd40c7fb6ddddd82b0099bdc9cf06ec37c386
|
File without changes
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# Attach the blob to a model so it doesn't disappear
|
2
|
+
# Example:
|
3
|
+
# class ExampleController < ApplicationController
|
4
|
+
# def update
|
5
|
+
# @record = Record.find(params[:id])
|
6
|
+
# # before attaching you may need to detach all (not purge)
|
7
|
+
# @record.files.attach(strong_params[:images_attributes])
|
8
|
+
# end
|
9
|
+
|
10
|
+
# private
|
11
|
+
|
12
|
+
# def strong_params
|
13
|
+
# params.require(:user).permit(images_attributes: [])
|
14
|
+
# end
|
15
|
+
# end
|
16
|
+
module Glib
|
17
|
+
class BlobUrlGeneratorsController < ::ActionController::Base
|
18
|
+
def create
|
19
|
+
blob = ::ActiveStorage::Blob.find_signed(params[:signed_id])
|
20
|
+
url = blob.present? ? rails_blob_path(blob) : nil
|
21
|
+
|
22
|
+
render json: { url: url }
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
File without changes
|
File without changes
|
@@ -16,7 +16,23 @@ class Glib::JsonUi::ActionBuilder
|
|
16
16
|
end
|
17
17
|
|
18
18
|
class OpenWeb < Action
|
19
|
-
string :url
|
19
|
+
# string :url
|
20
|
+
|
21
|
+
def url(value, options = {})
|
22
|
+
regex = /\/.+\.json|format=json/
|
23
|
+
|
24
|
+
if Rails.env.development? || Rails.env.test?
|
25
|
+
raise "JSON url detected #{value}" if value.to_s.match?(regex)
|
26
|
+
end
|
27
|
+
|
28
|
+
if value.to_s.match?(regex) && Rails.env.production?
|
29
|
+
Rollbar.error("JSON url detected #{value}")
|
30
|
+
value = value.gsub('.json', '')
|
31
|
+
end
|
32
|
+
|
33
|
+
instance_variable_set('@url', value) if options[:cache]
|
34
|
+
json.set! 'url', value
|
35
|
+
end
|
20
36
|
end
|
21
37
|
|
22
38
|
class Reload < Action
|
File without changes
|
File without changes
|
@@ -28,6 +28,15 @@ module Glib
|
|
28
28
|
)
|
29
29
|
end
|
30
30
|
|
31
|
+
def glib_blob_url_generators_url(options = {})
|
32
|
+
Glib::Web::Engine.routes.url_helpers.blob_url_generators_url(options.merge(
|
33
|
+
protocol: request.protocol,
|
34
|
+
host: request.host,
|
35
|
+
port: request.port,
|
36
|
+
_render: params[:_render], format: params[:format])
|
37
|
+
)
|
38
|
+
end
|
39
|
+
|
31
40
|
def json_ui_garage_current_url(options = {})
|
32
41
|
json_ui_garage_url(options.merge(path: params[:path]))
|
33
42
|
end
|
@@ -5,11 +5,12 @@ module Glib
|
|
5
5
|
__json_ui_analytics(json)
|
6
6
|
|
7
7
|
json.onResponse do
|
8
|
-
response =
|
8
|
+
response = Glib::JsonUi::PageHelper::Page.new(json, self)
|
9
9
|
yield response.action_builder
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
|
+
# Deprecated
|
13
14
|
def json_ui_response_with_view(json)
|
14
15
|
json.analytics do
|
15
16
|
json.disabled true
|
@@ -188,11 +188,13 @@ class Glib::JsonUi::ViewBuilder
|
|
188
188
|
|
189
189
|
class RichText < Text
|
190
190
|
array :images
|
191
|
-
hash :imageUploader, required: [:name], optional: [:accepts, :directUploadUrl]
|
191
|
+
hash :imageUploader, required: [:name], optional: [:accepts, :directUploadUrl, :blobUrlGenerator]
|
192
192
|
# `html` or `markdown`
|
193
193
|
string :produce
|
194
194
|
string :accept
|
195
195
|
string :cacheKey
|
196
|
+
array :mentionList
|
197
|
+
bool :debug
|
196
198
|
end
|
197
199
|
|
198
200
|
class Select < AbstractField
|
File without changes
|
File without changes
|
File without changes
|
data/app/models/glib/text.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -11,39 +11,39 @@ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', p
|
|
11
11
|
[
|
12
12
|
{ name: 'question', value: 'Punctuality' },
|
13
13
|
{ name: 'type', value: 'rating' },
|
14
|
-
{ name: 'primary_language', selectedOptions: [ { value: 'id3', text: 'Item 3' } ] },
|
14
|
+
{ name: '[primary_language]', selectedOptions: [ { value: 'id3', text: 'Item 3' } ] },
|
15
15
|
],
|
16
16
|
[
|
17
17
|
{ name: 'question', value: 'Quality of work' },
|
18
18
|
{ name: 'type', value: 'rating' },
|
19
19
|
{ name: 'enabled', value: '1' },
|
20
|
-
{ name: '
|
20
|
+
{ name: 'message[error]', value: 'Wrong answer' }
|
21
21
|
],
|
22
22
|
[
|
23
23
|
{ name: 'question', value: 'Satisfied?' },
|
24
24
|
{ name: 'type', value: 'yes_no' },
|
25
|
-
{ name: 'primary_language', selectedOptions: [ { value: 'id2', text: 'Item 2' } ] },
|
26
|
-
{ name: '
|
25
|
+
{ name: '[primary_language]', selectedOptions: [ { value: 'id2', text: 'Item 2' } ] },
|
26
|
+
{ name: 'message[error]', value: 'Incompatible selection' }
|
27
27
|
]
|
28
28
|
]
|
29
29
|
form.fields_dynamicGroup id: 'form_dynamic_group', width: 'matchParent', name: 'user[evaluation]', groupFieldProperties: properties, titlePrefix: 'Entry', content: ->(group) do
|
30
30
|
group.template padding: { left: 32 }, childViews: ->(template) do
|
31
31
|
template.spacer height: 10
|
32
|
-
template.fields_hidden name: '
|
32
|
+
template.fields_hidden name: 'message[error]'
|
33
33
|
template.fields_text width: 'matchParent', name: 'question', label: 'Question', placeholder: 'Question'
|
34
34
|
|
35
35
|
form.panels_responsive id: 'responsive_{{entryIndex}}', childViews: ->(column) do
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
36
|
+
column.panels_split width: 'matchParent', content: ->(split) do
|
37
|
+
split.center childViews: ->(center) do
|
38
|
+
center.fields_dynamicSelect \
|
39
|
+
name: '[primary_language]',
|
40
|
+
width: 'matchParent',
|
41
|
+
label: 'Primary Language',
|
42
|
+
# selectedOptions: [ { value: 'id3', text: 'Item 3' } ],
|
43
|
+
url: json_ui_garage_url(path: 'forms/dynamic_select_data'),
|
44
|
+
placeholder: 'Start typing'
|
45
|
+
end
|
45
46
|
end
|
46
|
-
end
|
47
47
|
|
48
48
|
options = [:rating, :yes_no, :choices, :unspecified]
|
49
49
|
template.fields_select \
|
@@ -140,10 +140,10 @@ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', p
|
|
140
140
|
action.logics_set debug: true, targetId: 'error_icon_{{entryIndex}}', conditionalData: {
|
141
141
|
displayed: {
|
142
142
|
"!!": [
|
143
|
-
{ 'var': '{{entryPrefix}}[
|
143
|
+
{ 'var': '{{entryPrefix}}[message][error]' }
|
144
144
|
]
|
145
145
|
},
|
146
|
-
'tooltip.text': { 'var': '{{entryPrefix}}[
|
146
|
+
'tooltip.text': { 'var': '{{entryPrefix}}[message][error]' }
|
147
147
|
}
|
148
148
|
end
|
149
149
|
template.panels_vertical id: 'choices_panel_{{entryIndex}}', childViews: ->(vertical) do
|
File without changes
|
@@ -14,7 +14,13 @@ Code line 1
|
|
14
14
|
Code line 2
|
15
15
|
```
|
16
16
|
## Header 2
|
17
|
+
|
17
18
|
`Inline code`
|
19
|
+
|
20
|
+
Do you know you can paste image or file here?
|
21
|
+
|
22
|
+
You can mention devs too! Try type @hg
|
23
|
+
|
18
24
|
Signature
|
19
25
|
TEXT
|
20
26
|
|
@@ -37,18 +43,14 @@ page.form url: json_ui_garage_url(path: 'forms/basic_post'), method: 'post', pad
|
|
37
43
|
# value: "<p>Test <img src='{{image1}}'</p>",
|
38
44
|
# value: glib_format_markdown(initial_message),
|
39
45
|
value: initial_message,
|
40
|
-
|
41
|
-
images: [
|
42
|
-
{
|
43
|
-
value: 'eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBFQT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--193dc0d939b9558fc4973fafbba91d989cbb04d4',
|
44
|
-
fileUrl: 'https://imageserver-demo.herokuapp.com/image/itinerarybuilder-demo/o6CKzNt67PWnkPdUEnWMt7pr?h=100&w=100'
|
45
|
-
}
|
46
|
-
],
|
46
|
+
mentionList: ['ikhwanh', 'hgani', 'fahmiaga', 'dwirendra', 'nazlifs'],
|
47
47
|
imageUploader: {
|
48
48
|
name: 'user[images_attributes][]',
|
49
|
-
accepts: { fileType: 'image', maxFileSize: 5000 },
|
50
|
-
directUploadUrl: glib_direct_uploads_url
|
49
|
+
accepts: { fileType: ['image', 'csv', 'xlsx', 'pptx', 'docx'], maxFileSize: 5000 },
|
50
|
+
directUploadUrl: glib_direct_uploads_url,
|
51
|
+
blobUrlGenerator: glib_blob_url_generators_url
|
51
52
|
},
|
53
|
+
debug: true,
|
52
54
|
onChange: ->(action) do
|
53
55
|
action.forms_submit overrideUrl: json_ui_garage_url(path: 'forms/rich_text_preview')
|
54
56
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
data = params[:user] || {}
|
2
2
|
|
3
|
-
|
3
|
+
json_ui_response json do |action|
|
4
4
|
action.components_replace targetId: 'preview', newView: ->(update) do
|
5
5
|
update.panels_vertical childViews: ->(vertical) do
|
6
6
|
vertical.label text: "Hello #{data[:name]},"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -6,7 +6,7 @@ options = {
|
|
6
6
|
'plant' => ['herb', 'rice', 'vegetable'].map { |v| { text: v.humanize, value: v } }
|
7
7
|
}[value]
|
8
8
|
|
9
|
-
|
9
|
+
json_ui_response json do |action|
|
10
10
|
action.components_set targetId: 'options', data: {
|
11
11
|
options: options
|
12
12
|
}
|
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
|
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
|
data/config/routes.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/glib/dynamic_text.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
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.
|
4
|
+
version: 4.27.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ''
|
@@ -114,6 +114,7 @@ files:
|
|
114
114
|
- app/controllers/concerns/glib/json/traversal.rb
|
115
115
|
- app/controllers/concerns/glib/json/ui.rb
|
116
116
|
- app/controllers/concerns/glib/json/validation.rb
|
117
|
+
- app/controllers/glib/blob_url_generators_controller.rb
|
117
118
|
- app/controllers/glib/errors_controller.rb
|
118
119
|
- app/controllers/glib/glib_direct_uploads_controller.rb
|
119
120
|
- app/controllers/glib/home_controller.rb
|
@@ -411,8 +412,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
411
412
|
- !ruby/object:Gem::Version
|
412
413
|
version: '0'
|
413
414
|
requirements: []
|
414
|
-
|
415
|
-
rubygems_version: 2.7.6
|
415
|
+
rubygems_version: 3.4.6
|
416
416
|
signing_key:
|
417
417
|
specification_version: 4
|
418
418
|
summary: ''
|