Skip to content

Commit

Permalink
Merge pull request #66 from vtex-apps/feature/returnUrl
Browse files Browse the repository at this point in the history
Returning to the `returnUrl` if it is present on the url.
  • Loading branch information
salesfelipe authored Mar 15, 2019
2 parents b7ca502 + 01e1401 commit ba195b7
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 29 deletions.
29 changes: 28 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,18 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [0.25.0] - 2019-03-15

### Changed

- Returning to the `returnUrl` if it is present on the url.

## [0.24.0] - 2019-03-13

### Added

- Italian translation

## [0.23.2] - 2019-02-26

### Fixed
Expand All @@ -18,55 +28,72 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [0.23.1] - 2019-02-25

### Fixed

- Add missing required prop, resulting in a error in address form

## [0.23.0] - 2019-02-12

### Added

- Add option to opt-out from default Menu component to use a custom one
- Add option to set default page

## [0.22.0] - 2019-01-31

### Changed

- Bump `vtex.styleguide` version.
- Profile page layout.
- Profile loading page layout.

### Fixed

- Address update.

### Fixed

- `ContentWrapper`

## [0.21.0] - 2019-01-07

### Added

- Catalan translation

## [0.20.0] - 2019-01-07

### Changed

- Use `vtex.address-form` from VTEX IO instead of using it from npm

## [0.19.6] - 2018-12-26

### Changed

- Use Skeleton components provided by `vtex.my-account-commons`

## [0.19.5] - 2018-12-03

### Removed

- `vtex.my-subscriptions` dependency.

## [0.19.4] - 2018-11-30

### Added

- `vtex.my-subscriptions` to the dependencies.

## [0.19.3] - 2018-11-29

### Fixed

- Fix `geoCoordinates`

## [0.19.2] - 2018-11-29

### Fixed
### Fixed

