Skip to content

[Admin][Settings] Introduce zone creation and modification capability #6224

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

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

chaimann
Copy link
Contributor

@chaimann chaimann commented Apr 30, 2025

Summary

Closes #6155

Introduces new UI for zones creation and modification.

Other new stuff:

  • states_controller - new resource to return states, responds with JSON by default;
  • state_blueprint - for JSON representation of the states to return, uses Blueprinter
  • gem "db-query-matchers" - for N+1 testing
  • few helpers for common buttons
  • helpers for stimulus data attributes

Showcase

Screen.Recording.2025-04-30.at.13.05.21.mov

Checklist

@chaimann chaimann self-assigned this Apr 30, 2025
@github-actions github-actions bot added changelog:solidus_core Changes to the solidus_core gem changelog:solidus_admin labels Apr 30, 2025
@chaimann chaimann removed this from Solidus Admin Apr 30, 2025
Copy link

codecov bot commented Apr 30, 2025

Codecov Report

Attention: Patch coverage is 97.84946% with 2 lines in your changes missing coverage. Please review.

Project coverage is 88.84%. Comparing base (61f675e) to head (a443fca).

Files with missing lines Patch % Lines
core/app/models/spree/state.rb 33.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6224      +/-   ##
==========================================
+ Coverage   88.80%   88.84%   +0.04%     
==========================================
  Files         842      848       +6     
  Lines       18244    18311      +67     
==========================================
+ Hits        16202    16269      +67     
  Misses       2042     2042              

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

@jarednorman
Copy link
Member

If you used Canada in the video in an effort to get me to pay attention to this video, it worked. 🙂

chaimann added 17 commits April 30, 2025 18:26
Extend `AllowedNames` to include `on`.
To avoid lag when rendering states options for zone form, use "src"
attribute that will point "solidus-select" to the resource that contains
all states.

Installed:
- blueprinter - for object serialization;

Introduced:
- state_blueprint - simple serializer with a "state_with_country" view
for zones states select;
- states_controller - resource with states;
- states_with_country now caches the result, as states/countries are not
going to be updated regularly, so we can save on preloading countries on each
 request, allowing the values to be cached over time;
- resources_controller#index - added ability to respond to json format
No need to pass `value` argument to forms/field component,
as value is being calculated when calling `#select`.
Shorter way to get the value from object
@chaimann chaimann force-pushed the admin-zones-add-edit branch from ba0f3ea to 987a16e Compare April 30, 2025 16:27
Installed "db-query-matchers" for N+1 tests
There's some bug with Rubocop that even though `on` is
specified as allowed parameter name, rubocop still complains
@chaimann chaimann force-pushed the admin-zones-add-edit branch from 987a16e to a443fca Compare April 30, 2025 18:06
@chaimann chaimann marked this pull request as ready for review April 30, 2025 18:37
@chaimann chaimann requested a review from a team as a code owner April 30, 2025 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Admin][Settings] Introduce zone creation and modification capability
2 participants