solidus_admin 0.1.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +61 -7
- data/Rakefile +1 -0
- data/app/assets/builds/solidus_admin/tailwind.css +197 -162
- data/app/assets/stylesheets/solidus_admin/dark.css +1 -0
- data/app/assets/stylesheets/solidus_admin/dimmed.css +1 -0
- data/app/components/solidus_admin/adjustment_reasons/edit/component.html.erb +27 -0
- data/app/components/solidus_admin/adjustment_reasons/edit/component.rb +12 -0
- data/app/components/solidus_admin/adjustment_reasons/edit/component.yml +8 -0
- data/app/components/solidus_admin/adjustment_reasons/index/component.rb +26 -19
- data/app/components/solidus_admin/adjustment_reasons/new/component.html.erb +28 -0
- data/app/components/solidus_admin/adjustment_reasons/new/component.rb +12 -0
- data/app/components/solidus_admin/adjustment_reasons/new/component.yml +8 -0
- data/app/components/solidus_admin/base_component.rb +4 -1
- data/app/components/solidus_admin/option_types/index/component.rb +21 -7
- data/app/components/solidus_admin/orders/index/component.rb +28 -23
- data/app/components/solidus_admin/orders/index/component.yml +1 -1
- data/app/components/solidus_admin/orders/show/address/component.html.erb +56 -54
- data/app/components/solidus_admin/orders/show/adjustments/index/adjustable/component.rb +27 -0
- data/app/components/solidus_admin/orders/show/adjustments/index/adjustable/spree_line_item/component.rb +14 -0
- data/app/components/solidus_admin/orders/show/adjustments/index/adjustable/spree_order/component.rb +11 -0
- data/app/components/solidus_admin/orders/show/adjustments/index/adjustable/spree_shipment/component.rb +15 -0
- data/app/components/solidus_admin/orders/show/adjustments/index/component.rb +147 -0
- data/app/components/solidus_admin/orders/show/adjustments/index/component.yml +21 -0
- data/app/components/solidus_admin/orders/show/adjustments/index/source/component.rb +26 -0
- data/app/components/solidus_admin/orders/show/adjustments/index/source/spree_tax_rate/component.rb +17 -0
- data/app/components/solidus_admin/orders/show/adjustments/index/source/spree_unit_cancel/component.rb +7 -0
- data/app/components/solidus_admin/orders/show/component.html.erb +7 -3
- data/app/components/solidus_admin/orders/show/component.rb +8 -0
- data/app/components/solidus_admin/orders/show/email/component.html.erb +18 -13
- data/app/components/solidus_admin/orders/show/email/component.rb +0 -4
- data/app/components/solidus_admin/orders/show/summary/component.html.erb +1 -1
- data/app/components/solidus_admin/payment_methods/index/component.rb +29 -19
- data/app/components/solidus_admin/payment_methods/index/component.yml +0 -5
- data/app/components/solidus_admin/products/index/component.rb +25 -15
- data/app/components/solidus_admin/products/index/component.yml +0 -2
- data/app/components/solidus_admin/products/show/component.html.erb +14 -3
- data/app/components/solidus_admin/products/status/component.rb +4 -1
- data/app/components/solidus_admin/products/status/component.yml +1 -0
- data/app/components/solidus_admin/properties/index/component.rb +18 -19
- data/app/components/solidus_admin/refund_reasons/edit/component.html.erb +27 -0
- data/app/components/solidus_admin/refund_reasons/edit/component.rb +12 -0
- data/app/components/solidus_admin/refund_reasons/edit/component.yml +8 -0
- data/app/components/solidus_admin/refund_reasons/index/component.rb +26 -19
- data/app/components/solidus_admin/refund_reasons/new/component.html.erb +27 -0
- data/app/components/solidus_admin/refund_reasons/new/component.rb +12 -0
- data/app/components/solidus_admin/refund_reasons/new/component.yml +6 -0
- data/app/components/solidus_admin/refunds_and_returns/component.rb +33 -13
- data/app/components/solidus_admin/reimbursement_types/index/component.rb +7 -25
- data/app/components/solidus_admin/return_reasons/edit/component.html.erb +26 -0
- data/app/components/solidus_admin/return_reasons/edit/component.rb +12 -0
- data/app/components/solidus_admin/return_reasons/edit/component.yml +8 -0
- data/app/components/solidus_admin/return_reasons/index/component.rb +27 -19
- data/app/components/solidus_admin/return_reasons/new/component.html.erb +27 -0
- data/app/components/solidus_admin/return_reasons/new/component.rb +12 -0
- data/app/components/solidus_admin/return_reasons/new/component.yml +8 -0
- data/app/components/solidus_admin/roles/edit/component.html.erb +33 -0
- data/app/components/solidus_admin/roles/edit/component.rb +20 -0
- data/app/components/solidus_admin/roles/edit/component.yml +19 -0
- data/app/components/solidus_admin/roles/index/component.rb +70 -0
- data/app/components/solidus_admin/roles/index/component.yml +6 -0
- data/app/components/solidus_admin/roles/new/component.html.erb +33 -0
- data/app/components/solidus_admin/roles/new/component.rb +20 -0
- data/app/components/solidus_admin/roles/new/component.yml +19 -0
- data/app/components/solidus_admin/shipping/component.rb +23 -11
- data/app/components/solidus_admin/shipping_categories/edit/component.html.erb +16 -0
- data/app/components/solidus_admin/shipping_categories/edit/component.rb +12 -0
- data/app/components/solidus_admin/shipping_categories/edit/component.yml +6 -0
- data/app/components/solidus_admin/shipping_categories/index/component.rb +37 -20
- data/app/components/solidus_admin/shipping_categories/new/component.html.erb +17 -0
- data/app/components/solidus_admin/shipping_categories/new/component.rb +12 -0
- data/app/components/solidus_admin/shipping_categories/new/component.yml +6 -0
- data/app/components/solidus_admin/shipping_methods/index/component.rb +19 -19
- data/app/components/solidus_admin/stock_items/edit/component.html.erb +66 -72
- data/app/components/solidus_admin/stock_items/edit/component.rb +0 -5
- data/app/components/solidus_admin/stock_items/index/component.rb +13 -20
- data/app/components/solidus_admin/stock_locations/index/component.rb +19 -11
- data/app/components/solidus_admin/stock_locations/index/component.yml +0 -3
- data/app/components/solidus_admin/store_credit_reasons/edit/component.html.erb +26 -0
- data/app/components/solidus_admin/store_credit_reasons/edit/component.rb +12 -0
- data/app/components/solidus_admin/store_credit_reasons/edit/component.yml +8 -0
- data/app/components/solidus_admin/store_credit_reasons/index/component.rb +26 -19
- data/app/components/solidus_admin/store_credit_reasons/new/component.html.erb +27 -0
- data/app/components/solidus_admin/store_credit_reasons/new/component.rb +12 -0
- data/app/components/solidus_admin/store_credit_reasons/new/component.yml +8 -0
- data/app/components/solidus_admin/stores/index/component.rb +18 -19
- data/app/components/solidus_admin/tax_categories/edit/component.html.erb +28 -0
- data/app/components/solidus_admin/tax_categories/edit/component.rb +12 -0
- data/app/components/solidus_admin/tax_categories/edit/component.yml +8 -0
- data/app/components/solidus_admin/tax_categories/index/component.rb +28 -21
- data/app/components/solidus_admin/tax_categories/new/component.html.erb +28 -0
- data/app/components/solidus_admin/tax_categories/new/component.rb +12 -0
- data/app/components/solidus_admin/tax_categories/new/component.yml +8 -0
- data/app/components/solidus_admin/tax_rates/index/component.rb +21 -17
- data/app/components/solidus_admin/taxes/component.rb +8 -8
- data/app/components/solidus_admin/taxonomies/index/component.rb +18 -12
- data/app/components/solidus_admin/ui/button/component.rb +1 -1
- data/app/components/solidus_admin/ui/checkbox_row/component.html.erb +29 -0
- data/app/components/solidus_admin/ui/checkbox_row/component.rb +11 -0
- data/app/components/solidus_admin/ui/forms/address/component.html.erb +27 -9
- data/app/components/solidus_admin/ui/forms/address/component.js +38 -13
- data/app/components/solidus_admin/ui/forms/search/component.html.erb +2 -3
- data/app/components/solidus_admin/ui/forms/search/component.js +3 -3
- data/app/components/solidus_admin/ui/modal/component.html.erb +7 -7
- data/app/components/solidus_admin/ui/modal/component.js +7 -0
- data/app/components/solidus_admin/ui/modal/component.rb +1 -1
- data/app/components/solidus_admin/ui/pages/index/component.html.erb +44 -0
- data/app/components/solidus_admin/ui/pages/index/component.rb +105 -0
- data/app/components/solidus_admin/ui/panel/component.html.erb +5 -16
- data/app/components/solidus_admin/ui/panel/component.rb +11 -7
- data/app/components/solidus_admin/ui/table/component.html.erb +2 -1
- data/app/components/solidus_admin/ui/table/component.js +31 -2
- data/app/components/solidus_admin/ui/table/component.rb +24 -8
- data/app/components/solidus_admin/ui/table/component.yml +1 -0
- data/app/components/solidus_admin/ui/thumbnail/component.rb +1 -1
- data/app/components/solidus_admin/ui/thumbnail_with_caption/component.html.erb +17 -0
- data/app/components/solidus_admin/ui/thumbnail_with_caption/component.rb +15 -0
- data/app/components/solidus_admin/users/addresses/component.html.erb +46 -0
- data/app/components/solidus_admin/users/addresses/component.rb +61 -0
- data/app/components/solidus_admin/users/addresses/component.yml +14 -0
- data/app/components/solidus_admin/users/edit/api_access/component.html.erb +49 -0
- data/app/components/solidus_admin/users/edit/api_access/component.js +9 -0
- data/app/components/solidus_admin/users/edit/api_access/component.rb +7 -0
- data/app/components/solidus_admin/users/edit/api_access/component.yml +10 -0
- data/app/components/solidus_admin/users/edit/component.html.erb +52 -0
- data/app/components/solidus_admin/users/edit/component.rb +51 -0
- data/app/components/solidus_admin/users/edit/component.yml +12 -0
- data/app/components/solidus_admin/users/index/component.rb +25 -16
- data/app/components/solidus_admin/users/index/component.yml +0 -3
- data/app/components/solidus_admin/users/items/component.html.erb +41 -0
- data/app/components/solidus_admin/users/items/component.rb +170 -0
- data/app/components/solidus_admin/users/items/component.yml +16 -0
- data/app/components/solidus_admin/users/orders/component.html.erb +42 -0
- data/app/components/solidus_admin/users/orders/component.rb +131 -0
- data/app/components/solidus_admin/users/orders/component.yml +12 -0
- data/app/components/solidus_admin/users/stats/component.html.erb +11 -0
- data/app/components/solidus_admin/users/stats/component.rb +9 -0
- data/app/components/solidus_admin/users/stats/component.yml +2 -0
- data/app/components/solidus_admin/users_and_roles/component.rb +24 -0
- data/app/components/solidus_admin/users_and_roles/component.yml +2 -0
- data/app/components/solidus_admin/zones/index/component.rb +19 -11
- data/app/controllers/solidus_admin/addresses_controller.rb +6 -1
- data/app/controllers/solidus_admin/adjustment_reasons_controller.rb +85 -10
- data/app/controllers/solidus_admin/adjustments_controller.rb +57 -0
- data/app/controllers/solidus_admin/customers_controller.rb +5 -1
- data/app/controllers/solidus_admin/orders_controller.rb +5 -1
- data/app/controllers/solidus_admin/products_controller.rb +11 -0
- data/app/controllers/solidus_admin/properties_controller.rb +1 -1
- data/app/controllers/solidus_admin/refund_reasons_controller.rb +85 -10
- data/app/controllers/solidus_admin/reimbursement_types_controller.rb +0 -5
- data/app/controllers/solidus_admin/return_reasons_controller.rb +85 -10
- data/app/controllers/solidus_admin/roles_controller.rb +118 -0
- data/app/controllers/solidus_admin/shipping_categories_controller.rb +87 -10
- data/app/controllers/solidus_admin/shipping_methods_controller.rb +0 -5
- data/app/controllers/solidus_admin/stock_items_controller.rb +6 -6
- data/app/controllers/solidus_admin/stock_locations_controller.rb +0 -5
- data/app/controllers/solidus_admin/store_credit_reasons_controller.rb +85 -10
- data/app/controllers/solidus_admin/stores_controller.rb +0 -5
- data/app/controllers/solidus_admin/tax_categories_controller.rb +89 -10
- data/app/controllers/solidus_admin/tax_rates_controller.rb +0 -5
- data/app/controllers/solidus_admin/users_controller.rb +85 -6
- data/app/controllers/solidus_admin/zones_controller.rb +0 -5
- data/app/helpers/solidus_admin/last_login_helper.rb +16 -0
- data/app/helpers/solidus_admin/permission_sets_helper.rb +32 -0
- data/app/views/layouts/solidus_admin/application.html.erb +2 -1
- data/app/views/layouts/solidus_admin/preview.html.erb +2 -0
- data/config/initializers/view_component.rb +1 -1
- data/config/locales/adjustment_reasons.en.yml +5 -1
- data/config/locales/adjustments.en.yml +10 -0
- data/config/locales/refund_reasons.en.yml +10 -0
- data/config/locales/return_reasons.en.yml +5 -1
- data/config/locales/roles.en.yml +10 -0
- data/config/locales/shipping_categories.en.yml +4 -0
- data/config/locales/store_credit_reasons.en.yml +5 -1
- data/config/locales/tax_categories.en.yml +4 -0
- data/config/locales/users.en.yml +10 -0
- data/config/routes.rb +24 -7
- data/docs/components.md +109 -0
- data/docs/{customizing_view_components.md → customizing_components.md} +2 -7
- data/docs/index_pages.md +146 -0
- data/docs/{customizing_menu_items.md → menu_items.md} +1 -1
- data/docs/stimulusjs.md +85 -0
- data/docs/{customizing_tailwindcss.md → tailwindcss.md} +27 -8
- data/lib/solidus_admin/component_registry.rb +40 -0
- data/lib/solidus_admin/configuration.rb +5 -27
- data/lib/solidus_admin/install_tailwindcss.rb +3 -1
- data/lib/solidus_admin/testing_support/admin_assets.rb +10 -0
- data/lib/solidus_admin/testing_support/component_helpers.rb +27 -0
- data/lib/solidus_admin/testing_support/dummy_app/rake_tasks.rb +60 -0
- data/lib/solidus_admin/testing_support/feature_helpers.rb +34 -0
- data/lib/solidus_admin/version.rb +1 -1
- data/solidus_admin.gemspec +7 -3
- metadata +111 -59
- data/app/components/solidus_admin/adjustment_reasons/index/component.html.erb +0 -32
- data/app/components/solidus_admin/adjustment_reasons/index/component.yml +0 -4
- data/app/components/solidus_admin/option_types/index/component.html.erb +0 -30
- data/app/components/solidus_admin/orders/index/component.html.erb +0 -35
- data/app/components/solidus_admin/payment_methods/index/component.html.erb +0 -38
- data/app/components/solidus_admin/products/index/component.html.erb +0 -34
- data/app/components/solidus_admin/promotion_categories/index/component.html.erb +0 -26
- data/app/components/solidus_admin/promotion_categories/index/component.rb +0 -57
- data/app/components/solidus_admin/promotion_categories/index/component.yml +0 -4
- data/app/components/solidus_admin/promotions/index/component.html.erb +0 -34
- data/app/components/solidus_admin/promotions/index/component.rb +0 -97
- data/app/components/solidus_admin/promotions/index/component.yml +0 -14
- data/app/components/solidus_admin/properties/index/component.html.erb +0 -34
- data/app/components/solidus_admin/properties/index/component.yml +0 -4
- data/app/components/solidus_admin/refund_reasons/index/component.html.erb +0 -31
- data/app/components/solidus_admin/refund_reasons/index/component.yml +0 -4
- data/app/components/solidus_admin/refunds_and_returns/component.html.erb +0 -26
- data/app/components/solidus_admin/reimbursement_types/index/component.html.erb +0 -22
- data/app/components/solidus_admin/reimbursement_types/index/component.yml +0 -4
- data/app/components/solidus_admin/return_reasons/index/component.html.erb +0 -31
- data/app/components/solidus_admin/return_reasons/index/component.yml +0 -4
- data/app/components/solidus_admin/shipping/component.html.erb +0 -30
- data/app/components/solidus_admin/shipping_categories/index/component.html.erb +0 -32
- data/app/components/solidus_admin/shipping_categories/index/component.yml +0 -4
- data/app/components/solidus_admin/shipping_methods/index/component.html.erb +0 -32
- data/app/components/solidus_admin/shipping_methods/index/component.yml +0 -4
- data/app/components/solidus_admin/stock_items/index/component.html.erb +0 -26
- data/app/components/solidus_admin/stock_locations/index/component.html.erb +0 -32
- data/app/components/solidus_admin/store_credit_reasons/index/component.html.erb +0 -31
- data/app/components/solidus_admin/store_credit_reasons/index/component.yml +0 -4
- data/app/components/solidus_admin/stores/index/component.html.erb +0 -34
- data/app/components/solidus_admin/stores/index/component.yml +0 -4
- data/app/components/solidus_admin/tax_categories/index/component.html.erb +0 -32
- data/app/components/solidus_admin/tax_categories/index/component.yml +0 -6
- data/app/components/solidus_admin/tax_rates/index/component.html.erb +0 -32
- data/app/components/solidus_admin/tax_rates/index/component.yml +0 -4
- data/app/components/solidus_admin/taxes/component.html.erb +0 -24
- data/app/components/solidus_admin/taxonomies/index/component.html.erb +0 -28
- data/app/components/solidus_admin/taxonomies/index/component.yml +0 -4
- data/app/components/solidus_admin/users/index/component.html.erb +0 -34
- data/app/components/solidus_admin/zones/index/component.html.erb +0 -35
- data/app/components/solidus_admin/zones/index/component.yml +0 -4
- data/app/controllers/solidus_admin/promotion_categories_controller.rb +0 -38
- data/app/controllers/solidus_admin/promotions_controller.rb +0 -46
- data/config/locales/promotion_categories.en.yml +0 -6
- data/config/locales/promotions.en.yml +0 -6
- data/config/locales/refund_reasons_.en.yml +0 -6
- /data/app/components/solidus_admin/{option_types → ui/pages}/index/component.yml +0 -0
@@ -0,0 +1,21 @@
|
|
1
|
+
en:
|
2
|
+
title: "Order %{number} / Adjustments"
|
3
|
+
save: "Save"
|
4
|
+
discard: "Discard"
|
5
|
+
none: "—"
|
6
|
+
|
7
|
+
actions:
|
8
|
+
title: "Actions"
|
9
|
+
delete: "Delete"
|
10
|
+
lock: "Lock"
|
11
|
+
unlock: "Unlock"
|
12
|
+
edit: "Edit"
|
13
|
+
|
14
|
+
state:
|
15
|
+
locked: "Locked"
|
16
|
+
unlocked: "Unlocked"
|
17
|
+
confirm: "Are you sure?"
|
18
|
+
|
19
|
+
totals:
|
20
|
+
adjustable: "Totals (by Adjustable)"
|
21
|
+
source: "Totals (by Source)"
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class SolidusAdmin::Orders::Show::Adjustments::Index::Source::Component < SolidusAdmin::BaseComponent
|
4
|
+
attr_reader :adjustment, :source, :model_name
|
5
|
+
|
6
|
+
def initialize(adjustment)
|
7
|
+
@adjustment = adjustment
|
8
|
+
@source = adjustment.source
|
9
|
+
@model_name = source&.model_name&.human
|
10
|
+
end
|
11
|
+
|
12
|
+
def call
|
13
|
+
render component("ui/thumbnail_with_caption").new(icon: icon, caption: caption, detail: detail)
|
14
|
+
end
|
15
|
+
|
16
|
+
def caption
|
17
|
+
adjustment.label
|
18
|
+
end
|
19
|
+
|
20
|
+
def detail
|
21
|
+
end
|
22
|
+
|
23
|
+
def icon
|
24
|
+
"question-line"
|
25
|
+
end
|
26
|
+
end
|
data/app/components/solidus_admin/orders/show/adjustments/index/source/spree_tax_rate/component.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class SolidusAdmin::Orders::Show::Adjustments::Index::Source::SpreeTaxRate::Component < SolidusAdmin::Orders::Show::Adjustments::Index::Source::Component
|
4
|
+
def icon
|
5
|
+
"percent-line"
|
6
|
+
end
|
7
|
+
|
8
|
+
def detail
|
9
|
+
link_to("#{model_name}: #{zone_name}", spree.edit_admin_tax_rate_path(adjustment.source_id), class: "body-link")
|
10
|
+
end
|
11
|
+
|
12
|
+
private
|
13
|
+
|
14
|
+
def zone_name
|
15
|
+
source.zone&.name || t("spree.all_zones")
|
16
|
+
end
|
17
|
+
end
|
@@ -16,9 +16,9 @@
|
|
16
16
|
|
17
17
|
<%= page_with_sidebar_aside do %>
|
18
18
|
<%= render component('ui/panel').new do |panel| %>
|
19
|
-
<% panel.with_menu t(".edit_email"), solidus_admin.order_customer_path(@order) %>
|
20
|
-
<% panel.with_menu t(".edit_shipping"), solidus_admin.edit_order_ship_address_path(@order) %>
|
21
|
-
<% panel.with_menu t(".edit_billing"), solidus_admin.edit_order_bill_address_path(@order) %>
|
19
|
+
<% panel.with_menu t(".edit_email"), solidus_admin.order_customer_path(@order), data: { turbo_frame: :edit_order_email_modal } %>
|
20
|
+
<% panel.with_menu t(".edit_shipping"), solidus_admin.edit_order_ship_address_path(@order), data: { turbo_frame: :edit_order_ship_address_modal } %>
|
21
|
+
<% panel.with_menu t(".edit_billing"), solidus_admin.edit_order_bill_address_path(@order), data: { turbo_frame: :edit_order_bill_address_modal } %>
|
22
22
|
<% panel.with_menu t(".remove_customer"), solidus_admin.order_customer_path(@order), method: :delete, class: "text-red-500" if @order.user %>
|
23
23
|
|
24
24
|
<% panel.with_section(class: 'flex flex-col gap-6') do %>
|
@@ -73,4 +73,8 @@
|
|
73
73
|
|
74
74
|
<% end %>
|
75
75
|
<% end %>
|
76
|
+
|
77
|
+
<% turbo_frames.each do |frame| %>
|
78
|
+
<%= turbo_frame_tag frame %>
|
79
|
+
<% end %>
|
76
80
|
<% end %>
|
@@ -29,6 +29,14 @@ class SolidusAdmin::Orders::Show::Component < SolidusAdmin::BaseComponent
|
|
29
29
|
], " ")
|
30
30
|
end
|
31
31
|
|
32
|
+
def turbo_frames
|
33
|
+
%w[
|
34
|
+
edit_order_email_modal
|
35
|
+
edit_order_bill_address_modal
|
36
|
+
edit_order_ship_address_modal
|
37
|
+
]
|
38
|
+
end
|
39
|
+
|
32
40
|
def customer_name(user)
|
33
41
|
(
|
34
42
|
user.default_user_bill_address ||
|
@@ -1,18 +1,23 @@
|
|
1
1
|
<div class="<%= stimulus_id %>">
|
2
|
-
<%=
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
2
|
+
<%= turbo_frame_tag "edit_order_email_modal" do %>
|
3
|
+
<%= render component("ui/modal").new(title: t(".title")) do |modal| %>
|
4
|
+
<%= form_for @order, url: solidus_admin.order_path(@order), html: { id: form_id } do |f| %>
|
5
|
+
<%= render component("ui/forms/field").text_field(f, :email) %>
|
6
|
+
<label class="font-normal text-sm mt-4 block">
|
7
|
+
<%= t('.guest_checkout') %>:
|
8
|
+
<output class="font-semibold text-sm"><%= @order.user ? t('.no') : t('.yes') %></output>
|
9
|
+
<%= render component('ui/toggletip').new(text: t('.guest_checkout_tip'), class: "align-middle") %>
|
10
|
+
</label>
|
11
|
+
<% end %>
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
<% modal.with_actions do %>
|
14
|
+
<form method="dialog">
|
15
|
+
<%= render component("ui/button").new(scheme: :secondary, text: t('.cancel')) %>
|
16
|
+
</form>
|
17
|
+
<%= render component("ui/button").new(form: form_id, type: :submit, text: t('.submit')) %>
|
18
|
+
<% end %>
|
16
19
|
<% end %>
|
17
20
|
<% end %>
|
21
|
+
|
22
|
+
<%= render component("orders/show").new(order: @order) %>
|
18
23
|
</div>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
{ label: t('.taxes'), value: number_to_currency(@order.additional_tax_total) },
|
7
7
|
{ label: t('.shipping'), value: number_to_currency(@order.shipment_total) },
|
8
8
|
{ label: link_to(t('.add_promo_code'), '#', class: "body-link"), value: number_to_currency(@order.promo_total) },
|
9
|
-
{ label: link_to(t('.adjustments'),
|
9
|
+
{ label: link_to(t('.adjustments'), solidus_admin.order_adjustments_path(@order), class: "body-link"), value: number_to_currency(@order.adjustment_total) },
|
10
10
|
{ label: t('.total'), value: number_to_currency(@order.total), class: 'font-semibold' }
|
11
11
|
]
|
12
12
|
) %>
|
@@ -1,28 +1,42 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
class SolidusAdmin::PaymentMethods::Index::Component < SolidusAdmin::
|
4
|
-
|
3
|
+
class SolidusAdmin::PaymentMethods::Index::Component < SolidusAdmin::UI::Pages::Index::Component
|
4
|
+
def model_class
|
5
|
+
Spree::PaymentMethod
|
6
|
+
end
|
7
|
+
|
8
|
+
def search_key
|
9
|
+
:name_or_description_cont
|
10
|
+
end
|
5
11
|
|
6
|
-
def
|
7
|
-
|
12
|
+
def search_url
|
13
|
+
solidus_admin.payment_methods_path
|
8
14
|
end
|
9
15
|
|
10
|
-
def
|
11
|
-
|
16
|
+
def row_url(payment_method)
|
17
|
+
spree.edit_admin_payment_method_path(payment_method)
|
12
18
|
end
|
13
19
|
|
14
|
-
def
|
15
|
-
|
20
|
+
def sortable_options
|
21
|
+
{
|
22
|
+
url: ->(payment_method) { solidus_admin.move_payment_method_path(payment_method) },
|
23
|
+
param: 'position',
|
24
|
+
}
|
16
25
|
end
|
17
26
|
|
18
|
-
def
|
19
|
-
|
27
|
+
def page_actions
|
28
|
+
render component("ui/button").new(
|
29
|
+
tag: :a,
|
30
|
+
text: t('.add'),
|
31
|
+
href: spree.new_admin_payment_method_path,
|
32
|
+
icon: "add-line",
|
33
|
+
)
|
20
34
|
end
|
21
35
|
|
22
36
|
def batch_actions
|
23
37
|
[
|
24
38
|
{
|
25
|
-
|
39
|
+
label: t('.batch_actions.delete'),
|
26
40
|
action: solidus_admin.payment_methods_path,
|
27
41
|
method: :delete,
|
28
42
|
icon: 'delete-bin-7-line',
|
@@ -40,10 +54,6 @@ class SolidusAdmin::PaymentMethods::Index::Component < SolidusAdmin::BaseCompone
|
|
40
54
|
]
|
41
55
|
end
|
42
56
|
|
43
|
-
def filters
|
44
|
-
[]
|
45
|
-
end
|
46
|
-
|
47
57
|
def columns
|
48
58
|
[
|
49
59
|
{
|
@@ -62,9 +72,9 @@ class SolidusAdmin::PaymentMethods::Index::Component < SolidusAdmin::BaseCompone
|
|
62
72
|
header: :available_to_users,
|
63
73
|
data: ->(payment_method) do
|
64
74
|
if payment_method.available_to_users?
|
65
|
-
component('ui/badge').
|
75
|
+
component('ui/badge').yes
|
66
76
|
else
|
67
|
-
component('ui/badge').
|
77
|
+
component('ui/badge').no
|
68
78
|
end
|
69
79
|
end
|
70
80
|
},
|
@@ -72,9 +82,9 @@ class SolidusAdmin::PaymentMethods::Index::Component < SolidusAdmin::BaseCompone
|
|
72
82
|
header: :available_to_admin,
|
73
83
|
data: ->(payment_method) do
|
74
84
|
if payment_method.available_to_admin?
|
75
|
-
component('ui/badge').
|
85
|
+
component('ui/badge').yes
|
76
86
|
else
|
77
|
-
component('ui/badge').
|
87
|
+
component('ui/badge').no
|
78
88
|
end
|
79
89
|
end
|
80
90
|
},
|
@@ -1,43 +1,53 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
class SolidusAdmin::Products::Index::Component < SolidusAdmin::
|
4
|
-
|
3
|
+
class SolidusAdmin::Products::Index::Component < SolidusAdmin::UI::Pages::Index::Component
|
4
|
+
def model_class
|
5
|
+
Spree::Product
|
6
|
+
end
|
5
7
|
|
6
|
-
def
|
7
|
-
|
8
|
+
def search_key
|
9
|
+
:name_or_variants_including_master_sku_cont
|
8
10
|
end
|
9
11
|
|
10
|
-
def
|
11
|
-
|
12
|
+
def search_url
|
13
|
+
solidus_admin.products_path
|
12
14
|
end
|
13
15
|
|
14
|
-
def
|
15
|
-
solidus_admin.
|
16
|
+
def row_url(product)
|
17
|
+
solidus_admin.product_path(product)
|
16
18
|
end
|
17
19
|
|
18
|
-
def
|
19
|
-
|
20
|
+
def page_actions
|
21
|
+
render component("ui/button").new(
|
22
|
+
tag: :a,
|
23
|
+
text: t('.add'),
|
24
|
+
href: spree.new_admin_product_path,
|
25
|
+
icon: "add-line",
|
26
|
+
)
|
20
27
|
end
|
21
28
|
|
22
29
|
def batch_actions
|
23
30
|
[
|
24
31
|
{
|
25
|
-
|
32
|
+
label: t('.batch_actions.delete'),
|
26
33
|
action: solidus_admin.products_path,
|
27
34
|
method: :delete,
|
28
35
|
icon: 'delete-bin-7-line',
|
36
|
+
require_confirmation: true,
|
29
37
|
},
|
30
38
|
{
|
31
|
-
|
39
|
+
label: t('.batch_actions.discontinue'),
|
32
40
|
action: solidus_admin.discontinue_products_path,
|
33
41
|
method: :put,
|
34
42
|
icon: 'pause-circle-line',
|
43
|
+
require_confirmation: true,
|
35
44
|
},
|
36
45
|
{
|
37
|
-
|
46
|
+
label: t('.batch_actions.activate'),
|
38
47
|
action: solidus_admin.activate_products_path,
|
39
48
|
method: :put,
|
40
49
|
icon: 'play-circle-line',
|
50
|
+
require_confirmation: true,
|
41
51
|
},
|
42
52
|
]
|
43
53
|
end
|
@@ -56,9 +66,9 @@ class SolidusAdmin::Products::Index::Component < SolidusAdmin::BaseComponent
|
|
56
66
|
def filters
|
57
67
|
Spree::OptionType.all.map do |option_type|
|
58
68
|
{
|
59
|
-
|
69
|
+
label: option_type.presentation,
|
60
70
|
combinator: 'or',
|
61
|
-
attribute: "
|
71
|
+
attribute: "option_values_id",
|
62
72
|
predicate: "in",
|
63
73
|
options: option_type.option_values.pluck(:name, :id),
|
64
74
|
}
|
@@ -100,9 +100,20 @@
|
|
100
100
|
|
101
101
|
<%= page_with_sidebar_aside do %>
|
102
102
|
<%= render component('ui/panel').new(title: "Publishing") do %>
|
103
|
-
<%= render component("ui/forms/field").text_field(
|
104
|
-
|
105
|
-
|
103
|
+
<%= render component("ui/forms/field").text_field(
|
104
|
+
f,
|
105
|
+
:available_on,
|
106
|
+
hint: t(".available_on_html"),
|
107
|
+
type: :date,
|
108
|
+
value: f.object.available_on&.to_date
|
109
|
+
) %>
|
110
|
+
<%= render component("ui/forms/field").text_field(
|
111
|
+
f,
|
112
|
+
:discontinue_on,
|
113
|
+
hint: t(".discontinue_on_html"),
|
114
|
+
type: :date,
|
115
|
+
value: f.object.discontinue_on&.to_date
|
116
|
+
) %>
|
106
117
|
<label class="flex gap-2 items-center">
|
107
118
|
<%= render component("ui/forms/checkbox").new(
|
108
119
|
name: "#{f.object_name}[promotionable]",
|
@@ -5,6 +5,7 @@ class SolidusAdmin::Products::Status::Component < SolidusAdmin::BaseComponent
|
|
5
5
|
available: :green,
|
6
6
|
discontinued: :yellow,
|
7
7
|
deleted: :red,
|
8
|
+
unavailable: :yellow
|
8
9
|
}.freeze
|
9
10
|
|
10
11
|
def self.from_product(product)
|
@@ -13,8 +14,10 @@ class SolidusAdmin::Products::Status::Component < SolidusAdmin::BaseComponent
|
|
13
14
|
:deleted
|
14
15
|
elsif product.discontinued?
|
15
16
|
:discontinued
|
16
|
-
|
17
|
+
elsif product.available?
|
17
18
|
:available
|
19
|
+
else
|
20
|
+
:unavailable
|
18
21
|
end
|
19
22
|
|
20
23
|
new(status: status)
|
@@ -1,28 +1,35 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
class SolidusAdmin::Properties::Index::Component < SolidusAdmin::
|
4
|
-
|
3
|
+
class SolidusAdmin::Properties::Index::Component < SolidusAdmin::UI::Pages::Index::Component
|
4
|
+
def model_class
|
5
|
+
Spree::Property
|
6
|
+
end
|
5
7
|
|
6
|
-
def
|
7
|
-
|
8
|
+
def search_key
|
9
|
+
:name_cont
|
8
10
|
end
|
9
11
|
|
10
|
-
def
|
11
|
-
|
12
|
+
def search_url
|
13
|
+
solidus_admin.properties_path
|
12
14
|
end
|
13
15
|
|
14
|
-
def
|
15
|
-
|
16
|
+
def row_url(property)
|
17
|
+
spree.admin_property_path(property)
|
16
18
|
end
|
17
19
|
|
18
|
-
def
|
19
|
-
|
20
|
+
def page_actions
|
21
|
+
render component("ui/button").new(
|
22
|
+
tag: :a,
|
23
|
+
text: t('.add'),
|
24
|
+
href: spree.new_admin_property_path,
|
25
|
+
icon: "add-line",
|
26
|
+
)
|
20
27
|
end
|
21
28
|
|
22
29
|
def batch_actions
|
23
30
|
[
|
24
31
|
{
|
25
|
-
|
32
|
+
label: t('.batch_actions.delete'),
|
26
33
|
action: solidus_admin.properties_path,
|
27
34
|
method: :delete,
|
28
35
|
icon: 'delete-bin-7-line',
|
@@ -30,14 +37,6 @@ class SolidusAdmin::Properties::Index::Component < SolidusAdmin::BaseComponent
|
|
30
37
|
]
|
31
38
|
end
|
32
39
|
|
33
|
-
def scopes
|
34
|
-
[]
|
35
|
-
end
|
36
|
-
|
37
|
-
def filters
|
38
|
-
[]
|
39
|
-
end
|
40
|
-
|
41
40
|
def columns
|
42
41
|
[
|
43
42
|
name_column,
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<%= turbo_frame_tag :edit_refund_reason_modal do %>
|
2
|
+
<%= render component("ui/modal").new(title: t(".title")) do |modal| %>
|
3
|
+
<%= form_for @refund_reason, url: solidus_admin.refund_reason_path(@refund_reason), html: { id: form_id } do |f| %>
|
4
|
+
<div class="flex flex-col gap-6 pb-4">
|
5
|
+
<%= render component("ui/forms/field").text_field(f, :name, class: "required") %>
|
6
|
+
<%= render component("ui/forms/field").text_field(f, :code, class: "required") %>
|
7
|
+
<label class="flex gap-2 items-center">
|
8
|
+
<%= hidden_field_tag "#{f.object_name}[active]", "0" %>
|
9
|
+
<%= render component("ui/forms/checkbox").new(
|
10
|
+
name: "#{f.object_name}[active]",
|
11
|
+
value: "1",
|
12
|
+
checked: f.object.active
|
13
|
+
) %>
|
14
|
+
<span class="font-semibold text-xs ml-2"><%= Spree::RefundReason.human_attribute_name :active %></span>
|
15
|
+
<%= render component("ui/toggletip").new(text: t(".hints.active")) %>
|
16
|
+
</label>
|
17
|
+
</div>
|
18
|
+
<% modal.with_actions do %>
|
19
|
+
<form method="dialog">
|
20
|
+
<%= render component("ui/button").new(scheme: :secondary, text: t('.cancel')) %>
|
21
|
+
</form>
|
22
|
+
<%= render component("ui/button").new(form: form_id, type: :submit, text: t('.submit')) %>
|
23
|
+
<% end %>
|
24
|
+
<% end %>
|
25
|
+
<% end %>
|
26
|
+
<% end %>
|
27
|
+
<%= render component("refund_reasons/index").new(page: @page) %>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class SolidusAdmin::RefundReasons::Edit::Component < SolidusAdmin::BaseComponent
|
4
|
+
def initialize(page:, refund_reason:)
|
5
|
+
@page = page
|
6
|
+
@refund_reason = refund_reason
|
7
|
+
end
|
8
|
+
|
9
|
+
def form_id
|
10
|
+
dom_id(@refund_reason, "#{stimulus_id}_edit_refund_reason_form")
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# Add your component translations here.
|
2
|
+
# Use the translation in the example in your template with `t(".hello")`.
|
3
|
+
en:
|
4
|
+
title: "Edit Refund Reason"
|
5
|
+
cancel: "Cancel"
|
6
|
+
submit: "Update Refund Reason"
|
7
|
+
hints:
|
8
|
+
active: "When checked, this refund reason will be available for selection when adding refunds to orders."
|
@@ -1,28 +1,43 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
class SolidusAdmin::RefundReasons::Index::Component < SolidusAdmin::
|
4
|
-
|
3
|
+
class SolidusAdmin::RefundReasons::Index::Component < SolidusAdmin::RefundsAndReturns::Component
|
4
|
+
def model_class
|
5
|
+
Spree::RefundReason
|
6
|
+
end
|
7
|
+
|
8
|
+
def search_url
|
9
|
+
solidus_admin.refund_reasons_path
|
10
|
+
end
|
5
11
|
|
6
|
-
def
|
7
|
-
|
12
|
+
def search_key
|
13
|
+
:name_or_code_cont
|
8
14
|
end
|
9
15
|
|
10
|
-
def
|
11
|
-
|
16
|
+
def row_url(refund_reason)
|
17
|
+
spree.edit_admin_refund_reason_path(refund_reason, _turbo_frame: :edit_refund_reason_modal)
|
12
18
|
end
|
13
19
|
|
14
|
-
def
|
15
|
-
|
20
|
+
def turbo_frames
|
21
|
+
%w[
|
22
|
+
new_refund_reason_modal
|
23
|
+
edit_refund_reason_modal
|
24
|
+
]
|
16
25
|
end
|
17
26
|
|
18
|
-
def
|
19
|
-
|
27
|
+
def page_actions
|
28
|
+
render component("ui/button").new(
|
29
|
+
tag: :a,
|
30
|
+
text: t('.add'),
|
31
|
+
href: solidus_admin.new_refund_reason_path, data: { turbo_frame: :new_refund_reason_modal },
|
32
|
+
icon: "add-line",
|
33
|
+
class: "align-self-end w-full",
|
34
|
+
)
|
20
35
|
end
|
21
36
|
|
22
37
|
def batch_actions
|
23
38
|
[
|
24
39
|
{
|
25
|
-
|
40
|
+
label: t('.batch_actions.delete'),
|
26
41
|
action: solidus_admin.refund_reasons_path,
|
27
42
|
method: :delete,
|
28
43
|
icon: 'delete-bin-7-line',
|
@@ -30,14 +45,6 @@ class SolidusAdmin::RefundReasons::Index::Component < SolidusAdmin::BaseComponen
|
|
30
45
|
]
|
31
46
|
end
|
32
47
|
|
33
|
-
def scopes
|
34
|
-
[]
|
35
|
-
end
|
36
|
-
|
37
|
-
def filters
|
38
|
-
[]
|
39
|
-
end
|
40
|
-
|
41
48
|
def columns
|
42
49
|
[
|
43
50
|
:name,
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<%= turbo_frame_tag :new_refund_reason_modal do %>
|
2
|
+
<%= render component("ui/modal").new(title: t(".title")) do |modal| %>
|
3
|
+
<%= form_for @refund_reason, url: solidus_admin.refund_reasons_path, html: { id: form_id } do |f| %>
|
4
|
+
<div class="flex flex-col gap-6 pb-4">
|
5
|
+
<%= render component("ui/forms/field").text_field(f, :name, class: "required") %>
|
6
|
+
<%= render component("ui/forms/field").text_field(f, :code, class: "required") %>
|
7
|
+
<label class="flex gap-2 items-center">
|
8
|
+
<%= render component("ui/forms/checkbox").new(
|
9
|
+
name: "#{f.object_name}[active]",
|
10
|
+
value: "1",
|
11
|
+
checked: f.object.active
|
12
|
+
) %>
|
13
|
+
<span class="font-semibold text-xs ml-2"><%= Spree::RefundReason.human_attribute_name :active %></span>
|
14
|
+
<%= render component("ui/toggletip").new(text: t(".hints.active")) %>
|
15
|
+
</label>
|
16
|
+
</div>
|
17
|
+
<% modal.with_actions do %>
|
18
|
+
<form method="dialog">
|
19
|
+
<%= render component("ui/button").new(scheme: :secondary, text: t('.cancel')) %>
|
20
|
+
</form>
|
21
|
+
<%= render component("ui/button").new(form: form_id, type: :submit, text: t('.submit')) %>
|
22
|
+
<% end %>
|
23
|
+
<% end %>
|
24
|
+
<% end %>
|
25
|
+
<% end %>
|
26
|
+
|
27
|
+
<%= render component("refund_reasons/index").new(page: @page) %>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class SolidusAdmin::RefundReasons::New::Component < SolidusAdmin::BaseComponent
|
4
|
+
def initialize(page:, refund_reason:)
|
5
|
+
@page = page
|
6
|
+
@refund_reason = refund_reason
|
7
|
+
end
|
8
|
+
|
9
|
+
def form_id
|
10
|
+
dom_id(@refund_reason, "#{stimulus_id}_new_refund_reason_form")
|
11
|
+
end
|
12
|
+
end
|