From 2c2c822ef7c90a4fd94a6d7cbcebe4d83b535016 Mon Sep 17 00:00:00 2001 From: Thomas Huang Date: Tue, 11 May 2021 09:25:09 -0700 Subject: [PATCH 1/9] Format locale to Intl standard for translated date in notifications. (#11036) * Format locale to Intl standard for translated date in notifications. * Simplify logic for correctly formatting locale code for Intl * Numeric format dates Co-authored-by: Dan Miller --- shared/notifications/index.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/shared/notifications/index.js b/shared/notifications/index.js index 212afddbf..ea1f31706 100644 --- a/shared/notifications/index.js +++ b/shared/notifications/index.js @@ -16,17 +16,18 @@ export const UI_NOTIFICATIONS = { }, 3: { id: 3, - date: '2021-03-8', + date: '2021-03-08', }, }; export const getTranslatedUINoficiations = (t, locale) => { + const formattedLocale = locale.replace('_', '-'); return { 1: { ...UI_NOTIFICATIONS[1], title: t('notifications1Title'), description: t('notifications1Description'), - date: new Intl.DateTimeFormat(locale).format( + date: new Intl.DateTimeFormat(formattedLocale).format( new Date(UI_NOTIFICATIONS[1].date), ), }, @@ -35,7 +36,7 @@ export const getTranslatedUINoficiations = (t, locale) => { title: t('notifications2Title'), description: t('notifications2Description'), actionText: t('notifications2ActionText'), - date: new Intl.DateTimeFormat(locale).format( + date: new Intl.DateTimeFormat(formattedLocale).format( new Date(UI_NOTIFICATIONS[2].date), ), }, @@ -44,7 +45,7 @@ export const getTranslatedUINoficiations = (t, locale) => { title: t('notifications3Title'), description: t('notifications3Description'), actionText: t('notifications3ActionText'), - date: new Intl.DateTimeFormat(locale).format( + date: new Intl.DateTimeFormat(formattedLocale).format( new Date(UI_NOTIFICATIONS[3].date), ), }, From ad399648fbca6ea91ab55c4b402725814b09632a Mon Sep 17 00:00:00 2001 From: Dan J Miller Date: Tue, 11 May 2021 16:25:21 -0230 Subject: [PATCH 2/9] Use UrlIcon instead of Identicon on approve screen (#11048) * Use UrlIcon instead of Identicon on approve screen * Update ui/pages/confirm-approve/confirm-approve-content/confirm-approve-content.component.js Co-authored-by: Thomas Huang Co-authored-by: Thomas Huang --- .../confirm-approve-content.component.js | 10 +++++----- .../confirm-approve/confirm-approve-content/index.scss | 5 +++++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ui/app/pages/confirm-approve/confirm-approve-content/confirm-approve-content.component.js b/ui/app/pages/confirm-approve/confirm-approve-content/confirm-approve-content.component.js index b12fa2896..8f586d65e 100644 --- a/ui/app/pages/confirm-approve/confirm-approve-content/confirm-approve-content.component.js +++ b/ui/app/pages/confirm-approve/confirm-approve-content/confirm-approve-content.component.js @@ -1,7 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import classnames from 'classnames'; -import Identicon from '../../../components/ui/identicon'; +import UrlIcon from '../../../components/ui/url-icon'; import { addressSummary } from '../../../helpers/utils/util'; import { formatCurrency } from '../../../helpers/utils/confirm-tx.util'; import { ConfirmPageContainerWarning } from '../../../components/app/confirm-page-container/confirm-page-container-content'; @@ -253,11 +253,11 @@ export default class ConfirmApproveContent extends Component { )}
-
diff --git a/ui/app/pages/confirm-approve/confirm-approve-content/index.scss b/ui/app/pages/confirm-approve/confirm-approve-content/index.scss index 9122644a4..edfafbebe 100644 --- a/ui/app/pages/confirm-approve/confirm-approve-content/index.scss +++ b/ui/app/pages/confirm-approve/confirm-approve-content/index.scss @@ -15,6 +15,11 @@ padding-right: 24px; } + &__identicon { + width: 48px; + height: 48px; + } + &__full-tx-content { display: flex; flex-flow: column; From 9a8254deb6347cd69fc1d40447a9265091a6298b Mon Sep 17 00:00:00 2001 From: Dan J Miller Date: Tue, 11 May 2021 16:53:50 -0230 Subject: [PATCH 3/9] Use isValidAddress helper instead of ethereumJsUtil.isValidAddress, when appropriate (#11049) --- ui/app/pages/add-token/add-token.component.js | 6 ++++-- ui/app/pages/send/send.component.js | 2 +- ui/lib/icon-factory.js | 3 +-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ui/app/pages/add-token/add-token.component.js b/ui/app/pages/add-token/add-token.component.js index c2c9e9fa3..664a368e6 100644 --- a/ui/app/pages/add-token/add-token.component.js +++ b/ui/app/pages/add-token/add-token.component.js @@ -1,7 +1,9 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { isValidAddress } from 'ethereumjs-util'; -import { checkExistingAddresses } from '../../helpers/utils/util'; +import { + checkExistingAddresses, + isValidAddress, +} from '../../helpers/utils/util'; import { tokenInfoGetter } from '../../helpers/utils/token-util'; import { CONFIRM_ADD_TOKEN_ROUTE } from '../../helpers/constants/routes'; import TextField from '../../components/ui/text-field'; diff --git a/ui/app/pages/send/send.component.js b/ui/app/pages/send/send.component.js index 478460aef..56eafb1e7 100644 --- a/ui/app/pages/send/send.component.js +++ b/ui/app/pages/send/send.component.js @@ -1,7 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { isValidAddress } from 'ethereumjs-util'; import { debounce } from 'lodash'; +import { isValidAddress } from '../../helpers/utils/util'; import { getAmountErrorObject, getGasFeeErrorObject, diff --git a/ui/lib/icon-factory.js b/ui/lib/icon-factory.js index ca254317b..c72f5dfd9 100644 --- a/ui/lib/icon-factory.js +++ b/ui/lib/icon-factory.js @@ -1,6 +1,5 @@ -import { isValidAddress } from 'ethereumjs-util'; import contractMap from '@metamask/contract-metadata'; -import { checksumAddress } from '../app/helpers/utils/util'; +import { isValidAddress, checksumAddress } from '../app/helpers/utils/util'; let iconFactory; From dfe5df765ea6375fe1bfe86dee8a3abd4ec50a4d Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Thu, 6 May 2021 16:02:22 -0230 Subject: [PATCH 4/9] Update lodash to `^4.17.21` (#11001) A resolution was required to update the version of `lodash` used by `ganache-core`, and a previous resolution required updating. All other lodash instances in our dependency tree were within range, and could be updated in the lockfile. --- package.json | 5 +++-- yarn.lock | 7 +------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index e42abd7d8..050aa01a5 100644 --- a/package.json +++ b/package.json @@ -73,11 +73,12 @@ "**/redux-devtools-instrument/symbol-observable": "^2.0.3", "**/rxjs/symbol-observable": "^2.0.3", "**/xmlhttprequest-ssl": "^1.6.2", - "3box/ipfs/ipld-zcash/zcash-bitcore-lib/lodash": "^4.17.19", + "3box/ipfs/ipld-zcash/zcash-bitcore-lib/lodash": "^4.17.21", "3box/ipfs/ipld-zcash/zcash-bitcore-lib/elliptic": "^6.5.4", "3box/**/libp2p-crypto/node-forge": "^0.10.0", "3box/**/libp2p-keychain/node-forge": "^0.10.0", "analytics-node/axios": "^0.21.1", + "ganache-core/lodash": "^4.17.21", "netmask": "^2.0.1", "pull-ws": "^3.3.2" }, @@ -150,7 +151,7 @@ "jsonschema": "^1.2.4", "labeled-stream-splicer": "^2.0.2", "localforage": "^1.9.0", - "lodash": "^4.17.19", + "lodash": "^4.17.21", "loglevel": "^1.4.1", "luxon": "^1.26.0", "nanoid": "^2.1.6", diff --git a/yarn.lock b/yarn.lock index 429e8d57a..4b05e3819 100644 --- a/yarn.lock +++ b/yarn.lock @@ -17612,12 +17612,7 @@ lodash.uniqby@^4.7.0: resolved "https://registry.yarnpkg.com/lodash.uniqby/-/lodash.uniqby-4.7.0.tgz#d99c07a669e9e6d24e1362dfe266c67616af1302" integrity sha1-2ZwHpmnp5tJOE2Lf4mbGdhavEwI= -lodash@4.17.20, lodash@=3.10.1, lodash@^4.0.0, lodash@^4.0.1, lodash@^4.13.1, lodash@^4.15.0, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.0, lodash@^4.3.0, lodash@~4.17.2: - version "4.17.20" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" - integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== - -lodash@^4.17.21, lodash@^4.7.0: +lodash@4.17.20, lodash@=3.10.1, lodash@^4.0.0, lodash@^4.0.1, lodash@^4.13.1, lodash@^4.15.0, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.0, lodash@^4.3.0, lodash@^4.7.0, lodash@~4.17.2: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== From 1675c047c753d608d262fa81ffa0bc4103e7db22 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Tue, 11 May 2021 18:36:01 -0230 Subject: [PATCH 5/9] Fix Sentry sourcemaps (#11051) The method used for uploading release artifacts to Sentry has been updated to allow `sentry-cli` to associate our minified bundles with the corresponding source map file. This should help Sentry display rich stack traces. Previously Sentry had used the `sourceMappingURL` to associate source maps with bundles, but we recently removed this in #10695. The hope is that this change to the upload process will ensure the mapping works correctly without the `sourceMappingURL` comment. The `upload_bundles` function was removed because the later `upload_sourcemaps` function actually uploaded both the bundles and source maps. The `--rewrite` flag was added to enable a newer "rewrite" feature of the Sentry CLI that they recommend using [1]. This rewrite is where they associate source maps with bundles. The `url-prefix` has been updated to be `metamask` rather than `sourcemaps`. I don't think `sourcemaps` was ever the correct prefix. We normalize our errors to have the path `metamask/` before sending any reports to Sentry. [1]: https://docs.sentry.io/product/cli/releases/#sentry-cli-sourcemaps --- development/sentry-upload-artifacts.sh | 29 ++------------------------ 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/development/sentry-upload-artifacts.sh b/development/sentry-upload-artifacts.sh index 12b799b94..3a605eff2 100755 --- a/development/sentry-upload-artifacts.sh +++ b/development/sentry-upload-artifacts.sh @@ -27,33 +27,10 @@ Options: EOF } -function upload_bundles { - local release="${1}"; shift - - for filepath in ./dist/chrome/*.js - do - if [[ -f $filepath ]] - then - upload_bundle "${release}" "${filepath}" - fi - done -} - -function upload_bundle { - local release="${1}"; shift - local filepath="${1}"; shift - local filename - - filename="$( basename "${filepath}" )" - - printf 'Uploading %s\n' "${filename}" - sentry-cli releases --org 'metamask' --project 'metamask' files "${release}" upload "${filepath}" "metamask/${filename}" -} - function upload_sourcemaps { local release="${1}"; shift - sentry-cli releases --org 'metamask' --project 'metamask' files "${release}" upload-sourcemaps ./dist/sourcemaps/ --url-prefix 'sourcemaps' + sentry-cli releases --org 'metamask' --project 'metamask' files "${release}" upload-sourcemaps ./dist/chrome/*.js ./dist/sourcemaps/ --rewrite --url-prefix 'metamask' } function main { @@ -87,9 +64,7 @@ function main { die 'Required parameter "release" missing; either include parameter or set VERSION environment variable' fi - printf 'uploading source files Sentry release "%s"...\n' "${release}" - upload_bundles "${release}" - printf 'uploading sourcemaps Sentry release "%s"...\n' "${release}" + printf 'uploading source files and sourcemaps for Sentry release "%s"...\n' "${release}" upload_sourcemaps "${release}" printf 'all done!\n' } From f632a9b769d61afb8cc0bb29a518e3a04550d450 Mon Sep 17 00:00:00 2001 From: ryanml Date: Tue, 11 May 2021 14:16:05 -0700 Subject: [PATCH 6/9] Adding new changelog entries --- CHANGELOG.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 39ae262ac..13230bf2a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ## [9.5.0] - 2021-04-28 +### Uncategorized +- [#11051](https://github.com/MetaMask/metamask-extension/pull/11051): Fix Sentry sourcemaps +- [#11001](https://github.com/MetaMask/metamask-extension/pull/11001): Update lodash to `^4.17.21` +- [#11049](https://github.com/MetaMask/metamask-extension/pull/11049): Use isValidAddress helper instead of ethereumJsUtil.isValidAddress, when appropriate +- [#11048](https://github.com/MetaMask/metamask-extension/pull/11048): Use UrlIcon instead of Identicon on approve screen +- [#11036](https://github.com/MetaMask/metamask-extension/pull/11036): Format locale to Intl standard for translated date in notifications. + ### Added - [#10583](https://github.com/MetaMask/metamask-extension/pull/10583): Adding popup display to show new MetaMask notifications - [#10938](https://github.com/MetaMask/metamask-extension/pull/10938): Add menu with "View on Etherscan" and "Account details" links to ETH asset page @@ -2221,8 +2228,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Uncategorized - Added the ability to restore accounts from seed words. -[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v9.4.0...HEAD -[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v9.3.0...HEAD [Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v9.5.0...HEAD [9.5.0]: https://github.com/MetaMask/metamask-extension/compare/v9.4.0...v9.5.0 [9.4.0]: https://github.com/MetaMask/metamask-extension/compare/v9.3.0...v9.4.0 From 9dd5bc0d4f00c1df2ae53a3749694a9449b1e5eb Mon Sep 17 00:00:00 2001 From: MetaMask Bot Date: Tue, 11 May 2021 21:18:34 +0000 Subject: [PATCH 7/9] Version v9.5.1 --- CHANGELOG.md | 7 ++++++- app/manifest/_base.json | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 13230bf2a..7a13c4c8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [9.5.1] +### Uncategorized +- Adding new changelog entries + ## [9.5.0] - 2021-04-28 ### Uncategorized - [#11051](https://github.com/MetaMask/metamask-extension/pull/11051): Fix Sentry sourcemaps @@ -2228,7 +2232,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Uncategorized - Added the ability to restore accounts from seed words. -[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v9.5.0...HEAD +[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v9.5.1...HEAD +[9.5.1]: https://github.com/MetaMask/metamask-extension/compare/v9.5.0...v9.5.1 [9.5.0]: https://github.com/MetaMask/metamask-extension/compare/v9.4.0...v9.5.0 [9.4.0]: https://github.com/MetaMask/metamask-extension/compare/v9.3.0...v9.4.0 [9.3.0]: https://github.com/MetaMask/metamask-extension/compare/v9.2.1...v9.3.0 diff --git a/app/manifest/_base.json b/app/manifest/_base.json index 38754eb1e..40c975a05 100644 --- a/app/manifest/_base.json +++ b/app/manifest/_base.json @@ -71,6 +71,6 @@ "notifications" ], "short_name": "__MSG_appName__", - "version": "9.5.0", + "version": "9.5.1", "web_accessible_resources": ["inpage.js", "phishing.html"] } From 64c25c19215c62554554b59fb0622d4e5e9820ef Mon Sep 17 00:00:00 2001 From: ryanml Date: Tue, 11 May 2021 16:38:31 -0700 Subject: [PATCH 8/9] [skip e2e] Update changelog for v9.5.1 (#11053) --- CHANGELOG.md | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a13c4c8f..043a560a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,17 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ## [9.5.1] -### Uncategorized -- Adding new changelog entries +### Fixed +- [#11048](https://github.com/MetaMask/metamask-extension/pull/11048): Fixed icon on approval screen +- [#11036](https://github.com/MetaMask/metamask-extension/pull/11036): Fixed broken app state for some users with Chinese, Portugese or Spanish browser language settings. ## [9.5.0] - 2021-04-28 -### Uncategorized -- [#11051](https://github.com/MetaMask/metamask-extension/pull/11051): Fix Sentry sourcemaps -- [#11001](https://github.com/MetaMask/metamask-extension/pull/11001): Update lodash to `^4.17.21` -- [#11049](https://github.com/MetaMask/metamask-extension/pull/11049): Use isValidAddress helper instead of ethereumJsUtil.isValidAddress, when appropriate -- [#11048](https://github.com/MetaMask/metamask-extension/pull/11048): Use UrlIcon instead of Identicon on approve screen -- [#11036](https://github.com/MetaMask/metamask-extension/pull/11036): Format locale to Intl standard for translated date in notifications. - ### Added - [#10583](https://github.com/MetaMask/metamask-extension/pull/10583): Adding popup display to show new MetaMask notifications - [#10938](https://github.com/MetaMask/metamask-extension/pull/10938): Add menu with "View on Etherscan" and "Account details" links to ETH asset page From b73c29a6a7bbed90b8dcf7ac5b3414ddb16b9504 Mon Sep 17 00:00:00 2001 From: ryanml Date: Tue, 11 May 2021 18:27:03 -0700 Subject: [PATCH 9/9] Fixing changelog, bumping package.json -> 9.5.1 --- CHANGELOG.md | 1 - package.json | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a7d233871..7596ba90e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2229,7 +2229,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v9.5.1...HEAD [9.5.1]: https://github.com/MetaMask/metamask-extension/compare/v9.5.0...v9.5.1 -[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v9.5.0...HEAD [9.5.0]: https://github.com/MetaMask/metamask-extension/compare/v9.4.0...v9.5.0 [9.4.0]: https://github.com/MetaMask/metamask-extension/compare/v9.3.0...v9.4.0 [9.3.0]: https://github.com/MetaMask/metamask-extension/compare/v9.2.1...v9.3.0 diff --git a/package.json b/package.json index bd820a322..c6cf54059 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "metamask-crx", - "version": "9.5.0", + "version": "9.5.1", "private": true, "repository": { "type": "git",