easy-admin-rails 0.2.2 → 0.2.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 87d3c4867f51a6c89bd00852824be9345c18dbac643010d91bbbcaed411eb683
4
- data.tar.gz: f37721aeeebfc654554f1d544b0f5a649ea4b764f36ae35a52b5993741c42b69
3
+ metadata.gz: 114db756f935751ce2446ada0465829ebc368580af18e11c0e4de7d736b3e57b
4
+ data.tar.gz: c12a7bcdf614b7fedc87ce6cc942a26094b6eb3a62b4bed93453cab3a79ea809
5
5
  SHA512:
6
- metadata.gz: 9aaf3cba5a2b398313e7d916cb6be2d0754a3fff3ec7c8e31ff70c03638186f7656925d30c5f49150c20c5f27040202dc9625ae306d2daed331e089d86817157
7
- data.tar.gz: 95e1b5e2579cd2fe1a1aab49a2f92e2c5f2ffce0a2a7bb254c5f52044c161c133415a6df4e242380ca0c584ec760269600a988ec055e316858fa2ddc32469159
6
+ metadata.gz: fe827e1adac715c9bf5db4caa5a7dc8749b3b32c65c0adc4362591c5f2845c454e4e7c7b623d3e44eb892dc561854ef5087cf4e073a036127b680957e3c44be2
7
+ data.tar.gz: 85b294f85b2d244fa8e22ab4bc0323100a54f052f7206bcd9c425881fa5ed907ee4e66ab5b575dd751164ac3f6fd36694e4e72f88afbc64d43cd5f75881cfeb0
@@ -110,11 +110,16 @@ module EasyAdmin
110
110
 
111
111
  respond_to do |format|
112
112
  format.html do
113
- flash[:alert] = error_message
114
-
115
- # Try to redirect back, fallback to dashboard
116
- redirect_path = request.referer&.start_with?(request.base_url) ? request.referer : easy_admin.root_path
117
- redirect_to redirect_path
113
+ # Check if this is a turbo_frame request (like inline editing)
114
+ if turbo_frame_request?
115
+ render template: 'easy_admin/application/authorization_failure', layout: false
116
+ else
117
+ flash[:alert] = error_message
118
+
119
+ # Try to redirect back, fallback to dashboard
120
+ redirect_path = request.referer&.start_with?(request.base_url) ? request.referer : easy_admin.root_path
121
+ redirect_to redirect_path
122
+ end
118
123
  end
119
124
 
120
125
  format.turbo_stream do
@@ -0,0 +1,9 @@
1
+ <turbo-frame id="modal">
2
+ <%= turbo_stream.update("notifications") do %>
3
+ <%== EasyAdmin::NotificationComponent.new(
4
+ type: :error,
5
+ message: @error_message,
6
+ title: "Access Denied"
7
+ ).call %>
8
+ <% end %>
9
+ </turbo-frame>
@@ -1,3 +1,3 @@
1
1
  module EasyAdmin
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy-admin-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Slaurmagan
@@ -355,6 +355,7 @@ files:
355
355
  - app/models/easy_admin/application_record.rb
356
356
  - app/policies/admin_user_policy.rb
357
357
  - app/policies/application_policy.rb
358
+ - app/views/easy_admin/application/authorization_failure.html.erb
358
359
  - app/views/easy_admin/application/authorization_failure.turbo_stream.erb
359
360
  - app/views/easy_admin/dashboard/index.html.erb
360
361
  - app/views/easy_admin/dashboards/card.html.erb