web47core 3.2.3.43 → 3.2.3.44

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.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/errors_controller.rb +7 -9
  3. data/app/controllers/status_controller.rb +3 -1
  4. data/app/helpers/card_nav_builder.rb +6 -3
  5. data/app/helpers/core_card_nav_items_helper.rb +0 -1
  6. data/app/helpers/core_data_grid_helper.rb +2 -1
  7. data/app/helpers/core_dropdown_helper.rb +4 -1
  8. data/app/helpers/core_floating_action_button_helper.rb +8 -6
  9. data/app/helpers/core_form_checkbox_helper.rb +3 -2
  10. data/app/helpers/core_form_helper.rb +7 -2
  11. data/app/helpers/core_form_input_helper.rb +2 -2
  12. data/app/helpers/core_form_select_helper.rb +1 -0
  13. data/app/helpers/core_form_textarea_helper.rb +4 -3
  14. data/app/helpers/core_link_helper.rb +2 -2
  15. data/app/helpers/core_nav_bar_helper.rb +6 -3
  16. data/app/helpers/core_table_action_helper.rb +4 -4
  17. data/app/helpers/core_table_helper.rb +2 -2
  18. data/app/helpers/model_modal_helper.rb +6 -4
  19. data/app/helpers/svg_icon_helper.rb +12 -7
  20. data/lib/app/controllers/concerns/core_controller.rb +1 -0
  21. data/lib/app/controllers/concerns/core_cron_tabs_controller.rb +1 -0
  22. data/lib/app/controllers/concerns/core_delayed_jobs_controller.rb +4 -0
  23. data/lib/app/controllers/concerns/core_system_configuration_controller.rb +2 -2
  24. data/lib/app/jobs/application_job.rb +1 -1
  25. data/lib/app/jobs/cron/emitter.rb +1 -1
  26. data/lib/app/jobs/cron/switchboard_sync_configuration.rb +8 -0
  27. data/lib/app/models/concerns/cdn_url.rb +1 -1
  28. data/lib/app/models/concerns/class_name.rb +1 -0
  29. data/lib/app/models/concerns/core_user.rb +0 -1
  30. data/lib/app/models/concerns/switchboard_able.rb +1 -1
  31. data/lib/app/models/notification.rb +1 -1
  32. data/lib/app/models/redis_configuration.rb +1 -1
  33. data/lib/app/validators/http_url_validator.rb +2 -3
  34. data/lib/merge_coverage.rb +2 -2
  35. data/lib/update_icons.rb +3 -3
  36. data/lib/web47core/boolean_flux_capacitor.rb +0 -1
  37. data/lib/web47core/version.rb +1 -1
  38. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1c38f0e545dfc8cb448c6f81d1797865f85b73a3ad8efe6e3e8912eaea1017db
4
- data.tar.gz: 4fb1faf78c41405b5d0fab207b640d7b428c424bf53a361f59fbf3b4a83b7e64
3
+ metadata.gz: 3adced90c2a22503ee987e0c720d5ea1e007f4fbc656dbc90bdc7fa7cf075ae8
4
+ data.tar.gz: 9e3018472076d431cccfa4009d08ab6bfdb91e5bad5e803cf11a3d3de913847f
5
5
  SHA512:
6
- metadata.gz: a3ae117203e66f4b9c2a02cadd2fa322b9e62be14fe68e9d7588fb37a566ef8121b58bff09a95f95668458100133f14b44fa8d976ec8c80d31a7c0209c2670cc
7
- data.tar.gz: 9d7c26fe8b4d246dff55bcb1e4545ff57ed7de3ec84e9f4697fba8385be903761d2d3f5529cb9add05e608d93586b4cd162acfb4164b9a2e172fe4722bebc124
6
+ metadata.gz: c8879b69e2ec9d801ee359c6be12100d80c6df3c45e849241acba09a17cc704049339b8fb68e6d4faf41c09e62ba60cc793d5ba21aca3dd4b7a0de0e644bd8ea
7
+ data.tar.gz: 1535db52112c0f4f5019fc3b5d9230ab284c3938f27093543f3142f344cc26a61f840fc6e33663b4ef9de242de10b3633f83532bc5e78c46b4fc9df3d6227a03
@@ -1,6 +1,6 @@
1
1
  # app/controllers/errors_controller.rb
2
- # We want to inherit `ActionController::Base` here, not `ApplicationController` because we just want a simple, fast response
3
- # with no extra checks for CSRF,authentication, layouts or the ilk. Just say, no, go away!
2
+ # Inherit ActionController::Base, not ApplicationController, so this stays a
3
+ # simple response with no CSRF, authentication, or layout checks.
4
4
  class ErrorsController < ActionController::Base
5
5
  # No CSRF/layout/filters; keep it cheap
6
6
  skip_authorization_check if respond_to?(:skip_authorization_check)
@@ -8,17 +8,15 @@ class ErrorsController < ActionController::Base
8
8
 
9
9
  # @abstract Quietly return a 410 Gone and go away, dont report this
10
10
  def not_found
11
- if defined?(NewRelic) && defined?(NewRelic::Agent)
12
- NewRelic::Agent.ignore_transaction
13
- end
14
- head :gone # 410 Gone is used here to indicate that the resource has been intentionally and permanently removed, and clients should not expect it to be available again. This is stronger than the standard 404 Not Found, which is used when the resource may be available in the future.
11
+ NewRelic::Agent.ignore_transaction if defined?(NewRelic) && defined?(NewRelic::Agent)
12
+ # 410 Gone: the resource was removed on purpose and will not come back.
13
+ # That is stronger than 404, which still allows the resource to return.
14
+ head :gone
15
15
  end
16
16
 
17
17
  # @abstract Quietly return 204 for OPTIONS (preflight)
18
18
  def preflight
19
- if defined?(NewRelic) && defined?(NewRelic::Agent)
20
- NewRelic::Agent.ignore_transaction
21
- end
19
+ NewRelic::Agent.ignore_transaction if defined?(NewRelic) && defined?(NewRelic::Agent)
22
20
  # Add CORS headers if you normally set them (optional)
23
21
  # response.set_header('Access-Control-Allow-Origin', '*')
24
22
  # response.set_header('Access-Control-Allow-Methods', 'GET, POST, PUT, PATCH, DELETE, OPTIONS')
@@ -82,7 +82,9 @@ class StatusController < ActionController::Base
82
82
  key = "redis-status-check-#{SecureRandom.hex(16)}"
83
83
  Rails.cache.write key, value, expires_in: 15.seconds
84
84
  cached_value = Rails.cache.fetch(key)
85
- raise "Redis not available: Expected: #{value} with key #{key}, but got #{cached_value}" unless value.eql?(cached_value)
85
+ unless value.eql?(cached_value)
86
+ raise "Redis not available: Expected: #{value} with key #{key}, but got #{cached_value}"
87
+ end
86
88
 
87
89
  report_success 'Redis Available', count: 1
88
90
  rescue StandardError => error
@@ -1,4 +1,4 @@
1
-
1
+ # Builds the action links shown on a record card.
2
2
  class CardNavBuilder
3
3
  include ActionView::Helpers::TagHelper
4
4
  include SvgIconHelper
@@ -36,7 +36,7 @@ class CardNavBuilder
36
36
  item_link(path, title, icon_name, confirm: confirm, method: method)
37
37
  end
38
38
 
39
- def info_link( path, title: 'Info', icon_name: :info, method: :get)
39
+ def info_link(path, title: 'Info', icon_name: :info, method: :get)
40
40
  return unless can?(:read, @obj)
41
41
 
42
42
  item_link(path, title, icon_name, method: method)
@@ -81,7 +81,10 @@ class CardNavBuilder
81
81
  # @param [String, Symbol] method - The HTTP method to use for the link, default is :get
82
82
  # @param [String] btn_class - The class of button that should be used, btn-primary is the default
83
83
  # @return HTML - The HTML for the given tag
84
- def item_link(path, title, icon_name, confirm: nil, method: :get, btn_class: '')
84
+ def item_link(path, title, icon_name, **options)
85
+ method = options.fetch(:method, :get)
86
+ confirm = options[:confirm]
87
+ btn_class = options.fetch(:btn_class, '')
85
88
  data = { method: method, bs_toggle: :tooltip, placement: :bottom }
86
89
  data[:confirm] = confirm if confirm.present?
87
90
 
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
-
4
3
  #
5
4
  # Help with nav items at the top of cards
6
5
  #
@@ -1,3 +1,4 @@
1
+ # Renders a data grid of a model's fields.
1
2
  module CoreDataGridHelper
2
3
  def data_grid_tag(model, fields: [], except: [], &block)
3
4
  fields = model.class.allowed_param_names(except) + model.class::STANDARD_FIELDS if fields.blank?
@@ -56,4 +57,4 @@ module CoreDataGridHelper
56
57
  'N/S'
57
58
  end
58
59
  end
59
- end
60
+ end
@@ -17,7 +17,10 @@ module CoreDropdownHelper
17
17
  end
18
18
  end
19
19
 
20
- def dropdown_item(path, icon_name, action_name, method: :get, confirm: nil, classes: [])
20
+ def dropdown_item(path, icon_name, action_name, **options)
21
+ method = options.fetch(:method, :get)
22
+ confirm = options[:confirm]
23
+ classes = options.fetch(:classes, [])
21
24
  data = { method: method, turbo_method: method }
22
25
  if confirm.present?
23
26
  data[:confirm] = confirm
@@ -33,17 +33,18 @@ module CoreFloatingActionButtonHelper
33
33
  def multiple_floating_action_button(&block)
34
34
  content_tag(:div, class: 'btn-fab') do
35
35
  concat(content_tag(:button, class: 'btn btn-primary btn-lg rounded-circle',
36
- type: :button,
37
- 'data-bs-toggle': :dropdown,
38
- haspopup: true,
39
- 'aria-expanded': false) do
36
+ type: :button,
37
+ 'data-bs-toggle': :dropdown,
38
+ haspopup: true,
39
+ 'aria-expanded': false) do
40
40
  svg_icon(:more_menu, classes: %w[ri-24px])
41
41
  end)
42
42
  concat(content_tag(:ul, class: 'dropdown-menu') { yield block })
43
43
  end
44
44
  end
45
45
 
46
- def delete_floating_action_button(clazz, path, title: 'Delete', icon_name: :delete, confirm: 'Are you sure you want to delete this item?')
46
+ def delete_floating_action_button(clazz, path, title: 'Delete', icon_name: :delete,
47
+ confirm: 'Are you sure you want to delete this item?')
47
48
  return unless can?(:destroy, clazz)
48
49
 
49
50
  floating_action_link(path, title, icon_name, confirm: confirm, method: :delete)
@@ -64,7 +65,8 @@ module CoreFloatingActionButtonHelper
64
65
  end
65
66
 
66
67
  # @abstract Edit floating action, if the user is allowed to edit the object
67
- def refresh_floating_action_link(clazz, path, title: 'Refresh', icon_name: :replay, confirm: 'Are you sure you want to refresh this item?')
68
+ def refresh_floating_action_link(clazz, path, title: 'Refresh', icon_name: :replay,
69
+ confirm: 'Are you sure you want to refresh this item?')
68
70
  return unless can?(:edit, clazz)
69
71
 
70
72
  floating_action_link(path, title, icon_name, confirm: confirm)
@@ -1,3 +1,4 @@
1
+ # Renders checkbox fields for core forms.
1
2
  module CoreFormCheckboxHelper
2
3
  # @abstract Render a text field
3
4
  # @param [Mongoid::Document] model - The model to render the field for
@@ -38,6 +39,6 @@ module CoreFormCheckboxHelper
38
39
  classes += error.present? ? ' invalid red-text' : ' valid'
39
40
  options[:class] = classes
40
41
  options['data-error'] = error.join(', ') if error.present?
41
- content_tag(:span, options) { label}
42
+ content_tag(:span, options) { label }
42
43
  end
43
- end
44
+ end
@@ -107,7 +107,11 @@ module CoreFormHelper
107
107
  options[:required] = form_required_field?(model, field) ? 'required' : nil
108
108
  tag.label(**options) do
109
109
  concat(input_label(model, field, field.to_s.humanize))
