Merge remote-tracking branch 'origin/develop' into Version-v8.0.0

* origin/develop:
  Restore list item title attributes (#8858)
  Fix mobile sync redirect (#8860)
  Align copy tooltip text and icon (#8861)
  Update inpage provider, deprecation warnings (#8854)
  Update test-dapp (#8856)
  Return after 'reject' in Promise constructor (#8857)
  Replace removed 'copy-to-clipboard' icon (#8853)
  Stop upper-casing exported private key (#8850)
feature/default_network_editable
Mark Stacey 4 years ago
commit b34dbe9ae1
  1. 2
      app/scripts/lib/auto-reload.js
  2. 2
      app/scripts/lib/decrypt-message-manager.js
  3. 2
      app/scripts/lib/encryption-public-key-manager.js
  4. 2
      app/scripts/lib/personal-message-manager.js
  5. 4
      package.json
  6. 2
      ui/app/components/app/asset-list-item/asset-list-item.js
  7. 2
      ui/app/components/app/transaction-list-item/transaction-list-item.component.js
  8. 3
      ui/app/components/ui/export-text-container/export-text-container.component.js
  9. 2
      ui/app/components/ui/list-item/list-item.component.js
  10. 75
      ui/app/components/ui/list-item/tests/list-item.test.js
  11. 1
      ui/app/css/itcss/components/modal.scss
  12. 4
      ui/app/pages/confirm-decrypt-message/confirm-decrypt-message.component.js
  13. 2
      ui/app/pages/mobile-sync/mobile-sync.container.js
  14. 30
      yarn.lock

@ -14,7 +14,7 @@ export default function setupDappAutoReload (web3, observable) {
lastTimeUsed = Date.now()
// show warning once on web3 access
if (!hasBeenWarned && key !== 'currentProvider') {
console.warn(`MetaMask: We will soon stop injecting web3. For more information, see: https://medium.com/metamask/no-longer-injecting-web3-js-4a899ad6e59e`)
console.warn(`MetaMask: We will stop injecting web3 in Q4 2020.\nPlease see this article for more information: https://medium.com/metamask/no-longer-injecting-web3-js-4a899ad6e59e`)
hasBeenWarned = true
}
// return value normally

@ -82,7 +82,7 @@ export default class DecryptMessageManager extends EventEmitter {
addUnapprovedMessageAsync (msgParams, req) {
return new Promise((resolve, reject) => {
if (!msgParams.from) {
reject(new Error('MetaMask Decryption: from field is required.'))
return reject(new Error('MetaMask Decryption: from field is required.'))
}
const msgId = this.addUnapprovedMessage(msgParams, req)
this.once(`${msgId}:finished`, (data) => {

@ -79,7 +79,7 @@ export default class EncryptionPublicKeyManager extends EventEmitter {
addUnapprovedMessageAsync (address, req) {
return new Promise((resolve, reject) => {
if (!address) {
reject(new Error('MetaMask Message: address field is required.'))
return reject(new Error('MetaMask Message: address field is required.'))
}
const msgId = this.addUnapprovedMessage(address, req)
this.once(`${msgId}:finished`, (data) => {

@ -85,7 +85,7 @@ export default class PersonalMessageManager extends EventEmitter {
addUnapprovedMessageAsync (msgParams, req) {
return new Promise((resolve, reject) => {
if (!msgParams.from) {
reject(new Error('MetaMask Message Signature: from field is required.'))
return reject(new Error('MetaMask Message Signature: from field is required.'))
}
const msgId = this.addUnapprovedMessage(msgParams, req)
this.once(`${msgId}:finished`, (data) => {

@ -78,7 +78,7 @@
"@metamask/eth-ledger-bridge-keyring": "^0.2.6",
"@metamask/eth-token-tracker": "^2.0.0",
"@metamask/etherscan-link": "^1.1.0",
"@metamask/inpage-provider": "^5.0.0",
"@metamask/inpage-provider": "^5.2.0",
"@popperjs/core": "^2.4.0",
"@reduxjs/toolkit": "^1.3.2",
"@sentry/browser": "^5.11.1",
@ -189,7 +189,7 @@
"@babel/register": "^7.5.5",
"@metamask/eslint-config": "^1.1.0",
"@metamask/forwarder": "^1.1.0",
"@metamask/test-dapp": "^1.0.1",
"@metamask/test-dapp": "^2.1.1",
"@sentry/cli": "^1.49.0",
"@storybook/addon-actions": "^5.3.14",
"@storybook/addon-backgrounds": "^5.3.14",

@ -97,7 +97,7 @@ const AssetListItem = ({
data-testid={dataTestId}
title={primary}
titleIcon={titleIcon}
subtitle={<h3>{secondary}</h3>}
subtitle={<h3 title={secondary}>{secondary}</h3>}
onClick={onClick}
icon={(
<Identicon

@ -132,7 +132,7 @@ export default function TransactionListItem ({ transactionGroup, isEarliestNonce
date={date}
status={status}
/>
<span className={subtitleContainsOrigin ? 'transaction-list-item__origin' : 'transaction-list-item__address'}>
<span className={subtitleContainsOrigin ? 'transaction-list-item__origin' : 'transaction-list-item__address'} title={subtitle}>
{subtitle}
</span>
</h3>

@ -2,6 +2,7 @@ import React, { Component } from 'react'
import PropTypes from 'prop-types'
import copyToClipboard from 'copy-to-clipboard'
import { exportAsFile } from '../../../helpers/utils/util'
import Copy from '../icon/copy-icon.component'
class ExportTextContainer extends Component {
render () {
@ -20,7 +21,7 @@ class ExportTextContainer extends Component {
className="export-text-container__button export-text-container__button--copy"
onClick={() => copyToClipboard(text)}
>
<img src="images/copy-to-clipboard.svg" alt="" />
<Copy size={17} color="#3098DC" />
<div className="export-text-container__button-text">
{t('copyToClipboard')}
</div>

@ -23,7 +23,7 @@ export default function ListItem ({
{icon}
</div>
)}
<div className="list-item__heading">
<div className="list-item__heading" title={title}>
<h2>{ title }</h2>
{titleIcon && (
<div className="list-item__heading-wrap">

@ -0,0 +1,75 @@
import { shallow } from 'enzyme'
import React from 'react'
import ListItem from '../list-item.component'
import assert from 'assert'
import Sinon from 'sinon'
import Preloader from '../../icon/preloader/preloader-icon.component'
import Send from '../../icon/send-icon.component'
const TITLE = 'Hello World'
const SUBTITLE = <p>I am a list item</p>
const CLASSNAME = 'list-item-test'
const RIGHT_CONTENT = <p>Content rendered to the right</p>
const CHILDREN = <button>I am a button</button>
const MID_CONTENT = <p>Content rendered in the middle</p>
describe('ListItem', function () {
let wrapper
let clickHandler
before(function () {
clickHandler = Sinon.fake()
wrapper = shallow(
<ListItem
className={CLASSNAME}
title={TITLE}
data-testid="test-id"
subtitle={SUBTITLE}
rightContent={RIGHT_CONTENT}
midContent={MID_CONTENT}
icon={<Send />}
titleIcon={<Preloader />}
onClick={clickHandler}
>
{CHILDREN}
</ListItem>
)
})
it('includes the data-testid', function () {
assert.equal(wrapper.props()['data-testid'], 'test-id')
})
it(`renders "${TITLE}" title`, function () {
assert.equal(wrapper.find('.list-item__heading h2').text(), TITLE)
})
it('adds html title to heading element', function () {
assert.equal(wrapper.find('.list-item__heading').props().title, TITLE)
})
it(`renders "I am a list item" subtitle`, function () {
assert.equal(wrapper.find('.list-item__subheading').text(), 'I am a list item')
})
it('attaches external className', function () {
assert(wrapper.props().className.includes(CLASSNAME))
})
it('renders content on the right side of the list item', function () {
assert.equal(wrapper.find('.list-item__right-content p').text(), 'Content rendered to the right')
})
it('renders content in the middle of the list item', function () {
assert.equal(wrapper.find('.list-item__mid-content p').text(), 'Content rendered in the middle')
})
it('renders list item actions', function () {
assert.equal(wrapper.find('.list-item__actions button').text(), 'I am a button')
})
it('renders the title icon', function () {
assert(wrapper.find(Preloader))
})
it('renders the list item icon', function () {
assert(wrapper.find(Send))
})
it('handles click action and fires onClick', function () {
wrapper.simulate('click')
assert.equal(clickHandler.callCount, 1)
})
after(function () {
Sinon.restore()
})
})

@ -216,7 +216,6 @@
overflow: hidden;
resize: none;
padding: 9px 13px 8px;
text-transform: uppercase;
}
.modal-close-x::after {

@ -7,6 +7,7 @@ import AccountListItem from '../send/account-list-item/account-list-item.compone
import Button from '../../components/ui/button'
import Identicon from '../../components/ui/identicon'
import Tooltip from '../../components/ui/tooltip-v2'
import Copy from '../../components/ui/icon/copy-icon.component'
import { ENVIRONMENT_TYPE_NOTIFICATION } from '../../../../app/scripts/lib/enums'
import { getEnvironmentType } from '../../../../app/scripts/lib/util'
@ -267,13 +268,14 @@ export default class ConfirmDecryptMessage extends Component {
position="bottom"
title={hasCopied ? t('copiedExclamation') : t('copyToClipboard')}
wrapperClassName="request-decrypt-message__message-copy-tooltip"
style={{ display: 'flex', alignItems: 'center' }}
>
<div
className="request-decrypt-message__message-copy-text"
>
{t('decryptCopy')}
</div>
<img src="images/copy-to-clipboard.svg" />
<Copy size={17} color="#3098DC" />
</Tooltip>
</div>
)

@ -19,7 +19,7 @@ const mapStateToProps = (state) => {
} = state
return {
mostRecentOverviewpage: getMostRecentOverviewPage(state),
mostRecentOverviewPage: getMostRecentOverviewPage(state),
selectedAddress,
}
}

@ -1696,10 +1696,10 @@
resolved "https://registry.yarnpkg.com/@metamask/forwarder/-/forwarder-1.1.0.tgz#13829d8244bbf19ea658c0b20d21a77b67de0bdd"
integrity sha512-Hggj4y0QIjDzKGTXzarhEPIQyFSB2bi2y6YLJNwaT4JmP30UB5Cj6gqoY0M4pj3QT57fzp0BUuGp7F/AUe28tw==
"@metamask/inpage-provider@^5.0.0":
version "5.0.0"
resolved "https://registry.yarnpkg.com/@metamask/inpage-provider/-/inpage-provider-5.0.0.tgz#f3961ceb02821255785fe20b1b676bfd944532d7"
integrity sha512-DjQy/hJPKwEhk+L/XPHfR6bSTWsGGXjHCQ3Q/LgieQX/Kv91yyMu+QUu+tWuVi0qX0dSRmaTnFNCF9FWNV1XgA==
"@metamask/inpage-provider@^5.2.0":
version "5.2.0"
resolved "https://registry.yarnpkg.com/@metamask/inpage-provider/-/inpage-provider-5.2.0.tgz#a288d473e7374b1b227ea70d888e258854378c28"
integrity sha512-KyMfHcu3LqgxqS2hsxUxfIDjBQRJwOwhK6wOxOtAIRQLz4+Rns0Xt5R/Nk//U/JEskrHnNadTBgWOFCp3YzgJQ==
dependencies:
eth-json-rpc-errors "^2.0.2"
fast-deep-equal "^2.0.1"
@ -1711,19 +1711,10 @@
pump "^3.0.0"
safe-event-emitter "^1.0.1"
"@metamask/onboarding@^0.2.1":
version "0.2.1"
resolved "https://registry.yarnpkg.com/@metamask/onboarding/-/onboarding-0.2.1.tgz#76e864634d6436a486fcfa743f09a25b1934a11e"
integrity sha512-wSwgkIfVHM6IWja0xfNbK+wMFweOazNe1Z1RVqS0ZKG5v8vCPT93N5IQF2mKCDD+RnBpremE1VYslPPQxQz25g==
dependencies:
bowser "^2.5.4"
"@metamask/test-dapp@^1.0.1":
version "1.0.1"
resolved "https://registry.yarnpkg.com/@metamask/test-dapp/-/test-dapp-1.0.1.tgz#67961a53640faca827422fd7bc467d5b2ceb0292"
integrity sha512-RANP75a5UpCXYydaxZQ6p+4A9UjEg6YC5XS6dGatohtIKbGvN3TAU0wPot3GKcxfn9BbnGKMzQ8DIxmkrEaqSg==
dependencies:
"@metamask/onboarding" "^0.2.1"
"@metamask/test-dapp@^2.1.1":
version "2.1.1"
resolved "https://registry.yarnpkg.com/@metamask/test-dapp/-/test-dapp-2.1.1.tgz#c3b79f93c8a698b0904171c5143d0bca1307653a"
integrity sha512-ed0Ma9TLc+wkQYJK5TWslphp58JSi4Rer84LK2RxW1p4aS2LsGKS30pKMFUegj+g9g//7tyh+uFE87pXu4vPkA==
"@mrmlnc/readdir-enhanced@^2.2.1":
version "2.2.1"
@ -5451,11 +5442,6 @@ borc@^2.1.0:
iso-url "~0.4.4"
json-text-sequence "~0.1.0"
bowser@^2.5.4:
version "2.7.0"
resolved "https://registry.yarnpkg.com/bowser/-/bowser-2.7.0.tgz#96eab1fa07fab08c1ec4c75977a7c8ddf8e0fe1f"
integrity sha512-aIlMvstvu8x+34KEiOHD3AsBgdrzg6sxALYiukOWhFvGMbQI6TRP/iY0LMhUrHs56aD6P1G0Z7h45PUJaa5m9w==
boxen@^1.2.1:
version "1.3.0"
resolved "https://registry.yarnpkg.com/boxen/-/boxen-1.3.0.tgz#55c6c39a8ba58d9c61ad22cd877532deb665a20b"

Loading…
Cancel
Save