Skip to content

Admin stock locations form #6160

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

Merged
merged 12 commits into from
Jul 24, 2025
Merged

Conversation

chaimann
Copy link
Contributor

@chaimann chaimann commented Feb 25, 2025

Summary

Adds a page with form for stock locations create/update, as well as updates stock locations table with links to go to edit page.

Updates "ui/forms/checkbox" component to contain common layout and logic reused between all checkboxes in admin forms, separating a "checkbox" component as a single element into its own component "ui/checkbox". - split to #6275

Adds helper methods .back, .discard and .save for UI button components

Adds missing tests for refund reasons, tax categories and product forms, where missing hidden input prevented booleans to be saved properly. - split to #6275

Page screenshot:
image
image

There are a few differences from the design card which I believe make sense to have:

  • "Name" and "Internal Name" are placed on the same row;
  • "Address" panel is a reused component "ui/forms/address", so the placement of the fields is different from the design;
  • there is no email column in stock_locations, and the "Phone" field is included in "ui/forms/address", so "Phone" field is not placed in its own section; email column is added and phone + email placed in their own address fieldset;
  • "Active" is a checkbox rather than select field, since it's a boolean;
  • texts for hints are copied from current backend; there is currently no hint for "Default" checkbox there so I haven't added any hint for "Set as default for all products";

Checklist

@chaimann chaimann force-pushed the admin-stock-locations-form branch from 2acc0de to 17d8f3d Compare February 26, 2025 14:01
@github-actions github-actions bot added the changelog:solidus_legacy_promotions Changes to the solidus_legacy_promotions gem label Feb 26, 2025
Copy link

codecov bot commented Feb 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.31%. Comparing base (48de765) to head (8f9d2b2).
Report is 13 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6160      +/-   ##
==========================================
+ Coverage   89.23%   89.31%   +0.08%     
==========================================
  Files         955      959       +4     
  Lines       20079    20116      +37     
==========================================
+ Hits        17917    17967      +50     
+ Misses       2162     2149      -13     

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

@github-actions github-actions bot added changelog:solidus_core Changes to the solidus_core gem and removed changelog:solidus_core Changes to the solidus_core gem labels Feb 26, 2025
@chaimann chaimann force-pushed the admin-stock-locations-form branch from 2ee470c to 8c92d69 Compare February 28, 2025 10:50
@github-actions github-actions bot removed the changelog:solidus_legacy_promotions Changes to the solidus_legacy_promotions gem label Feb 28, 2025
@chaimann chaimann force-pushed the admin-stock-locations-form branch 3 times, most recently from 526a065 to 95992db Compare March 1, 2025 14:13
@chaimann chaimann marked this pull request as ready for review March 1, 2025 14:37
@chaimann chaimann requested a review from a team as a code owner March 1, 2025 14:37
@chaimann chaimann force-pushed the admin-stock-locations-form branch from 95992db to c0d25ea Compare March 14, 2025 18:13
@chaimann
Copy link
Contributor Author

test failure seems to be one of those intermittent

@chaimann
Copy link
Contributor Author

@kennyadsl @tvdeyen hey guys, you might have missed this one, can I get some eyes 👀 please?

Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we extract the address component changes into a separate PR please? This change warrants more visibility in changelogs.

@chaimann chaimann marked this pull request as draft March 17, 2025 17:07
@chaimann chaimann force-pushed the admin-stock-locations-form branch from c0d25ea to aca21dd Compare April 29, 2025 10:22
@chaimann chaimann force-pushed the admin-stock-locations-form branch from ec015b0 to fdf9c61 Compare May 8, 2025 16:45
@github-actions github-actions bot added changelog:solidus_core Changes to the solidus_core gem changelog:solidus_legacy_promotions Changes to the solidus_legacy_promotions gem changelog:solidus_promotions Changes to the solidus_promotions gem labels May 8, 2025
@chaimann chaimann force-pushed the admin-stock-locations-form branch 2 times, most recently from 0f5d2bf to 09c144d Compare May 13, 2025 09:04
@chaimann chaimann marked this pull request as ready for review May 13, 2025 14:59
@chaimann chaimann requested review from tvdeyen and a team May 13, 2025 14:59
@tvdeyen
Copy link
Member

tvdeyen commented Jun 4, 2025

@chaimann are there any chances to split up this PR? There are lot of changes in here that are worth it's own changelog entry

@chaimann
Copy link
Contributor Author

chaimann commented Jun 4, 2025

@tvdeyen

are there any chances to split up this PR

Absolutely! Just to clarify and for the future PRs, what kind of changes would be good candidates to split? Here I assume it should be checkbox component changes. Maybe migration as well? Not sure, as I've seen other PRs where migration was included along with main changes, so I also put it here. Anything else?

@chaimann chaimann mentioned this pull request Jun 4, 2025
4 tasks
@tvdeyen
Copy link
Member

tvdeyen commented Jun 5, 2025

There is no hard rules. Anything that is tangential to the current work or worth a changelog entry because it changes the schema (as in your case) or makes a significant change to a shared component. Again, not a hard rules, more like a rule of thumb and a gut feeling "ah, that might interest others and is worth a special note in the changelog".

Anything else in well written commit messages (but you already do that), so that future contributors can make sense of a certain change.

In this case I think it is worth to have a dedicated PR about the schema change of spree_stores and maybe the checkbox component, if they are easy to extract.

I hope to finish the github actions work soon, so that extra PRs are not that much of a hassle as of right now.

Thanks for all the great work on the new admin

@chaimann chaimann mentioned this pull request Jun 5, 2025
4 tasks
@chaimann chaimann marked this pull request as draft June 11, 2025 11:04
@chaimann chaimann force-pushed the admin-stock-locations-form branch from e78e06b to 4024b3c Compare June 27, 2025 17:16
@github-actions github-actions bot removed the changelog:solidus_core Changes to the solidus_core gem label Jun 27, 2025
@chaimann chaimann force-pushed the admin-stock-locations-form branch from 4024b3c to dc56e04 Compare June 27, 2025 17:26
@chaimann chaimann marked this pull request as ready for review June 27, 2025 21:30
@chaimann chaimann requested a review from tvdeyen June 27, 2025 21:30
chaimann added 12 commits July 24, 2025 21:07
As a common resource controller make it inherit from
ResourcesController.
Since stock location form will not be in a modal, change the
turbo frame name to be more general :resource_form
Seems like a common fieldset to have, with two
fields "phone" and "email"
We don't have to use turbo_frames on these pages since we are not
loading content into it but always do a page visit to /new and /edit
routes, and when server responds with 422 and templates with validation
errors we can just place relevant "id" on the topmost element of the
page so its content will be replaced with turbo stream.
@tvdeyen tvdeyen force-pushed the admin-stock-locations-form branch from dc56e04 to 8f9d2b2 Compare July 24, 2025 19:07
@tvdeyen tvdeyen enabled auto-merge July 24, 2025 19:08
@tvdeyen tvdeyen merged commit d67ef3e into solidusio:main Jul 24, 2025
38 of 39 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Solidus Admin Jul 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:solidus_admin changelog:solidus_legacy_promotions Changes to the solidus_legacy_promotions gem changelog:solidus_promotions Changes to the solidus_promotions gem
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants