solidus_backend 4.7.3 → 4.8.0
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/LICENSE +29 -0
- data/app/assets/images/spree/backend/themes/solidus_admin/remixicon.symbol.svg +4 -4
- data/app/controllers/spree/admin/adjustment_reasons_controller.rb +0 -5
- data/app/controllers/spree/admin/adjustments_controller.rb +0 -4
- data/app/controllers/spree/admin/base_controller.rb +3 -1
- data/app/controllers/spree/admin/images_controller.rb +0 -7
- data/app/controllers/spree/admin/option_types_controller.rb +0 -10
- data/app/controllers/spree/admin/orders/customer_details_controller.rb +8 -4
- data/app/controllers/spree/admin/orders_controller.rb +3 -3
- data/app/controllers/spree/admin/payment_methods_controller.rb +1 -6
- data/app/controllers/spree/admin/payments_controller.rb +15 -2
- data/app/controllers/spree/admin/prices_controller.rb +0 -6
- data/app/controllers/spree/admin/product_properties_controller.rb +0 -4
- data/app/controllers/spree/admin/products_controller.rb +1 -17
- data/app/controllers/spree/admin/properties_controller.rb +1 -5
- data/app/controllers/spree/admin/refund_reasons_controller.rb +0 -5
- data/app/controllers/spree/admin/refunds_controller.rb +9 -5
- data/app/controllers/spree/admin/reimbursements_controller.rb +0 -6
- data/app/controllers/spree/admin/resource_controller.rb +3 -17
- data/app/controllers/spree/admin/return_authorizations_controller.rb +0 -12
- data/app/controllers/spree/admin/return_items_controller.rb +0 -4
- data/app/controllers/spree/admin/return_reasons_controller.rb +0 -5
- data/app/controllers/spree/admin/search_controller.rb +2 -0
- data/app/controllers/spree/admin/shipping_categories_controller.rb +0 -5
- data/app/controllers/spree/admin/shipping_methods_controller.rb +0 -16
- data/app/controllers/spree/admin/stock_items_controller.rb +1 -1
- data/app/controllers/spree/admin/stock_locations_controller.rb +1 -8
- data/app/controllers/spree/admin/store_credit_reasons_controller.rb +0 -5
- data/app/controllers/spree/admin/store_credits_controller.rb +1 -1
- data/app/controllers/spree/admin/stores_controller.rb +8 -8
- data/app/controllers/spree/admin/tax_categories_controller.rb +0 -5
- data/app/controllers/spree/admin/tax_rates_controller.rb +1 -16
- data/app/controllers/spree/admin/taxonomies_controller.rb +0 -4
- data/app/controllers/spree/admin/users_controller.rb +7 -3
- data/app/controllers/spree/admin/variants_controller.rb +1 -5
- data/app/controllers/spree/admin/zones_controller.rb +0 -4
- data/app/helpers/spree/admin/products_helper.rb +1 -1
- data/app/views/spree/admin/orders/customer_details/_form.html.erb +2 -2
- data/app/views/spree/admin/payment_methods/_form.html.erb +1 -1
- data/app/views/spree/admin/payments/_log_entries.html.erb +7 -2
- data/app/views/spree/admin/payments/show.html.erb +2 -2
- data/app/views/spree/admin/shared/_address_form.html.erb +19 -13
- data/app/views/spree/admin/shared/_head.html.erb +1 -1
- data/app/views/spree/admin/shared/_locale_selection.html.erb +1 -1
- data/app/views/spree/admin/shared/_locale_selection_solidus_admin.html.erb +1 -1
- data/app/views/spree/admin/shared/_navigation.html.erb +1 -0
- data/app/views/spree/admin/shared/_navigation_header.html.erb +1 -1
- data/app/views/spree/admin/shared/_navigation_solidus_admin.html.erb +3 -2
- data/app/views/spree/admin/shared/_timezone_selection.html.erb +10 -0
- data/app/views/spree/admin/shared/_timezone_selection_solidus_admin.html.erb +13 -0
- data/app/views/spree/admin/stores/_form.html.erb +7 -0
- data/app/views/spree/admin/users/_form.html.erb +8 -1
- data/lib/spree/backend_configuration.rb +0 -2
- metadata +10 -7
- /data/app/assets/images/{favicon.ico → spree/backend/favicon.ico} +0 -0
|
@@ -21,10 +21,6 @@ module Spree
|
|
|
21
21
|
|
|
22
22
|
private
|
|
23
23
|
|
|
24
|
-
def permitted_resource_params
|
|
25
|
-
params.require(:adjustment).permit(:amount, :label, :adjustment_reason_id)
|
|
26
|
-
end
|
|
27
|
-
|
|
28
24
|
def find_adjustment
|
|
29
25
|
# Need to assign to @object here to keep ResourceController happy
|
|
30
26
|
@adjustment = @object = parent.all_adjustments.find(params[:id])
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
module Spree
|
|
4
4
|
module Admin
|
|
5
5
|
class BaseController < Spree::BaseController
|
|
6
|
+
include Spree::Core::ControllerHelpers::Timezone
|
|
7
|
+
|
|
6
8
|
helper "spree/admin/navigation"
|
|
7
9
|
layout "spree/layouts/admin"
|
|
8
10
|
|
|
@@ -49,7 +51,7 @@ module Spree
|
|
|
49
51
|
end
|
|
50
52
|
|
|
51
53
|
def config_locale
|
|
52
|
-
Spree::Backend::Config
|
|
54
|
+
Spree::Backend::Config.locale
|
|
53
55
|
end
|
|
54
56
|
|
|
55
57
|
def lock_order
|
|
@@ -9,13 +9,6 @@ module Spree
|
|
|
9
9
|
|
|
10
10
|
private
|
|
11
11
|
|
|
12
|
-
def permitted_resource_params
|
|
13
|
-
# We remove viewable_type because it is explicitly set by set_viewable.
|
|
14
|
-
# The field isn't editable with the current UI, so we don't want to
|
|
15
|
-
# allow it to be set via mass assignment.
|
|
16
|
-
params.require(:image).permit(permitted_image_attributes - [:viewable_type])
|
|
17
|
-
end
|
|
18
|
-
|
|
19
12
|
def location_after_destroy
|
|
20
13
|
admin_product_images_url(@product)
|
|
21
14
|
end
|
|
@@ -17,16 +17,6 @@ module Spree
|
|
|
17
17
|
|
|
18
18
|
private
|
|
19
19
|
|
|
20
|
-
def permitted_resource_params
|
|
21
|
-
attributes = permitted_option_type_attributes.map do |attribute|
|
|
22
|
-
next attribute unless attribute.is_a?(Hash) && attribute.key?(:option_values_attributes)
|
|
23
|
-
|
|
24
|
-
attribute.merge(option_values_attributes: [:id, *permitted_option_value_attributes])
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
params.require(:option_type).permit(attributes)
|
|
28
|
-
end
|
|
29
|
-
|
|
30
20
|
def location_after_save
|
|
31
21
|
edit_admin_option_type_url(@option_type)
|
|
32
22
|
end
|
|
@@ -23,12 +23,16 @@ module Spree
|
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
def update
|
|
26
|
-
if
|
|
26
|
+
if should_associate_user?
|
|
27
|
+
requested_user = Spree.user_class.accessible_by(current_ability, :show).find_by(id: params[:user_id])
|
|
27
28
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
@order.associate_user!(requested_user, @order.email.blank?)
|
|
29
|
+
unless requested_user
|
|
30
|
+
return resource_not_found(flash_class: Spree.user_class, redirect_url: edit_admin_order_customer_url(@order))
|
|
31
31
|
end
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
if @order.contents.update_cart(order_params)
|
|
35
|
+
@order.associate_user!(requested_user, @order.email.blank?) if requested_user
|
|
32
36
|
|
|
33
37
|
unless @order.completed?
|
|
34
38
|
@order.contents.advance
|
|
@@ -16,7 +16,7 @@ module Spree
|
|
|
16
16
|
|
|
17
17
|
def index
|
|
18
18
|
params[:q] ||= {}
|
|
19
|
-
params[:q][:completed_at_not_null] ||= "1" if Spree::Config
|
|
19
|
+
params[:q][:completed_at_not_null] ||= "1" if Spree::Config.show_only_complete_orders_by_default
|
|
20
20
|
@show_only_completed = params[:q][:completed_at_not_null] == "1"
|
|
21
21
|
params[:q][:s] ||= @show_only_completed ? "completed_at desc" : "created_at desc"
|
|
22
22
|
params[:q][:completed_at_not_null] = "" unless @show_only_completed
|
|
@@ -53,7 +53,7 @@ module Spree
|
|
|
53
53
|
@search = Spree::Order.accessible_by(current_ability, :index).ransack(params[:q])
|
|
54
54
|
@orders = @search.result.includes([:user])
|
|
55
55
|
.page(params[:page])
|
|
56
|
-
.per(params[:per_page] || Spree::Config
|
|
56
|
+
.per(params[:per_page] || Spree::Config.orders_per_page)
|
|
57
57
|
|
|
58
58
|
# Restore dates
|
|
59
59
|
params[:q][:created_at_gt] = created_at_gt
|
|
@@ -61,7 +61,7 @@ module Spree
|
|
|
61
61
|
end
|
|
62
62
|
|
|
63
63
|
def new
|
|
64
|
-
user = Spree.user_class.find_by(id: params[:user_id]) if params[:user_id]
|
|
64
|
+
user = Spree.user_class.accessible_by(current_ability, :show).find_by(id: params[:user_id]) if params[:user_id]
|
|
65
65
|
order_importer_params = order_params
|
|
66
66
|
order_importer_params[:bill_address] = user&.bill_address
|
|
67
67
|
order_importer_params[:ship_address] = user&.ship_address
|
|
@@ -67,12 +67,7 @@ module Spree
|
|
|
67
67
|
end
|
|
68
68
|
|
|
69
69
|
def payment_method_params
|
|
70
|
-
params.require(:payment_method).permit
|
|
71
|
-
:name, :description, :type, :preference_source, :auto_capture,
|
|
72
|
-
:active, :available_to_admin, :available_to_users,
|
|
73
|
-
*@payment_method_type.permitted_preference_attributes,
|
|
74
|
-
store_ids: []
|
|
75
|
-
)
|
|
70
|
+
params.require(:payment_method).permit!
|
|
76
71
|
end
|
|
77
72
|
|
|
78
73
|
def build_resource
|
|
@@ -9,6 +9,7 @@ module Spree
|
|
|
9
9
|
before_action :load_payment, except: [:create, :new, :index, :fire]
|
|
10
10
|
before_action :load_payment_for_fire, only: :fire
|
|
11
11
|
before_action :load_data
|
|
12
|
+
before_action :load_log_entries, only: [:show]
|
|
12
13
|
before_action :require_bill_address, only: [:index]
|
|
13
14
|
|
|
14
15
|
helper ::Spree::Admin::OrdersHelper
|
|
@@ -16,7 +17,7 @@ module Spree
|
|
|
16
17
|
respond_to :html
|
|
17
18
|
|
|
18
19
|
def index
|
|
19
|
-
@payments = @order.payments.includes(refunds: :reason)
|
|
20
|
+
@payments = @order.payments.includes(:payment_method, refunds: :reason)
|
|
20
21
|
@refunds = @payments.flat_map(&:refunds)
|
|
21
22
|
redirect_to new_admin_order_payment_url(@order) if @payments.empty?
|
|
22
23
|
end
|
|
@@ -57,6 +58,11 @@ module Spree
|
|
|
57
58
|
def fire
|
|
58
59
|
return unless (event = params[:e]) && @payment.payment_source
|
|
59
60
|
|
|
61
|
+
unless @payment.actions.include?(event)
|
|
62
|
+
flash[:error] = t("spree.cannot_perform_operation")
|
|
63
|
+
return
|
|
64
|
+
end
|
|
65
|
+
|
|
60
66
|
# Because we have a transition method also called void, we do this to avoid conflicts.
|
|
61
67
|
event = "void_transaction" if event == "void"
|
|
62
68
|
if @payment.send("#{event}!")
|
|
@@ -104,6 +110,13 @@ module Spree
|
|
|
104
110
|
@payment = Spree::Payment.find(params[:id])
|
|
105
111
|
end
|
|
106
112
|
|
|
113
|
+
def load_log_entries
|
|
114
|
+
@all_log_entries = Spree::LogEntry
|
|
115
|
+
.where(source: @payment)
|
|
116
|
+
.or(Spree::LogEntry.where(source: @payment.refunds))
|
|
117
|
+
.order(:created_at)
|
|
118
|
+
end
|
|
119
|
+
|
|
107
120
|
def load_payment_for_fire
|
|
108
121
|
load_payment
|
|
109
122
|
authorize! params[:e].to_sym, @payment
|
|
@@ -114,7 +127,7 @@ module Spree
|
|
|
114
127
|
end
|
|
115
128
|
|
|
116
129
|
def require_bill_address
|
|
117
|
-
if Spree::Config
|
|
130
|
+
if Spree::Config.order_bill_address_used && @order.bill_address.nil?
|
|
118
131
|
flash[:notice] = t("spree.fill_in_customer_info")
|
|
119
132
|
redirect_to edit_admin_order_customer_url(@order)
|
|
120
133
|
end
|
|
@@ -47,22 +47,6 @@ module Spree
|
|
|
47
47
|
|
|
48
48
|
private
|
|
49
49
|
|
|
50
|
-
def permitted_resource_params
|
|
51
|
-
# update_before may clear params[:product] when removing all product properties
|
|
52
|
-
params.require(:product).permit(
|
|
53
|
-
*(permitted_attributes.product_attributes - [:deleted_at, :option_values_hash]),
|
|
54
|
-
:slug, :meta_title, :rebuild_vat_prices, :promotionable, :track_inventory,
|
|
55
|
-
taxon_ids: [],
|
|
56
|
-
option_type_ids: [],
|
|
57
|
-
product_properties_attributes: [:id, *permitted_product_properties_attributes],
|
|
58
|
-
variant_property_rules_attributes: [
|
|
59
|
-
:id, :apply_to_all,
|
|
60
|
-
option_value_ids: [],
|
|
61
|
-
values_attributes: [:id, :property_name, :value]
|
|
62
|
-
]
|
|
63
|
-
)
|
|
64
|
-
end
|
|
65
|
-
|
|
66
50
|
def set_default_tax_category
|
|
67
51
|
@product.tax_category_id ||= @default_tax_category&.id
|
|
68
52
|
end
|
|
@@ -109,7 +93,7 @@ module Spree
|
|
|
109
93
|
.order(id: :asc)
|
|
110
94
|
.includes(product_includes)
|
|
111
95
|
.page(params[:page])
|
|
112
|
-
.per(Spree::Config
|
|
96
|
+
.per(Spree::Config.admin_products_per_page)
|
|
113
97
|
end
|
|
114
98
|
|
|
115
99
|
def update_before
|
|
@@ -9,10 +9,6 @@ module Spree
|
|
|
9
9
|
|
|
10
10
|
private
|
|
11
11
|
|
|
12
|
-
def permitted_resource_params
|
|
13
|
-
params.require(:property).permit(permitted_property_attributes)
|
|
14
|
-
end
|
|
15
|
-
|
|
16
12
|
def collection
|
|
17
13
|
return @collection if @collection
|
|
18
14
|
# params[:q] can be blank upon pagination
|
|
@@ -22,7 +18,7 @@ module Spree
|
|
|
22
18
|
@search = @collection.ransack(params[:q])
|
|
23
19
|
@collection = @search.result
|
|
24
20
|
.page(params[:page])
|
|
25
|
-
.per(Spree::Config
|
|
21
|
+
.per(Spree::Config.properties_per_page)
|
|
26
22
|
|
|
27
23
|
@collection
|
|
28
24
|
end
|
|
@@ -5,6 +5,7 @@ module Spree
|
|
|
5
5
|
class RefundsController < ResourceController
|
|
6
6
|
belongs_to "spree/payment"
|
|
7
7
|
before_action :load_order
|
|
8
|
+
before_action :ensure_refundable_payment, only: [:new, :create]
|
|
8
9
|
|
|
9
10
|
helper_method :refund_reasons
|
|
10
11
|
|
|
@@ -37,16 +38,19 @@ module Spree
|
|
|
37
38
|
@order = @payment.order if @payment
|
|
38
39
|
end
|
|
39
40
|
|
|
41
|
+
def ensure_refundable_payment
|
|
42
|
+
return if Spree::Config.refundable_payment_states.include?(@payment.state)
|
|
43
|
+
|
|
44
|
+
flash[:error] = t("spree.payment_is_not_refundable")
|
|
45
|
+
redirect_to admin_order_payments_path(@order)
|
|
46
|
+
end
|
|
47
|
+
|
|
40
48
|
def refund_reasons
|
|
41
49
|
@refund_reasons ||= Spree::RefundReason.active.all
|
|
42
50
|
end
|
|
43
51
|
|
|
44
52
|
def refund_params
|
|
45
|
-
params.require(:refund).permit
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
def permitted_resource_params
|
|
49
|
-
params.require(:refund).permit(:refund_reason_id)
|
|
53
|
+
params.require(:refund).permit!
|
|
50
54
|
end
|
|
51
55
|
|
|
52
56
|
def build_resource
|
|
@@ -20,12 +20,6 @@ module Spree
|
|
|
20
20
|
|
|
21
21
|
private
|
|
22
22
|
|
|
23
|
-
def permitted_resource_params
|
|
24
|
-
params.fetch(:reimbursement, {}).permit(
|
|
25
|
-
return_items_attributes: [:id, :amount, :override_reimbursement_type_id, :exchange_variant_id]
|
|
26
|
-
)
|
|
27
|
-
end
|
|
28
|
-
|
|
29
23
|
def recalculate_order
|
|
30
24
|
@reimbursement.order.recalculate
|
|
31
25
|
end
|
|
@@ -274,25 +274,11 @@ class Spree::Admin::ResourceController < Spree::Admin::BaseController
|
|
|
274
274
|
spree
|
|
275
275
|
end
|
|
276
276
|
|
|
277
|
-
#
|
|
278
|
-
# attributes.
|
|
277
|
+
# Allow all attributes to be updatable.
|
|
279
278
|
#
|
|
280
|
-
#
|
|
281
|
-
# That legacy behaviour is preserved here behind a configuration flag. We
|
|
282
|
-
# strongly recommend disabling the flag and implementing this method in your
|
|
283
|
-
# controller to explicitly permit only the attributes you want to allow.
|
|
279
|
+
# Other controllers can, should, override it to set custom logic
|
|
284
280
|
def permitted_resource_params
|
|
285
|
-
|
|
286
|
-
Spree.deprecator.warn(
|
|
287
|
-
"Using `permit_all_resource_params_fallback` is not safe and will be " \
|
|
288
|
-
"removed in a future version of Solidus. Please implement " \
|
|
289
|
-
"`permitted_resource_params` in your controller to explicitly permit only " \
|
|
290
|
-
"the attributes you want to allow."
|
|
291
|
-
)
|
|
292
|
-
params[object_name].present? ? params.require(object_name).permit! : ActionController::Parameters.new.permit!
|
|
293
|
-
else
|
|
294
|
-
raise NotImplementedError, "You must implement permitted_resource_params in your controller"
|
|
295
|
-
end
|
|
281
|
+
params[object_name].present? ? params.require(object_name).permit! : ActionController::Parameters.new.permit!
|
|
296
282
|
end
|
|
297
283
|
|
|
298
284
|
def collection_actions
|
|
@@ -26,18 +26,6 @@ module Spree
|
|
|
26
26
|
|
|
27
27
|
private
|
|
28
28
|
|
|
29
|
-
def permitted_resource_params
|
|
30
|
-
attributes = permitted_return_authorization_attributes.map do |attribute|
|
|
31
|
-
next attribute unless attribute.is_a?(Hash) && attribute.key?(:return_items_attributes)
|
|
32
|
-
|
|
33
|
-
attribute.except(:customer_metadata).merge(
|
|
34
|
-
return_items_attributes: [:id, :_destroy, :amount, *attribute[:return_items_attributes]]
|
|
35
|
-
)
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
params.require(:return_authorization).permit(attributes)
|
|
39
|
-
end
|
|
40
|
-
|
|
41
29
|
def load_form_data
|
|
42
30
|
load_return_items
|
|
43
31
|
load_reimbursement_types
|
|
@@ -5,10 +5,6 @@ module Spree
|
|
|
5
5
|
class ReturnItemsController < ResourceController
|
|
6
6
|
private
|
|
7
7
|
|
|
8
|
-
def permitted_resource_params
|
|
9
|
-
params.require(:return_item).permit(:acceptance_status, :reception_status_event)
|
|
10
|
-
end
|
|
11
|
-
|
|
12
8
|
def location_after_save
|
|
13
9
|
url_for([:edit, :admin, @return_item.customer_return.order, @return_item.customer_return])
|
|
14
10
|
end
|
|
@@ -20,22 +20,6 @@ module Spree
|
|
|
20
20
|
|
|
21
21
|
private
|
|
22
22
|
|
|
23
|
-
def permitted_resource_params
|
|
24
|
-
params.require(:shipping_method).permit(
|
|
25
|
-
:name, :admin_name, :code, :carrier, :service_level, :tracking_url,
|
|
26
|
-
:available_to_all, :available_to_users, :tax_category_id, :calculator_type,
|
|
27
|
-
store_ids: [],
|
|
28
|
-
stock_location_ids: [],
|
|
29
|
-
calculator_attributes: [:id, *calculator_attributes]
|
|
30
|
-
)
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
def calculator_attributes
|
|
34
|
-
@calculators.flat_map do |calculator_class|
|
|
35
|
-
calculator_class.permitted_preference_attributes
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
|
|
39
23
|
def set_shipping_category
|
|
40
24
|
return true if params["shipping_method"][:shipping_categories] == ""
|
|
41
25
|
@shipping_method.shipping_categories = Spree::ShippingCategory.where(id: params["shipping_method"][:shipping_categories])
|
|
@@ -50,7 +50,7 @@ module Spree
|
|
|
50
50
|
)
|
|
51
51
|
@variant_display_attributes = self.class.variant_display_attributes
|
|
52
52
|
@variants = Spree::Config.variant_search_class.new(params[:variant_search_term], scope: variant_scope).results
|
|
53
|
-
.order(id: :desc).page(params[:page]).per(params[:per_page] || Spree::Config
|
|
53
|
+
.order(id: :desc).page(params[:page]).per(params[:per_page] || Spree::Config.orders_per_page)
|
|
54
54
|
end
|
|
55
55
|
|
|
56
56
|
def variant_scope
|
|
@@ -7,13 +7,6 @@ module Spree
|
|
|
7
7
|
|
|
8
8
|
private
|
|
9
9
|
|
|
10
|
-
def permitted_resource_params
|
|
11
|
-
params.require(:stock_location).permit(
|
|
12
|
-
*permitted_stock_location_attributes,
|
|
13
|
-
:code, :admin_name, :default, :restock_inventory, :fulfillable, :check_stock_on_transfer
|
|
14
|
-
)
|
|
15
|
-
end
|
|
16
|
-
|
|
17
10
|
def set_country
|
|
18
11
|
@stock_location.country = Spree::Country.default
|
|
19
12
|
rescue ActiveRecord::RecordNotFound
|
|
@@ -22,7 +15,7 @@ module Spree
|
|
|
22
15
|
end
|
|
23
16
|
|
|
24
17
|
def collection
|
|
25
|
-
super.page(params[:page]).per(Spree::Config
|
|
18
|
+
super.page(params[:page]).per(Spree::Config.admin_products_per_page)
|
|
26
19
|
end
|
|
27
20
|
end
|
|
28
21
|
end
|
|
@@ -14,18 +14,18 @@ module Spree
|
|
|
14
14
|
private
|
|
15
15
|
|
|
16
16
|
def permitted_resource_params
|
|
17
|
-
|
|
18
|
-
without_address_parameters =
|
|
19
|
-
|
|
17
|
+
super.tap do |store_params|
|
|
18
|
+
without_address_parameters = store_params[:address_attributes]&.except(:country_id, :state_id, :reverse_charge_status)&.compact_blank&.empty?
|
|
19
|
+
store_params.delete(:address_attributes) if without_address_parameters
|
|
20
20
|
end
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
def store_params
|
|
24
|
-
params.require(:store).permit(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
params.require(:store).permit(permitted_params)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def permitted_params
|
|
28
|
+
Spree::PermittedAttributes.store_attributes
|
|
29
29
|
end
|
|
30
30
|
end
|
|
31
31
|
end
|
|
@@ -7,21 +7,6 @@ module Spree
|
|
|
7
7
|
|
|
8
8
|
private
|
|
9
9
|
|
|
10
|
-
def permitted_resource_params
|
|
11
|
-
params.require(:tax_rate).permit(
|
|
12
|
-
:name, :amount, :included_in_price, :level, :zone_id, :show_rate_in_label,
|
|
13
|
-
:starts_at, :expires_at, :calculator_type,
|
|
14
|
-
tax_category_ids: [],
|
|
15
|
-
calculator_attributes: [:id, *calculator_attributes]
|
|
16
|
-
)
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
def calculator_attributes
|
|
20
|
-
@calculators.flat_map do |calculator_class|
|
|
21
|
-
calculator_class.permitted_preference_attributes
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
|
|
25
10
|
def load_data
|
|
26
11
|
@available_zones = Spree::Zone.order(:name)
|
|
27
12
|
@available_categories = Spree::TaxCategory.order(:name)
|
|
@@ -36,7 +21,7 @@ module Spree
|
|
|
36
21
|
.order(:zone_id)
|
|
37
22
|
@collection = @collection
|
|
38
23
|
.page(params[:page])
|
|
39
|
-
.per(Spree::Config
|
|
24
|
+
.per(Spree::Config.admin_products_per_page)
|
|
40
25
|
end
|
|
41
26
|
end
|
|
42
27
|
end
|
|
@@ -5,10 +5,6 @@ module Spree
|
|
|
5
5
|
class TaxonomiesController < ResourceController
|
|
6
6
|
private
|
|
7
7
|
|
|
8
|
-
def permitted_resource_params
|
|
9
|
-
params.require(:taxonomy).permit(permitted_taxonomy_attributes)
|
|
10
|
-
end
|
|
11
|
-
|
|
12
8
|
def location_after_save
|
|
13
9
|
if @taxonomy.created_at == @taxonomy.updated_at
|
|
14
10
|
edit_admin_taxonomy_url(@taxonomy)
|
|
@@ -42,6 +42,10 @@ module Spree
|
|
|
42
42
|
set_roles
|
|
43
43
|
set_stock_locations
|
|
44
44
|
|
|
45
|
+
if @user.respond_to?(:timezone) && @user.saved_change_to_timezone? && @user == spree_current_user
|
|
46
|
+
session[:solidus_timezone] = nil
|
|
47
|
+
end
|
|
48
|
+
|
|
45
49
|
flash[:success] = t("spree.account_updated")
|
|
46
50
|
redirect_to edit_admin_user_url(@user)
|
|
47
51
|
else
|
|
@@ -66,7 +70,7 @@ module Spree
|
|
|
66
70
|
def orders
|
|
67
71
|
params[:q] ||= {}
|
|
68
72
|
@search = Spree::Order.reverse_chronological.ransack(params[:q].merge(user_id_eq: @user.id))
|
|
69
|
-
@orders = @search.result.page(params[:page]).per(Spree::Config
|
|
73
|
+
@orders = @search.result.page(params[:page]).per(Spree::Config.admin_products_per_page)
|
|
70
74
|
end
|
|
71
75
|
|
|
72
76
|
def items
|
|
@@ -78,7 +82,7 @@ module Spree
|
|
|
78
82
|
}
|
|
79
83
|
).ransack(params[:q].merge(user_id_eq: @user.id))
|
|
80
84
|
|
|
81
|
-
@orders = @search.result.page(params[:page]).per(Spree::Config
|
|
85
|
+
@orders = @search.result.page(params[:page]).per(Spree::Config.admin_products_per_page)
|
|
82
86
|
end
|
|
83
87
|
|
|
84
88
|
def model_class
|
|
@@ -93,7 +97,7 @@ module Spree
|
|
|
93
97
|
@search = super.ransack(params[:q])
|
|
94
98
|
@collection = @search.result.includes(:spree_roles)
|
|
95
99
|
@collection = @collection.includes(:orders)
|
|
96
|
-
@collection = @collection.page(params[:page]).per(Spree::Config
|
|
100
|
+
@collection = @collection.page(params[:page]).per(Spree::Config.admin_products_per_page)
|
|
97
101
|
end
|
|
98
102
|
|
|
99
103
|
def user_params
|
|
@@ -12,10 +12,6 @@ module Spree
|
|
|
12
12
|
|
|
13
13
|
private
|
|
14
14
|
|
|
15
|
-
def permitted_resource_params
|
|
16
|
-
params.require(:variant).permit(permitted_variant_attributes)
|
|
17
|
-
end
|
|
18
|
-
|
|
19
15
|
def new_before
|
|
20
16
|
@object.attributes = @object.product.master.attributes.except("id", "created_at", "deleted_at",
|
|
21
17
|
"sku", "is_master")
|
|
@@ -31,7 +27,7 @@ module Spree
|
|
|
31
27
|
end
|
|
32
28
|
|
|
33
29
|
search = Spree::Config.variant_search_class.new(params[:variant_search_term], scope: base_variant_scope)
|
|
34
|
-
@collection = search.results.includes(variant_includes).page(params[:page]).per(Spree::Config
|
|
30
|
+
@collection = search.results.includes(variant_includes).page(params[:page]).per(Spree::Config.admin_variants_per_page)
|
|
35
31
|
end
|
|
36
32
|
|
|
37
33
|
def load_data
|