web47core 3.2.3.14 → 3.2.3.16
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/errors_controller.rb +16 -0
- data/app/helpers/card_nav_builder.rb +6 -0
- data/app/helpers/model_modal_helper.rb +1 -1
- data/lib/web47core/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9352c85947fbaa91629aa7f60bef985bc7fd148cd6ff60e2bec7d141b2e6c977
|
|
4
|
+
data.tar.gz: 71c329f35ad2caf3a8f5f81dbd7764c376fd470e2274b063f147a156675e7702
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2333cf3f5c5ed1e12e0597cc2af30213fd3f97390f3fb13b6575aac6933f4819ec8aa8420eaa38fc981b6cad8d19f7fb3f620faf7ff6fcc153cabd243367276d
|
|
7
|
+
data.tar.gz: 160eef1a00bf46335a434a516683a1f69515c575e21f4e3d45d052c4b78c8c80bff5a3ae5d63cdba6c5a13d7134f0c49a2997cef9bc9af277ad186ec3058647f
|
|
@@ -3,10 +3,26 @@
|
|
|
3
3
|
# with no extra checks for CSRF,authentication, layouts or the ilk. Just say, no, go away!
|
|
4
4
|
class ErrorsController < ActionController::Base
|
|
5
5
|
# No CSRF/layout/filters; keep it cheap
|
|
6
|
+
skip_authorization_check if respond_to?(:skip_authorization_check)
|
|
7
|
+
skip_forgery_protection
|
|
8
|
+
|
|
9
|
+
# @abstract Quietly return a 410 Gone and go away, dont report this
|
|
6
10
|
def not_found
|
|
7
11
|
if defined?(NewRelic) && defined?(NewRelic::Agent)
|
|
8
12
|
NewRelic::Agent.ignore_transaction
|
|
9
13
|
end
|
|
10
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
15
|
end
|
|
16
|
+
|
|
17
|
+
# @abstract Quietly return 204 for OPTIONS (preflight)
|
|
18
|
+
def preflight
|
|
19
|
+
if defined?(NewRelic) && defined?(NewRelic::Agent)
|
|
20
|
+
NewRelic::Agent.ignore_transaction
|
|
21
|
+
end
|
|
22
|
+
# Add CORS headers if you normally set them (optional)
|
|
23
|
+
# response.set_header('Access-Control-Allow-Origin', '*')
|
|
24
|
+
# response.set_header('Access-Control-Allow-Methods', 'GET, POST, PUT, PATCH, DELETE, OPTIONS')
|
|
25
|
+
# response.set_header('Access-Control-Allow-Headers', 'Content-Type, Authorization, X-Requested-With')
|
|
26
|
+
head :no_content
|
|
27
|
+
end
|
|
12
28
|
end
|
|
@@ -54,6 +54,12 @@ class CardNavBuilder
|
|
|
54
54
|
item_link(path, title, icon_name)
|
|
55
55
|
end
|
|
56
56
|
|
|
57
|
+
def duplicate_link(path, title: 'Duplicate', icon_name: :duplicate)
|
|
58
|
+
return unless can?(:create, @obj)
|
|
59
|
+
|
|
60
|
+
item_link(path, title, icon_name)
|
|
61
|
+
end
|
|
62
|
+
|
|
57
63
|
def delete_link(path, confirm: nil, title: 'Delete')
|
|
58
64
|
return unless can?(:manage, @obj)
|
|
59
65
|
|
|
@@ -176,7 +176,7 @@ module ModelModalHelper
|
|
|
176
176
|
|
|
177
177
|
def model_modal_fields(model, _options = {})
|
|
178
178
|
content_tag(:div, class: 'datagrid m-2') do
|
|
179
|
-
field_names = ((model.class.allowed_param_names) + %w(description name)).uniq.sort
|
|
179
|
+
field_names = ((model.class.allowed_param_names) + %w(description name display_value)).uniq.sort
|
|
180
180
|
field_names.each do |field_name|
|
|
181
181
|
concat(model_modal_field(model, field_name)) if model.respond_to?(field_name) && model.send(field_name).present?
|
|
182
182
|
end
|
data/lib/web47core/version.rb
CHANGED