-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[Admin][Settings][Shipments] Introduce shipping method creation and modification capability #6232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
7a76917
to
2aee7da
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6232 +/- ##
==========================================
+ Coverage 88.83% 88.86% +0.02%
==========================================
Files 850 857 +7
Lines 18328 18359 +31
==========================================
+ Hits 16281 16314 +33
+ Misses 2047 2045 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
48b4946
to
ae87ce1
Compare
# frozen_string_literal: true | ||
|
||
class SolidusAdmin::ShippingMethods::Edit::Component < SolidusAdmin::Resources::Edit::Component | ||
include SolidusAdmin::Layout::PageHelpers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: bad indentation
admin/app/components/solidus_admin/shipping_methods/form/component.html.erb
Outdated
Show resolved
Hide resolved
While trying to save I got:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces an admin UI that enables the creation and modification of shipping methods in Solidus Admin. Key changes include adding new components for creating, editing, and listing shipping methods; integrating a dynamic form for calculator preferences; and updating related routes and translations.
Reviewed Changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
admin/app/components/solidus_admin/shipping_methods/new/* | New components to render the “new shipping method” form and related translations |
admin/app/components/solidus_admin/shipping_methods/* | Components for listing, editing, and form management of shipping methods |
admin/app/components/solidus_admin/calculators/* | New calculator preference components with dynamic preference fields |
value: @shipping_method.stock_location_ids, | ||
class: "fullwidth", | ||
multiple: true, | ||
label: '', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider providing a descriptive label for the stock locations select field to improve accessibility, for example using a translation key or clear text such as 'Stock Locations'.
label: '', | |
label: t('.stock_locations'), |
Copilot uses AI. Check for mistakes.
ae87ce1
to
c1b1f44
Compare
- Added form fields for shipping method details, pricing, taxation, availability, and organization. - Implemented JavaScript to toggle stock location visibility based on checkbox state. - Added translations for the form component.
- Added fields using form component. - Added translations for the new component. - Added feature spec for shipping method creation.
- Added fields using form component. - Added translations for the edit component. - Added feature spec to edit exisiting shipping method.
- Updated the index component to use new paths for editing and creating shipping methods. - Refactored columns to use helper methods for better readability. - Added links to edit shipping methods directly from the index.
- Refactored the controller to use `SolidusAdmin::ResourcesController`. - Updated permitted parameters to include new fields.
- Updated routes to include all actions except `show` for shipping methods. - Added locale translations for shipping method actions.
- Added a dropdown to select calculator type and render preferences based on the selected type. - Implemented JavaScript to toggle visibility of preferences based on the selected calculator type.
- Implemented text fields for decimal and integer preferences with appropriate input types and steps. - Implemented text fields for string preferences.
- Updated the `component.rb` file to handle multiple select fields.
c1b1f44
to
b13304f
Compare
Add Admin UI and Feature Specs for Shipping Methods
Solves: Solidus Admin (view)
This PR implements a complete admin interface for managing Shipping Methods in Solidus Admin, along with feature specs and UI components.
Shipping Method Form Component
ui/forms/field
andui/panel
components.Calculator Support
preferred_amount
,preferred_flat_percent
)Controller Enhancements
ShippingMethodsController
updated to:SolidusAdmin::ResourcesController
shipping_categories
andzones
calculator_attributes
and multiple select values likestore_ids
UI Improvements