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

Quantity label width #168

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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 node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"dependencies": {
"@gocommerce/utils": "^0.7.3",
"@vtex/api": "6.46.1",
"@vtex/api": "6.47.0",
"atob": "^2.1.2",
"axios": "^0.19.0",
"camelcase": "^5.0.0",
Expand Down
10 changes: 5 additions & 5 deletions node/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1863,10 +1863,10 @@
resolved "https://registry.yarnpkg.com/@types/zen-observable/-/zen-observable-0.8.0.tgz#8b63ab7f1aa5321248aad5ac890a485656dcea4d"
integrity sha512-te5lMAWii1uEJ4FwLjzdlbw3+n0FZNOvFXHxQDKeT0dilh7HOzdMzV2TrJVUzq8ep7J4Na8OUYPRLSQkJHAlrg==

"@vtex/api@6.46.1":
version "6.46.1"
resolved "https://registry.yarnpkg.com/@vtex/api/-/api-6.46.1.tgz#55a8755ae48f5400e7f1ed1921cd547950bb7a2a"
integrity sha512-geoxVvyWoQpOQ70Zmx3M8SBkRoGOS/bp9Gy26M+iCue63jofVSwmFz1zf66EaHA1PKOJNRgQPFwY+oeDE1U2lQ==
"@vtex/api@6.47.0":
version "6.47.0"
resolved "https://registry.yarnpkg.com/@vtex/api/-/api-6.47.0.tgz#6910455d593d8bb76f1f4f2b7660023853fda35e"
integrity sha512-t9gt7Q89EMbSj3rLhho+49Fv+/lQgiy8EPVRgtmmXFp1J4v8hIAZF7GPjCPie111KVs4eG0gfZFpmhA5dafKNA==
dependencies:
"@types/koa" "^2.11.0"
"@types/koa-compose" "^3.2.3"
Expand Down Expand Up @@ -6071,7 +6071,7 @@ static-extend@^0.1.1:
define-property "^0.2.5"
object-copy "^0.1.0"

stats-lite@vtex/node-stats-lite#dist:
"stats-lite@github:vtex/node-stats-lite#dist":
version "2.2.0"
resolved "https://codeload.github.com/vtex/node-stats-lite/tar.gz/1b0d39cc41ef7aaecfd541191f877887a2044797"
dependencies:
Expand Down
46 changes: 23 additions & 23 deletions react/components/ReviewBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,22 +139,22 @@ const ReviewBlock: FunctionComponent<WrappedComponentProps & any> = ({
const refIdNotFound =
!!refidData && !!refidData.skuFromRefIds.items
? refidData.skuFromRefIds.items.filter((item: any) => {
return item.sku === null
})
return item.sku === null
})
: []

const refIdFound =
!!refidData && !!refidData.skuFromRefIds.items
? refidData.skuFromRefIds.items.filter((item: any) => {
return item.sku !== null
})
return item.sku !== null
})
: []

const refNotAvailable =
!!refidData && !!refidData.skuFromRefIds.items
? refidData.skuFromRefIds.items.filter((item: any) => {
return !!item.sellers?.length
})
return !!item.sellers?.length
})
: []

const mappedRefId = {}
Expand Down Expand Up @@ -233,25 +233,25 @@ const ReviewBlock: FunctionComponent<WrappedComponentProps & any> = ({
const sellerWithStock = item.seller
? item.seller
: item.sku && mappedRefId[item.sku]?.sellers?.length
? mappedRefId[item.sku]?.sellers.find(
? mappedRefId[item.sku]?.sellers.find(
(seller: any) =>
seller.availability === 'available' ||
seller.availability === 'partiallyAvailable'
)?.id ?? ''
: ''
: ''

const sellerUnitMultiplier =
item.sku && mappedRefId[item.sku]?.sellers?.length
? mappedRefId[item.sku]?.sellers.find(
(seller: any) => seller.id === sellerWithStock
)?.unitMultiplier ?? '1'
(seller: any) => seller.id === sellerWithStock
)?.unitMultiplier ?? '1'
: '1'

const sellerAvailableQuantity =
item.sku && mappedRefId[item.sku]?.sellers?.length
? mappedRefId[item.sku]?.sellers.find(
(seller: any) => seller.id === sellerWithStock
)?.availableQuantity
(seller: any) => seller.id === sellerWithStock
)?.availableQuantity
: null

return {
Expand Down Expand Up @@ -378,9 +378,9 @@ const ReviewBlock: FunctionComponent<WrappedComponentProps & any> = ({
const items = reviewItems.map((item: any) => {
return item.index === index
? {
...item,
content,
}
...item,
content,
}
: item
})

Expand All @@ -395,9 +395,9 @@ const ReviewBlock: FunctionComponent<WrappedComponentProps & any> = ({
const items = reviewItems.map((item: any) => {
return item.index === index
? {
...item,
seller,
}
...item,
seller,
}
: item
})

Expand Down Expand Up @@ -486,7 +486,7 @@ const ReviewBlock: FunctionComponent<WrappedComponentProps & any> = ({
title: intl.formatMessage({
id: 'store/quickorder.review.label.quantity',
}),
width: 72,
width: 90,
}
}

Expand Down Expand Up @@ -557,10 +557,10 @@ const ReviewBlock: FunctionComponent<WrappedComponentProps & any> = ({
const text =
errMsg === messages.partiallyAvailable
? intl.formatMessage(errMsg, {
quantity: rowData.availableQuantity,
totalQuantity:
rowData.availableQuantity * rowData.unitMultiplier,
})
quantity: rowData.availableQuantity,
totalQuantity:
rowData.availableQuantity * rowData.unitMultiplier,
})
: intl.formatMessage(errMsg)

return (
Expand Down