Skip to content

Conversation

chaimann
Copy link
Contributor

@chaimann chaimann commented Jun 10, 2025

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

  • list associated product option types according to Figma designs;
  • multi-select field with available option types to associate/remove option types;
  • product option types sorting;
  • "Edit" button leads to relevant option type edit page;
  • "Manage option types" link leads to option types index page;

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:

  • 📖 I have updated the README to account for my changes.
  • 📑 I have documented new code with YARD.
  • 🛣️ I have opened a PR to update the guides.
  • ✅ I have added automated tests to cover my changes.
  • 📸 I have attached screenshots to demo visual changes.

@github-actions github-actions bot added changelog:solidus_core Changes to the solidus_core gem changelog:solidus_admin labels Jun 10, 2025
@chaimann chaimann force-pushed the admin-product-option-types-list branch 6 times, most recently from 786b4b2 to fdb49ab Compare June 10, 2025 22:46
Copy link

codecov bot commented Jun 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.99%. Comparing base (bbca5cc) to head (add36d3).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@chaimann chaimann marked this pull request as ready for review June 10, 2025 23:13
@chaimann chaimann requested a review from a team as a code owner June 10, 2025 23:13
@tvdeyen tvdeyen moved this to In Progress in Solidus Admin Jun 11, 2025
@tvdeyen tvdeyen moved this from In Progress to Review in Solidus Admin Jun 11, 2025
@chaimann chaimann force-pushed the admin-product-option-types-list branch 2 times, most recently from aae1bad to b9643ab Compare June 11, 2025 11:21
@tvdeyen
Copy link
Member

tvdeyen commented Jun 27, 2025

The commit history seems to need some fixup commits.

@chaimann chaimann force-pushed the admin-product-option-types-list branch from b9643ab to 1b6f163 Compare June 27, 2025 14:05
chaimann added 12 commits June 27, 2025 23:20
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.
chaimann added 3 commits June 27, 2025 23:20
If sortable elements have a handle we need to account for it, so that
drag and drop can be performed correctly.
@chaimann chaimann force-pushed the admin-product-option-types-list branch from 1b6f163 to add36d3 Compare June 27, 2025 21:20
Copy link
Member

@jarednorman jarednorman left a 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
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Review
Development

Successfully merging this pull request may close these issues.

4 participants