forked from solidusio/solidus
-
Notifications
You must be signed in to change notification settings - Fork 3
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
[pull] main from solidusio:main #402
Merged
Merged
Conversation
This file contains 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
We need to whitelist the ransackable attributes used on the new admin tax categories page, or filtering won't work.
The former ones were not correct, probably just a leftover from a cut and paste.
The component now behaves like a standard dialog: * closes on the current page, rather than redirecting elsewhere; * the close button is a standard dialog closing form; * the `open` attribute is removed, thus allowing ESC keypress to close the modal, and creating a focus trap when open. The previous behavior (i.e. have the modal open by default) is achieved via the new Stimulus controller, which on connect opens the dialog via JS.
This way we can inject arbitrary turbo frames into pages rendered via this component.
The correct method name is `page_actions`, for this reason it was previously not showing. Also, href is changed to a new route from the new admin.
The new version adds cool new features such as page morphing and refreshes. Specifically, we're going to use turbo stream refreshes in a later commit.
The `new` action will render a modal dialog above a list of tax categories, like the `index` action. For this reason, the common controller code is extracted to a private method.
The component renders: 1) a list of tax categories in the background; 2) a dialog modal with the form for creating a new resource. The modal is wrapped into a turbo frame tag, so it can be enclosed in other pages (i.e. the tax categories index) asynchronously.
The `#create` controller action allows the creation of a new tax category. Failed creation re-renders the form with errors within the turbo frame tag, while successful creation is handled via a turbo stream refresh tag that reloads the page. Scroll position is preserved thanks to the custom Turbo meta tag that enables the feature globally on the new admin. Integration specs are added to test the complete feature.
The API gem needs to know which attributes are available by default, and that is dependent on the promotion system that is being utilized.
When the legacy promotion system is extracted into its own gem, we won't have the luxury of factories any longer and will need to stub the API of a promotion handler ourselves.
…egory [Admin] Create new Tax Categories
…ibutes Make API independent of promotion configuration
pull
bot
added
⤵️ pull
and removed
changelog:solidus_api
changelog:solidus_core
changelog:solidus_admin
labels
Mar 11, 2024
We need to move some specs from solidus_legacy_promotions into solidus_legacy_promotions. These specs use routes from the gem. Let's add api as a dependency.
We're keeping the non-promotion-related parts of this spec in core, but the promotion part has to go. For this spec, I don't think it makes sense to stub out all the things.
This spec is not feasible with the promotion system extracted within core. Moving.
This spec was previously already fixed to not refer to any promotion-system-related things, but I forgot this one line in #5686.
SolidusLegacyPromotion extraction: Move and fix remaining API specs
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
See Commits and Changes for more details.
Created by pull[bot]
Can you help keep this open source service alive? 💖 Please sponsor : )