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(dashboard): claims first implementation #8468

Merged
merged 10 commits into from
Aug 7, 2024
Merged

Conversation

riqwan
Copy link
Contributor

@riqwan riqwan commented Aug 6, 2024

what:

  • order claims end to end feature branch

fPolic and others added 7 commits July 31, 2024 18:09
# Conflicts:
#	packages/admin-next/dashboard/src/providers/router-provider/route-map.tsx
#	packages/admin-next/dashboard/src/routes/orders/order-create-return/return-create.tsx
#	packages/admin-next/dashboard/src/routes/orders/order-detail/components/order-summary-section/order-summary-section.tsx
Copy link

vercel bot commented Aug 6, 2024

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

Name Status Preview Comments Updated (UTC)
medusa-dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 7, 2024 10:34am
6 Skipped Deployments
Name Status Preview Comments Updated (UTC)
api-reference ⬜️ Ignored (Inspect) Aug 7, 2024 10:34am
api-reference-v2 ⬜️ Ignored (Inspect) Visit Preview Aug 7, 2024 10:34am
docs-ui ⬜️ Ignored (Inspect) Visit Preview Aug 7, 2024 10:34am
docs-v2 ⬜️ Ignored (Inspect) Visit Preview Aug 7, 2024 10:34am
medusa-docs ⬜️ Ignored (Inspect) Visit Preview Aug 7, 2024 10:34am
resources-docs ⬜️ Ignored (Inspect) Visit Preview Aug 7, 2024 10:34am

Copy link

changeset-bot bot commented Aug 6, 2024

⚠️ No Changeset found

Latest commit: ac0d8f8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@olivermrbl
Copy link
Contributor

@riqwan, I would be OK with merging this to develop incrementally instead of a long-lived feature branch. Wdyt?

@riqwan
Copy link
Contributor Author

riqwan commented Aug 7, 2024

@olivermrbl yes, much prefer that. Don't know why this was introduced.

@riqwan riqwan changed the title [WIP]: Claims e2e feat(dashboard): claims first implementation Aug 7, 2024
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.

Overall LGTM, left a few comments and questions

Comment on lines +31 to +34
// TODO: GET /claims/:id is not implemented
// const { claim } = useClaim(activeClaimId, undefined, {
// enabled: !!activeClaimId,
// })
Copy link
Contributor

Choose a reason for hiding this comment

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

todo: This was introduced yesterday. Maybe just replace it in a follow-up PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Its already replaced here

className="flex-shrink"
variant="transparent"
onClick={() => {
onUpdate({ reason_id: null }) // TODO BE: we should be able to set to unset reason here
Copy link
Contributor

Choose a reason for hiding this comment

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

todo: Should be possible as of yesterday

variant="transparent"
onClick={() => {
onUpdate({ reason_id: null }) // TODO BE: we should be able to set to unset reason here
form.setValue(`inbound_items.${index}.reason_id`, "")
Copy link
Contributor

Choose a reason for hiding this comment

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

nit:

Suggested change
form.setValue(`inbound_items.${index}.reason_id`, "")
form.setValue(`inbound_items.${index}.reason_id`, null)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll keep this here as is, its changed in my current PR

),
outbound_items: z.array(
z.object({
item_id: z.string(), // TODO: variant id?
Copy link
Contributor

Choose a reason for hiding this comment

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

comment: Yeah I think we need to be able to pass variants here. We don't have the item ID upfront, as far as I can see. We can tackle that when we add support for outbound items.

limit: 999,
fields: "*prices,+service_zone.fulfillment_set.location.id",
/**
* TODO: this should accept filter for location_id
Copy link
Contributor

Choose a reason for hiding this comment

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

question: Do we have a ticket for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just created it now

)

return Promise.resolve({
inbound_items: previewItems.map((i) => ({
Copy link
Contributor

Choose a reason for hiding this comment

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

question: Will likely need outbound items too when added right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, haven't gotten to outbound yet.

if (!item.variant_id) {
return undefined
}
return await sdk.admin.product.retrieveVariant(
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion/though: can we use list?

@riqwan
Copy link
Contributor Author

riqwan commented Aug 7, 2024

@olivermrbl Will port over the changes to the current branch i'm working on 🤞🏻

@riqwan riqwan merged commit 17567b9 into develop Aug 7, 2024
23 checks passed
@riqwan riqwan deleted the feat/claims-e2e branch August 7, 2024 11:40
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.

3 participants