- Loading layout of address creation form.
- Do not break if country rule doesn't have `document`, `tradeName`, `corporateDocument` or `stateRegistration`.

Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "my-account",
"vendor": "vtex",
"version": "0.24.0",
"version": "0.25.0",
"title": "My Account",
"description": "",
"mustUpdateAt": "2019-07-09",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.24.0",
"version": "0.25.0",
"devDependencies": {
"@types/exenv": "^1.2.0",
"@vtex/intl-equalizer": "^2.0.1",
Expand Down
7 changes: 6 additions & 1 deletion react/components/pages/AddressCreate.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import PropTypes from 'prop-types'
import { graphql } from 'react-apollo'
import { compose, branch, renderComponent, withProps } from 'recompose'
import { ContentWrapper } from 'vtex.my-account-commons'
import queryString from 'query-string'

import AddressCreateLoading from '../loaders/AddressCreateLoading'
import AddressFormBox from '../Addresses/AddressFormBox'
Expand All @@ -21,7 +22,11 @@ export const headerConfig = () => {

class AddressCreate extends Component {
handleGoBack = () => {
this.props.history.push('/addresses?success=true')
const { history } = this.props

const parsed = queryString.parse(history.location.search)

history.push(parsed.returnUrl ? parsed.returnUrl : '/addresses?success=true')
}

render() {
Expand Down
1 change: 1 addition & 0 deletions react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"exenv": "^1.2.2",
"graphql": "^14.0.2",
"moment": "^2.22.2",
"query-string": "^6.3.0",
"react": "^16.4.1",
"react-apollo": "^2.3.2",
"react-dropzone": "^5.0.1",
Expand Down
13 changes: 13 additions & 0 deletions react/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4242,6 +4242,14 @@ qs@~6.5.2:
resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36"
integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==

query-string@^6.3.0:
version "6.3.0"
resolved "https://registry.yarnpkg.com/query-string/-/query-string-6.3.0.tgz#41ae8a61e1213c80b182d5db6cf129e05af89fc5"
integrity sha512-jkpCkoHiAA2BYZvni5GieU3x860QDfkh2+M6bPnrYUywqOWbGwPq5VzntTS06ixX4GVHEiq2ZhlmGy/e9LQ3zA==
dependencies:
decode-uri-component "^0.2.0"
strict-uri-encode "^2.0.0"

randomatic@^3.0.0:
version "3.1.1"
resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-3.1.1.tgz#b776efc59375984e36c537b2f51a1f0aff0da1ed"
Expand Down Expand Up @@ -4917,6 +4925,11 @@ stealthy-require@^1.1.1:
resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b"
integrity sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=

strict-uri-encode@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz#b9c7330c7042862f6b142dc274bbcc5866ce3546"
integrity sha1-ucczDHBChi9rFC3CdLvMWGbONUY=

string-convert@^0.2.0:
version "0.2.1"
resolved "https://registry.yarnpkg.com/string-convert/-/string-convert-0.2.1.tgz#6982cc3049fbb4cd85f8b24568b9d9bf39eeff97"
Expand Down
62 changes: 37 additions & 25 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
integrity sha512-kSyh9q6bvrOGEnJ9X9Io5gjXaakcSRQTax/Nj2ZKJHuOZ7bH4uvUgLyXA9uV2QBCP7+T8KS0JHbPfP1/79ckKw==

"@vtex/intl-equalizer@^2.0.1":
version "2.0.1"
resolved "https://registry.yarnpkg.com/@vtex/intl-equalizer/-/intl-equalizer-2.0.1.tgz#e620834da013237167e2c4b99816dcb901bf693a"
integrity sha512-8WcP92K/qxw3lf5cxl9WAFYIJU9u/+D5pPqszgi+VH6EVVNp3Y9hQuGfdarGgDnEhm3mJy3SAPCJ1xpabYe5bA==
version "2.2.1"
resolved "https://registry.yarnpkg.com/@vtex/intl-equalizer/-/intl-equalizer-2.2.1.tgz#611330e32a2a888f2da33e617217018f8ac1c664"
integrity sha512-NowujAGFFm2UyJWjiy8A+kp2NA8nTtfuJ+hW8tpnK+uUtKQd4nWNdb2otVoFnvNZIPeHtPyZJlbUzPBBR7tlfw==
dependencies:
cli-table2 "^0.2.0"
commander "^2.19.0"
diff "^4.0.1"
util "^0.11.0"

ansi-regex@^2.0.0:
Expand All @@ -27,11 +29,6 @@ argparse@^1.0.7:
dependencies:
sprintf-js "~1.0.2"

builtin-modules@^1.0.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f"
integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=

caller-callsite@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/caller-callsite/-/caller-callsite-2.0.0.tgz#847e0fce0a223750a9a027c54b33731ad3154134"
Expand Down Expand Up @@ -76,6 +73,11 @@ colors@^1.1.2:
resolved "https://registry.yarnpkg.com/colors/-/colors-1.3.3.tgz#39e005d546afe01e01f9c4ca8fa50f686a01205d"
integrity sha512-mmGt/1pZqYRjMxB1axhTo16/snVZ5krrKkcmMeVKxzECMMXoCgnvTPp10QgHfcbQZw8Dq2jMNG6je4JlWU0gWg==

commander@^2.19.0:
version "2.19.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.19.0.tgz#f6198aa84e5b83c46054b94ddedbfed5ee9ff12a"
integrity sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==

cosmiconfig@^5.0.7:
version "5.1.0"
resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-5.1.0.tgz#6c5c35e97f37f985061cdf653f114784231185cf"
Expand All @@ -98,6 +100,11 @@ cross-spawn@^6.0.0:
shebang-command "^1.2.0"
which "^1.2.9"

diff@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.1.tgz#0c667cb467ebbb5cea7f14f135cc2dba7780a8ff"
integrity sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q==

end-of-stream@^1.1.0:
version "1.4.1"
resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.1.tgz#ed29634d19baba463b6ce6b80a37213eab71ec43"
Expand Down Expand Up @@ -188,13 +195,6 @@ is-arrayish@^0.2.1:
resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d"
integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=

is-builtin-module@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe"
integrity sha1-VAVy0096wxGfj3bDDLwbHgN6/74=
dependencies:
builtin-modules "^1.0.0"

is-ci@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c"
Expand Down Expand Up @@ -261,12 +261,12 @@ nice-try@^1.0.4:
integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==

normalize-package-data@^2.3.2:
version "2.4.0"
resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f"
integrity sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==
version "2.5.0"
resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8"
integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==
dependencies:
hosted-git-info "^2.1.4"
is-builtin-module "^1.0.0"
resolve "^1.10.0"
semver "2 || 3 || 4 || 5"
validate-npm-package-license "^3.0.1"

Expand Down Expand Up @@ -331,6 +331,11 @@ path-key@^2.0.0, path-key@^2.0.1:
resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40"
integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=

path-parse@^1.0.6:
version "1.0.6"
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c"
integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==

pify@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176"
Expand Down Expand Up @@ -372,6 +377,13 @@ resolve-from@^3.0.0:
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748"
integrity sha1-six699nWiBvItuZTM17rywoYh0g=

resolve@^1.10.0:
version "1.10.0"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.10.0.tgz#3bdaaeaf45cc07f375656dfd2e54ed0810b101ba"
integrity sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg==
dependencies:
path-parse "^1.0.6"

run-node@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/run-node/-/run-node-1.0.0.tgz#46b50b946a2aa2d4947ae1d886e9856fd9cabe5e"
Expand Down Expand Up @@ -410,9 +422,9 @@ slash@^2.0.0:
integrity sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==

spdx-correct@^3.0.0:
version "3.0.2"
resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.0.2.tgz#19bb409e91b47b1ad54159243f7312a858db3c2e"
integrity sha512-q9hedtzyXHr5S0A1vEPoK/7l8NpfkFYTq6iCY+Pno2ZbdZR6WexZFtqeVGkGxW3TEJMN914Z55EnAGMmenlIQQ==
version "3.1.0"
resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.0.tgz#fb83e504445268f154b074e218c87c003cd31df4"
integrity sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==
dependencies:
spdx-expression-parse "^3.0.0"
spdx-license-ids "^3.0.0"
Expand All @@ -431,9 +443,9 @@ spdx-expression-parse@^3.0.0:
spdx-license-ids "^3.0.0"

spdx-license-ids@^3.0.0:
version "3.0.2"
resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.2.tgz#a59efc09784c2a5bada13cfeaf5c75dd214044d2"
integrity sha512-qky9CVt0lVIECkEsYbNILVnPvycuEBkXoMFLRWsREkomQLevYhtRKC+R91a5TOAQ3bCMjikRwhyaRqj1VYatYg==
version "3.0.3"
resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.3.tgz#81c0ce8f21474756148bbb5f3bfc0f36bf15d76e"
integrity sha512-uBIcIl3Ih6Phe3XHK1NqboJLdGfwr1UN3k6wSD1dZpmPsIkb8AGNbZYJ1fOBk834+Gxy8rpfDxrS6XLEMZMY2g==

sprintf-js@~1.0.2:
version "1.0.3"
Expand Down

0 comments on commit ba195b7

Please sign in to comment.