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

feat(medusa, admin-ui, medusa-react, medusa-js): Allow toggling of manage inventory #3435

Merged
merged 23 commits into from
Mar 14, 2023

Conversation

pKorsholm
Copy link
Contributor

@pKorsholm pKorsholm commented Mar 9, 2023

What

  • Toggle manage inventory in the inventory management modal

How

  • Create/update/remove inventory item based on if manage_inventory is set and if an inventory item already exists
  • Move all stock location updates to when the modal is submitted
  • Add create-inventory-item endpoint in the core

Fixes CORE-1196

@changeset-bot
Copy link

changeset-bot bot commented Mar 9, 2023

🦋 Changeset detected

Latest commit: 1643aaf

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
medusa-react Patch
@medusajs/medusa-js Patch
@medusajs/medusa Patch
@medusajs/admin-ui Patch
@medusajs/inventory Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Mar 9, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
medusa-docs ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 14, 2023 at 3:59PM (UTC)

@pKorsholm pKorsholm marked this pull request as ready for review March 9, 2023 16:49
@pKorsholm pKorsholm requested a review from a team as a code owner March 9, 2023 16:49
@srindom
Copy link
Collaborator

srindom commented Mar 9, 2023

Super clean work - great job!

One thing I have found in quick testing is this:

When untoggling the inventory item is correctly deleted. There is, however, still stale location levels in the DB. Would suggest that we make sure these are deleted as well.

@pKorsholm
Copy link
Contributor Author

@srindom I added the following change to ensure that all location levels are removed along with the inventory item: https://github.com/medusajs/medusa/pull/3435/files#diff-5f5cf885c014b538496c75814623c92a750781d41c098513cba235ca67ce8414

wdyt?

Copy link
Collaborator

@srindom srindom left a comment

Choose a reason for hiding this comment

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

Please add integration tests for create inventory item :)

@pKorsholm pKorsholm requested a review from srindom March 13, 2023 18:10
@pKorsholm
Copy link
Contributor Author

@srindom added an integration test! 😄

Copy link
Collaborator

@srindom srindom left a comment

Choose a reason for hiding this comment

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

LGTM!

@kodiakhq kodiakhq bot removed the automerge label Mar 14, 2023
@kodiakhq
Copy link
Contributor

kodiakhq bot commented Mar 14, 2023

This PR currently has a merge conflict. Please resolve this and then re-add the automerge label.

@kodiakhq kodiakhq bot merged commit fe9eea4 into develop Mar 14, 2023
@kodiakhq kodiakhq bot deleted the fix/manage-inventory branch March 14, 2023 16:14
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.

5 participants