110
- concat(content_tag(:span, class: 'form-help ms-2', data: { bs_toggle: :popover, bs_content: help_text }) { '?' }) if help_text.present?
110
+ if help_text.present?
111
+ concat(content_tag(:span, class: 'form-help ms-2', data: { bs_toggle: :popover, bs_content: help_text }) do
112
+ '?'
113
+ end)
114
+ end
111
115
  # @todo CMS add handling specific errors later
112
116
  # concat(" #{error.join(', ')}") if error.present?
113
117
  end
@@ -160,7 +164,8 @@ module CoreFormHelper
160
164
  return options[:form_id] if options[:form_id].present?
161
165
 
162
166
  field = "#{field}_id" if model.class.reflect_on_association(field).present?
163
- [options[:form_id_prefix], options[:base_name], options[:array_name] || model.class.to_s.underscore, options[:index], field].compact.join('_')
167
+ [options[:form_id_prefix], options[:base_name], options[:array_name] || model.class.to_s.underscore,
168
+ options[:index], field].compact.join('_')
164
169
  end
165
170
 
166
171
  # @abstract Determine if the field is required or not
@@ -1,5 +1,5 @@
1
+ # Renders text and date inputs for core forms.
1
2
  module CoreFormInputHelper
2
-
3
3
  # @abstract Render a date field
4
4
  # @param [Mongoid::Document] model - The model to render the field for
5
5
  # @param [Symbol] field - The field to render
@@ -80,4 +80,4 @@ module CoreFormInputHelper
80
80
  options[:class] = classes.uniq
81
81
  options
82
82
  end
83
- end
83
+ end
@@ -1,3 +1,4 @@
1
+ # Renders select fields for core forms.
1
2
  module CoreFormSelectHelper
2
3
  def form_select(model, field, options = {})
3
4
  value = model.send(field)
@@ -1,3 +1,4 @@
1
+ # Renders textarea fields for core forms.
1
2
  module CoreFormTextareaHelper
2
3
  #
3
4
  # Text area
@@ -14,7 +15,7 @@ module CoreFormTextareaHelper
14
15
  concat(text_area_tag(model, field, value, options))
15
16
  end
16
17
  end
17
- alias_method :form_textarea, :form_text_area
18
+ alias form_textarea form_text_area
18
19
 
19
20
  def text_area_tag(model, field, value, options = {})
20
21
  tag_options = text_field_options(model, field, options)
@@ -22,5 +23,5 @@ module CoreFormTextareaHelper
22
23
  content_tag(:textarea, tag_options) do
23
24
  concat(value)
24
25
  end
25
- end
26
- end
26
+ end
27
+ end
@@ -18,12 +18,12 @@ module CoreLinkHelper
18
18
  # @param title [String] Title of the button
19
19
  # @param classes [Array] Additional classes to add to the button
20
20
  # @return [String] HTML with the copy button
21
- def copy_tag(text_to_copy, title: "Copy to clipboard", classes: [], text: '')
21
+ def copy_tag(text_to_copy, title: 'Copy to clipboard', classes: [], text: '')
22
22
  classes += %w[copy-text ms-1]
23
23
  content_tag(:a,
24
24
  title: title,
25
25
  class: classes.join(' '),
26
- data: { copy_text: text_to_copy, bs_toggle: 'tooltip'}) do
26
+ data: { copy_text: text_to_copy, bs_toggle: 'tooltip' }) do
27
27
  concat(svg_icon(:copy_icon, classes: %w[copy-icon]))
28
28
  concat(svg_icon(:copy_success, classes: %w[success-icon text-success d-none]))
29
29
  concat(svg_icon(:copy_error, classes: %w[error-icon text-error d-none]))
@@ -60,7 +60,9 @@ module CoreNavBarHelper
60
60
  badge_count = options[:badge_count] || 0
61
61
  return if badge_count.blank? || badge_count.to_i <= 0
62
62
 
63
- content_tag(:span, class: 'badge z-3 me-2 bg-green-lt', title: "#{badge_count} #{name.pluralize}") { badge_count.to_s }
63
+ content_tag(:span, class: 'badge z-3 me-2 bg-green-lt', title: "#{badge_count} #{name.pluralize}") do
64
+ badge_count.to_s
65
+ end
64
66
  end
