Skip to content
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

Extract a products/stock component #5433

Merged
merged 2 commits into from
Oct 13, 2023
Merged

Extract a products/stock component #5433

merged 2 commits into from
Oct 13, 2023

Conversation

elia
Copy link
Member

@elia elia commented Oct 12, 2023

Summary

image

Both the stock and status component now accept basic values in the initializer and have an alternative from_product constructor that will get those basic values from a Spree::Product object.

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

The following are not always needed:

  • 📖 I have updated the README to account for my changes.
  • 📑 I have documented new code with YARD.
  • 🛣️ I have opened a PR to update the guides.
  • ✅ I have added automated tests to cover my changes.
  • 📸 I have attached screenshots to demo visual changes.

@elia elia self-assigned this Oct 12, 2023
@elia elia force-pushed the elia/admin/product-components branch 2 times, most recently from 8a3dd41 to a4b6bf2 Compare October 12, 2023 13:07
@elia elia force-pushed the elia/admin/product-components branch from a4b6bf2 to 595b072 Compare October 12, 2023 13:08
@codecov
Copy link

codecov bot commented Oct 12, 2023

Codecov Report

Merging #5433 (595b072) into main (7869560) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #5433      +/-   ##
==========================================
+ Coverage   88.86%   88.88%   +0.01%     
==========================================
  Files         610      611       +1     
  Lines       14793    14799       +6     
==========================================
+ Hits        13146    13154       +8     
+ Misses       1647     1645       -2     
Files Coverage Δ
...mponents/solidus_admin/products/index/component.rb 90.90% <100.00%> (+4.06%) ⬆️
...ponents/solidus_admin/products/status/component.rb 100.00% <100.00%> (ø)
...mponents/solidus_admin/products/stock/component.rb 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@elia elia marked this pull request as ready for review October 13, 2023 08:06
@elia elia requested a review from a team as a code owner October 13, 2023 08:06
@elia elia requested a review from rainerdema October 13, 2023 08:06
Comment on lines +4 to +9
def self.from_product(product)
new(
on_hand: product.total_on_hand,
variants_count: product.variants.count,
)
end
Copy link
Contributor

Choose a reason for hiding this comment

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

@elia elia merged commit 0e4424c into main Oct 13, 2023
11 checks passed
@elia elia deleted the elia/admin/product-components branch October 13, 2023 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants