glib-web 3.8.1 → 3.8.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/auth/policy.rb +7 -5
- data/app/controllers/concerns/glib/json/libs.rb +11 -0
- 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/forms_helper.rb +0 -0
- data/app/helpers/glib/json_ui/action_builder/sheets.rb +0 -0
- data/app/helpers/glib/json_ui/action_builder.rb +4 -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/list_builders.rb +3 -0
- data/app/helpers/glib/json_ui/table_builders.rb +0 -0
- data/app/helpers/glib/urls_helper.rb +19 -1
- data/app/models/concerns/glib/enum_humanization.rb +26 -0
- data/app/models/glib/active_storage/attachment.rb +0 -0
- data/app/models/glib/active_storage/blob.rb +0 -0
- data/app/models/glib/application_record.rb +10 -8
- 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/_reload.json.jbuilder +0 -0
- data/app/views/json_ui/garage/actions/_sheets.json.jbuilder +0 -0
- data/app/views/json_ui/garage/actions/dialogs_oauth_post.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/dynamic_group.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/dynamic_select_data.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/generic_post.json.jbuilder +0 -0
- data/app/views/json_ui/garage/forms/show_hide.json.jbuilder +3 -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/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/edit_mode.json.jbuilder +1 -1
- 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/index.json.jbuilder +0 -0
- data/app/views/json_ui/garage/pages/layout.json.jbuilder +0 -0
- data/app/views/json_ui/garage/pages/lifecycle_hooks.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/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/images.json.jbuilder +5 -0
- data/app/views/json_ui/garage/views/links.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/config/routes.rb +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/crypt/utils.rb +0 -0
- data/lib/glib/crypt.rb +0 -0
- data/lib/glib/dynamic_text/config.rb +0 -0
- data/lib/glib/dynamic_text.rb +0 -0
- data/lib/glib/engine.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/forms_submit.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/json_crawler.rb +0 -0
- data/lib/glib/mailer_tester.rb +0 -0
- data/lib/glib/value.rb +0 -0
- data/lib/glib/version.rb +0 -0
- data/lib/glib-web.rb +0 -0
- data/lib/tasks/db.rake +2 -0
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: adcc5121f8959025d9937146a154b771c1b5792019223b5845f5a3445a9b7e03
|
|
4
|
+
data.tar.gz: e05846e84a368a702bb2d391436e69c94397432b3192946ddb723639ead60592
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 27c4de7b3dd80a009e9178511cd921884d217289b3a6c64b9980ac5c353d4a90be58eb727e59e067315b7d66ec74c4509741d6fdffcc3c9b5ef17bf63bdb9378
|
|
7
|
+
data.tar.gz: 31c82c4e57b0449a52fd2327b3c8f8645ab8a5b2a0c72dcf72b76076f20c8531eab684bf9052d13e899869c78379682d84af6a27d4d5d95217e9c4b9c3b8c7ea
|
|
@@ -29,11 +29,13 @@ module Glib::Auth
|
|
|
29
29
|
return @__pundit_policies[policy_name]
|
|
30
30
|
end
|
|
31
31
|
|
|
32
|
-
if policy_name.is_a?(Symbol) && policy_name.to_s.ends_with?('_admin')
|
|
33
|
-
|
|
34
|
-
else
|
|
35
|
-
|
|
36
|
-
end
|
|
32
|
+
# if policy_name.is_a?(Symbol) && policy_name.to_s.ends_with?('_admin')
|
|
33
|
+
# policy_class = CommonAdminPolicy
|
|
34
|
+
# else
|
|
35
|
+
# policy_class = Pundit::PolicyFinder.new(policy_name).policy
|
|
36
|
+
# end
|
|
37
|
+
|
|
38
|
+
policy_class = Pundit::PolicyFinder.new(policy_name).policy
|
|
37
39
|
|
|
38
40
|
raise "Policy not found for #{policy_name.is_a?(Symbol) || policy_name.is_a?(Class) ? policy_name : policy_name.class}" unless policy_class
|
|
39
41
|
|
|
@@ -58,6 +58,17 @@ module Glib::Json::Libs
|
|
|
58
58
|
JSON.parse(render_to_string(template, locals: args))
|
|
59
59
|
end
|
|
60
60
|
|
|
61
|
+
def glib_ui_redirect_to(url)
|
|
62
|
+
respond_to do |format|
|
|
63
|
+
format.html do
|
|
64
|
+
redirect_to url
|
|
65
|
+
end
|
|
66
|
+
format.json do
|
|
67
|
+
glib_json_redirect_to url
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
|
|
61
72
|
def glib_force_json_ui
|
|
62
73
|
if params[:_render] != 'v1'
|
|
63
74
|
redirect_to url_for(params.to_unsafe_h.merge(_render: 'v1'))
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -57,8 +57,11 @@ module Glib
|
|
|
57
57
|
|
|
58
58
|
module Forms
|
|
59
59
|
class Submit < Action
|
|
60
|
-
# Change the URL to submit and bypass all frontend validations.
|
|
60
|
+
# Change the URL to submit and bypass all frontend validations. This is useful for
|
|
61
|
+
# previewing and showing/hiding certain components based on user's selection prior
|
|
62
|
+
# to submitting the final data.
|
|
61
63
|
string :overrideUrl
|
|
64
|
+
string :overrideMethod
|
|
62
65
|
end
|
|
63
66
|
end
|
|
64
67
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
module Glib
|
|
2
2
|
module UrlsHelper
|
|
3
|
-
def glib_url_current(new_params)
|
|
3
|
+
def glib_url_current(new_params = {})
|
|
4
4
|
url_for(params.to_unsafe_h.merge(new_params.merge(only_path: false)))
|
|
5
5
|
end
|
|
6
6
|
|
|
@@ -8,5 +8,23 @@ module Glib
|
|
|
8
8
|
route = Rails.application.routes.recognize_path(url)
|
|
9
9
|
route[:controller] == controller_name && route[:action] == action_name
|
|
10
10
|
end
|
|
11
|
+
|
|
12
|
+
def glib_url_build(protocol, host, port, path, params = {})
|
|
13
|
+
case (protocol = protocol.chomp('://'))
|
|
14
|
+
when 'http'
|
|
15
|
+
request_builder = URI::HTTP
|
|
16
|
+
when 'https'
|
|
17
|
+
request_builder = URI::HTTPS
|
|
18
|
+
else
|
|
19
|
+
Rollbar.warn("Unsupported protocol: #{protocol}")
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
request_builder.build(
|
|
23
|
+
host: host,
|
|
24
|
+
port: port,
|
|
25
|
+
path: path,
|
|
26
|
+
query: params.to_query
|
|
27
|
+
)
|
|
28
|
+
end
|
|
11
29
|
end
|
|
12
30
|
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# To use this, simply:
|
|
2
|
+
# - Include the module
|
|
3
|
+
# - Add this migration: `add_column :model, :deleted_at, :datetime, null: true`
|
|
4
|
+
#
|
|
5
|
+
# After that, any call to `destroy` will automatically be a soft-deletion.
|
|
6
|
+
module Glib
|
|
7
|
+
module EnumHumanization
|
|
8
|
+
extend ActiveSupport::Concern
|
|
9
|
+
|
|
10
|
+
included do
|
|
11
|
+
extend ClassMethods
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def glib_enum_humanize(enum_name, default_value = nil)
|
|
15
|
+
self.class.glib_enum_humanize(enum_name, send(enum_name), default_value)
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
module ClassMethods
|
|
20
|
+
def glib_enum_humanize(enum_name, enum_value, default_value = nil)
|
|
21
|
+
if enum_value
|
|
22
|
+
I18n.t("activerecord.attributes.#{model_name.i18n_key}.#{enum_name.to_s.pluralize}.#{enum_value}", default: default_value)
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
File without changes
|
|
File without changes
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
module Glib
|
|
2
2
|
class ApplicationRecord < ActiveRecord::Base
|
|
3
|
+
include EnumHumanization
|
|
4
|
+
|
|
3
5
|
self.abstract_class = true
|
|
4
6
|
|
|
5
7
|
scope :created_asc, -> { order(created_at: :asc) }
|
|
6
8
|
scope :created_desc, -> { order(created_at: :desc) }
|
|
7
9
|
|
|
8
|
-
def glib_enum_humanize(enum_name, default_value = nil)
|
|
9
|
-
|
|
10
|
-
end
|
|
10
|
+
# def glib_enum_humanize(enum_name, default_value = nil)
|
|
11
|
+
# self.class.glib_enum_humanize(enum_name, send(enum_name), default_value)
|
|
12
|
+
# end
|
|
11
13
|
|
|
12
|
-
def self.glib_enum_humanize(enum_name, enum_value, default_value = nil)
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
end
|
|
14
|
+
# def self.glib_enum_humanize(enum_name, enum_value, default_value = nil)
|
|
15
|
+
# if enum_value
|
|
16
|
+
# I18n.t("activerecord.attributes.#{model_name.i18n_key}.#{enum_name.to_s.pluralize}.#{enum_value}", default: default_value)
|
|
17
|
+
# end
|
|
18
|
+
# end
|
|
17
19
|
end
|
|
18
20
|
end
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -262,7 +262,9 @@ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', p
|
|
|
262
262
|
|
|
263
263
|
form.spacer height: 8
|
|
264
264
|
|
|
265
|
-
|
|
265
|
+
if !Rails.env.test?
|
|
266
|
+
form.button text: 'Reload component', onClick: ->(action) { action.windows_reload url: json_ui_garage_current_url({ key: SecureRandom.hex(3) }) }
|
|
267
|
+
end
|
|
266
268
|
|
|
267
269
|
if !params[:key]
|
|
268
270
|
form.fields_check name: 'user[loadif4]', label: 'Show reload component 1', checkValue: 'true', uncheckValue: 'false', value: 'false'
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -7,6 +7,11 @@ render "#{@path_prefix}/nav_menu", json: json, page: page
|
|
|
7
7
|
small_image_url = 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSGQpSWjtELISLBlmugOZ6wzl1JamYXQvbFeYywpfg3E8b8DrO0Kg&s'
|
|
8
8
|
|
|
9
9
|
page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
|
|
10
|
+
scroll.panels_column lg: { cols: 3 }, md: { cols: 1 }, sm: { cols: 1 }, xs: { cols: 1 }
|
|
11
|
+
scroll.panels_column backgroundColor: '#333333', height: 'matchParent', lg: { cols: 3 }, xs: { cols: 4 }, childViews: ->(column) do
|
|
12
|
+
column.image width: 'matchParent', url: glib_json_image_standard_url
|
|
13
|
+
end
|
|
14
|
+
|
|
10
15
|
scroll.h2 text: 'Avatar'
|
|
11
16
|
scroll.spacer height: 6
|
|
12
17
|
scroll.avatar \
|
|
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/crypt/utils.rb
CHANGED
|
File without changes
|
data/lib/glib/crypt.rb
CHANGED
|
File without changes
|
|
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
|
|
File without changes
|
|
File without changes
|
data/lib/glib/json_crawler.rb
CHANGED
|
File without changes
|
data/lib/glib/mailer_tester.rb
CHANGED
|
File without changes
|
data/lib/glib/value.rb
CHANGED
|
File without changes
|
data/lib/glib/version.rb
CHANGED
|
File without changes
|
data/lib/glib-web.rb
CHANGED
|
File without changes
|
data/lib/tasks/db.rake
CHANGED
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: 3.8.
|
|
4
|
+
version: 3.8.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- ''
|
|
@@ -121,6 +121,7 @@ files:
|
|
|
121
121
|
- app/helpers/glib/json_ui/view_builder/multimedia.rb
|
|
122
122
|
- app/helpers/glib/json_ui/view_builder/panels.rb
|
|
123
123
|
- app/helpers/glib/urls_helper.rb
|
|
124
|
+
- app/models/concerns/glib/enum_humanization.rb
|
|
124
125
|
- app/models/concerns/glib/soft_deletable.rb
|
|
125
126
|
- app/models/glib/active_storage/attachment.rb
|
|
126
127
|
- app/models/glib/active_storage/blob.rb
|
|
@@ -318,7 +319,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
318
319
|
- !ruby/object:Gem::Version
|
|
319
320
|
version: '0'
|
|
320
321
|
requirements: []
|
|
321
|
-
|
|
322
|
+
rubyforge_project:
|
|
323
|
+
rubygems_version: 2.7.6
|
|
322
324
|
signing_key:
|
|
323
325
|
specification_version: 4
|
|
324
326
|
summary: ''
|