-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[Admin][Products] Product option types list #6283
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?
[Admin][Products] Product option types list #6283
Conversation
786b4b2
to
fdb49ab
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6283 +/- ##
==========================================
+ Coverage 86.65% 88.99% +2.33%
==========================================
Files 521 863 +342
Lines 11943 18430 +6487
==========================================
+ Hits 10349 16401 +6052
- Misses 1594 2029 +435 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
aae1bad
to
b9643ab
Compare
The commit history seems to need some fixup commits. |
b9643ab
to
1b6f163
Compare
Follow common pattern for flashes everywhere else in admin.
Responsible for sorting on backend
Delegate option type methods #name, #presentation, #option_values for easier access in the view.
Add a section in Options panel to display all saved product option types along with associated option values. Make them sortable and show "Edit" button in front of each option that would direct to the edit page of respective option type.
Adds a submit button to save selected options and a hidden field to allow removing all saved options.
This way it mimics how they are displayed in the list.
Link to option types page.
If sortable elements have a handle we need to account for it, so that drag and drop can be performed correctly.
1b6f163
to
add36d3
Compare
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.
Other than my one comment this looks good to me.
belongs_to :option_type, class_name: 'Spree::OptionType', inverse_of: :product_option_types | ||
acts_as_list scope: :product | ||
|
||
delegate :name, :presentation, :option_values, to: :option_type |
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.
This delegation seems somewhat arbitrary. I don't think we should add to the API of this class just to make a couple of calls in the view more convenient. I think this actually makes the view more confusing because it obfuscates where this information is.
Takes care of Solidus Admin
Contains partial changes from #6282(branch in main, and already rebased)Summary
Implements a list of associated product options types.
Features
Demo
Screen.Recording.2025-06-10.at.15.54.24.mov
Checklist
Check out our PR guidelines for more details.
The following are mandatory for all PRs:
The following are not always needed: