avo 2.28.3.pre.pr1646 → 2.29.0

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: 527b4a8adeef6e5f6833c8329a66e2c5ced407a38f78956c4927f42af9967e93
4
- data.tar.gz: e90ddb57665013a527f4cf1fe815578e3126af4b1225f96687b37386131cb9c5
3
+ metadata.gz: 572070da39670d32588de6616a4b51015615efe3482ea813fe148035bba33cf7
4
+ data.tar.gz: 9a1056b36ab1d3ceebd06eeb505fb5641f41d9ddbe943e48e87627030df2edb0
5
5
  SHA512:
6
- metadata.gz: ab734f7daa2221975ef03005c5b7a94e75db330055de4e90efc540d91e2d9816ee3c89013f13b7d195010df224569849f449e3460010991ed1ec59c1a5bdabb6
7
- data.tar.gz: a6b2a63cfdba2692203888b799c4e3c12414ece3cfc5017ce26a2dc453477c7e0f3d3065780add4232af92343915e3a8d98faa65f9ae07b4b5ab45d40d74360a
6
+ metadata.gz: 95570888ee4d613f5062f3cf924aa7af69d1b6675a042da4a0ed75131a5e858ab451ab4d23c85ceed79c1a8f57508ef2dda4540cdbc7462f96ff251e1f70a20c
7
+ data.tar.gz: 3941183c0d08772696b52fdc5bac795d35002d87309dd7d5963d1f9b4d7b1107354ba3cf0d116a8752af35ec54a39e0f89de4c05df2e67df28aaa1b062aa1f39
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- avo (2.28.3.pre.pr1646)
4
+ avo (2.29.0)
5
5
  actionview (>= 6.0)
6
6
  active_link_to
7
7
  activerecord (>= 6.0)
@@ -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
@@ -60,6 +60,10 @@ export default class extends BaseController {
60
60
  },
61
61
  originalInputValueFormat: (valuesArr) => valuesArr.map((item) => item.value),
62
62
  })
63
+ } else {
64
+ options = merge(options, {
65
+ originalInputValueFormat: (valuesArr) => valuesArr.map((item) => item.value).join(','),
66
+ })
63
67
  }
64
68
 
65
69
  return options
@@ -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.3.pre.pr1646" unless const_defined?(:VERSION)
2
+ VERSION = "2.29.0" 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