-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Admin product organization categories #6296
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
Draft
chaimann
wants to merge
35
commits into
solidusio:main
Choose a base branch
from
chaimann:admin-product-organization--categories
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Admin product organization categories #6296
chaimann
wants to merge
35
commits into
solidusio:main
from
chaimann:admin-product-organization--categories
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
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.
21d5599
to
cbd793c
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
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. 🚀 New features to boost your workflow:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.

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: