Skip to content

Commit

Permalink
Merge pull request #298 from vtex-apps/hotfix/OMS-5577-0.x-geo-location
Browse files Browse the repository at this point in the history
fix address form logic of default country with geo location
  • Loading branch information
wagnerlduarte authored Feb 15, 2024
2 parents 87da7bb + 11315a5 commit 6086ae4
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 29 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Fixed

- Fix address form logic of default country with geo location

## [0.43.0] - 2023-06-28

### Removed
Expand All @@ -16,6 +20,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [0.42.2] - 2023-03-28

### Fixed

- German translation.

## [0.42.1] - 2023-01-26
Expand Down
2 changes: 1 addition & 1 deletion node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"vtex.styleguide": "http://vtex.vtexassets.com/_v/public/typings/v1/[email protected]/public/@types/vtex.styleguide"
},
"dependencies": {
"@vtex/api": "6.45.15"
"@vtex/api": "6.46.1"
},
"version": "0.43.0"
}
68 changes: 42 additions & 26 deletions node/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,10 @@
lodash.unescape "4.0.1"
semver "5.5.0"

"@vtex/api@6.45.15":
version "6.45.15"
resolved "https://registry.yarnpkg.com/@vtex/api/-/api-6.45.15.tgz#aa987d22f7df16ce2861130deda6ffd63156817b"
integrity sha512-Rg1VGDzJ4hHUNp1vSidMdGGPojr1PikMTptlZsJ3oNZVdEo4cPx2l8ZcAEwHWORL7QjPjXaEgmeA5ZOSf+boCQ==
"@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==
dependencies:
"@types/koa" "^2.11.0"
"@types/koa-compose" "^3.2.3"
Expand All @@ -233,7 +233,7 @@
fs-extra "^7.0.0"
graphql "^14.5.8"
graphql-tools "^4.0.6"
graphql-upload "^8.1.0"
graphql-upload "^13.0.0"
jaeger-client "^3.18.0"
js-base64 "^2.5.1"
koa "^2.11.0"
Expand All @@ -244,7 +244,7 @@
mime-types "^2.1.12"
opentracing "^0.14.4"
p-limit "^2.2.0"
prom-client "^12.0.0"
prom-client "^14.2.0"
qs "^6.5.1"
querystring "^0.2.0"
ramda "^0.26.0"
Expand Down Expand Up @@ -988,10 +988,10 @@ fresh@~0.5.2:
resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7"
integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=

fs-capacitor@^2.0.4:
version "2.0.4"
resolved "https://registry.yarnpkg.com/fs-capacitor/-/fs-capacitor-2.0.4.tgz#5a22e72d40ae5078b4fe64fe4d08c0d3fc88ad3c"
integrity sha512-8S4f4WsCryNw2mJJchi46YgB6CR5Ze+4L1h8ewl9tEpL4SJ3ZO+c/bS4BWhB8bK+O3TMqhuZarTitd0S0eh2pA==
fs-capacitor@^6.2.0:
version "6.2.0"
resolved "https://registry.yarnpkg.com/fs-capacitor/-/fs-capacitor-6.2.0.tgz#fa79ac6576629163cb84561995602d8999afb7f5"
integrity sha512-nKcE1UduoSKX27NSZlg879LdQc94OtbOsEmKMN2MBNudXREvijRKx2GEBsTMTfws+BrbkJoEuynbGSVRSpauvw==

fs-constants@^1.0.0:
version "1.0.0"
Expand Down Expand Up @@ -1055,15 +1055,15 @@ graphql-tools@^4.0.6:
iterall "^1.1.3"
uuid "^3.1.0"

graphql-upload@^8.1.0:
version "8.1.0"
resolved "https://registry.yarnpkg.com/graphql-upload/-/graphql-upload-8.1.0.tgz#6d0ab662db5677a68bfb1f2c870ab2544c14939a"
integrity sha512-U2OiDI5VxYmzRKw0Z2dmfk0zkqMRaecH9Smh1U277gVgVe9Qn+18xqf4skwr4YJszGIh7iQDZ57+5ygOK9sM/Q==
graphql-upload@^13.0.0:
version "13.0.0"
resolved "https://registry.yarnpkg.com/graphql-upload/-/graphql-upload-13.0.0.tgz#1a255b64d3cbf3c9f9171fa62a8fb0b9b59bb1d9"
integrity sha512-YKhx8m/uOtKu4Y1UzBFJhbBGJTlk7k4CydlUUiNrtxnwZv0WigbRHP+DVhRNKt7u7DXOtcKZeYJlGtnMXvreXA==
dependencies:
busboy "^0.3.1"
fs-capacitor "^2.0.4"
http-errors "^1.7.3"
object-path "^0.11.4"
fs-capacitor "^6.2.0"
http-errors "^1.8.1"
object-path "^0.11.8"

graphql@^14.5.8:
version "14.7.0"
Expand Down Expand Up @@ -1106,7 +1106,7 @@ [email protected], http-errors@~1.7.2:
statuses ">= 1.5.0 < 2"
toidentifier "1.0.0"

http-errors@^1.3.1, http-errors@^1.6.3, http-errors@^1.7.3:
http-errors@^1.3.1, http-errors@^1.6.3:
version "1.8.0"
resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.8.0.tgz#75d1bbe497e1044f51e4ee9e704a62f28d336507"
integrity sha512-4I8r0C5JDhT5VkvI47QktDW75rNlGVsUf/8hzjCC/wkWI/jdTRmBb9aI7erSG82r1bjKY3F6k28WnsVxB1C73A==
Expand All @@ -1117,6 +1117,17 @@ http-errors@^1.3.1, http-errors@^1.6.3, http-errors@^1.7.3:
statuses ">= 1.5.0 < 2"
toidentifier "1.0.0"

http-errors@^1.8.1:
version "1.8.1"
resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.8.1.tgz#7c3f28577cbc8a207388455dbd62295ed07bd68c"
integrity sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==
dependencies:
depd "~1.1.2"
inherits "2.0.4"
setprototypeof "1.2.0"
statuses ">= 1.5.0 < 2"
toidentifier "1.0.1"

humanize-ms@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/humanize-ms/-/humanize-ms-1.2.1.tgz#c46e3159a293f6b896da29316d8b6fe8bb79bbed"
Expand Down Expand Up @@ -1535,10 +1546,10 @@ normalize-path@^3.0.0:
resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65"
integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==

object-path@^0.11.4:
version "0.11.4"
resolved "https://registry.yarnpkg.com/object-path/-/object-path-0.11.4.tgz#370ae752fbf37de3ea70a861c23bba8915691949"
integrity sha1-NwrnUvvzfePqcKhhwju6iRVpGUk=
object-path@^0.11.8:
version "0.11.8"
resolved "https://registry.yarnpkg.com/object-path/-/object-path-0.11.8.tgz#ed002c02bbdd0070b78a27455e8ae01fc14d4742"
integrity sha512-YJjNZrlXJFM42wTBn6zgOJVar9KFJvzx6sTWDte8sWZF//cnjl0BxHNpfZx+ZffXX63A9q0b1zsFiBX4g4X5KA==

on-finished@^2.3.0:
version "2.3.0"
Expand Down Expand Up @@ -1666,10 +1677,10 @@ progress@^2.0.0:
resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8"
integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==

prom-client@^12.0.0:
version "12.0.0"
resolved "https://registry.yarnpkg.com/prom-client/-/prom-client-12.0.0.tgz#9689379b19bd3f6ab88a9866124db9da3d76c6ed"
integrity sha512-JbzzHnw0VDwCvoqf8y1WDtq4wSBAbthMB1pcVI/0lzdqHGJI3KBJDXle70XK+c7Iv93Gihqo0a5LlOn+g8+DrQ==
prom-client@^14.2.0:
version "14.2.0"
resolved "https://registry.yarnpkg.com/prom-client/-/prom-client-14.2.0.tgz#ca94504e64156f6506574c25fb1c34df7812cf11"
integrity sha512-sF308EhTenb/pDRPakm+WgiN+VdM/T1RaHj1x+MvAuT8UiQP8JmOEbxVqtkbfR4LrvOg5n7ic01kRBDGXjYikA==
dependencies:
tdigest "^0.1.1"

Expand Down Expand Up @@ -1993,6 +2004,11 @@ [email protected]:
resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553"
integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==

[email protected]:
version "1.0.1"
resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35"
integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==

tokenbucket@^0.3.2:
version "0.3.2"
resolved "https://registry.yarnpkg.com/tokenbucket/-/tokenbucket-0.3.2.tgz#8172b2b58e3083acc8d914426fed15162a3a8e90"
Expand Down
10 changes: 8 additions & 2 deletions react/components/Addresses/AddressForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,15 @@ class AddressForm extends Component<InnerProps & OuterProps, State> {
let address: Address

if (props.address === undefined) {
const { runtime, shipsTo, receiverName } = props
const { runtime, shipsTo, receiverName, useGeolocation } = props

const country = shipsTo.length > 0 ? shipsTo[0] : runtime.culture.country
let country

if (useGeolocation) {
country = runtime.culture.country
} else {
country = shipsTo.length > 0 ? shipsTo[0] : runtime.culture.country
}

address = getEmptyAddress(country, receiverName ?? '')
} else {
Expand Down

0 comments on commit 6086ae4

Please sign in to comment.