spree_admin 5.4.0.beta3 → 5.4.0.beta5
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/spree/admin/coupon_codes_controller.rb +6 -0
- data/app/controllers/spree/admin/gift_cards_controller.rb +0 -15
- data/app/controllers/spree/admin/stores_controller.rb +0 -2
- data/app/helpers/spree/admin/orders_helper.rb +0 -18
- data/app/helpers/spree/admin/products_helper.rb +0 -27
- data/app/helpers/spree/admin/promotions_helper.rb +0 -11
- data/app/helpers/spree/admin/stores_helper.rb +1 -1
- data/app/helpers/spree/admin/table_helper.rb +5 -2
- data/app/models/spree/admin/table/column.rb +1 -0
- data/app/views/spree/admin/coupon_codes/index.html.erb +2 -1
- data/app/views/spree/admin/refund_reasons/index.html.erb +1 -1
- data/app/views/spree/admin/reimbursement_types/index.html.erb +1 -1
- data/app/views/spree/admin/return_authorization_reasons/index.html.erb +1 -1
- data/app/views/spree/admin/return_authorizations/index.html.erb +1 -1
- data/app/views/spree/admin/shipping_categories/index.html.erb +1 -1
- data/app/views/spree/admin/shipping_methods/index.html.erb +1 -1
- data/app/views/spree/admin/stock_locations/index.html.erb +1 -1
- data/app/views/spree/admin/stores/edit.html.erb +0 -1
- data/app/views/spree/admin/stores/form/_checkout.html.erb +0 -27
- data/app/views/spree/admin/tax_categories/index.html.erb +1 -1
- data/app/views/spree/admin/tax_rates/index.html.erb +1 -1
- data/app/views/spree/admin/taxonomies/index.html.erb +1 -1
- data/app/views/spree/admin/zones/index.html.erb +1 -1
- data/config/initializers/spree_admin_tables.rb +384 -0
- metadata +6 -84
- data/app/views/spree/admin/coupon_codes/_filters.html.erb +0 -41
- data/app/views/spree/admin/coupon_codes/_table_header.html.erb +0 -0
- data/app/views/spree/admin/coupon_codes/_table_row.html.erb +0 -8
- data/app/views/spree/admin/coupon_codes/index.csv.erb +0 -14
- data/app/views/spree/admin/customer_returns/_filters.html.erb +0 -11
- data/app/views/spree/admin/customer_returns/_table_header.html.erb +0 -8
- data/app/views/spree/admin/customer_returns/_table_row.html.erb +0 -31
- data/app/views/spree/admin/gift_cards/_filters.html.erb +0 -53
- data/app/views/spree/admin/gift_cards/_gift_card.html.erb +0 -28
- data/app/views/spree/admin/gift_cards/_list.html.erb +0 -24
- data/app/views/spree/admin/gift_cards/_table_filter_dropdown.html.erb +0 -25
- data/app/views/spree/admin/metafield_definitions/_filters.html.erb +0 -18
- data/app/views/spree/admin/metafield_definitions/_table_header.html.erb +0 -11
- data/app/views/spree/admin/metafield_definitions/_table_row.html.erb +0 -22
- data/app/views/spree/admin/newsletter_subscribers/_filters.html.erb +0 -41
- data/app/views/spree/admin/newsletter_subscribers/_table_header.html.erb +0 -8
- data/app/views/spree/admin/newsletter_subscribers/_table_row.html.erb +0 -36
- data/app/views/spree/admin/option_types/_filters.html.erb +0 -7
- data/app/views/spree/admin/option_types/_table_header.html.erb +0 -19
- data/app/views/spree/admin/option_types/_table_row.html.erb +0 -19
- data/app/views/spree/admin/orders/_filters.html.erb +0 -116
- data/app/views/spree/admin/orders/_list.html.erb +0 -28
- data/app/views/spree/admin/orders/_order.html.erb +0 -28
- data/app/views/spree/admin/orders/_table_filter_dropdown.html.erb +0 -34
- data/app/views/spree/admin/policies/_filters.html.erb +0 -8
- data/app/views/spree/admin/policies/_table_header.html.erb +0 -8
- data/app/views/spree/admin/policies/_table_row.html.erb +0 -20
- data/app/views/spree/admin/price_lists/_table_header.html.erb +0 -7
- data/app/views/spree/admin/products/_filters.html.erb +0 -66
- data/app/views/spree/admin/products/_list.html.erb +0 -47
- data/app/views/spree/admin/products/_product.html.erb +0 -29
- data/app/views/spree/admin/products/_product_status.html.erb +0 -3
- data/app/views/spree/admin/products/_table_filter_dropdown.html.erb +0 -42
- data/app/views/spree/admin/promotions/_filters.html.erb +0 -29
- data/app/views/spree/admin/promotions/_table_filter_dropdown.html.erb +0 -17
- data/app/views/spree/admin/promotions/_table_header.html.erb +0 -7
- data/app/views/spree/admin/promotions/_table_row.html.erb +0 -31
- data/app/views/spree/admin/refund_reasons/_table_header.html.erb +0 -6
- data/app/views/spree/admin/refund_reasons/_table_row.html.erb +0 -14
- data/app/views/spree/admin/reimbursement_types/_table_header.html.erb +0 -7
- data/app/views/spree/admin/reimbursement_types/_table_row.html.erb +0 -17
- data/app/views/spree/admin/return_authorization_reasons/_table_header.html.erb +0 -5
- data/app/views/spree/admin/return_authorization_reasons/_table_row.html.erb +0 -18
- data/app/views/spree/admin/return_authorizations/_list.html.erb +0 -21
- data/app/views/spree/admin/return_authorizations/_table_header.html.erb +0 -6
- data/app/views/spree/admin/return_authorizations/_table_row.html.erb +0 -40
- data/app/views/spree/admin/return_authorizations/filters.html.erb +0 -34
- data/app/views/spree/admin/shared/_page_section_image.html.erb +0 -4
- data/app/views/spree/admin/shared/_page_section_logo.html.erb +0 -1
- data/app/views/spree/admin/shipping_categories/_table_header.html.erb +0 -4
- data/app/views/spree/admin/shipping_categories/_table_row.html.erb +0 -8
- data/app/views/spree/admin/shipping_methods/_table_header.html.erb +0 -8
- data/app/views/spree/admin/shipping_methods/_table_row.html.erb +0 -33
- data/app/views/spree/admin/stock_items/_filters.html.erb +0 -35
- data/app/views/spree/admin/stock_items/_table_header.html.erb +0 -9
- data/app/views/spree/admin/stock_items/_table_row.html.erb +0 -43
- data/app/views/spree/admin/stock_locations/_table_header.html.erb +0 -9
- data/app/views/spree/admin/stock_locations/_table_row.html.erb +0 -36
- data/app/views/spree/admin/stock_transfers/_filters.html.erb +0 -49
- data/app/views/spree/admin/stock_transfers/_table_header.html.erb +0 -9
- data/app/views/spree/admin/stock_transfers/_table_row.html.erb +0 -11
- data/app/views/spree/admin/stores/form/_buttons.html.erb +0 -3
- data/app/views/spree/admin/stores/form/_checkout_links.html.erb +0 -28
- data/app/views/spree/admin/stores/form/_policies.html.erb +0 -69
- data/app/views/spree/admin/tax_categories/_table_header.html.erb +0 -7
- data/app/views/spree/admin/tax_categories/_table_row.html.erb +0 -13
- data/app/views/spree/admin/tax_rates/_table_header.html.erb +0 -9
- data/app/views/spree/admin/tax_rates/_table_row.html.erb +0 -15
- data/app/views/spree/admin/taxonomies/_table_header.html.erb +0 -6
- data/app/views/spree/admin/taxonomies/_table_row.html.erb +0 -16
- data/app/views/spree/admin/taxonomies/filters.html.erb +0 -6
- data/app/views/spree/admin/users/_filters.html.erb +0 -81
- data/app/views/spree/admin/webhook_deliveries/_table_header.html.erb +0 -8
- data/app/views/spree/admin/webhook_deliveries/_table_row.html.erb +0 -22
- data/app/views/spree/admin/webhook_endpoints/_table_header.html.erb +0 -7
- data/app/views/spree/admin/webhook_endpoints/_table_row.html.erb +0 -24
- data/app/views/spree/admin/zones/_table_header.html.erb +0 -8
- data/app/views/spree/admin/zones/_table_row.html.erb +0 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f45183de9d64006954bcebdd91c2c544994ea85f1f5b574b69a6a35f337f5af4
|
|
4
|
+
data.tar.gz: 4f3f18d194978187237fa890bd90d6632bbeee79928c8fa228e98a3581e8f328
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 624c5d873b90a4b4a7f2570b263b70f506c80be33549326a3915bfee92479a7de0bd9c85c87654cb16c1202095bb8c09f855e57e485bb7dddc4e4033540dcc46
|
|
7
|
+
data.tar.gz: 26d013dab76bebf422f1d0ff17b68a21f574d4954ad65bc661b789cce8e75d743d003cf7e1fc844e6ecd877890175b0b4b1b68a00f1b7c746ed938f48ef93f63
|
|
@@ -6,8 +6,6 @@ module Spree
|
|
|
6
6
|
before_action :add_breadcrumbs
|
|
7
7
|
before_action :load_orders, only: :show
|
|
8
8
|
|
|
9
|
-
helper_method :gift_cards_filter_dropdown_value
|
|
10
|
-
|
|
11
9
|
private
|
|
12
10
|
|
|
13
11
|
def permitted_resource_params
|
|
@@ -49,19 +47,6 @@ module Spree
|
|
|
49
47
|
@user = Spree.user_class.find_by_prefix_id(params[:user_id]) if params[:user_id].present?
|
|
50
48
|
end
|
|
51
49
|
|
|
52
|
-
def gift_cards_filter_dropdown_value
|
|
53
|
-
Spree::Deprecation.warn("gift_cards_filter_dropdown_value is deprecated and will be removed in Spree 5.5")
|
|
54
|
-
if params.dig(:q, :active).present?
|
|
55
|
-
Spree.t('admin.gift_cards.active')
|
|
56
|
-
elsif params.dig(:q, :expired).present?
|
|
57
|
-
Spree.t(:expired)
|
|
58
|
-
elsif params.dig(:q, :redeemed).present?
|
|
59
|
-
Spree.t('admin.gift_cards.redeemed')
|
|
60
|
-
else
|
|
61
|
-
Spree.t('admin.gift_cards.all_statuses')
|
|
62
|
-
end
|
|
63
|
-
end
|
|
64
|
-
|
|
65
50
|
def add_breadcrumbs
|
|
66
51
|
if @user.present?
|
|
67
52
|
@breadcrumb_icon = 'users'
|
|
@@ -11,8 +11,6 @@ module Spree
|
|
|
11
11
|
def edit
|
|
12
12
|
if params[:section] == 'emails'
|
|
13
13
|
add_breadcrumb Spree.t(:emails), spree.edit_admin_store_path(section: params[:section])
|
|
14
|
-
elsif params[:section] == 'policies'
|
|
15
|
-
add_breadcrumb Spree.t(:policies), spree.edit_admin_store_path(section: params[:section])
|
|
16
14
|
elsif params[:section] == 'checkout'
|
|
17
15
|
add_breadcrumb Spree.t(:checkout), spree.edit_admin_store_path(section: params[:section])
|
|
18
16
|
else
|
|
@@ -141,24 +141,6 @@ module Spree
|
|
|
141
141
|
}
|
|
142
142
|
end
|
|
143
143
|
|
|
144
|
-
def order_filter_dropdown_value
|
|
145
|
-
Spree::Deprecation.warn("order_filter_dropdown_value is deprecated and will be removed in Spree 5.5")
|
|
146
|
-
|
|
147
|
-
if params.dig(:q, :shipment_state_not_in) == ['shipped', 'canceled']
|
|
148
|
-
Spree.t('admin.orders.unfulfilled')
|
|
149
|
-
elsif params.dig(:q, :shipment_state_eq) == 'shipped'
|
|
150
|
-
Spree.t('admin.orders.fulfilled')
|
|
151
|
-
elsif params.dig(:q, :state_in) == ['canceled','partially_canceled']
|
|
152
|
-
Spree.t('admin.orders.canceled')
|
|
153
|
-
elsif params.dig(:q, :refunded)&.present?
|
|
154
|
-
Spree.t('admin.orders.refunded')
|
|
155
|
-
elsif params.dig(:q, :partially_refunded)&.present?
|
|
156
|
-
Spree.t('admin.orders.partially_refunded')
|
|
157
|
-
else
|
|
158
|
-
Spree.t('admin.orders.all_orders')
|
|
159
|
-
end
|
|
160
|
-
end
|
|
161
|
-
|
|
162
144
|
private
|
|
163
145
|
|
|
164
146
|
def map_to_tax_line(tax_adjustment, for_shipment: false)
|
|
@@ -76,28 +76,6 @@ module Spree
|
|
|
76
76
|
category_tree
|
|
77
77
|
end
|
|
78
78
|
|
|
79
|
-
def product_filter_status_dropdown_value
|
|
80
|
-
case params.dig(:q, :status_eq)
|
|
81
|
-
when 'active'
|
|
82
|
-
Spree.t('admin.products.active')
|
|
83
|
-
when 'draft'
|
|
84
|
-
Spree.t('admin.products.draft')
|
|
85
|
-
when 'archived'
|
|
86
|
-
Spree.t('admin.products.archived')
|
|
87
|
-
else
|
|
88
|
-
Spree.t('admin.products.all_statuses')
|
|
89
|
-
end
|
|
90
|
-
end
|
|
91
|
-
|
|
92
|
-
def product_filter_stock_dropdown_value
|
|
93
|
-
if params.dig(:q, :in_stock) == '1'
|
|
94
|
-
Spree.t('admin.products.in_stock')
|
|
95
|
-
elsif params.dig(:q, :out_of_stock) == '1'
|
|
96
|
-
Spree.t('admin.products.out_of_stock')
|
|
97
|
-
else
|
|
98
|
-
Spree.t('admin.products.any_stock')
|
|
99
|
-
end
|
|
100
|
-
end
|
|
101
79
|
|
|
102
80
|
def show_product_status_help_bubble?
|
|
103
81
|
false
|
|
@@ -106,11 +84,6 @@ module Spree
|
|
|
106
84
|
def variant_form_stock_location_options
|
|
107
85
|
options_for_select(available_stock_locations_list)
|
|
108
86
|
end
|
|
109
|
-
|
|
110
|
-
def product_list_filters_search_form_path
|
|
111
|
-
[:admin, @search]
|
|
112
|
-
end
|
|
113
|
-
|
|
114
87
|
end
|
|
115
88
|
end
|
|
116
89
|
end
|
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
module Spree
|
|
2
2
|
module Admin
|
|
3
3
|
module PromotionsHelper
|
|
4
|
-
def promotion_filter_dropdown_value
|
|
5
|
-
Spree::Deprecation.warn("promotion_filter_dropdown_value is deprecated and will be removed in Spree 5.5")
|
|
6
|
-
if params.dig(:q, :expired)
|
|
7
|
-
Spree.t(:expired)
|
|
8
|
-
elsif params.dig(:q, :active)
|
|
9
|
-
Spree.t(:active)
|
|
10
|
-
else
|
|
11
|
-
Spree.t(:all)
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
|
|
15
4
|
def promotion_status(promotion)
|
|
16
5
|
if promotion.active?
|
|
17
6
|
Spree.t(:active)
|
|
@@ -17,7 +17,7 @@ module Spree
|
|
|
17
17
|
Rails.cache.fetch(["#{store.cache_key_with_version}/admin_icon", opts.to_param]) do
|
|
18
18
|
if store.logo&.attached? && store.logo&.variable?
|
|
19
19
|
spree_image_tag(store.logo, class: opts[:class], width: opts[:width], height: opts[:height])
|
|
20
|
-
elsif store.favicon_image&.attached? && store.favicon_image&.variable?
|
|
20
|
+
elsif store.respond_to?(:favicon_image) && store.favicon_image&.attached? && store.favicon_image&.variable?
|
|
21
21
|
spree_image_tag(store.favicon_image, class: opts[:class], width: opts[:width], height: opts[:height])
|
|
22
22
|
else
|
|
23
23
|
first_letter_icon(store.name, opts)
|
|
@@ -125,7 +125,7 @@ module Spree
|
|
|
125
125
|
def render_status_column(value, column)
|
|
126
126
|
return empty_column_placeholder if value.blank?
|
|
127
127
|
|
|
128
|
-
css_class = STATUS_BADGE_CLASSES[value.to_s] || 'badge-
|
|
128
|
+
css_class = STATUS_BADGE_CLASSES[value.to_s] || 'badge-light'
|
|
129
129
|
content_tag(:span, Spree.t(value, scope: column.key, default: value.to_s.humanize), class: "badge #{css_class}")
|
|
130
130
|
end
|
|
131
131
|
|
|
@@ -222,7 +222,10 @@ module Spree
|
|
|
222
222
|
# @param column [Spree::Admin::Table::Column] column definition
|
|
223
223
|
# @return [String]
|
|
224
224
|
def column_cell_class(column)
|
|
225
|
-
|
|
225
|
+
[].tap do |classes|
|
|
226
|
+
classes << "text-#{column.align}" unless column.align.to_s == 'left'
|
|
227
|
+
classes << (column.wrap ? 'text-wrap' : 'text-nowrap')
|
|
228
|
+
end.join(' ')
|
|
226
229
|
end
|
|
227
230
|
|
|
228
231
|
# Build query builder fields JSON for Stimulus controller
|
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
<% content_for :page_actions do %>
|
|
4
4
|
<%= render_admin_partials(:coupon_codes_actions_partials) %>
|
|
5
|
+
<%= link_to_export_modal %>
|
|
5
6
|
<% end %>
|
|
6
7
|
|
|
7
8
|
<%= render_admin_partials(:coupon_codes_header_partials) %>
|
|
8
9
|
|
|
9
10
|
<div class="grid grid-cols-12 gap-6">
|
|
10
11
|
<div class="col-span-12 lg:col-span-8">
|
|
11
|
-
<%=
|
|
12
|
+
<%= render_table @collection, :coupon_codes, export_type: Spree::Exports::CouponCodes %>
|
|
12
13
|
</div>
|
|
13
14
|
|
|
14
15
|
<div class="col-span-12 lg:col-span-4">
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
<%= render partial: 'spree/admin/stores/form/basic', locals: { f: f } if params[:section].blank? || params[:section] == 'general-settings' %>
|
|
11
11
|
<%= render partial: 'spree/admin/stores/form/emails', locals: { f: f } if params[:section] == 'emails' %>
|
|
12
12
|
<%= render partial: 'spree/admin/stores/form/checkout', locals: { f: f } if params[:section] == 'checkout' %>
|
|
13
|
-
<%= render partial: 'spree/admin/stores/form/policies', locals: { f: f } if params[:section] == 'policies' %>
|
|
14
13
|
<% end %>
|
|
15
14
|
</div>
|
|
16
15
|
</div>
|
|
@@ -20,30 +20,3 @@
|
|
|
20
20
|
<%= f.spree_check_box :preferred_special_instructions_enabled, label: Spree.t('admin.checkout_settings.special_instructions.label'), help: Spree.t('admin.checkout_settings.special_instructions.description') %>
|
|
21
21
|
</div>
|
|
22
22
|
</div>
|
|
23
|
-
|
|
24
|
-
<div class="card mb-6">
|
|
25
|
-
<div class="card-header">
|
|
26
|
-
<h5 class="card-title"><%= Spree.t(:checkout_message) %></h5>
|
|
27
|
-
</div>
|
|
28
|
-
|
|
29
|
-
<div class="card-body">
|
|
30
|
-
<%= f.spree_rich_text_area :checkout_message, label: false, help: Spree.t('admin.checkout_settings.checkout_message_description') %>
|
|
31
|
-
</div>
|
|
32
|
-
</div>
|
|
33
|
-
|
|
34
|
-
<% if current_store.respond_to?(:links) %>
|
|
35
|
-
<div class="card mb-6">
|
|
36
|
-
<div class="card-header">
|
|
37
|
-
<h5 class="card-title"><%= Spree.t('admin.checkout_settings.checkout_links.label') %></h5>
|
|
38
|
-
</div>
|
|
39
|
-
|
|
40
|
-
<div class="card-body">
|
|
41
|
-
<div class="alert alert-info">
|
|
42
|
-
<div>
|
|
43
|
-
<%= Spree.t('admin.checkout_settings.checkout_links.description') %>
|
|
44
|
-
</div>
|
|
45
|
-
</div>
|
|
46
|
-
<%= render 'spree/admin/stores/form/checkout_links' %>
|
|
47
|
-
</div>
|
|
48
|
-
</div>
|
|
49
|
-
<% end %>
|