Skip to content

Conversation

chaimann
Copy link
Contributor

@chaimann chaimann commented Jun 25, 2025

Important

Blocked by #6280

Summary

Implements interface to add product categories to product, as well as create new categories and associate them with product in one go.
image

When creating new category it's possible to choose "None" as Parent Category - this will create a root taxon and a taxonomy that holds that root taxon.

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

chaimann added 27 commits June 27, 2025 19:32
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.
Following many trials and errors, this should make it pass on CI. Not
sure why it does not register a form submit when clicking Save button
within options panel.
Perhaps due to some difference in configuration between different CI
envs, on 2 of them this test passes, meaning we can't use `pending`, so
will just skip for now, until new option types UI is merged.
once new flashes are merged this commit should be dropped
Multi-select fields are not rendered as native list boxes, so this
attribute does not do anything anymore.
By default, a selected option has the same text representation as in the
options list. This change allows to customize it.
Indentation with an arrow is only useful when showing the list of taxons
in the dropdown, we can just show the name of taxon when selected to
save space.
Include hidden field to allow emptying categories collection when none
selected. Add link and turbo frame for a new category modal.
Modal frame targets category select, so on successful request the only
part of the form that will be updated is this select field, preserving
any other inputs that user might have yet unsaved in the product form.
Turbo stream action update will empty the modal essentially closing it.
With turbo frame response only `product_organization_frame` will be
targeted for change after successful request, so in order to show flash
message we can use turbo stream replace from within the frame to refresh
the flashes.
Hides implementation details of the modal "close" and flashes refresh
logic, and also allows to reuse it in similar scenarios.
chaimann added 7 commits June 27, 2025 19:33
These helpers are related to new admin so it's better to place them in
feature_helpers.rb
This should not be in shared helper, perhaps missed it during
refactoring.
Choosing empty parent category will create a root taxon and a new
taxonomy record under the hood.
@chaimann chaimann force-pushed the admin-product-organization--categories branch from 21d5599 to cbd793c Compare June 27, 2025 21:01
Copy link

codecov bot commented Jun 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.05%. Comparing base (bbca5cc) to head (84b72e1).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6296      +/-   ##
==========================================
+ Coverage   86.65%   89.05%   +2.39%     
==========================================
  Files         521      867     +346     
  Lines       11943    18434    +6491     
==========================================
+ Hits        10349    16416    +6067     
- Misses       1594     2018     +424     

☔ 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant