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

Use return.stock_location as Destination #3

Merged
merged 3 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"dependencies": {
"@ac-dev/countries-service": "^1.2.0",
"@commercelayer/app-elements": "^1.6.3",
"@commercelayer/app-elements": "1.6.5",
"@commercelayer/sdk": "5.21.1",
"@hookform/resolvers": "^3.3.1",
"lodash": "^4.17.21",
Expand Down
7 changes: 4 additions & 3 deletions packages/app/src/components/ReturnInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ export const ReturnInfo = withSkeletonTemplate<Props>(
settings: { mode }
} = useTokenProvider()

const returnOrderNumber = `#${returnObj?.order?.number}`
const returnOrderMarket = returnObj.order?.market?.name
const returnOrderNumber = `#${returnObj.order?.number}`
const navigateToOrder = canAccess('orders')
? navigateTo({
destination: {
Expand Down Expand Up @@ -51,10 +52,10 @@ export const ReturnInfo = withSkeletonTemplate<Props>(
<Text tag='div' weight='semibold'>
{canAccess('orders') ? (
<Button variant='link' {...navigateToOrder}>
{returnOrderNumber}
{`${returnOrderMarket} ${returnOrderNumber}`}
</Button>
) : (
returnOrderNumber
`${returnOrderMarket} ${returnOrderNumber}`
)}
</Text>
</ListItem>
Expand Down
4 changes: 2 additions & 2 deletions packages/app/src/components/ReturnSteps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ export const ReturnSteps = withSkeletonTemplate<Props>(
<div>
<Spacer bottom='2'>
<Text size='small' tag='div' variant='info' weight='semibold'>
To
Destination
</Text>
</Spacer>
<Text weight='semibold' className='text-lg'>
{returnObj?.order?.market?.name}
{returnObj?.stock_location?.name}
</Text>
</div>
</Stack>
Expand Down
1 change: 1 addition & 0 deletions packages/app/src/hooks/useReturnDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { isMockedId, makeReturn } from '#mocks'
import { useCoreApi } from '@commercelayer/app-elements'

export const returnIncludeAttribute = [
'stock_location',
'order',
'order.market',
'customer',
Expand Down
10 changes: 8 additions & 2 deletions packages/app/src/pages/ReturnsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,16 @@ export function ReturnsList(): JSX.Element {
ItemTemplate={ListItemReturn}
query={{
fields: {
returns: ['id', 'number', 'updated_at', 'status', 'order'],
returns: [
'id',
'number',
'updated_at',
'status',
'stock_location'
],
stock_location: ['id', 'name']
},
include: ['stock_location', 'order', 'order.market'],
include: ['stock_location'],
pageSize: 25,
sort: {
updated_at: 'desc'
Expand Down
106 changes: 53 additions & 53 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.