glib-web 4.1.0 → 4.1.2
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/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/sheets.rb +0 -0
- 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/view_builder/fields.rb +7 -2
- data/app/helpers/glib/json_ui/view_builder/panels.rb +32 -2
- 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/forms/checkboxes.json.jbuilder +5 -0
- data/app/views/json_ui/garage/forms/dynamic_select_data.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/file_upload.json.jbuilder +1 -0
- data/app/views/json_ui/garage/forms/generic_post.json.jbuilder +0 -0
- 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/text_validation.json.jbuilder +1 -0
- 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_section.json.jbuilder +1 -1
- 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/panels/ul.json.jbuilder +19 -4
- 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/tables/index.json.jbuilder +0 -0
- data/app/views/json_ui/garage/views/calendar_data.json.jbuilder +0 -0
- data/app/views/json_ui/garage/views/links.json.jbuilder +1 -1
- 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/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/blob.rb +11 -3
- data/lib/glib/direct_uploads_controller.rb +1 -1
- data/lib/glib/dynamic_text/config.rb +0 -0
- data/lib/glib/dynamic_text.rb +0 -0
- data/lib/glib/engine.rb +2 -1
- 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/s3_service.rb +30 -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: bbf47486dbe68678b731438238a642383682ac7fa2b5fd85c40784a46dd8b05e
|
|
4
|
+
data.tar.gz: 48745d3666ada734c838020fc10828187d22c0d06b8f95ad8d45b942ad922518
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8bb4e390bb6058cfa4e262ca6da33770fe934508865790a08cfb42425603e3480ccc928f92ed81493fae82a953a15946f68231310a9983cfa42446361f8d56a7
|
|
7
|
+
data.tar.gz: c62be0278b0a8f13005d250ffe06beb52cae2fc500eee818995209c8acde78174fc00b449a126ef37eae5f0336be611dbbbcbd4cdf7a0aa7359b7afdcd419bcb
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -53,6 +53,10 @@ class Glib::JsonUi::ViewBuilder
|
|
|
53
53
|
@prop = prop
|
|
54
54
|
end
|
|
55
55
|
|
|
56
|
+
def autoValidate(autoValidate)
|
|
57
|
+
@autoValidate = autoValidate
|
|
58
|
+
end
|
|
59
|
+
|
|
56
60
|
# Override
|
|
57
61
|
def created
|
|
58
62
|
if @prop && (form = page.current_form)
|
|
@@ -79,8 +83,7 @@ class Glib::JsonUi::ViewBuilder
|
|
|
79
83
|
# - Placeholder competes with label for space
|
|
80
84
|
json.placeholder @placeholder if @placeholder
|
|
81
85
|
|
|
82
|
-
|
|
83
|
-
# json.validation @validation if @validation
|
|
86
|
+
json.validation @validation if @autoValidate
|
|
84
87
|
end
|
|
85
88
|
|
|
86
89
|
# To be overridden
|
|
@@ -139,6 +142,7 @@ class Glib::JsonUi::ViewBuilder
|
|
|
139
142
|
string :text
|
|
140
143
|
color :color
|
|
141
144
|
icon :icon
|
|
145
|
+
bool :disableIfFormInvalid
|
|
142
146
|
end
|
|
143
147
|
|
|
144
148
|
class CheckGroup < AbstractField
|
|
@@ -317,6 +321,7 @@ class Glib::JsonUi::ViewBuilder
|
|
|
317
321
|
|
|
318
322
|
string :storagePrefix
|
|
319
323
|
hash :metadata
|
|
324
|
+
string :tagging
|
|
320
325
|
|
|
321
326
|
required :accepts, :directUploadUrl
|
|
322
327
|
|
|
@@ -121,10 +121,40 @@ class Glib::JsonUi::ViewBuilder
|
|
|
121
121
|
def self.field_validation(model, prop)
|
|
122
122
|
validations = {}
|
|
123
123
|
model.class.validators_on(prop).each do |validator|
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
validations[validator.kind] = validator.options.except(:if, :unless)
|
|
125
|
+
validations[validator.kind][:message] = validator.options[:message]
|
|
126
|
+
case validator.kind
|
|
127
|
+
when :presence
|
|
128
|
+
validations[validator.kind][:message] ||= I18n.t('errors.messages.present')
|
|
129
|
+
when :acceptance
|
|
130
|
+
validations[validator.kind][:message] ||= I18n.t('errors.messages.accepted')
|
|
131
|
+
when :confirmation
|
|
132
|
+
# raise NotImplemented
|
|
133
|
+
when :numericality
|
|
134
|
+
# raise NotImplemented
|
|
135
|
+
when :comparison
|
|
136
|
+
comparison = validator.options.first[0]
|
|
137
|
+
validations[validator.kind][:message] ||= I18n.t("errors.messages.#{comparison}")
|
|
138
|
+
when :format
|
|
139
|
+
validations[validator.kind][:message] ||= I18n.t('errors.messages.invalid')
|
|
140
|
+
when :inclusion
|
|
141
|
+
validations[validator.kind][:message] ||= I18n.t('errors.messages.inclusion')
|
|
142
|
+
when :exclusion
|
|
143
|
+
validations[validator.kind][:message] ||= I18n.t('errors.messages.exclusion')
|
|
144
|
+
when :length
|
|
145
|
+
validations[validator.kind][:message] = {
|
|
146
|
+
too_long: I18n.t('errors.messages.too_long'),
|
|
147
|
+
wrong_length: I18n.t('errors.messages.wrong_length'),
|
|
148
|
+
too_short: I18n.t('errors.messages.too_short')
|
|
149
|
+
}
|
|
126
150
|
end
|
|
127
151
|
end
|
|
152
|
+
|
|
153
|
+
if validations[:presence].present?
|
|
154
|
+
validations[:required] = validations[:presence]
|
|
155
|
+
validations.delete(:presence)
|
|
156
|
+
end
|
|
157
|
+
|
|
128
158
|
validations
|
|
129
159
|
end
|
|
130
160
|
|
|
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
|
|
@@ -32,6 +32,11 @@ page.scroll childViews: ->(scroll) do
|
|
|
32
32
|
group.fields_check checkValue: 4, label: 'Photography'
|
|
33
33
|
end
|
|
34
34
|
|
|
35
|
+
form.spacer height: 20
|
|
36
|
+
form.h2 text: 'Check without group'
|
|
37
|
+
form.spacer height: 4
|
|
38
|
+
form.fields_check name: 'user[driver]', label: 'Do you have driver license?'
|
|
39
|
+
|
|
35
40
|
form.spacer height: 20
|
|
36
41
|
form.button text: 'Submit', onClick: ->(action) { action.forms_submit }
|
|
37
42
|
end
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -11,7 +11,7 @@ section.rows builder: ->(row) do
|
|
|
11
11
|
array.each do |i|
|
|
12
12
|
index = page_index * batch_count + i
|
|
13
13
|
if local_assigns[:reorder]
|
|
14
|
-
row.thumbnail title: "Item #{index}"
|
|
14
|
+
row.thumbnail title: "Item #{index}"
|
|
15
15
|
else
|
|
16
16
|
row.thumbnail title: "Item #{index}", subtitle: "Sub Item #{index}", subsubtitle: "Sub Sub Item #{index}"
|
|
17
17
|
end
|
|
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
|
|
@@ -38,10 +38,25 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
|
|
|
38
38
|
action.windows_open url: json_ui_garage_url(path: 'home/blank')
|
|
39
39
|
end
|
|
40
40
|
|
|
41
|
-
ul.button icon: 'keyboard_arrow_down', text: 'Level 2', styleClass: 'link',
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
ul.button icon: 'keyboard_arrow_down', text: 'Level 2', styleClass: 'link', onClick: ->(action) do
|
|
42
|
+
action.popovers_show \
|
|
43
|
+
key: 'menu',
|
|
44
|
+
placement: 'bottom-start',
|
|
45
|
+
content: ->(dialog) do
|
|
46
|
+
dialog.body childViews: ->(view) do
|
|
47
|
+
view.panels_responsive styleClass: 'popover-menu', width: 200, childViews: ->(res) do
|
|
48
|
+
res.label text: 'Item 1', styleClass: 'popover-menu-item', onClick: ->(saction) do
|
|
49
|
+
saction.popovers_close key: 'menu'
|
|
50
|
+
end
|
|
51
|
+
res.label text: 'Item 2', styleClass: 'popover-menu-item', onClick: ->(saction) do
|
|
52
|
+
saction.popovers_close key: 'menu'
|
|
53
|
+
end
|
|
54
|
+
res.label text: 'Item 3', styleClass: 'popover-menu-item', onClick: ->(saction) do
|
|
55
|
+
saction.popovers_close key: 'menu'
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
45
60
|
end
|
|
46
61
|
ul.label text: 'Level 3'
|
|
47
62
|
end
|
|
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
|
|
@@ -58,7 +58,7 @@ json_ui_page json do |page|
|
|
|
58
58
|
scroll.spacer height: 20
|
|
59
59
|
scroll.h2 text: 'Icon with onClick'
|
|
60
60
|
scroll.spacer height: 6
|
|
61
|
-
scroll.icon
|
|
61
|
+
scroll.icon name: 'info', onClick: ->(action) do
|
|
62
62
|
action.windows_open url: json_ui_garage_url(path: 'home/blank')
|
|
63
63
|
end
|
|
64
64
|
|
|
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/lib/glib/blob.rb
CHANGED
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
::ActiveStorage::Blob.class_eval do
|
|
2
|
+
attr_accessor :tagging
|
|
3
|
+
|
|
4
|
+
# removing custom_metadata and add tagging
|
|
2
5
|
def service_headers_for_direct_upload
|
|
3
|
-
service.headers_for_direct_upload key, filename: filename, content_type: content_type, content_length: byte_size, checksum: checksum
|
|
6
|
+
service.headers_for_direct_upload key, filename: filename, content_type: content_type, content_length: byte_size, checksum: checksum, tagging: tagging
|
|
7
|
+
end
|
|
8
|
+
def service_url_for_direct_upload(expires_in: ActiveStorage.service_urls_expire_in)
|
|
9
|
+
service.url_for_direct_upload key, expires_in: expires_in, content_type: content_type, content_length: byte_size, checksum: checksum, custom_metadata: custom_metadata, tagging: tagging
|
|
4
10
|
end
|
|
5
11
|
|
|
6
12
|
class << self
|
|
7
|
-
def create_before_direct_upload!(key: nil, filename:, byte_size:, checksum:, content_type: nil, metadata: nil, service_name: nil, record: nil, prefix: nil)
|
|
13
|
+
def create_before_direct_upload!(key: nil, filename:, byte_size:, checksum:, content_type: nil, metadata: nil, service_name: nil, record: nil, prefix: nil, tagging: nil)
|
|
8
14
|
key_name = key || generate_unique_secure_token
|
|
9
15
|
if prefix.present?
|
|
10
16
|
key_name = "#{prefix}/#{key_name}"
|
|
11
17
|
end
|
|
12
|
-
create! key: key_name, filename: filename, byte_size: byte_size, checksum: checksum, content_type: content_type, metadata: metadata, service_name: service_name
|
|
18
|
+
blob = create! key: key_name, filename: filename, byte_size: byte_size, checksum: checksum, content_type: content_type, metadata: metadata, service_name: service_name
|
|
19
|
+
blob.tagging = tagging
|
|
20
|
+
blob
|
|
13
21
|
end
|
|
14
22
|
end
|
|
15
23
|
end
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
|
|
20
20
|
private
|
|
21
21
|
def blob_args
|
|
22
|
-
params.require(:blob).permit(:filename, :byte_size, :checksum, :content_type, :prefix, metadata: {}).to_h.symbolize_keys
|
|
22
|
+
params.require(:blob).permit(:filename, :byte_size, :checksum, :content_type, :prefix, :tagging, metadata: {}).to_h.symbolize_keys
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
def authenticate_user!
|
|
File without changes
|
data/lib/glib/dynamic_text.rb
CHANGED
|
File without changes
|
data/lib/glib/engine.rb
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
require 'active_storage/service/s3_service'
|
|
2
|
+
|
|
3
|
+
::ActiveStorage::Service::S3Service.class_eval do
|
|
4
|
+
attr_reader :headers_for_request
|
|
5
|
+
|
|
6
|
+
# Change presigned_url to presigned_request
|
|
7
|
+
# appearently presigned_url hoist all header `x-amz-` to query params.
|
|
8
|
+
# This is cause problem because S3 server ignore `x-amz-tagging` query params so it fails to tagging an object
|
|
9
|
+
# API: https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/S3/Presigner.html#presigned_request-instance_method
|
|
10
|
+
# Detail about problem: https://github.com/aws/aws-sdk/issues/782
|
|
11
|
+
def url_for_direct_upload(key, expires_in:, content_type:, content_length:, checksum:, tagging: nil, custom_metadata: {})
|
|
12
|
+
instrument :url, key: key do |payload|
|
|
13
|
+
generated_url, headers = object_for(key).presigned_request :put, expires_in: expires_in.to_i,
|
|
14
|
+
content_type: content_type, content_length: content_length, content_md5: checksum,
|
|
15
|
+
metadata: custom_metadata, whitelist_headers: ['content-length'], tagging: tagging, **upload_options
|
|
16
|
+
|
|
17
|
+
payload[:url] = generated_url
|
|
18
|
+
@headers_for_request = headers
|
|
19
|
+
|
|
20
|
+
generated_url
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def headers_for_direct_upload(key, content_type:, checksum:, filename: nil, disposition: nil, tagging: nil, custom_metadata: {}, **)
|
|
25
|
+
content_disposition = content_disposition_with(type: disposition, filename: filename) if filename
|
|
26
|
+
|
|
27
|
+
headers = { 'Content-Type' => content_type, 'Content-MD5' => checksum, 'Content-Disposition' => content_disposition, **custom_metadata_headers(custom_metadata) }
|
|
28
|
+
headers.merge(headers_for_request)
|
|
29
|
+
end
|
|
30
|
+
end
|
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.1.
|
|
4
|
+
version: 4.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- ''
|
|
@@ -328,6 +328,7 @@ files:
|
|
|
328
328
|
- lib/glib/json_crawler/http.rb
|
|
329
329
|
- lib/glib/json_crawler/router.rb
|
|
330
330
|
- lib/glib/mailer_tester.rb
|
|
331
|
+
- lib/glib/s3_service.rb
|
|
331
332
|
- lib/glib/test_helpers.rb
|
|
332
333
|
- lib/glib/time_freezable_mailer.rb
|
|
333
334
|
- lib/glib/time_returning_mailer.rb
|
|
@@ -352,8 +353,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
352
353
|
- !ruby/object:Gem::Version
|
|
353
354
|
version: '0'
|
|
354
355
|
requirements: []
|
|
355
|
-
|
|
356
|
-
rubygems_version: 2.7.6
|
|
356
|
+
rubygems_version: 3.4.6
|
|
357
357
|
signing_key:
|
|
358
358
|
specification_version: 4
|
|
359
359
|
summary: ''
|