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(admin-ui,medusa): Reservations management #4081

Merged
merged 43 commits into from
May 23, 2023

Conversation

pKorsholm
Copy link
Contributor

@pKorsholm pKorsholm commented May 12, 2023

What

  • Add reservations table
  • Add create-reservations modal

note: filtering is not part of this pr but the boilerplate has been copied over

Fixes CORE-1386

@vercel
Copy link

vercel bot commented May 12, 2023

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

Name Status Preview Comments Updated (UTC)
medusa-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 22, 2023 5:19pm

@changeset-bot
Copy link

changeset-bot bot commented May 12, 2023

🦋 Changeset detected

Latest commit: c50594c

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

This PR includes changesets to release 11 packages
Name Type
@medusajs/client-types Patch
medusa-react Patch
@medusajs/medusa-js Patch
@medusajs/admin-ui Patch
@medusajs/medusa Patch
@medusajs/admin Patch
medusa-payment-paypal Patch
medusa-payment-stripe Patch
medusa-plugin-restock-notification Patch
@medusajs/medusa-oas-cli Patch
@medusajs/oas-github-ci 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

@pKorsholm pKorsholm marked this pull request as ready for review May 12, 2023 08:24
@pKorsholm pKorsholm requested a review from a team as a code owner May 12, 2023 08:24
@pKorsholm pKorsholm force-pushed the feat/reservations-management branch from 908ea81 to 945dd53 Compare May 16, 2023 13:26
@olivermrbl
Copy link
Contributor

Should this be a quantity picker similar to elsewhere?

CleanShot 2023-05-16 at 15 59 59@2x

@olivermrbl
Copy link
Contributor

olivermrbl commented May 16, 2023

Would be nice to add a tooltip here stating that we are searching for SKU on inventory items:

CleanShot 2023-05-16 at 16 16 19@2x

SKU is nullable so in case users have not added those, the empty search might cause confusion.

@olivermrbl
Copy link
Contributor

olivermrbl commented May 16, 2023

Something is off with the font sizing here. The 10 is smaller than the rest
CleanShot 2023-05-16 at 16 19 00@2x

Also, I am not sure the / Requested makes sense. Here I created a reservation of 10 when there were 100 in stock. Am I missing something?

Copy link
Contributor

@olivermrbl olivermrbl left a comment

Choose a reason for hiding this comment

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

Very strong work! I've added a couple of initial comments and thoughts. Will give it another review tomorrow :)

Deleting a reservation item succeeds but never closes the confirmation modal. I am struck here:
CleanShot 2023-05-16 at 19 32 58@2x
Switching between locations should clear the selected item:

CleanShot.2023-05-16.at.19.36.43.mp4

Also, a changeset is missing

Copy link
Contributor

@olivermrbl olivermrbl left a comment

Choose a reason for hiding this comment

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

Very strong work! I've added a couple of initial comments and thoughts. Will give it another review tomorrow :)

Deleting a reservation item succeeds but never closes the confirmation modal. I am stuck here:
CleanShot 2023-05-16 at 19 32 58@2x

Switching between locations should clear the selected item:

CleanShot.2023-05-16.at.19.36.43.mp4

Also, a changeset is missing

@olivermrbl olivermrbl changed the title Feat/reservations management feat(admin-ui,medusa): Reservations management May 17, 2023
@pKorsholm pKorsholm force-pushed the feat/reservations-management branch from 8c76592 to d480350 Compare May 19, 2023 08:34
@pKorsholm pKorsholm requested a review from olivermrbl May 19, 2023 09:01
@olivermrbl
Copy link
Contributor

nit: Can we add cache invalidation to transferring reservations from one location to another?

Right now, I am seeing an incorrect availability by doing:

  • Create reservation -> 10/100 requested
  • Edit reservation -> Move to another location -> Submit
  • Edit same reservation -> Change to first location -> Availability at first location is 90
  • Hard refresh -> Availability at first location is 100

Copy link
Contributor

@olivermrbl olivermrbl left a comment

Choose a reason for hiding this comment

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

LGTM, will review filters separately 💪

Great work @pKorsholm !

import Button from "../../../../components/fundamentals/button"
import CrossIcon from "../../../../components/fundamentals/icons/cross-icon"
import InputField from "../../../../components/molecules/input"
import { LineItem } from "@medusajs/medusa"
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: Create type to live in @medusajs/types

Copy link
Member

@adrien2p adrien2p left a comment

Choose a reason for hiding this comment

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

LGTM w/ comment

* type: number
* description: The total quantity of the item available across levels
*/
export type DecoratedInventoryItemDTO = InventoryItemDTO & {
Copy link
Member

Choose a reason for hiding this comment

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

suggestion: should this move to the types package? Maybe not now since there is a coupling with the variant but the idea would be to have a variant dto as well, we should get rid of returning entity type as it forces us to be structured around the ORM

* description: inventory item from inventory module
* $ref: "#/components/schemas/InventoryItemDTO"
*/
export type ExtendedReservationItem = ReservationItemDTO & {
Copy link
Member

Choose a reason for hiding this comment

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

same as the previous comment, but probably not as part of that pr but as we move towards modules

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants