avo 2.28.1.pre.pr1642 → 2.28.2.pre.pr1642

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of avo might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d3bb2ce2c32ddbba4f8bbeb6106e8bba29345090ccb6fb373372bd8d23afa5cf
4
- data.tar.gz: 6230460ca9c90b5195b384df63d96feac645e863c3821648425eb7ee2d108c11
3
+ metadata.gz: 2afd7fab61f56b5df63d0776f412e50efbf64bb0e45f9d011ec03f21978581c3
4
+ data.tar.gz: 69ea4d9a6097b88268f6058f0978a9ff938876d0c6837f41e5896411a2447db0
5
5
  SHA512:
6
- metadata.gz: 0d91aceda8772221c07996c3c1538b378451a8cf0726ad93ef593394335d833070135ef5412fdc40f09024805c2c05582a70d7cca481ee0e28d03aacd350ac5d
7
- data.tar.gz: 5f7a86dc730ddb524274a91d0ec6781e02b9e2a93867c02e798f70c838081305140f5a70fdab806c023fed3ec91e018759a86f74eb639b47dd7f83f74c5c9fd4
6
+ metadata.gz: 3a324a98e38853c7b2cb4339f6c8d8c84efd7d4668248c1fd6e360f0fe7827a537108909c965241a080491fb6b18ac2d39c6b4e536de35708a495eb0484c0927
7
+ data.tar.gz: 0ddeccf56e54a0cd30214d69c1a02182d909b8731bf98ee95b4548ab1734ee1ff6c5b7d361b64e05a163a2cb0e957dfdcef88b3c156b7bc129ff06a452c4d90a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- avo (2.28.1.pre.pr1642)
4
+ avo (2.28.2.pre.pr1642)
5
5
  actionview (>= 6.0)
6
6
  active_link_to
7
7
  activerecord (>= 6.0)
@@ -28,7 +28,7 @@ module Avo
28
28
  rescue_from Avo::NotAuthorizedError, with: :render_unauthorized
29
29
  rescue_from ActiveRecord::RecordInvalid, with: :exception_logger
30
30
 
31
- helper_method :_current_user, :resources_path, :resource_path, :new_resource_path, :edit_resource_path, :resource_attach_path, :resource_detach_path, :related_resources_path, :turbo_frame_request?, :resource_view_path, :mount_path
31
+ helper_method :_current_user, :resources_path, :resource_path, :new_resource_path, :edit_resource_path, :resource_attach_path, :resource_detach_path, :related_resources_path, :turbo_frame_request?, :resource_view_path
32
32
  add_flash_types :info, :warning, :success, :error
33
33
 
34
34
  def init_app
@@ -101,10 +101,6 @@ module Avo
101
101
  instance_eval(&Avo.configuration.context)
102
102
  end
103
103
 
104
- def mount_path
105
- Avo::Engine.routes.find_script_name(params.permit!.to_h.symbolize_keys)
106
- end
107
-
108
104
  # This is coming from Turbo::Frames::FrameRequest module.
109
105
  # Exposing it as public method
110
106
  def turbo_frame_request?
@@ -102,16 +102,15 @@ module Avo
102
102
  end
103
103
 
104
104
  def root_path_without_url
105
- Avo::App.root_path
106
- .to_s
107
- .delete_prefix(request.base_url.to_s)
108
- .delete_suffix("/")
109
- .gsub("/?", "?")
110
- .query = ""
105
+ "#{Avo.configuration.prefix_path}#{mount_path}"
111
106
  rescue
112
107
  Avo.configuration.root_path
113
108
  end
114
109
 
110
+ def mount_path
111
+ Avo::Engine.routes.find_script_name(params.permit!.to_h.symbolize_keys)
112
+ end
113
+
115
114
  private
116
115
 
117
116
  # Taken from the original library
@@ -1,7 +1,7 @@
1
1
  <%= javascript_tag nonce: true do %>
2
2
  window.Avo = window.Avo || { configuration: {} }
3
3
  Avo.configuration.timezone = '<%= Avo.configuration.timezone %>'
4
- Avo.configuration.root_path = '<%= mount_path %>'
4
+ Avo.configuration.root_path = '<%= root_path_without_url %>'
5
5
  Avo.configuration.search_debounce = '<%= Avo.configuration.search_debounce %>'
6
6
  Avo.configuration.cookies_key = '<%= Avo::COOKIES_KEY %>'
7
7
  <% end %>
@@ -42,6 +42,7 @@ module Avo
42
42
  attr_accessor :field_wrapper_layout
43
43
  attr_accessor :sign_out_path_name
44
44
  attr_accessor :resources
45
+ attr_accessor :prefix_path
45
46
  attr_writer :branding
46
47
 
47
48
  def initialize
@@ -94,6 +95,7 @@ module Avo
94
95
  @authorization_client = :pundit
95
96
  @field_wrapper_layout = :inline
96
97
  @resources = nil
98
+ @prefix_path = nil
97
99
  end
98
100
 
99
101
  def current_user_method(&block)
@@ -117,8 +119,8 @@ module Avo
117
119
  end
118
120
 
119
121
  def namespace
120
- if computed_root_path.present?
121
- computed_root_path.delete "/"
122
+ if Avo.configuration.root_path.present?
123
+ Avo.configuration.root_path.delete "/"
122
124
  else
123
125
  root_path.delete "/"
124
126
  end
@@ -130,10 +132,6 @@ module Avo
130
132
  @root_path
131
133
  end
132
134
 
133
- def computed_root_path
134
- Avo.configuration.root_path
135
- end
136
-
137
135
  def feature_enabled?(feature)
138
136
  !@disabled_features.map(&:to_sym).include?(feature.to_sym)
139
137
  end
data/lib/avo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Avo
2
- VERSION = "2.28.1.pre.pr1642" unless const_defined?(:VERSION)
2
+ VERSION = "2.28.2.pre.pr1642" unless const_defined?(:VERSION)
3
3
  end
@@ -2,6 +2,8 @@
2
2
  Avo.configure do |config|
3
3
  ## == Routing ==
4
4
  config.root_path = '/<%= options[:path] %>'
5
+ # used only when you have custom `map` configuration in your config.ru
6
+ # config.prefix_path = "/internal"
5
7
 
6
8
  # Where should the user be redirected when visting the `/<%= options[:path] %>` url
7
9
  # config.home_path = nil
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avo
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.28.1.pre.pr1642
4
+ version: 2.28.2.pre.pr1642
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrian Marin
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-03-22 00:00:00.000000000 Z
12
+ date: 2023-03-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord