solidus_admin 0.4.1 → 0.5.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 +23 -4
- data/README.md +6 -1
- data/Rakefile +15 -15
- data/app/assets/builds/solidus_admin/tailwind.css +721 -44
- data/app/assets/images/solidus_admin/remixicon.license.txt +196 -0
- data/app/assets/images/solidus_admin/remixicon.symbol.svg +4 -4
- data/app/blueprints/solidus_admin/state_blueprint.rb +13 -0
- data/app/components/concerns/solidus_admin/slotable_default.rb +42 -0
- data/app/components/solidus_admin/adjustment_reasons/edit/component.html.erb +6 -15
- data/app/components/solidus_admin/adjustment_reasons/edit/component.yml +0 -1
- data/app/components/solidus_admin/adjustment_reasons/index/component.rb +13 -13
- data/app/components/solidus_admin/adjustment_reasons/new/component.html.erb +6 -15
- data/app/components/solidus_admin/adjustment_reasons/new/component.yml +0 -1
- data/app/components/solidus_admin/base_component.rb +7 -3
- data/app/components/solidus_admin/layout/confirm/component.html.erb +18 -0
- data/app/components/solidus_admin/layout/confirm/component.js +21 -0
- data/app/components/solidus_admin/layout/confirm/component.rb +26 -0
- data/app/components/solidus_admin/layout/confirm/component.yml +4 -0
- data/app/components/solidus_admin/layout/flashes/alerts/component.html.erb +7 -0
- data/app/components/solidus_admin/layout/flashes/alerts/component.rb +19 -0
- data/app/components/solidus_admin/layout/flashes/component.html.erb +5 -0
- data/app/components/solidus_admin/layout/flashes/component.rb +4 -0
- data/app/components/solidus_admin/layout/flashes/toasts/component.html.erb +5 -0
- data/app/components/solidus_admin/layout/flashes/toasts/component.rb +9 -0
- data/app/components/solidus_admin/layout/navigation/account/component.html.erb +12 -1
- data/app/components/solidus_admin/layout/navigation/account/component.rb +4 -4
- data/app/components/solidus_admin/layout/page_helpers.rb +3 -9
- data/app/components/solidus_admin/layout/skip_link/component.rb +3 -3
- data/app/components/solidus_admin/option_types/edit/component.html.erb +44 -0
- data/app/components/solidus_admin/option_types/edit/component.rb +5 -0
- data/app/components/solidus_admin/option_types/edit/component.yml +10 -0
- data/app/components/solidus_admin/option_types/index/component.rb +22 -22
- data/app/components/solidus_admin/option_types/new/component.html.erb +16 -0
- data/app/components/solidus_admin/option_types/new/component.rb +4 -0
- data/app/components/solidus_admin/option_types/new/component.yml +4 -0
- data/app/components/solidus_admin/option_values/edit/component.html.erb +16 -0
- data/app/components/solidus_admin/option_values/edit/component.rb +4 -0
- data/app/components/solidus_admin/option_values/edit/component.yml +4 -0
- data/app/components/solidus_admin/option_values/new/component.html.erb +16 -0
- data/app/components/solidus_admin/option_values/new/component.rb +7 -0
- data/app/components/solidus_admin/option_values/new/component.yml +4 -0
- data/app/components/solidus_admin/option_values/table/component.rb +53 -0
- data/app/components/solidus_admin/option_values/table/component.yml +3 -0
- data/app/components/solidus_admin/orders/cart/component.html.erb +5 -7
- data/app/components/solidus_admin/orders/cart/result/component.html.erb +2 -2
- data/app/components/solidus_admin/orders/index/component.rb +26 -26
- data/app/components/solidus_admin/orders/show/address/component.html.erb +8 -20
- data/app/components/solidus_admin/orders/show/address/component.rb +7 -7
- data/app/components/solidus_admin/orders/show/address/component.yml +0 -1
- data/app/components/solidus_admin/orders/show/adjustments/index/adjustable/spree_shipment/component.rb +1 -1
- data/app/components/solidus_admin/orders/show/adjustments/index/component.rb +24 -21
- data/app/components/solidus_admin/orders/show/component.html.erb +2 -2
- data/app/components/solidus_admin/orders/show/component.rb +1 -1
- data/app/components/solidus_admin/orders/show/component.yml +0 -3
- data/app/components/solidus_admin/orders/show/customer_search/result/component.html.erb +2 -2
- data/app/components/solidus_admin/orders/show/email/component.html.erb +2 -2
- data/app/components/solidus_admin/payment_methods/edit/component.html.erb +13 -0
- data/app/components/solidus_admin/payment_methods/edit/component.rb +7 -0
- data/app/components/solidus_admin/payment_methods/edit/component.yml +2 -0
- data/app/components/solidus_admin/payment_methods/form/component.html.erb +29 -0
- data/app/components/solidus_admin/payment_methods/form/component.rb +34 -0
- data/app/components/solidus_admin/payment_methods/form/component.yml +15 -0
- data/app/components/solidus_admin/payment_methods/index/component.rb +24 -23
- data/app/components/solidus_admin/payment_methods/new/component.html.erb +12 -0
- data/app/components/solidus_admin/payment_methods/new/component.rb +7 -0
- data/app/components/solidus_admin/payment_methods/new/component.yml +2 -0
- data/app/components/solidus_admin/products/index/component.rb +26 -26
- data/app/components/solidus_admin/products/show/categories/new/component.html.erb +17 -0
- data/app/components/solidus_admin/products/show/categories/new/component.rb +17 -0
- data/app/components/solidus_admin/products/show/categories/new/component.yml +5 -0
- data/app/components/solidus_admin/products/show/component.html.erb +90 -66
- data/app/components/solidus_admin/products/show/component.rb +2 -2
- data/app/components/solidus_admin/products/show/component.yml +23 -11
- data/app/components/solidus_admin/products/status/component.rb +1 -1
- data/app/components/solidus_admin/products/stock/component.rb +7 -7
- data/app/components/solidus_admin/properties/edit/component.html.erb +5 -5
- data/app/components/solidus_admin/properties/index/component.rb +13 -13
- data/app/components/solidus_admin/properties/new/component.html.erb +5 -5
- data/app/components/solidus_admin/refund_reasons/edit/component.html.erb +6 -15
- data/app/components/solidus_admin/refund_reasons/edit/component.yml +0 -1
- data/app/components/solidus_admin/refund_reasons/index/component.rb +13 -13
- data/app/components/solidus_admin/refund_reasons/new/component.html.erb +6 -14
- data/app/components/solidus_admin/refund_reasons/new/component.yml +0 -1
- data/app/components/solidus_admin/refunds_and_returns/component.rb +7 -7
- data/app/components/solidus_admin/reimbursement_types/index/component.rb +2 -2
- data/app/components/solidus_admin/return_reasons/edit/component.html.erb +5 -14
- data/app/components/solidus_admin/return_reasons/index/component.rb +11 -11
- data/app/components/solidus_admin/return_reasons/new/component.html.erb +5 -14
- data/app/components/solidus_admin/roles/edit/component.html.erb +12 -12
- data/app/components/solidus_admin/roles/edit/component.yml +0 -1
- data/app/components/solidus_admin/roles/index/component.rb +12 -12
- data/app/components/solidus_admin/roles/new/component.html.erb +12 -12
- data/app/components/solidus_admin/roles/new/component.yml +0 -1
- data/app/components/solidus_admin/shipping/component.rb +5 -5
- data/app/components/solidus_admin/shipping_categories/edit/component.html.erb +4 -4
- data/app/components/solidus_admin/shipping_categories/edit/component.yml +0 -1
- data/app/components/solidus_admin/shipping_categories/index/component.rb +9 -9
- data/app/components/solidus_admin/shipping_categories/new/component.html.erb +4 -4
- data/app/components/solidus_admin/shipping_categories/new/component.yml +0 -1
- data/app/components/solidus_admin/shipping_methods/index/component.rb +10 -10
- data/app/components/solidus_admin/stock_items/edit/component.html.erb +5 -8
- data/app/components/solidus_admin/stock_items/edit/component.rb +2 -2
- data/app/components/solidus_admin/stock_items/index/component.rb +25 -25
- data/app/components/solidus_admin/stock_locations/edit/component.html.erb +16 -0
- data/app/components/solidus_admin/stock_locations/edit/component.rb +5 -0
- data/app/components/solidus_admin/stock_locations/edit/component.yml +2 -0
- data/app/components/solidus_admin/stock_locations/form/component.html.erb +65 -0
- data/app/components/solidus_admin/stock_locations/form/component.rb +11 -0
- data/app/components/solidus_admin/stock_locations/form/component.yml +19 -0
- data/app/components/solidus_admin/stock_locations/index/component.rb +94 -47
- data/app/components/solidus_admin/stock_locations/new/component.html.erb +16 -0
- data/app/components/solidus_admin/stock_locations/new/component.rb +16 -0
- data/app/components/solidus_admin/stock_locations/new/component.yml +2 -0
- data/app/components/solidus_admin/store_credit_reasons/edit/component.html.erb +5 -14
- data/app/components/solidus_admin/store_credit_reasons/edit/component.yml +0 -1
- data/app/components/solidus_admin/store_credit_reasons/index/component.rb +11 -11
- data/app/components/solidus_admin/store_credit_reasons/new/component.html.erb +5 -14
- data/app/components/solidus_admin/store_credit_reasons/new/component.yml +0 -1
- data/app/components/solidus_admin/stores/edit/component.html.erb +27 -0
- data/app/components/solidus_admin/stores/edit/component.rb +5 -0
- data/app/components/solidus_admin/stores/form/component.html.erb +102 -0
- data/app/components/solidus_admin/stores/form/component.rb +27 -0
- data/app/components/solidus_admin/stores/form/component.yml +17 -0
- data/app/components/solidus_admin/stores/index/component.rb +51 -22
- data/app/components/solidus_admin/stores/new/component.html.erb +16 -0
- data/app/components/solidus_admin/stores/new/component.rb +5 -0
- data/app/components/solidus_admin/stores/new/component.yml +2 -0
- data/app/components/solidus_admin/tax_categories/edit/component.html.erb +7 -15
- data/app/components/solidus_admin/tax_categories/edit/component.yml +0 -1
- data/app/components/solidus_admin/tax_categories/index/component.rb +17 -17
- data/app/components/solidus_admin/tax_categories/new/component.html.erb +7 -15
- data/app/components/solidus_admin/tax_categories/new/component.yml +0 -1
- data/app/components/solidus_admin/tax_rates/edit/component.html.erb +12 -0
- data/app/components/solidus_admin/tax_rates/edit/component.rb +5 -0
- data/app/components/solidus_admin/tax_rates/edit/component.yml +4 -0
- data/app/components/solidus_admin/tax_rates/form/component.html.erb +25 -0
- data/app/components/solidus_admin/tax_rates/form/component.rb +29 -0
- data/app/components/solidus_admin/tax_rates/form/component.yml +9 -0
- data/app/components/solidus_admin/tax_rates/index/component.rb +38 -20
- data/app/components/solidus_admin/tax_rates/new/component.html.erb +12 -0
- data/app/components/solidus_admin/tax_rates/new/component.rb +5 -0
- data/app/components/solidus_admin/tax_rates/new/component.yml +4 -0
- data/app/components/solidus_admin/taxes/component.rb +4 -4
- data/app/components/solidus_admin/taxonomies/index/component.rb +7 -7
- data/app/components/solidus_admin/turbo/target_frame/component.html.erb +5 -0
- data/app/components/solidus_admin/turbo/target_frame/component.rb +8 -0
- data/app/components/solidus_admin/ui/alert/component.html.erb +35 -0
- data/app/components/solidus_admin/ui/alert/component.rb +51 -0
- data/app/components/solidus_admin/ui/alert/component.yml +8 -0
- data/app/components/solidus_admin/ui/badge/component.rb +11 -11
- data/app/components/solidus_admin/ui/button/component.rb +84 -27
- data/app/components/solidus_admin/ui/button/component.yml +10 -0
- data/app/components/solidus_admin/ui/checkbox/component.rb +42 -0
- data/app/components/solidus_admin/ui/dropdown/component.rb +3 -3
- data/app/components/solidus_admin/ui/forms/address/component.html.erb +1 -48
- data/app/components/solidus_admin/ui/forms/address/component.rb +29 -6
- data/app/components/solidus_admin/ui/forms/address/fields/city_and_zipcode/component.html.erb +4 -0
- data/app/components/solidus_admin/ui/forms/address/fields/city_and_zipcode/component.rb +8 -0
- data/app/components/solidus_admin/ui/forms/address/fields/country_and_state/component.html.erb +39 -0
- data/app/components/solidus_admin/ui/forms/address/{component.js → fields/country_and_state/component.js} +2 -0
- data/app/components/solidus_admin/ui/forms/address/fields/country_and_state/component.rb +15 -0
- data/app/components/solidus_admin/ui/forms/address/fields/reverse_charge_fields/component.html.erb +7 -0
- data/app/components/solidus_admin/ui/forms/address/fields/reverse_charge_fields/component.rb +12 -0
- data/app/components/solidus_admin/ui/forms/address/fieldsets/base.rb +54 -0
- data/app/components/solidus_admin/ui/forms/address/fieldsets/contact/component.rb +16 -0
- data/app/components/solidus_admin/ui/forms/address/fieldsets/contact_info/component.rb +10 -0
- data/app/components/solidus_admin/ui/forms/address/fieldsets/location/component.rb +14 -0
- data/app/components/solidus_admin/ui/forms/checkbox/component.html.erb +14 -0
- data/app/components/solidus_admin/ui/forms/checkbox/component.rb +24 -31
- data/app/components/solidus_admin/ui/forms/field/component.html.erb +4 -4
- data/app/components/solidus_admin/ui/forms/field/component.rb +14 -18
- data/app/components/solidus_admin/ui/forms/input/component.rb +9 -18
- data/app/components/solidus_admin/ui/forms/search/result/component.rb +2 -2
- data/app/components/solidus_admin/ui/forms/select/component.html.erb +21 -0
- data/app/components/solidus_admin/ui/forms/select/component.rb +157 -0
- data/app/components/solidus_admin/ui/forms/switch/component.rb +4 -4
- data/app/components/solidus_admin/ui/icon/component.rb +4 -4
- data/app/components/solidus_admin/ui/icon/names.txt +973 -238
- data/app/components/solidus_admin/ui/modal/component.html.erb +2 -4
- data/app/components/solidus_admin/ui/modal/component.js +7 -1
- data/app/components/solidus_admin/ui/modal/component.rb +2 -2
- data/app/components/solidus_admin/ui/pages/index/component.rb +50 -19
- data/app/components/solidus_admin/ui/panel/component.rb +5 -9
- data/app/components/solidus_admin/ui/radio/component.rb +29 -0
- data/app/components/solidus_admin/ui/tab/component.rb +4 -4
- data/app/components/solidus_admin/ui/table/component.html.erb +11 -10
- data/app/components/solidus_admin/ui/table/component.js +18 -26
- data/app/components/solidus_admin/ui/table/component.rb +24 -18
- data/app/components/solidus_admin/ui/table/component.yml +1 -0
- data/app/components/solidus_admin/ui/table/ransack_filter/component.html.erb +1 -1
- data/app/components/solidus_admin/ui/table/ransack_filter/component.rb +7 -7
- data/app/components/solidus_admin/ui/thumbnail/component.rb +5 -5
- data/app/components/solidus_admin/ui/toast/component.html.erb +6 -6
- data/app/components/solidus_admin/ui/toast/component.rb +1 -1
- data/app/components/solidus_admin/ui/toggletip/component.rb +1 -1
- data/app/components/solidus_admin/users/addresses/component.html.erb +3 -5
- data/app/components/solidus_admin/users/addresses/component.rb +0 -30
- data/app/components/solidus_admin/users/addresses/component.yml +0 -7
- data/app/components/solidus_admin/users/edit/api_access/component.html.erb +6 -4
- data/app/components/solidus_admin/users/edit/api_access/component.yml +8 -2
- data/app/components/solidus_admin/users/edit/component.html.erb +15 -12
- data/app/components/solidus_admin/users/edit/component.rb +1 -33
- data/app/components/solidus_admin/users/edit/component.yml +0 -7
- data/app/components/solidus_admin/users/edit/tabs/component.rb +46 -0
- data/app/components/solidus_admin/users/edit/tabs/component.yml +6 -0
- data/app/components/solidus_admin/users/index/component.rb +20 -20
- data/app/components/solidus_admin/users/items/component.html.erb +1 -3
- data/app/components/solidus_admin/users/items/component.rb +17 -47
- data/app/components/solidus_admin/users/items/component.yml +0 -7
- data/app/components/solidus_admin/users/orders/component.html.erb +1 -3
- data/app/components/solidus_admin/users/orders/component.rb +9 -39
- data/app/components/solidus_admin/users/orders/component.yml +0 -6
- data/app/components/solidus_admin/users/store_credits/edit_amount/component.html.erb +7 -8
- data/app/components/solidus_admin/users/store_credits/edit_amount/component.rb +0 -5
- data/app/components/solidus_admin/users/store_credits/edit_amount/component.yml +0 -1
- data/app/components/solidus_admin/users/store_credits/edit_memo/component.html.erb +4 -4
- data/app/components/solidus_admin/users/store_credits/edit_memo/component.yml +0 -1
- data/app/components/solidus_admin/users/store_credits/edit_validity/component.html.erb +6 -7
- data/app/components/solidus_admin/users/store_credits/edit_validity/component.rb +0 -5
- data/app/components/solidus_admin/users/store_credits/index/component.html.erb +4 -6
- data/app/components/solidus_admin/users/store_credits/index/component.rb +10 -40
- data/app/components/solidus_admin/users/store_credits/index/component.yml +0 -6
- data/app/components/solidus_admin/users/store_credits/new/component.html.erb +12 -13
- data/app/components/solidus_admin/users/store_credits/new/component.rb +0 -9
- data/app/components/solidus_admin/users/store_credits/new/component.yml +0 -1
- data/app/components/solidus_admin/users/store_credits/show/component.html.erb +5 -7
- data/app/components/solidus_admin/users/store_credits/show/component.rb +8 -38
- data/app/components/solidus_admin/users/store_credits/show/component.yml +0 -6
- data/app/components/solidus_admin/users_and_roles/component.rb +4 -4
- data/app/components/solidus_admin/zones/edit/component.html.erb +1 -0
- data/app/components/solidus_admin/zones/edit/component.rb +4 -0
- data/app/components/solidus_admin/zones/form/component.html.erb +47 -0
- data/app/components/solidus_admin/zones/form/component.js +32 -0
- data/app/components/solidus_admin/zones/form/component.rb +23 -0
- data/app/components/solidus_admin/zones/form/component.yml +7 -0
- data/app/components/solidus_admin/zones/index/component.rb +57 -18
- data/app/components/solidus_admin/zones/new/component.html.erb +1 -0
- data/app/components/solidus_admin/zones/new/component.rb +4 -0
- data/app/controllers/concerns/solidus_admin/moveable.rb +31 -0
- data/app/controllers/solidus_admin/addresses_controller.rb +9 -11
- data/app/controllers/solidus_admin/adjustments_controller.rb +5 -6
- data/app/controllers/solidus_admin/base_controller.rb +8 -7
- data/app/controllers/solidus_admin/controller_helpers/authorization.rb +1 -1
- data/app/controllers/solidus_admin/controller_helpers/locale.rb +1 -1
- data/app/controllers/solidus_admin/controller_helpers/pagination.rb +37 -0
- data/app/controllers/solidus_admin/controller_helpers/search.rb +5 -5
- data/app/controllers/solidus_admin/controller_helpers/theme.rb +2 -2
- data/app/controllers/solidus_admin/customers_controller.rb +3 -3
- data/app/controllers/solidus_admin/line_items_controller.rb +3 -3
- data/app/controllers/solidus_admin/option_types_controller.rb +11 -32
- data/app/controllers/solidus_admin/option_values_controller.rb +54 -0
- data/app/controllers/solidus_admin/orders_controller.rb +25 -19
- data/app/controllers/solidus_admin/payment_methods_controller.rb +23 -28
- data/app/controllers/solidus_admin/product_option_types_controller.rb +5 -0
- data/app/controllers/solidus_admin/product_taxons_controller.rb +58 -0
- data/app/controllers/solidus_admin/products_controller.rb +24 -28
- data/app/controllers/solidus_admin/reimbursement_types_controller.rb +3 -3
- data/app/controllers/solidus_admin/resources_controller.rb +59 -20
- data/app/controllers/solidus_admin/shipping_methods_controller.rb +4 -4
- data/app/controllers/solidus_admin/states_controller.rb +30 -0
- data/app/controllers/solidus_admin/stock_items_controller.rb +11 -6
- data/app/controllers/solidus_admin/stock_locations_controller.rb +25 -26
- data/app/controllers/solidus_admin/store_credits_controller.rb +9 -9
- data/app/controllers/solidus_admin/stores_controller.rb +43 -9
- data/app/controllers/solidus_admin/tax_rates_controller.rb +9 -22
- data/app/controllers/solidus_admin/taxonomies_controller.rb +5 -21
- data/app/controllers/solidus_admin/users_controller.rb +16 -16
- data/app/controllers/solidus_admin/zones_controller.rb +6 -26
- data/app/helpers/solidus_admin/flash_helper.rb +14 -0
- data/app/helpers/solidus_admin/last_login_helper.rb +2 -2
- data/app/helpers/solidus_admin/permission_sets_helper.rb +3 -3
- data/app/helpers/solidus_admin/solidus_form_helper.rb +9 -0
- data/app/helpers/solidus_admin/stimulus_helper.rb +29 -0
- data/app/helpers/solidus_admin/void_elements_helper.rb +1 -1
- data/app/javascript/solidus_admin/application.js +10 -1
- data/app/javascript/solidus_admin/confirm_modal.js +24 -0
- data/app/javascript/solidus_admin/controllers/custom_validity_controller.js +12 -0
- data/app/javascript/solidus_admin/controllers/sortable_controller.js +9 -2
- data/app/javascript/solidus_admin/tom-select/plugins/patch_scroll.js +19 -0
- data/app/javascript/solidus_admin/tom-select/plugins/remote_with_pagination.js +67 -0
- data/app/javascript/solidus_admin/tom-select/plugins/stash_on_search.js +68 -0
- data/app/javascript/solidus_admin/tom-select/tom-select.js +11 -0
- data/app/javascript/solidus_admin/utils.js +40 -0
- data/app/javascript/solidus_admin/web_components/solidus_select.js +90 -0
- data/app/javascript/vendor/custom_elements.js +3 -0
- data/app/lib/solidus_admin/form_builder.rb +58 -0
- data/app/views/layouts/solidus_admin/application.html.erb +6 -8
- data/app/views/layouts/solidus_admin/preview.html.erb +1 -1
- data/app/views/solidus_admin/option_values/create.turbo_stream.erb +3 -0
- data/app/views/solidus_admin/option_values/destroy.turbo_stream.erb +3 -0
- data/app/views/solidus_admin/option_values/update.turbo_stream.erb +3 -0
- data/config/importmap.rb +9 -0
- data/config/initializers/view_component.rb +1 -1
- data/config/locales/option_types.en.yml +5 -1
- data/config/locales/option_values.en.yml +9 -0
- data/config/locales/payment_methods.en.yml +5 -1
- data/config/locales/product_taxons.en.yml +6 -0
- data/config/locales/products.en.yml +2 -0
- data/config/locales/solidus_select.yml +6 -0
- data/config/locales/stock_locations.en.yml +4 -0
- data/config/locales/stores.en.yml +22 -0
- data/config/locales/tax_rates.en.yml +4 -0
- data/config/locales/zones.en.yml +4 -0
- data/config/routes.rb +21 -9
- data/config/tailwind.config.js +6 -2
- data/docs/components.md +2 -2
- data/docs/index_pages.md +11 -5
- data/docs/stimulusjs.md +1 -1
- data/eslint.config.mjs +25 -0
- data/lib/generators/solidus_admin/component/component_generator.rb +10 -6
- data/lib/generators/solidus_admin/install/install_generator.rb +24 -5
- data/lib/generators/solidus_admin/install/templates/config/initializers/solidus_admin.rb.tt +6 -0
- data/lib/solidus_admin/admin_resources.rb +1 -1
- data/lib/solidus_admin/configuration.rb +14 -14
- data/lib/solidus_admin/engine.rb +3 -2
- data/lib/solidus_admin/importmap.rb +1 -1
- data/lib/solidus_admin/menu_item.rb +1 -1
- data/lib/solidus_admin/preview.rb +1 -0
- data/lib/solidus_admin/testing_support/admin_assets.rb +1 -1
- data/lib/solidus_admin/testing_support/feature_helpers.rb +77 -3
- data/lib/solidus_admin/testing_support/shared_examples/crud_resource_requests.rb +43 -36
- data/lib/solidus_admin/testing_support/shared_examples/moveable.rb +48 -0
- data/lib/solidus_admin/testing_support/shared_examples/promotion_categories_features.rb +5 -11
- data/lib/solidus_admin/version.rb +1 -1
- data/lib/tasks/tailwind.rake +1 -1
- data/solidus_admin.gemspec +24 -21
- metadata +172 -28
- data/.eslintrc.json +0 -7
- data/app/components/solidus_admin/products/show/component.js +0 -9
- data/app/components/solidus_admin/ui/forms/input/component.js +0 -15
- data/app/components/solidus_admin/users/edit/api_access/component.js +0 -9
- data/app/javascript/solidus_admin/controllers/confirm_controller.js +0 -21
- data/lib/solidus_admin/testing_support/shared_examples/bulk_delete_resources.rb +0 -20
- /data/app/{components/solidus_admin/ui/toast/component.js → javascript/solidus_admin/controllers/alert_animation_controller.js} +0 -0
|
@@ -20,34 +20,34 @@ class SolidusAdmin::Roles::Index::Component < SolidusAdmin::UsersAndRoles::Compo
|
|
|
20
20
|
def page_actions
|
|
21
21
|
render component("ui/button").new(
|
|
22
22
|
tag: :a,
|
|
23
|
-
text: t(
|
|
23
|
+
text: t(".add"),
|
|
24
24
|
href: solidus_admin.new_role_path(**search_filter_params),
|
|
25
|
-
data: {
|
|
26
|
-
icon: "add-line"
|
|
25
|
+
data: {turbo_frame: :resource_form},
|
|
26
|
+
icon: "add-line"
|
|
27
27
|
)
|
|
28
28
|
end
|
|
29
29
|
|
|
30
30
|
def turbo_frames
|
|
31
31
|
%w[
|
|
32
|
-
|
|
32
|
+
resource_form
|
|
33
33
|
]
|
|
34
34
|
end
|
|
35
35
|
|
|
36
36
|
def batch_actions
|
|
37
37
|
[
|
|
38
38
|
{
|
|
39
|
-
label: t(
|
|
39
|
+
label: t(".batch_actions.delete"),
|
|
40
40
|
action: solidus_admin.roles_path(**search_filter_params),
|
|
41
41
|
method: :delete,
|
|
42
|
-
icon:
|
|
43
|
-
}
|
|
42
|
+
icon: "delete-bin-7-line"
|
|
43
|
+
}
|
|
44
44
|
]
|
|
45
45
|
end
|
|
46
46
|
|
|
47
47
|
def scopes
|
|
48
48
|
[
|
|
49
|
-
{
|
|
50
|
-
{
|
|
49
|
+
{name: :all, label: t(".scopes.all"), default: true},
|
|
50
|
+
{name: :admin, label: t(".scopes.admin")}
|
|
51
51
|
]
|
|
52
52
|
end
|
|
53
53
|
|
|
@@ -61,15 +61,15 @@ class SolidusAdmin::Roles::Index::Component < SolidusAdmin::UsersAndRoles::Compo
|
|
|
61
61
|
header: :role,
|
|
62
62
|
data: ->(role) do
|
|
63
63
|
link_to role.name, edit_path(role),
|
|
64
|
-
data: {
|
|
64
|
+
data: {turbo_frame: :resource_form},
|
|
65
65
|
class: "body-link"
|
|
66
|
-
end
|
|
66
|
+
end
|
|
67
67
|
},
|
|
68
68
|
{
|
|
69
69
|
header: :description,
|
|
70
70
|
data: ->(role) do
|
|
71
71
|
link_to_if role.description, role.description, edit_path(role),
|
|
72
|
-
data: {
|
|
72
|
+
data: {turbo_frame: :resource_form},
|
|
73
73
|
class: "body-link"
|
|
74
74
|
end
|
|
75
75
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
<%= turbo_frame_tag :
|
|
1
|
+
<%= turbo_frame_tag :resource_form, target: "_top" do %>
|
|
2
2
|
<%= render component("ui/modal").new(title: t(".title")) do |modal| %>
|
|
3
|
-
<%=
|
|
3
|
+
<%= solidus_form_for @role, url: form_url, html: { id: form_id } do |f| %>
|
|
4
4
|
<div class="flex flex-col gap-6 pb-4">
|
|
5
|
-
<%=
|
|
6
|
-
<%=
|
|
5
|
+
<%= f.text_field(:name, class: "required", placeholder: t(".name_placeholder")) %>
|
|
6
|
+
<%= f.text_field(:description, placeholder: t(".description_placeholder")) %>
|
|
7
7
|
</div>
|
|
8
8
|
|
|
9
9
|
<% if permission_set_options.present? %>
|
|
@@ -12,19 +12,19 @@
|
|
|
12
12
|
</h3>
|
|
13
13
|
<% end %>
|
|
14
14
|
|
|
15
|
-
<%=
|
|
16
|
-
<%=
|
|
17
|
-
<%=
|
|
18
|
-
<%=
|
|
19
|
-
<%=
|
|
20
|
-
<%=
|
|
21
|
-
<%=
|
|
15
|
+
<%= f.checkbox_row(:permission_set_ids, options: permission_set_options[:order], row_title: t('.orders')) %>
|
|
16
|
+
<%= f.checkbox_row(:permission_set_ids, options: permission_set_options[:product], row_title: t('.products')) %>
|
|
17
|
+
<%= f.checkbox_row(:permission_set_ids, options: permission_set_options[:stock], row_title: t('.stock')) %>
|
|
18
|
+
<%= f.checkbox_row(:permission_set_ids, options: permission_set_options[:user], row_title: t('.customers')) %>
|
|
19
|
+
<%= f.checkbox_row(:permission_set_ids, options: permission_set_options[:restricted_stock], row_title: t('.restricted_stock')) %>
|
|
20
|
+
<%= f.checkbox_row(:permission_set_ids, options: permission_set_options[:configuration], row_title: t('.settings')) %>
|
|
21
|
+
<%= f.checkbox_row(:permission_set_ids, options: permission_set_options[:other], row_title: t('.other'), layout: :subsection) %>
|
|
22
22
|
|
|
23
23
|
<% modal.with_actions do %>
|
|
24
24
|
<form method="dialog">
|
|
25
25
|
<%= render component("ui/button").new(scheme: :secondary, text: t('.cancel')) %>
|
|
26
26
|
</form>
|
|
27
|
-
<%=
|
|
27
|
+
<%= f.submit %>
|
|
28
28
|
<% end %>
|
|
29
29
|
<% end %>
|
|
30
30
|
<% end %>
|
|
@@ -4,7 +4,7 @@ class SolidusAdmin::Shipping::Component < SolidusAdmin::UI::Pages::Index::Compon
|
|
|
4
4
|
def title
|
|
5
5
|
page_header_title safe_join([
|
|
6
6
|
tag.div(t(".title")),
|
|
7
|
-
tag.div(t(".subtitle"), class: "font-normal text-sm text-gray-500")
|
|
7
|
+
tag.div(t(".subtitle"), class: "font-normal text-sm text-gray-500")
|
|
8
8
|
])
|
|
9
9
|
end
|
|
10
10
|
|
|
@@ -13,18 +13,18 @@ class SolidusAdmin::Shipping::Component < SolidusAdmin::UI::Pages::Index::Compon
|
|
|
13
13
|
{
|
|
14
14
|
text: Spree::ShippingMethod.model_name.human.pluralize,
|
|
15
15
|
href: solidus_admin.shipping_methods_path,
|
|
16
|
-
current: model_class == Spree::ShippingMethod
|
|
16
|
+
current: model_class == Spree::ShippingMethod
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
19
|
text: Spree::ShippingCategory.model_name.human.pluralize,
|
|
20
20
|
href: solidus_admin.shipping_categories_path,
|
|
21
|
-
current: model_class == Spree::ShippingCategory
|
|
21
|
+
current: model_class == Spree::ShippingCategory
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
24
|
text: Spree::StockLocation.model_name.human.pluralize,
|
|
25
25
|
href: solidus_admin.stock_locations_path,
|
|
26
|
-
current: model_class == Spree::StockLocation
|
|
27
|
-
}
|
|
26
|
+
current: model_class == Spree::StockLocation
|
|
27
|
+
}
|
|
28
28
|
]
|
|
29
29
|
end
|
|
30
30
|
end
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
<%= turbo_frame_tag :
|
|
1
|
+
<%= turbo_frame_tag :resource_form, target: "_top" do %>
|
|
2
2
|
<%= render component("ui/modal").new(title: t(".title")) do |modal| %>
|
|
3
|
-
<%=
|
|
3
|
+
<%= solidus_form_for @shipping_category, url: form_url, html: { id: form_id } do |f| %>
|
|
4
4
|
<div class="flex flex-col gap-6 pb-4">
|
|
5
|
-
<%=
|
|
5
|
+
<%= f.text_field(:name) %>
|
|
6
6
|
</div>
|
|
7
7
|
<% modal.with_actions do %>
|
|
8
8
|
<form method="dialog">
|
|
9
9
|
<%= render component("ui/button").new(scheme: :secondary, text: t('.cancel')) %>
|
|
10
10
|
</form>
|
|
11
|
-
<%=
|
|
11
|
+
<%= f.submit %>
|
|
12
12
|
<% end %>
|
|
13
13
|
<% end %>
|
|
14
14
|
<% end %>
|
|
@@ -8,17 +8,17 @@ class SolidusAdmin::ShippingCategories::Index::Component < SolidusAdmin::Shippin
|
|
|
8
8
|
def page_actions
|
|
9
9
|
render component("ui/button").new(
|
|
10
10
|
tag: :a,
|
|
11
|
-
text: t(
|
|
11
|
+
text: t(".add"),
|
|
12
12
|
href: solidus_admin.new_shipping_category_path(**search_filter_params),
|
|
13
|
-
data: {
|
|
13
|
+
data: {turbo_frame: :resource_form},
|
|
14
14
|
icon: "add-line",
|
|
15
|
-
class: "align-self-end w-full"
|
|
15
|
+
class: "align-self-end w-full"
|
|
16
16
|
)
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
def turbo_frames
|
|
20
20
|
%w[
|
|
21
|
-
|
|
21
|
+
resource_form
|
|
22
22
|
]
|
|
23
23
|
end
|
|
24
24
|
|
|
@@ -37,11 +37,11 @@ class SolidusAdmin::ShippingCategories::Index::Component < SolidusAdmin::Shippin
|
|
|
37
37
|
def batch_actions
|
|
38
38
|
[
|
|
39
39
|
{
|
|
40
|
-
label: t(
|
|
40
|
+
label: t(".batch_actions.delete"),
|
|
41
41
|
action: solidus_admin.shipping_categories_path(**search_filter_params),
|
|
42
42
|
method: :delete,
|
|
43
|
-
icon:
|
|
44
|
-
}
|
|
43
|
+
icon: "delete-bin-7-line"
|
|
44
|
+
}
|
|
45
45
|
]
|
|
46
46
|
end
|
|
47
47
|
|
|
@@ -51,10 +51,10 @@ class SolidusAdmin::ShippingCategories::Index::Component < SolidusAdmin::Shippin
|
|
|
51
51
|
header: :name,
|
|
52
52
|
data: ->(shipping_category) do
|
|
53
53
|
link_to shipping_category.name, edit_url(shipping_category),
|
|
54
|
-
data: {
|
|
54
|
+
data: {turbo_frame: :resource_form},
|
|
55
55
|
class: "body-link"
|
|
56
56
|
end
|
|
57
|
-
}
|
|
57
|
+
}
|
|
58
58
|
]
|
|
59
59
|
end
|
|
60
60
|
end
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
<%= turbo_frame_tag :
|
|
1
|
+
<%= turbo_frame_tag :resource_form, target: "_top" do %>
|
|
2
2
|
<%= render component("ui/modal").new(title: t(".title")) do |modal| %>
|
|
3
|
-
<%=
|
|
3
|
+
<%= solidus_form_for @shipping_category, url: form_url, html: { id: form_id } do |f| %>
|
|
4
4
|
<div class="flex flex-col gap-6 pb-4">
|
|
5
|
-
<%=
|
|
5
|
+
<%= f.text_field(:name) %>
|
|
6
6
|
</div>
|
|
7
7
|
<% modal.with_actions do %>
|
|
8
8
|
<form method="dialog">
|
|
9
9
|
<%= render component("ui/button").new(scheme: :secondary, text: t('.cancel')) %>
|
|
10
10
|
</form>
|
|
11
|
-
<%=
|
|
11
|
+
<%= f.submit %>
|
|
12
12
|
<% end %>
|
|
13
13
|
<% end %>
|
|
14
14
|
<% end %>
|
|
@@ -20,21 +20,21 @@ class SolidusAdmin::ShippingMethods::Index::Component < SolidusAdmin::Shipping::
|
|
|
20
20
|
def page_actions
|
|
21
21
|
render component("ui/button").new(
|
|
22
22
|
tag: :a,
|
|
23
|
-
text: t(
|
|
23
|
+
text: t(".add"),
|
|
24
24
|
href: spree.new_admin_shipping_method_path,
|
|
25
25
|
icon: "add-line",
|
|
26
|
-
class: "align-self-end w-full"
|
|
26
|
+
class: "align-self-end w-full"
|
|
27
27
|
)
|
|
28
28
|
end
|
|
29
29
|
|
|
30
30
|
def batch_actions
|
|
31
31
|
[
|
|
32
32
|
{
|
|
33
|
-
label: t(
|
|
33
|
+
label: t(".batch_actions.delete"),
|
|
34
34
|
action: solidus_admin.shipping_methods_path,
|
|
35
35
|
method: :delete,
|
|
36
|
-
icon:
|
|
37
|
-
}
|
|
36
|
+
icon: "delete-bin-7-line"
|
|
37
|
+
}
|
|
38
38
|
]
|
|
39
39
|
end
|
|
40
40
|
|
|
@@ -42,20 +42,20 @@ class SolidusAdmin::ShippingMethods::Index::Component < SolidusAdmin::Shipping::
|
|
|
42
42
|
[
|
|
43
43
|
{
|
|
44
44
|
header: :name,
|
|
45
|
-
data: -> { [_1.admin_name.presence, _1.name].compact.join(
|
|
45
|
+
data: -> { [_1.admin_name.presence, _1.name].compact.join(" / ") }
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
48
|
header: :zone,
|
|
49
|
-
data: -> { _1.zones.pluck(:name).to_sentence }
|
|
49
|
+
data: -> { _1.zones.pluck(:name).to_sentence }
|
|
50
50
|
},
|
|
51
51
|
{
|
|
52
52
|
header: :calculator,
|
|
53
|
-
data: -> { _1.calculator&.description }
|
|
53
|
+
data: -> { _1.calculator&.description }
|
|
54
54
|
},
|
|
55
55
|
{
|
|
56
56
|
header: :available_to_users,
|
|
57
|
-
data: -> { _1.available_to_users? ? component(
|
|
58
|
-
}
|
|
57
|
+
data: -> { _1.available_to_users? ? component("ui/badge").yes : component("ui/badge").no }
|
|
58
|
+
}
|
|
59
59
|
]
|
|
60
60
|
end
|
|
61
61
|
end
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
<%= turbo_frame_tag :
|
|
1
|
+
<%= turbo_frame_tag :resource_form, target: "_top" do %>
|
|
2
2
|
<%= render component("ui/modal").new(title: t(".title")) do |modal| %>
|
|
3
|
-
<%=
|
|
3
|
+
<%= solidus_form_for @stock_item, url: form_url, html: { id: form_id } do |f| %>
|
|
4
4
|
<div
|
|
5
5
|
class="flex flex-col gap-6 pb-4"
|
|
6
6
|
data-controller="<%= stimulus_id %>"
|
|
@@ -35,8 +35,7 @@
|
|
|
35
35
|
<% end %>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
|
-
<%=
|
|
39
|
-
f,
|
|
38
|
+
<%= f.text_field(
|
|
40
39
|
:count_on_hand,
|
|
41
40
|
readonly: true,
|
|
42
41
|
value: @stock_item.count_on_hand_was || @stock_item.count_on_hand,
|
|
@@ -55,12 +54,10 @@
|
|
|
55
54
|
) %>
|
|
56
55
|
<% end %>
|
|
57
56
|
|
|
58
|
-
<%=
|
|
59
|
-
|
|
57
|
+
<%= f.switch_field(
|
|
58
|
+
:backorderable,
|
|
60
59
|
label: Spree::StockItem.human_attribute_name(:backorderable),
|
|
61
|
-
error: f.object.errors[:backorderable],
|
|
62
60
|
hint: t(".backorderable_hint_html"),
|
|
63
|
-
checked: f.object.backorderable?,
|
|
64
61
|
include_hidden: true,
|
|
65
62
|
) %>
|
|
66
63
|
</div>
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
class SolidusAdmin::StockItems::Edit::Component < SolidusAdmin::Resources::Edit::Component
|
|
4
4
|
def title
|
|
5
5
|
[
|
|
6
|
-
"#{Spree::StockLocation.model_name.human}: #{@stock_item.stock_location.name}"
|
|
7
|
-
].join(
|
|
6
|
+
"#{Spree::StockLocation.model_name.human}: #{@stock_item.stock_location.name}"
|
|
7
|
+
].join(" / ")
|
|
8
8
|
end
|
|
9
9
|
end
|
|
@@ -19,19 +19,19 @@ class SolidusAdmin::StockItems::Index::Component < SolidusAdmin::UI::Pages::Inde
|
|
|
19
19
|
|
|
20
20
|
def scopes
|
|
21
21
|
[
|
|
22
|
-
{
|
|
23
|
-
{
|
|
24
|
-
{
|
|
25
|
-
{
|
|
26
|
-
{
|
|
22
|
+
{label: t(".scopes.all_stock_items"), name: "all", default: true},
|
|
23
|
+
{label: t(".scopes.back_orderable"), name: "back_orderable"},
|
|
24
|
+
{label: t(".scopes.out_of_stock"), name: "out_of_stock"},
|
|
25
|
+
{label: t(".scopes.low_stock"), name: "low_stock"},
|
|
26
|
+
{label: t(".scopes.in_stock"), name: "in_stock"}
|
|
27
27
|
]
|
|
28
28
|
end
|
|
29
29
|
|
|
30
30
|
def filters
|
|
31
31
|
[
|
|
32
32
|
{
|
|
33
|
-
label: t(
|
|
34
|
-
combinator:
|
|
33
|
+
label: t(".filters.stock_locations"),
|
|
34
|
+
combinator: "or",
|
|
35
35
|
attribute: "stock_location_id",
|
|
36
36
|
predicate: "eq",
|
|
37
37
|
options: Spree::StockLocation.all.map do |stock_location|
|
|
@@ -42,8 +42,8 @@ class SolidusAdmin::StockItems::Index::Component < SolidusAdmin::UI::Pages::Inde
|
|
|
42
42
|
end
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
|
-
label: t(
|
|
46
|
-
combinator:
|
|
45
|
+
label: t(".filters.variants"),
|
|
46
|
+
combinator: "or",
|
|
47
47
|
attribute: "variant_id",
|
|
48
48
|
predicate: "eq",
|
|
49
49
|
options: Spree::Variant.all.map do |variant|
|
|
@@ -52,7 +52,7 @@ class SolidusAdmin::StockItems::Index::Component < SolidusAdmin::UI::Pages::Inde
|
|
|
52
52
|
variant.id
|
|
53
53
|
]
|
|
54
54
|
end
|
|
55
|
-
}
|
|
55
|
+
}
|
|
56
56
|
]
|
|
57
57
|
end
|
|
58
58
|
|
|
@@ -65,19 +65,19 @@ class SolidusAdmin::StockItems::Index::Component < SolidusAdmin::UI::Pages::Inde
|
|
|
65
65
|
stock_location_column,
|
|
66
66
|
back_orderable_column,
|
|
67
67
|
count_on_hand_column,
|
|
68
|
-
stock_movements_column
|
|
68
|
+
stock_movements_column
|
|
69
69
|
]
|
|
70
70
|
end
|
|
71
71
|
|
|
72
72
|
def image_column
|
|
73
73
|
{
|
|
74
|
-
col: {
|
|
75
|
-
header: tag.span(
|
|
74
|
+
col: {class: "w-[72px]"},
|
|
75
|
+
header: tag.span("aria-label": Spree::Image.model_name.human, role: "text"),
|
|
76
76
|
data: ->(stock_item) do
|
|
77
77
|
image = stock_item.variant.gallery.images.first or return
|
|
78
78
|
|
|
79
79
|
render(
|
|
80
|
-
component(
|
|
80
|
+
component("ui/thumbnail").new(
|
|
81
81
|
src: image.url(:small),
|
|
82
82
|
alt: stock_item.variant.name
|
|
83
83
|
)
|
|
@@ -91,8 +91,8 @@ class SolidusAdmin::StockItems::Index::Component < SolidusAdmin::UI::Pages::Inde
|
|
|
91
91
|
header: :name,
|
|
92
92
|
data: ->(stock_item) do
|
|
93
93
|
link_to stock_item.variant.name, edit_path(stock_item),
|
|
94
|
-
data: {
|
|
95
|
-
class:
|
|
94
|
+
data: {turbo_frame: :resource_form},
|
|
95
|
+
class: "body-link"
|
|
96
96
|
end
|
|
97
97
|
}
|
|
98
98
|
end
|
|
@@ -102,8 +102,8 @@ class SolidusAdmin::StockItems::Index::Component < SolidusAdmin::UI::Pages::Inde
|
|
|
102
102
|
header: :sku,
|
|
103
103
|
data: ->(stock_item) do
|
|
104
104
|
link_to stock_item.variant.sku, edit_path(stock_item),
|
|
105
|
-
data: {
|
|
106
|
-
class:
|
|
105
|
+
data: {turbo_frame: :resource_form},
|
|
106
|
+
class: "body-link"
|
|
107
107
|
end
|
|
108
108
|
}
|
|
109
109
|
end
|
|
@@ -115,7 +115,7 @@ class SolidusAdmin::StockItems::Index::Component < SolidusAdmin::UI::Pages::Inde
|
|
|
115
115
|
content_tag(:div, class: "space-y-0.5") do
|
|
116
116
|
safe_join(
|
|
117
117
|
stock_item.variant.option_values.sort_by(&:option_type_name).map do |option_value|
|
|
118
|
-
render(component(
|
|
118
|
+
render(component("ui/badge").new(name: "#{option_value.option_type_presentation}: #{option_value.presentation}"))
|
|
119
119
|
end
|
|
120
120
|
)
|
|
121
121
|
end
|
|
@@ -126,13 +126,13 @@ class SolidusAdmin::StockItems::Index::Component < SolidusAdmin::UI::Pages::Inde
|
|
|
126
126
|
def stock_location_column
|
|
127
127
|
{
|
|
128
128
|
header: :stock_location,
|
|
129
|
-
data: ->(stock_item) { stock_item.stock_location.name }
|
|
129
|
+
data: ->(stock_item) { stock_item.stock_location.name }
|
|
130
130
|
}
|
|
131
131
|
end
|
|
132
132
|
|
|
133
133
|
# Cache the stock movement counts to avoid N+1 queries
|
|
134
134
|
def stock_movement_counts
|
|
135
|
-
@stock_movement_counts ||= Spree::StockMovement.where(stock_item_id: @page.records.
|
|
135
|
+
@stock_movement_counts ||= Spree::StockMovement.where(stock_item_id: @page.records.map(&:id)).group(:stock_item_id).count
|
|
136
136
|
end
|
|
137
137
|
|
|
138
138
|
def stock_movements_column
|
|
@@ -145,9 +145,9 @@ class SolidusAdmin::StockItems::Index::Component < SolidusAdmin::UI::Pages::Inde
|
|
|
145
145
|
"#{count} #{Spree::StockMovement.model_name.human(count:).downcase}",
|
|
146
146
|
spree.admin_stock_location_stock_movements_path(
|
|
147
147
|
_1.stock_location.id,
|
|
148
|
-
q: {
|
|
148
|
+
q: {variant_sku_eq: _1.variant.sku}
|
|
149
149
|
),
|
|
150
|
-
class:
|
|
150
|
+
class: "body-link"
|
|
151
151
|
)
|
|
152
152
|
end
|
|
153
153
|
}
|
|
@@ -157,7 +157,7 @@ class SolidusAdmin::StockItems::Index::Component < SolidusAdmin::UI::Pages::Inde
|
|
|
157
157
|
{
|
|
158
158
|
header: :back_orderable,
|
|
159
159
|
data: ->(stock_item) do
|
|
160
|
-
stock_item.backorderable? ? component(
|
|
160
|
+
stock_item.backorderable? ? component("ui/badge").yes : component("ui/badge").no
|
|
161
161
|
end
|
|
162
162
|
}
|
|
163
163
|
end
|
|
@@ -172,6 +172,6 @@ class SolidusAdmin::StockItems::Index::Component < SolidusAdmin::UI::Pages::Inde
|
|
|
172
172
|
end
|
|
173
173
|
|
|
174
174
|
def turbo_frames
|
|
175
|
-
%w[
|
|
175
|
+
%w[resource_form]
|
|
176
176
|
end
|
|
177
177
|
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<%= page id: :resource_form do %>
|
|
2
|
+
<%= page_header do %>
|
|
3
|
+
<%= page_header_back(back_url) %>
|
|
4
|
+
<%= page_header_title(t('.title')) %>
|
|
5
|
+
<%= page_header_actions do %>
|
|
6
|
+
<%= render component("ui/button").discard(path: back_url) %>
|
|
7
|
+
<%= render component("ui/button").save(form: form_id) %>
|
|
8
|
+
<% end %>
|
|
9
|
+
<% end %>
|
|
10
|
+
|
|
11
|
+
<%= render component("stock_locations/form").new(stock_location: @stock_location, url: form_url, id: form_id) %>
|
|
12
|
+
|
|
13
|
+
<%= page_footer do %>
|
|
14
|
+
<%= render component("ui/button").save(form: form_id) %>
|
|
15
|
+
<% end %>
|
|
16
|
+
<% end %>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<%= form_for @stock_location, url: @url, html: { id: @id } do |f| %>
|
|
2
|
+
<%= page_with_sidebar do %>
|
|
3
|
+
<%= page_with_sidebar_main do %>
|
|
4
|
+
<%= render component('ui/panel').new do |panel| %>
|
|
5
|
+
<% panel.with_section(class: "flex flex-col gap-4") do %>
|
|
6
|
+
<div class="flex gap-4 w-full">
|
|
7
|
+
<%= render component("ui/forms/field").text_field(f, :name, class: "required") %>
|
|
8
|
+
<%= render component("ui/forms/field").text_field(f, :admin_name) %>
|
|
9
|
+
</div>
|
|
10
|
+
<%= render component("ui/forms/field").text_field(f, :code) %>
|
|
11
|
+
<% end %>
|
|
12
|
+
<% end %>
|
|
13
|
+
|
|
14
|
+
<%= render component('ui/panel').new(title: t('.address')) do %>
|
|
15
|
+
<%= render component('ui/forms/address').new(addressable: @stock_location, form_field_name: 'stock_location', fieldset: :location, excludes: %i[phone email]) %>
|
|
16
|
+
<% end %>
|
|
17
|
+
|
|
18
|
+
<%= render component('ui/panel').new(title: t('.contact_info')) do %>
|
|
19
|
+
<%= render component('ui/forms/address').new(addressable: @stock_location, form_field_name: 'stock_location', fieldset: :contact_info) %>
|
|
20
|
+
<% end %>
|
|
21
|
+
<% end %>
|
|
22
|
+
|
|
23
|
+
<%= page_with_sidebar_aside do %>
|
|
24
|
+
<%= render component('ui/panel').new(title: t('.availability')) do %>
|
|
25
|
+
<%= render component("ui/forms/checkbox").new(object_name: f.object_name, method: :active, checked: f.object.active) do |checkbox| %>
|
|
26
|
+
<%= checkbox.with_label(text: t(".active")) %>
|
|
27
|
+
<%= checkbox.with_hint(text: t(".hints.active")) %>
|
|
28
|
+
<% end %>
|
|
29
|
+
<% end %>
|
|
30
|
+
|
|
31
|
+
<%= render component('ui/panel').new(title: t('.setup')) do |panel| %>
|
|
32
|
+
<% panel.with_section(class: "flex flex-col gap-4") do %>
|
|
33
|
+
<%= render component("ui/forms/checkbox").new(object_name: f.object_name, method: :default, checked: f.object.default) do |checkbox| %>
|
|
34
|
+
<%= checkbox.with_label(text: t(".default")) %>
|
|
35
|
+
<% end %>
|
|
36
|
+
|
|
37
|
+
<%= render component("ui/forms/checkbox").new(object_name: f.object_name, method: :backorderable_default, checked: f.object.backorderable_default) do |checkbox| %>
|
|
38
|
+
<%= checkbox.with_label(text: t(".backorderable_default")) %>
|
|
39
|
+
<%= checkbox.with_hint(text: t(".hints.backorderable_default")) %>
|
|
40
|
+
<% end %>
|
|
41
|
+
|
|
42
|
+
<%= render component("ui/forms/checkbox").new(object_name: f.object_name, method: :propagate_all_variants, checked: f.object.propagate_all_variants) do |checkbox| %>
|
|
43
|
+
<%= checkbox.with_label(text: t(".propagate_all_variants")) %>
|
|
44
|
+
<%= checkbox.with_hint(text: t(".hints.propagate_all_variants")) %>
|
|
45
|
+
<% end %>
|
|
46
|
+
|
|
47
|
+
<%= render component("ui/forms/checkbox").new(object_name: f.object_name, method: :restock_inventory, checked: f.object.restock_inventory) do |checkbox| %>
|
|
48
|
+
<%= checkbox.with_label(text: t(".restock_inventory")) %>
|
|
49
|
+
<%= checkbox.with_hint(text: t(".hints.restock_inventory")) %>
|
|
50
|
+
<% end %>
|
|
51
|
+
|
|
52
|
+
<%= render component("ui/forms/checkbox").new(object_name: f.object_name, method: :fulfillable, checked: f.object.fulfillable) do |checkbox| %>
|
|
53
|
+
<%= checkbox.with_label(text: t(".fulfillable")) %>
|
|
54
|
+
<%= checkbox.with_hint(text: t(".hints.fulfillable")) %>
|
|
55
|
+
<% end %>
|
|
56
|
+
|
|
57
|
+
<%= render component("ui/forms/checkbox").new(object_name: f.object_name, method: :check_stock_on_transfer, checked: f.object.check_stock_on_transfer) do |checkbox| %>
|
|
58
|
+
<%= checkbox.with_label(text: t(".check_stock_on_transfer")) %>
|
|
59
|
+
<%= checkbox.with_hint(text: t(".hints.check_stock_on_transfer")) %>
|
|
60
|
+
<% end %>
|
|
61
|
+
<% end %>
|
|
62
|
+
<% end %>
|
|
63
|
+
<% end %>
|
|
64
|
+
<% end %>
|
|
65
|
+
<% end %>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class SolidusAdmin::StockLocations::Form::Component < SolidusAdmin::BaseComponent
|
|
4
|
+
include SolidusAdmin::Layout::PageHelpers
|
|
5
|
+
|
|
6
|
+
def initialize(stock_location:, id:, url:)
|
|
7
|
+
@stock_location = stock_location
|
|
8
|
+
@id = id
|
|
9
|
+
@url = url
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
en:
|
|
2
|
+
active: "Active"
|
|
3
|
+
address: "Address"
|
|
4
|
+
availability: "Availability"
|
|
5
|
+
backorderable_default: "Backorderable default"
|
|
6
|
+
check_stock_on_transfer: "Check stock on transfer"
|
|
7
|
+
contact_info: "Contact information"
|
|
8
|
+
default: "Set as default for all products"
|
|
9
|
+
fulfillable: "Fulfillable"
|
|
10
|
+
hints:
|
|
11
|
+
active: "This determines whether stock from this location can be used when building packages"
|
|
12
|
+
backorderable_default: "When checked, stock items in this location will default to allowing backorders"
|
|
13
|
+
check_stock_on_transfer: "When checked, inventory levels will be checked when performing stock transfers"
|
|
14
|
+
fulfillable: "When unchecked, this indicates that items in this location don't require actual fulfilment. Stock will not be checked when shipping and emails will not be sent"
|
|
15
|
+
propagate_all_variants: "When checked, this will create a stock item for each variant in this stock location"
|
|
16
|
+
restock_inventory: "When checked, returned inventory can be added back to this location's stock levels"
|
|
17
|
+
propagate_all_variants: "Propagate all variants"
|
|
18
|
+
restock_inventory: "Restock inventory"
|
|
19
|
+
setup: "Setup"
|