65
67
 
66
68
  def nav_link(name, action_path, badge_count: 0, classes: [])
@@ -75,7 +77,7 @@ module CoreNavBarHelper
75
77
  end
76
78
 
77
79
  def nav_item_link(name, action_path, badge_count: 0, classes: [])
78
- lic = [classes, 'nav-item',].compact.join(' ')
80
+ lic = [classes, 'nav-item'].compact.join(' ')
79
81
  content_tag(:div, class: lic) do
80
82
  concat(nav_link(name, action_path, badge_count: badge_count))
81
83
  end
@@ -91,7 +93,8 @@ module CoreNavBarHelper
91
93
  nav_css << 'show'
92
94
  end
93
95
  content_tag(:div, class: lic) do
94
- concat(content_tag(:a, class: ac, data: { bs_toggle: :collapse }, role: :button, href: "##{name}", aria: { expanded: open_close, controls: :nav_group_settings }) do
96
+ concat(content_tag(:a, class: ac, data: { bs_toggle: :collapse }, role: :button, href: "##{name}",
97
+ aria: { expanded: open_close, controls: :nav_group_settings }) do
95
98
  concat(content_tag(:span, class: 'nav-link-icon d-md-none d-lg-inline-block') { svg_icon(name) })
96
99
  concat(content_tag(:span, class: 'nav-link-title') { nav_menu_title(name) })
97
100
  concat(new_count_badge(nav_menu_title(name), badge_count: badge_count))
@@ -1,5 +1,5 @@
1
+ # Renders the action links used in core tables.
1
2
  module CoreTableActionHelper
2
-
3
3
  def table_action_duplicate_tag(record, path, options = {})
4
4
  return unless can?(:create, record.class)
5
5
 
@@ -111,8 +111,8 @@ module CoreTableActionHelper
111
111
 
112
112
  private
113
113
 
114
- def table_tooltip_data(options, default_title)
115
- classes = ['btn-floating', 'btn-small']
114
+ def table_tooltip_data(options, _default_title)
115
+ classes = %w[btn-floating btn-small]
116
116
  classes << 'tooltipped' unless options[:no_tooltip]
117
117
  classes << options[:class] if options[:class]
118
118
  classes
@@ -138,4 +138,4 @@ module CoreTableActionHelper
138
138
  link_options[:data][:confirm] = confirm if confirm.present?
139
139
  link_options
140
140
  end
141
- end
141
+ end
@@ -76,8 +76,8 @@ module CoreTableHelper
76
76
  content_tag(:td, class: 'text-center', data: { order: value ? 0 : 1 }) do
77
77
  if value
78
78
  svg_icon(:check, color: :green)
79
- else
80
- svg_icon(:x, color: :red) if show_false
79
+ elsif show_false
80
+ svg_icon(:x, color: :red)
81
81
  end
82
82
  end
83
83
  end
@@ -98,14 +98,14 @@ module ModelModalHelper
98
98
  end
99
99
  end
100
100
 
101
- def model_modal_header(model, edit_path, options = {})
101
+ def model_modal_header(model, _edit_path, _options = {})
102
102
  content_tag(:div, class: 'modal-header') do
103
103
  concat(content_tag(:h2) { model.name.titleize })
104
104
  concat(tag(:button, class: 'btn-close', data: { bs_dismiss: :modal }, aria_label: :close))
105
105
  end
106
106
  end
107
107
 
108
- def model_modal_body(model, edit_path, options = {})
108
+ def model_modal_body(model, _edit_path, options = {})
109
109
  concat(content_tag(:div, class: 'model-body') do
110
110
  concat(model_modal_tabs(model, options))
111
111
  concat(model_modal_tab_content(model, options))
@@ -115,7 +115,9 @@ module ModelModalHelper
115
115
  def model_modal_tabs(model, _options = {})
116
116
  content_tag(:ul, class: 'nav nav-tabs', data: { bs_toggle: :tabs }) do
117
117
  concat(content_tag(:li, class: 'nav-item') do
118
- content_tag(:a, class: 'nav-link active', href: "#field-tab-#{model.id}", data: { bs_toggle: :tab }) { model.class.to_s.titleize }
118
+ content_tag(:a, class: 'nav-link active', href: "#field-tab-#{model.id}", data: { bs_toggle: :tab }) do
119
+ model.class.to_s.titleize
120
+ end
119
121
  end)
120
122
  concat(content_tag(:li, class: 'nav-item') do
121
123
  content_tag(:a, class: 'nav-link', href: "#standard-tab-#{model.id}", data: { bs_toggle: :tab }) { 'Details' }
@@ -176,7 +178,7 @@ module ModelModalHelper
176
178
 
177
179
  def model_modal_fields(model, _options = {})
178
180
  content_tag(:div, class: 'datagrid m-2') do
179
- field_names = ((model.class.allowed_param_names) + %w(description name display_value)).uniq.sort
181
+ field_names = (model.class.allowed_param_names + %w[description name display_value]).uniq.sort
180
182
  field_names.each do |field_name|
181
183
  concat(model_modal_field(model, field_name)) if model.respond_to?(field_name) && model.send(field_name).present?
182
184
  end
@@ -1,4 +1,5 @@
1
1
  # app/helpers/svg_icon_helper.rb
2
+ # Renders an SVG icon partial, falling back to the bug icon when the name is missing.
2
3
  module SvgIconHelper
3
4
  # @abstract Render the appropriate icon based on the name and type
4
5
  # @return [View]
@@ -17,7 +18,11 @@ module SvgIconHelper
17
18
  classes = classes.compact.flatten.join(' ')
18
19
  key = "icon_partial_path:#{name}:#{type}"
19
20
  (partial, stroke) = Rails.cache.fetch(key, expires_in: 15.minutes) do
20
- preferred_path = I18n.exists?("nav.icons.#{name}") ? 'icons/' + I18n.t("nav.icons.#{name}") : "icons/#{type}/#{name}"
21
+ preferred_path = if I18n.exists?("nav.icons.#{name}")
22
+ "icons/#{I18n.t("nav.icons.#{name}")}"
23
+ else
24
+ "icons/#{type}/#{name}"
25
+ end
21
26
  outline_path = "icons/outline/#{name}"
22
27
  filled_path = "icons/filled/#{name}"
23
28
 
@@ -30,8 +35,8 @@ module SvgIconHelper
30
35
  stroke = 'red'
31
36
  end
32
37
 
33
- tag.svg(xmlns: "http://www.w3.org/2000/svg",
34
- viewBox: "0 0 24 24",
38
+ tag.svg(xmlns: 'http://www.w3.org/2000/svg',
39
+ viewBox: '0 0 24 24',
35
40
  width: size,
36
41
  height: size,
37
42
  class: classes,
@@ -43,10 +48,10 @@ module SvgIconHelper
43
48
  title: name) do
44
49
  render partial
45
50
  end
46
- rescue StandardError => e
47
- puts "Error: #{e}"
48
- tag.svg(xmlns: "http://www.w3.org/2000/svg",
49
- viewBox: "0 0 24 24",
51
+ rescue StandardError => error
52
+ puts "Error: #{error}"
53
+ tag.svg(xmlns: 'http://www.w3.org/2000/svg',
54
+ viewBox: '0 0 24 24',
50
55
  width: size,
51
56
  height: size,
52
57
  class: classes,
@@ -28,6 +28,7 @@ module CoreController
28
28
  def system_config
29
29
  @system_config = SystemConfiguration.configuration
30
30
  end
31
+
31
32
  private
32
33
 
33
34
  def index_path
@@ -10,6 +10,7 @@ module CoreCronTabsController
10
10
  #
11
11
  def run_now
12
12
  cron_tab.run
13
+ AutoScaler.warm_up
13
14
  redirect_to_referrer index_path
14
15
  rescue StandardError => error
15
16
  log_controller_error error, true
@@ -41,11 +41,14 @@ module CoreDelayedJobsController
41
41
  def resubmit_all
42
42
  authorize! :read, Delayed::Backend::Mongoid::Job
43
43
  failed_only = params[:failed_only].eql?('true')
44
+ started_count = 0
44
45
  delayed_jobs.each do |job|
45
46
  next if failed_only && !job.failed?
46
47
 
48
+ started_count += 1
47
49
  job.resubmit
48
50
  end
51
+ AutoScaler.warm_up if started_count.positive?
49
52
  flash.now[:info] = 'All DelayJobs has been resubmitted'
50
53
  redirect_to index_path
51
54
  rescue StandardError => error
@@ -59,6 +62,7 @@ module CoreDelayedJobsController
59
62
  def resubmit
60
63
  authorize! :read, delayed_job
61
64
  delayed_job.resubmit
65
+ AutoScaler.warm_up
62
66
  flash.now[:info] = 'DelayJob has been resubmitted'
63
67
  redirect_to index_path
64
68
  rescue StandardError => error
@@ -17,7 +17,7 @@ module CoreSystemConfigurationsController
17
17
  def sync
18
18
  raise 'System Configuration not configured to sync' unless system_config.switchboard_configured?
19
19
 
20
- Cron::SwitchboardSyncConfiguration.perform_later
20
+ Cron::SwitchboardSyncConfiguration.sync
21
21
  flash[:info] = 'System Configuration Refreshing in the Background'
22
22
  redirect_to index_path
23
23
  rescue StandardError => error
@@ -32,7 +32,7 @@ module CoreSystemConfigurationsController
32
32
  system_config.update! system_configuration_params
33
33
  if system_config.switchboard_configured?
34
34
  flash[:info] = 'System Configuration Updated, sync job running in the background'
35
- Cron::SwitchboardSyncConfiguration.perform_later
35
+ Cron::SwitchboardSyncConfiguration.sync
36
36
  else
37
37
  flash[:info] = 'System Configuration Updated'
38
38
  end
@@ -18,7 +18,7 @@ class ApplicationJob < ActiveJob::Base
18
18
  parse_payload
19
19
  execute
20
20
  rescue StandardError => error
21
- log_error "Failed to execute job: #{self.inspect}", error
21
+ log_error "Failed to execute job: #{inspect}", error
22
22
  raise error
23
23
  ensure
24
24
  GC.start
@@ -11,4 +11,4 @@ module Cron
11
11
  # @return Put your logic here in run
12
12
  def self.run; end
13
13
  end
14
- end
14
+ end
@@ -8,6 +8,14 @@ module Cron
8
8
  class SwitchboardSyncConfiguration < Job
9
9
  cron_tab_entry :hourly
10
10
 
11
+ # Start the sync process and make sure we have at least one worker running
12
+ def self.sync
13
+ return unless SystemConfiguration.switchboard_configured?
14
+
15
+ Cron::SwitchboardSyncConfiguration.perform_later
16
+ AutoScaler.warm_up
17
+ end
18
+
11
19
  #
12
20
  # Only run in environments where switchboard is configured
13
21
  #
@@ -18,7 +18,7 @@
18
18
  module CdnUrl
19
19
  extend ActiveSupport::Concern
20
20
 
21
- # @abstract Catch methods started with `cdn_` and respond to those requests if there is a
21
+ # @abstract Catch methods started with `cdn_` and respond to those requests if there is a
22
22
  # matching method ending in `_url`
23
23
  def method_missing(method, *args)
24
24
  if method.to_s.start_with? 'cdn_'
@@ -17,6 +17,7 @@ class Object
17
17
  def class_name_underscored
18
18
  class_name.underscore
19
19
  end
20
+
20
21
  #
21
22
  # Return my class name as a readable titleized string
22
23
  #
@@ -15,7 +15,6 @@ module CoreUser
15
15
  field :theme, type: String, default: 'light'
16
16
  field :color, type: String, default: '#0D9394'
17
17
 
18
-
19
18
  # @abstract Return the display name for the user
20
19
  # 1. If :name is blank, then just return the email
21
20
  # 2. If :name is NOT blank, then use "Name (email)"
@@ -116,7 +116,7 @@ module SwitchboardAble
116
116
  sys_config.switchboard_stack_id,
117
117
  switchboard_name]
118
118
  components << switchboard_id if switchboard_id.present?
119
- components.join('/') + '.json'
119
+ "#{components.join('/')}.json"
120
120
  end
121
121
 
122
122
  #
@@ -184,7 +184,7 @@ class Notification
184
184
 
185
185
  def message_from_template(template_name, locals)
186
186
  template = account_message_template(template_name) ||
187
- Template.from_file(template_name, delivery_channel: delivery_channel)
187
+ Template.from_file(template_name, delivery_channel: delivery_channel)
188
188
  if template.present?
189
189
  message_from_liquid_text(template, locals)
190
190
  else
@@ -60,7 +60,7 @@ class RedisConfiguration
60
60
  # Load a default configuration with the given database
61
61
  #
62
62
  def load_default(database = 0)
63
- { host: '127.0.0.1', port: 6_379, db: (database || 0) }
63
+ { host: '127.0.0.1', port: 6_379, db: database || 0 }
64
64
  end
65
65
 
66
66
  #
@@ -1,7 +1,6 @@
1
1
  # Validator for ensuring that an attribute contains a valid HTTP or HTTPS URL.
2
2
  # Uses URI.parse to verify the scheme and the presence of a host.
3
3
  class HttpUrlValidator < ActiveModel::EachValidator
4
-
5
4
  # Validates the format of the URL provided in the attribute.
6
5
  #
7
6
  # @param record [ActiveModel::Model] The record being validated.
@@ -13,8 +12,8 @@ class HttpUrlValidator < ActiveModel::EachValidator
13
12
  uri = URI.parse(value)
14
13
  return if uri.is_a?(URI::HTTP) && uri.host.present?
15
14
 
16
- record.errors.add(attribute, "is not a valid URL")
15
+ record.errors.add(attribute, 'is not a valid URL')
17
16
  rescue URI::InvalidURIError
18
- record.errors.add(attribute, "is not a valid URL")
17
+ record.errors.add(attribute, 'is not a valid URL')
19
18
  end
20
19
  end
@@ -1,11 +1,11 @@
1
- require "simplecov"
1
+ require 'simplecov'
2
2
  require 'simplecov_lcov_formatter'
3
3
 
4
4
  SimpleCov::Formatter::LcovFormatter.config do |c|
5
5
  c.single_report_path = 'coverage/final.lcov'
6
6
  c.report_with_single_file = true
7
7
  end
8
- SimpleCov.collate( Dir['coverage-artifacts/*/.resultset.json'], 'rails' ) do
8
+ SimpleCov.collate(Dir['coverage-artifacts/*/.resultset.json'], 'rails') do
9
9
  add_filter '/spec/'
10
10
  add_filter '/config/'
11
11
  add_filter '/lib/'
data/lib/update_icons.rb CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  require 'fileutils'
6
6
 
7
- #SOURCE_DIR = (ARGV[0] || 'tabler/icons').to_s
7
+ # SOURCE_DIR = (ARGV[0] || 'tabler/icons').to_s
8
8
  SOURCE_DIR = (ARGV[0] || '../tabler-icons/icons').to_s
9
9
  DEST_ROOT = (ARGV[1] || 'app/views/icons').to_s
10
10
 
@@ -12,7 +12,7 @@ def extract_paths(svg_path)
12
12
  xml = File.read(svg_path)
13
13
 
14
14
  require 'nokogiri'
15
- doc = Nokogiri::XML(xml) { |cfg| cfg.noblanks }
15
+ doc = Nokogiri::XML(xml, &:noblanks)
16
16
  doc.remove_namespaces!
17
17
  doc.xpath('//path').map(&:to_xml)
18
18
  rescue LoadError => error
@@ -46,4 +46,4 @@ def process
46
46
  end
47
47
  end
48
48
 
49
- process
49
+ process
@@ -78,4 +78,3 @@ TrueClass.include(BooleanFluxCapacitor)
78
78
  FalseClass.include(BooleanFluxCapacitor)
79
79
  Numeric.include(BooleanFluxCapacitor)
80
80
  String.include(BooleanFluxCapacitor)
81
-
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Web47core
4
- VERSION = '3.2.3.43'
4
+ VERSION = '3.2.3.44'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: web47core
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.3.43
4
+ version: 3.2.3.44
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Schroeder