)
}
+
+ return null
}
}
diff --git a/ui/app/pages/send/send-content/add-recipient/ens-input.container.js b/ui/app/pages/send/send-content/add-recipient/ens-input.container.js
index 48d266db4..479773e9e 100644
--- a/ui/app/pages/send/send-content/add-recipient/ens-input.container.js
+++ b/ui/app/pages/send/send-content/add-recipient/ens-input.container.js
@@ -1,11 +1,11 @@
import { connect } from 'react-redux'
-import EnsInput from './ens-input.component'
import {
getCurrentNetwork,
getSendTo,
getSendToNickname,
getAddressBookEntry,
} from '../../../../selectors'
+import EnsInput from './ens-input.component'
export default connect(
(state) => {
diff --git a/ui/app/pages/send/send-content/add-recipient/tests/add-recipient-component.test.js b/ui/app/pages/send/send-content/add-recipient/tests/add-recipient-component.test.js
index b031323be..a25230267 100644
--- a/ui/app/pages/send/send-content/add-recipient/tests/add-recipient-component.test.js
+++ b/ui/app/pages/send/send-content/add-recipient/tests/add-recipient-component.test.js
@@ -1,5 +1,5 @@
-import React from 'react'
import assert from 'assert'
+import React from 'react'
import { shallow } from 'enzyme'
import sinon from 'sinon'
import AddRecipient from '../add-recipient.component'
@@ -37,7 +37,7 @@ describe('AddRecipient Component', function () {
nonContacts={[{ address: '0x70F061544cC398520615B5d3e7A3BedD70cd4510', name: 'Fav 7' }]}
contacts={[{ address: '0x60F061544cC398520615B5d3e7A3BedD70cd4510', name: 'Fav 6' }]}
/>
- ), { context: { t: (str) => str + '_t' } })
+ ), { context: { t: (str) => `${str}_t` } })
instance = wrapper.instance()
})
@@ -94,7 +94,6 @@ describe('AddRecipient Component', function () {
const xferLink = wrapper.find('.send__select-recipient-wrapper__list__link')
assert.equal(xferLink.length, 1)
-
const groups = wrapper.find('RecipientGroup')
assert.equal(groups.shallow().find('.send__select-recipient-wrapper__group').length, 1)
})
diff --git a/ui/app/pages/send/send-content/add-recipient/tests/add-recipient-utils.test.js b/ui/app/pages/send/send-content/add-recipient/tests/add-recipient-utils.test.js
index a35ba5b9f..628420688 100644
--- a/ui/app/pages/send/send-content/add-recipient/tests/add-recipient-utils.test.js
+++ b/ui/app/pages/send/send-content/add-recipient/tests/add-recipient-utils.test.js
@@ -9,7 +9,7 @@ import {
} from '../../../send.constants'
const stubs = {
- isValidAddress: sinon.stub().callsFake((to) => Boolean(to.match(/^[0xabcdef123456798]+$/))),
+ isValidAddress: sinon.stub().callsFake((to) => Boolean(to.match(/^[0xabcdef123456798]+$/u))),
}
const toRowUtils = proxyquire('../add-recipient.js', {
diff --git a/ui/app/pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.component.js b/ui/app/pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.component.js
index 59fcea367..adab9856e 100644
--- a/ui/app/pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.component.js
+++ b/ui/app/pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.component.js
@@ -51,12 +51,12 @@ export default class AmountMaxButton extends Component {
name: 'Clicked "Amount Max"',
},
})
- if (!maxModeOn) {
- setMaxModeTo(true)
- this.setMaxAmount()
- } else {
+ if (maxModeOn) {
setMaxModeTo(false)
clearMaxAmount()
+ } else {
+ setMaxModeTo(true)
+ this.setMaxAmount()
}
}
diff --git a/ui/app/pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.container.js b/ui/app/pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.container.js
index 4060b3eee..1113ad7f9 100644
--- a/ui/app/pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.container.js
+++ b/ui/app/pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.container.js
@@ -7,15 +7,15 @@ import {
getSendMaxModeState,
getBasicGasEstimateLoadingStatus,
} from '../../../../../selectors'
-import { calcMaxAmount } from './amount-max-button.utils.js'
import {
updateSendAmount,
setMaxModeTo,
} from '../../../../../store/actions'
-import AmountMaxButton from './amount-max-button.component'
import {
updateSendErrors,
} from '../../../../../ducks/send/send.duck'
+import { calcMaxAmount } from './amount-max-button.utils'
+import AmountMaxButton from './amount-max-button.component'
export default connect(mapStateToProps, mapDispatchToProps)(AmountMaxButton)
diff --git a/ui/app/pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.utils.js b/ui/app/pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.utils.js
index 606ab6a84..f27207ecb 100644
--- a/ui/app/pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.utils.js
+++ b/ui/app/pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.utils.js
@@ -1,5 +1,5 @@
-import { multiplyCurrencies, subtractCurrencies } from '../../../../../helpers/utils/conversion-util'
import ethUtil from 'ethereumjs-util'
+import { multiplyCurrencies, subtractCurrencies } from '../../../../../helpers/utils/conversion-util'
export function calcMaxAmount ({ balance, gasTotal, sendToken, tokenBalance }) {
const { decimals } = sendToken || {}
diff --git a/ui/app/pages/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-component.test.js b/ui/app/pages/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-component.test.js
index 322d21288..cc4546f58 100644
--- a/ui/app/pages/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-component.test.js
+++ b/ui/app/pages/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-component.test.js
@@ -1,8 +1,8 @@
-import React from 'react'
import assert from 'assert'
+import React from 'react'
import { shallow } from 'enzyme'
import sinon from 'sinon'
-import AmountMaxButton from '../amount-max-button.component.js'
+import AmountMaxButton from '../amount-max-button.component'
describe('AmountMaxButton Component', function () {
let wrapper
@@ -13,7 +13,7 @@ describe('AmountMaxButton Component', function () {
setMaxModeTo: sinon.spy(),
}
- const MOCK_EVENT = { preventDefault: () => {} }
+ const MOCK_EVENT = { preventDefault: () => undefined }
before(function () {
sinon.spy(AmountMaxButton.prototype, 'setMaxAmount')
@@ -32,8 +32,8 @@ describe('AmountMaxButton Component', function () {
/>
), {
context: {
- t: (str) => str + '_t',
- metricsEvent: () => {},
+ t: (str) => `${str}_t`,
+ metricsEvent: () => undefined,
},
})
instance = wrapper.instance()
diff --git a/ui/app/pages/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-utils.test.js b/ui/app/pages/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-utils.test.js
index 08fc28b73..caafcfb51 100644
--- a/ui/app/pages/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-utils.test.js
+++ b/ui/app/pages/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-utils.test.js
@@ -1,7 +1,7 @@
import assert from 'assert'
import {
calcMaxAmount,
-} from '../amount-max-button.utils.js'
+} from '../amount-max-button.utils'
describe('amount-max-button utils', function () {
diff --git a/ui/app/pages/send/send-content/send-amount-row/send-amount-row.component.js b/ui/app/pages/send/send-content/send-amount-row/send-amount-row.component.js
index 37b764fbc..c21c38509 100644
--- a/ui/app/pages/send/send-content/send-amount-row/send-amount-row.component.js
+++ b/ui/app/pages/send/send-content/send-amount-row/send-amount-row.component.js
@@ -2,9 +2,9 @@ import React, { Component } from 'react'
import PropTypes from 'prop-types'
import { debounce } from 'lodash'
import SendRowWrapper from '../send-row-wrapper'
-import AmountMaxButton from './amount-max-button'
import UserPreferencedCurrencyInput from '../../../../components/app/user-preferenced-currency-input'
import UserPreferencedTokenInput from '../../../../components/app/user-preferenced-token-input'
+import AmountMaxButton from './amount-max-button'
export default class SendAmountRow extends Component {
diff --git a/ui/app/pages/send/send-content/send-amount-row/tests/send-amount-row-component.test.js b/ui/app/pages/send/send-content/send-amount-row/tests/send-amount-row-component.test.js
index 6264c137c..5b025e985 100644
--- a/ui/app/pages/send/send-content/send-amount-row/tests/send-amount-row-component.test.js
+++ b/ui/app/pages/send/send-content/send-amount-row/tests/send-amount-row-component.test.js
@@ -1,8 +1,8 @@
-import React from 'react'
import assert from 'assert'
+import React from 'react'
import { shallow } from 'enzyme'
import sinon from 'sinon'
-import SendAmountRow from '../send-amount-row.component.js'
+import SendAmountRow from '../send-amount-row.component'
import SendRowWrapper from '../../send-row-wrapper/send-row-wrapper.component'
import AmountMaxButton from '../amount-max-button/amount-max-button.container'
@@ -158,9 +158,9 @@ function shallowRenderSendAmountRow () {
updateGasFeeError={updateGasFeeError}
updateSendAmount={updateSendAmount}
updateSendAmountError={updateSendAmountError}
- updateGas={() => {}}
+ updateGas={() => undefined}
/>
- ), { context: { t: (str) => str + '_t' } })
+ ), { context: { t: (str) => `${str}_t` } })
const instance = wrapper.instance()
const updateAmount = sinon.spy(instance, 'updateAmount')
const updateGas = sinon.spy(instance, 'updateGas')
diff --git a/ui/app/pages/send/send-content/send-asset-row/send-asset-row.component.js b/ui/app/pages/send/send-content/send-asset-row/send-asset-row.component.js
index 4920156f0..831bf9ac7 100644
--- a/ui/app/pages/send/send-content/send-asset-row/send-asset-row.component.js
+++ b/ui/app/pages/send/send-content/send-asset-row/send-asset-row.component.js
@@ -124,7 +124,6 @@ export default class SendAssetRow extends Component {
)
}
-
renderAsset (token, insideDropdown = false) {
const { address, symbol } = token
const { t } = this.context
diff --git a/ui/app/pages/send/send-content/send-asset-row/send-asset-row.container.js b/ui/app/pages/send/send-content/send-asset-row/send-asset-row.container.js
index 3fdb4803c..dbbf2dddb 100644
--- a/ui/app/pages/send/send-content/send-asset-row/send-asset-row.container.js
+++ b/ui/app/pages/send/send-content/send-asset-row/send-asset-row.container.js
@@ -1,7 +1,7 @@
import { connect } from 'react-redux'
-import SendAssetRow from './send-asset-row.component'
import { getMetaMaskAccounts, getSendTokenAddress } from '../../../../selectors'
import { updateSendToken } from '../../../../store/actions'
+import SendAssetRow from './send-asset-row.component'
function mapStateToProps (state) {
return {
diff --git a/ui/app/pages/send/send-content/send-content.component.js b/ui/app/pages/send/send-content/send-content.component.js
index 6ae20f19e..a764849f9 100644
--- a/ui/app/pages/send/send-content/send-content.component.js
+++ b/ui/app/pages/send/send-content/send-content.component.js
@@ -1,11 +1,11 @@
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import PageContainerContent from '../../../components/ui/page-container/page-container-content.component'
+import Dialog from '../../../components/ui/dialog'
import SendAmountRow from './send-amount-row'
import SendGasRow from './send-gas-row'
import SendHexDataRow from './send-hex-data-row'
import SendAssetRow from './send-asset-row'
-import Dialog from '../../../components/ui/dialog'
export default class SendContent extends Component {
@@ -48,7 +48,7 @@ export default class SendContent extends Component {
const { isOwnedAccount, showAddToAddressBookModal, contact = {} } = this.props
if (isOwnedAccount || contact.name) {
- return
+ return null
}
return (
diff --git a/ui/app/pages/send/send-content/send-content.container.js b/ui/app/pages/send/send-content/send-content.container.js
index 8ee785736..3bbc36a49 100644
--- a/ui/app/pages/send/send-content/send-content.container.js
+++ b/ui/app/pages/send/send-content/send-content.container.js
@@ -1,5 +1,4 @@
import { connect } from 'react-redux'
-import SendContent from './send-content.component'
import {
getSendTo,
accountsWithSendEtherInfoSelector,
@@ -7,12 +6,13 @@ import {
} from '../../../selectors'
import * as actions from '../../../store/actions'
+import SendContent from './send-content.component'
function mapStateToProps (state) {
const ownedAccounts = accountsWithSendEtherInfoSelector(state)
const to = getSendTo(state)
return {
- isOwnedAccount: !!ownedAccounts.find(({ address }) => address.toLowerCase() === to.toLowerCase()),
+ isOwnedAccount: Boolean(ownedAccounts.find(({ address }) => address.toLowerCase() === to.toLowerCase())),
contact: getAddressBookEntry(state, to),
to,
}
diff --git a/ui/app/pages/send/send-content/send-gas-row/gas-fee-display/gas-fee-display.component.js b/ui/app/pages/send/send-content/send-gas-row/gas-fee-display/gas-fee-display.component.js
index ddbee30bb..601cf0c5f 100644
--- a/ui/app/pages/send/send-content/send-gas-row/gas-fee-display/gas-fee-display.component.js
+++ b/ui/app/pages/send/send-content/send-gas-row/gas-fee-display/gas-fee-display.component.js
@@ -20,6 +20,7 @@ export default class GasFeeDisplay extends Component {
return (
+ {/* eslint-disable-next-line no-nested-ternary */}
{gasTotal
? (
diff --git a/ui/app/pages/send/send-content/send-gas-row/gas-fee-display/tests/gas-fee-display.component.test.js b/ui/app/pages/send/send-content/send-gas-row/gas-fee-display/tests/gas-fee-display.component.test.js
index 63a0eba57..d5f6716a7 100644
--- a/ui/app/pages/send/send-content/send-gas-row/gas-fee-display/tests/gas-fee-display.component.test.js
+++ b/ui/app/pages/send/send-content/send-gas-row/gas-fee-display/tests/gas-fee-display.component.test.js
@@ -1,9 +1,9 @@
-import React from 'react'
import assert from 'assert'
+import React from 'react'
import { shallow } from 'enzyme'
+import sinon from 'sinon'
import GasFeeDisplay from '../gas-fee-display.component'
import UserPreferencedCurrencyDisplay from '../../../../../../components/app/user-preferenced-currency-display'
-import sinon from 'sinon'
const propsMethodSpies = {
showCustomizeGasModal: sinon.spy(),
@@ -24,7 +24,7 @@ describe('GasFeeDisplay Component', function () {
showGasButtonGroup={propsMethodSpies.showCustomizeGasModal}
onReset={propsMethodSpies.onReset}
/>
- ), { context: { t: (str) => str + '_t' } })
+ ), { context: { t: (str) => `${str}_t` } })
})
afterEach(function () {
diff --git a/ui/app/pages/send/send-content/send-gas-row/send-gas-row.component.js b/ui/app/pages/send/send-content/send-gas-row/send-gas-row.component.js
index 9388cd2d1..8df7bbbfa 100644
--- a/ui/app/pages/send/send-content/send-gas-row/send-gas-row.component.js
+++ b/ui/app/pages/send/send-content/send-gas-row/send-gas-row.component.js
@@ -1,9 +1,9 @@
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import SendRowWrapper from '../send-row-wrapper'
-import GasFeeDisplay from './gas-fee-display/gas-fee-display.component'
import GasPriceButtonGroup from '../../../../components/app/gas-customization/gas-price-button-group'
import AdvancedGasInputs from '../../../../components/app/gas-customization/advanced-gas-inputs'
+import GasFeeDisplay from './gas-fee-display/gas-fee-display.component'
export default class SendGasRow extends Component {
@@ -151,9 +151,8 @@ export default class SendGasRow extends Component {
return advancedGasInputs
} else if (gasButtonGroupShown) {
return gasPriceButtonGroup
- } else {
- return gasFeeDisplay
}
+ return gasFeeDisplay
}
render () {
diff --git a/ui/app/pages/send/send-content/send-gas-row/send-gas-row.container.js b/ui/app/pages/send/send-content/send-gas-row/send-gas-row.container.js
index 7510588a4..b215087fe 100644
--- a/ui/app/pages/send/send-content/send-gas-row/send-gas-row.container.js
+++ b/ui/app/pages/send/send-content/send-gas-row/send-gas-row.container.js
@@ -22,7 +22,7 @@ import {
import {
isBalanceSufficient,
calcGasTotal,
-} from '../../send.utils.js'
+} from '../../send.utils'
import { calcMaxAmount } from '../send-amount-row/amount-max-button/amount-max-button.utils'
import {
showGasButtonGroup,
@@ -36,7 +36,6 @@ import {
import { showModal, setGasPrice, setGasLimit, setGasTotal, updateSendAmount } from '../../../../store/actions'
import SendGasRow from './send-gas-row.component'
-
export default connect(mapStateToProps, mapDispatchToProps, mergeProps)(SendGasRow)
function mapStateToProps (state) {
diff --git a/ui/app/pages/send/send-content/send-gas-row/send-gas-row.scss b/ui/app/pages/send/send-content/send-gas-row/send-gas-row.scss
index e69de29bb..b8a23d06b 100644
--- a/ui/app/pages/send/send-content/send-gas-row/send-gas-row.scss
+++ b/ui/app/pages/send/send-content/send-gas-row/send-gas-row.scss
@@ -0,0 +1,82 @@
+.currency-display {
+ height: 54px;
+ border: 1px solid $alto;
+ border-radius: 4px;
+ background-color: $white;
+ color: $scorpion;
+ font-size: 16px;
+ padding: 8px 10px;
+ position: relative;
+
+ &__primary-row {
+ display: flex;
+ }
+
+ &__input {
+ color: $scorpion;
+ font-size: 16px;
+ line-height: 22px;
+ border: none;
+ max-width: 22ch;
+ }
+
+ &__primary-currency {
+ color: $scorpion;
+ font-weight: 400;
+ font-size: 16px;
+ line-height: 22px;
+ }
+
+ &__converted-row {
+ display: flex;
+ }
+
+ &__converted-value,
+ &__converted-currency {
+ color: $dusty-gray;
+ font-size: 12px;
+ line-height: 12px;
+ }
+
+ &__input-wrapper {
+ position: relative;
+ display: flex;
+ flex: 1;
+ max-width: 100%;
+
+ input[type="number"] {
+ -moz-appearance: textfield;
+ }
+
+ input[type="number"]::-webkit-inner-spin-button {
+ -webkit-appearance: none;
+ -moz-appearance: none;
+ display: none;
+ }
+
+ input[type="number"]:hover::-webkit-inner-spin-button {
+ -webkit-appearance: none;
+ -moz-appearance: none;
+ display: none;
+ }
+ }
+
+ &__currency-symbol {
+ margin-top: 1px;
+ color: $scorpion;
+ }
+
+ .react-numeric-input {
+ input[type="number"]::-webkit-inner-spin-button {
+ -webkit-appearance: none;
+ -moz-appearance: none;
+ display: none;
+ }
+
+ input[type="number"]:hover::-webkit-inner-spin-button {
+ -webkit-appearance: none;
+ -moz-appearance: none;
+ display: none;
+ }
+ }
+}
diff --git a/ui/app/pages/send/send-content/send-gas-row/tests/send-gas-row-component.test.js b/ui/app/pages/send/send-content/send-gas-row/tests/send-gas-row-component.test.js
index 1664c3211..e078ed25a 100644
--- a/ui/app/pages/send/send-content/send-gas-row/tests/send-gas-row-component.test.js
+++ b/ui/app/pages/send/send-content/send-gas-row/tests/send-gas-row-component.test.js
@@ -1,8 +1,8 @@
-import React from 'react'
import assert from 'assert'
+import React from 'react'
import { shallow } from 'enzyme'
import sinon from 'sinon'
-import SendGasRow from '../send-gas-row.component.js'
+import SendGasRow from '../send-gas-row.component'
import SendRowWrapper from '../../send-row-wrapper/send-row-wrapper.component'
import GasFeeDisplay from '../gas-fee-display/gas-fee-display.component'
@@ -33,7 +33,7 @@ describe('SendGasRow Component', function () {
anotherGasPriceButtonGroupProp: 'bar',
}}
/>
- ), { context: { t: (str) => str + '_t', metricsEvent: () => ({}) } })
+ ), { context: { t: (str) => `${str}_t`, metricsEvent: () => ({}) } })
wrapper.setProps({ isMainnet: true })
})
diff --git a/ui/app/pages/send/send-content/send-hex-data-row/send-hex-data-row.component.js b/ui/app/pages/send/send-content/send-hex-data-row/send-hex-data-row.component.js
index eeff87b84..cf774ae0c 100644
--- a/ui/app/pages/send/send-content/send-hex-data-row/send-hex-data-row.component.js
+++ b/ui/app/pages/send/send-content/send-hex-data-row/send-hex-data-row.component.js
@@ -15,7 +15,7 @@ export default class SendHexDataRow extends Component {
onInput = (event) => {
const { updateSendHexData, updateGas } = this.props
- const data = event.target.value.replace(/\n/g, '') || null
+ const data = event.target.value.replace(/\n/ug, '') || null
updateSendHexData(data)
updateGas({ data })
}
diff --git a/ui/app/pages/send/send-content/send-row-wrapper/send-row-error-message/tests/send-row-error-message-component.test.js b/ui/app/pages/send/send-content/send-row-wrapper/send-row-error-message/tests/send-row-error-message-component.test.js
index 47d624598..5e2b261e0 100644
--- a/ui/app/pages/send/send-content/send-row-wrapper/send-row-error-message/tests/send-row-error-message-component.test.js
+++ b/ui/app/pages/send/send-content/send-row-wrapper/send-row-error-message/tests/send-row-error-message-component.test.js
@@ -1,7 +1,7 @@
-import React from 'react'
import assert from 'assert'
+import React from 'react'
import { shallow } from 'enzyme'
-import SendRowErrorMessage from '../send-row-error-message.component.js'
+import SendRowErrorMessage from '../send-row-error-message.component'
describe('SendRowErrorMessage Component', function () {
let wrapper
@@ -13,7 +13,7 @@ describe('SendRowErrorMessage Component', function () {
errors={{ error1: 'abc', error2: 'def' }}
errorType="error3"
/>
- ), { context: { t: (str) => str + '_t' } })
+ ), { context: { t: (str) => `${str}_t` } })
})
it('should render null if the passed errors do not contain an error of errorType', function () {
diff --git a/ui/app/pages/send/send-content/send-row-wrapper/send-row-error-message/tests/send-row-error-message-container.test.js b/ui/app/pages/send/send-content/send-row-wrapper/send-row-error-message/tests/send-row-error-message-container.test.js
index 8c57cf268..5e8773529 100644
--- a/ui/app/pages/send/send-content/send-row-wrapper/send-row-error-message/tests/send-row-error-message-container.test.js
+++ b/ui/app/pages/send/send-content/send-row-wrapper/send-row-error-message/tests/send-row-error-message-container.test.js
@@ -20,7 +20,8 @@ describe('send-row-error-message container', function () {
it('should map the correct properties to props', function () {
assert.deepEqual(mapStateToProps('mockState', { errorType: 'someType' }), {
errors: 'mockErrors:mockState',
- errorType: 'someType' })
+ errorType: 'someType',
+ })
})
})
diff --git a/ui/app/pages/send/send-content/send-row-wrapper/tests/send-row-wrapper-component.test.js b/ui/app/pages/send/send-content/send-row-wrapper/tests/send-row-wrapper-component.test.js
index 6d793c1bd..00f3ceb7f 100644
--- a/ui/app/pages/send/send-content/send-row-wrapper/tests/send-row-wrapper-component.test.js
+++ b/ui/app/pages/send/send-content/send-row-wrapper/tests/send-row-wrapper-component.test.js
@@ -1,7 +1,7 @@
-import React from 'react'
import assert from 'assert'
+import React from 'react'
import { shallow } from 'enzyme'
-import SendRowWrapper from '../send-row-wrapper.component.js'
+import SendRowWrapper from '../send-row-wrapper.component'
import SendRowErrorMessage from '../send-row-error-message/send-row-error-message.container'
diff --git a/ui/app/pages/send/send-content/tests/send-content-component.test.js b/ui/app/pages/send/send-content/tests/send-content-component.test.js
index 01dc83277..dff83a610 100644
--- a/ui/app/pages/send/send-content/tests/send-content-component.test.js
+++ b/ui/app/pages/send/send-content/tests/send-content-component.test.js
@@ -1,7 +1,7 @@
-import React from 'react'
import assert from 'assert'
+import React from 'react'
import { shallow } from 'enzyme'
-import SendContent from '../send-content.component.js'
+import SendContent from '../send-content.component'
import PageContainerContent from '../../../../components/ui/page-container/page-container-content.component'
import SendAmountRow from '../send-amount-row/send-amount-row.container'
@@ -18,7 +18,7 @@ describe('SendContent Component', function () {
,
- { context: { t: (str) => str + '_t' } },
+ { context: { t: (str) => `${str}_t` } },
)
})
diff --git a/ui/app/pages/send/send-footer/send-footer.container.js b/ui/app/pages/send/send-footer/send-footer.container.js
index 02379a9e6..6ffda4952 100644
--- a/ui/app/pages/send/send-footer/send-footer.container.js
+++ b/ui/app/pages/send/send-footer/send-footer.container.js
@@ -26,13 +26,13 @@ import {
getRenderableEstimateDataForSmallButtonsFromGWEI,
getDefaultActiveButtonIndex,
} from '../../../selectors'
+import { getMostRecentOverviewPage } from '../../../ducks/history/history'
import SendFooter from './send-footer.component'
import {
addressIsNew,
constructTxParams,
constructUpdatedTx,
} from './send-footer.utils'
-import { getMostRecentOverviewPage } from '../../../ducks/history/history'
export default connect(mapStateToProps, mapDispatchToProps)(SendFooter)
diff --git a/ui/app/pages/send/send-footer/send-footer.utils.js b/ui/app/pages/send/send-footer/send-footer.utils.js
index 9235f6755..2fec545dc 100644
--- a/ui/app/pages/send/send-footer/send-footer.utils.js
+++ b/ui/app/pages/send/send-footer/send-footer.utils.js
@@ -55,15 +55,15 @@ export function constructUpdatedTx ({
}
if (sendToken) {
- const data = TOKEN_TRANSFER_FUNCTION_SIGNATURE + Array.prototype.map.call(
- ethAbi.rawEncode(['address', 'uint256'], [to, ethUtil.addHexPrefix(amount)]),
- (x) => ('00' + x.toString(16)).slice(-2),
- ).join('')
-
Object.assign(editingTx.txParams, addHexPrefixToObjectValues({
value: '0',
to: sendToken.address,
- data,
+ data: (
+ TOKEN_TRANSFER_FUNCTION_SIGNATURE + Array.prototype.map.call(
+ ethAbi.rawEncode(['address', 'uint256'], [to, ethUtil.addHexPrefix(amount)]),
+ (x) => (`00${x.toString(16)}`).slice(-2),
+ ).join('')
+ ),
}))
}
diff --git a/ui/app/pages/send/send-footer/tests/send-footer-component.test.js b/ui/app/pages/send/send-footer/tests/send-footer-component.test.js
index 12317cf09..0ddd961ee 100644
--- a/ui/app/pages/send/send-footer/tests/send-footer-component.test.js
+++ b/ui/app/pages/send/send-footer/tests/send-footer-component.test.js
@@ -1,9 +1,9 @@
-import React from 'react'
import assert from 'assert'
+import React from 'react'
import { shallow } from 'enzyme'
import sinon from 'sinon'
import { CONFIRM_TRANSACTION_ROUTE } from '../../../../helpers/constants/routes'
-import SendFooter from '../send-footer.component.js'
+import SendFooter from '../send-footer.component'
import PageContainerFooter from '../../../../components/ui/page-container/page-container-footer'
describe('SendFooter Component', function () {
@@ -18,7 +18,7 @@ describe('SendFooter Component', function () {
const historySpies = {
push: sinon.spy(),
}
- const MOCK_EVENT = { preventDefault: () => {} }
+ const MOCK_EVENT = { preventDefault: () => undefined }
before(function () {
sinon.spy(SendFooter.prototype, 'onCancel')
@@ -83,7 +83,6 @@ describe('SendFooter Component', function () {
})
})
-
describe('formShouldBeDisabled()', function () {
const config = {
'should return true if inError is truthy': {
diff --git a/ui/app/pages/send/send-footer/tests/send-footer-container.test.js b/ui/app/pages/send/send-footer/tests/send-footer-container.test.js
index 54040bfd7..314503e0d 100644
--- a/ui/app/pages/send/send-footer/tests/send-footer-container.test.js
+++ b/ui/app/pages/send/send-footer/tests/send-footer-container.test.js
@@ -97,7 +97,7 @@ describe('send-footer container', function () {
)
assert.deepEqual(
actionSpies.signTokenTx.getCall(0).args,
- [ '0xabc', 'mockTo', 'mockAmount', { value: 'mockAmount' } ],
+ ['0xabc', 'mockTo', 'mockAmount', { value: 'mockAmount' }],
)
})
@@ -125,7 +125,7 @@ describe('send-footer container', function () {
)
assert.deepEqual(
actionSpies.signTx.getCall(0).args,
- [ { value: 'mockAmount' } ],
+ [{ value: 'mockAmount' }],
)
})
})
@@ -168,7 +168,7 @@ describe('send-footer container', function () {
assert.equal(utilsStubs.addressIsNew.getCall(0).args[0], 'mockToAccounts')
assert.deepEqual(
actionSpies.addToAddressBook.getCall(0).args,
- [ '0xmockNewAddress', 'mockNickname' ],
+ ['0xmockNewAddress', 'mockNickname'],
)
})
})
diff --git a/ui/app/pages/send/send-footer/tests/send-footer-utils.test.js b/ui/app/pages/send/send-footer/tests/send-footer-utils.test.js
index c84856c3c..b0f5f6586 100644
--- a/ui/app/pages/send/send-footer/tests/send-footer-utils.test.js
+++ b/ui/app/pages/send/send-footer/tests/send-footer-utils.test.js
@@ -5,7 +5,7 @@ import { TOKEN_TRANSFER_FUNCTION_SIGNATURE } from '../../send.constants'
const stubs = {
rawEncode: sinon.stub().callsFake((arr1, arr2) => {
- return [ ...arr1, ...arr2 ]
+ return [...arr1, ...arr2]
}),
}
diff --git a/ui/app/pages/send/send-header/send-header.container.js b/ui/app/pages/send/send-header/send-header.container.js
index e79d359c7..e89d127d3 100644
--- a/ui/app/pages/send/send-header/send-header.container.js
+++ b/ui/app/pages/send/send-header/send-header.container.js
@@ -1,8 +1,8 @@
import { connect } from 'react-redux'
import { clearSend } from '../../../store/actions'
-import SendHeader from './send-header.component'
import { getTitleKey } from '../../../selectors'
import { getMostRecentOverviewPage } from '../../../ducks/history/history'
+import SendHeader from './send-header.component'
export default connect(mapStateToProps, mapDispatchToProps)(SendHeader)
diff --git a/ui/app/pages/send/send-header/tests/send-header-component.test.js b/ui/app/pages/send/send-header/tests/send-header-component.test.js
index 8e9c75f8f..2844bc879 100644
--- a/ui/app/pages/send/send-header/tests/send-header-component.test.js
+++ b/ui/app/pages/send/send-header/tests/send-header-component.test.js
@@ -1,8 +1,8 @@
-import React from 'react'
import assert from 'assert'
+import React from 'react'
import { shallow } from 'enzyme'
import sinon from 'sinon'
-import SendHeader from '../send-header.component.js'
+import SendHeader from '../send-header.component'
import PageContainerHeader from '../../../../components/ui/page-container/page-container-header'
describe('SendHeader Component', function () {
diff --git a/ui/app/pages/send/send.component.js b/ui/app/pages/send/send.component.js
index e73aa8bf7..ff6a54e58 100644
--- a/ui/app/pages/send/send.component.js
+++ b/ui/app/pages/send/send.component.js
@@ -1,12 +1,12 @@
import React, { Component } from 'react'
import PropTypes from 'prop-types'
+import { debounce } from 'lodash'
import {
getAmountErrorObject,
getGasFeeErrorObject,
getToAddressForGasUpdate,
doesAmountErrorRequireUpdate,
} from './send.utils'
-import { debounce } from 'lodash'
import { getToWarningObject, getToErrorObject } from './send-content/add-recipient/add-recipient'
import SendHeader from './send-header'
import AddRecipient from './send-content/add-recipient'
@@ -14,7 +14,6 @@ import SendContent from './send-content'
import SendFooter from './send-footer'
import EnsInput from './send-content/add-recipient/ens-input'
-
export default class SendTransactionScreen extends Component {
static propTypes = {
@@ -225,7 +224,8 @@ export default class SendTransactionScreen extends Component {
} = this.props
if (!query) {
- return this.setState({ toError: '', toWarning: '' })
+ this.setState({ toError: '', toWarning: '' })
+ return
}
const toErrorObject = getToErrorObject(query, hasHexData, network)
diff --git a/ui/app/pages/send/send.constants.js b/ui/app/pages/send/send.constants.js
index 7ef707440..c7460fa32 100644
--- a/ui/app/pages/send/send.constants.js
+++ b/ui/app/pages/send/send.constants.js
@@ -2,9 +2,9 @@ import ethUtil from 'ethereumjs-util'
import { conversionUtil, multiplyCurrencies } from '../../helpers/utils/conversion-util'
const MIN_GAS_PRICE_DEC = '0'
-const MIN_GAS_PRICE_HEX = (parseInt(MIN_GAS_PRICE_DEC)).toString(16)
+const MIN_GAS_PRICE_HEX = (parseInt(MIN_GAS_PRICE_DEC, 10)).toString(16)
const MIN_GAS_LIMIT_DEC = '21000'
-const MIN_GAS_LIMIT_HEX = (parseInt(MIN_GAS_LIMIT_DEC)).toString(16)
+const MIN_GAS_LIMIT_HEX = (parseInt(MIN_GAS_LIMIT_DEC, 10)).toString(16)
const MIN_GAS_PRICE_GWEI = ethUtil.addHexPrefix(conversionUtil(MIN_GAS_PRICE_HEX, {
fromDenomination: 'WEI',
diff --git a/ui/app/pages/send/send.container.js b/ui/app/pages/send/send.container.js
index e4a1c8194..34e876aae 100644
--- a/ui/app/pages/send/send.container.js
+++ b/ui/app/pages/send/send.container.js
@@ -1,5 +1,4 @@
import { connect } from 'react-redux'
-import SendEther from './send.component'
import { withRouter } from 'react-router-dom'
import { compose } from 'redux'
@@ -43,12 +42,13 @@ import {
fetchBasicGasEstimates,
} from '../../ducks/gas/gas.duck'
import { getTokens } from '../../ducks/metamask/metamask'
-import {
- calcGasTotal,
-} from './send.utils.js'
import {
isValidDomainName,
} from '../../helpers/utils/util'
+import {
+ calcGasTotal,
+} from './send.utils'
+import SendEther from './send.component'
function mapStateToProps (state) {
const editingTransactionId = getSendEditingTransactionId(state)
@@ -90,9 +90,9 @@ function mapDispatchToProps (dispatch) {
value,
data,
}) => {
- !editingTransactionId
- ? dispatch(updateGasData({ gasPrice, selectedAddress, sendToken, blockGasLimit, to, value, data }))
- : dispatch(setGasTotal(calcGasTotal(gasLimit, gasPrice)))
+ editingTransactionId
+ ? dispatch(setGasTotal(calcGasTotal(gasLimit, gasPrice)))
+ : dispatch(updateGasData({ gasPrice, selectedAddress, sendToken, blockGasLimit, to, value, data }))
},
updateSendTokenBalance: ({ sendToken, tokenContract, address }) => {
dispatch(updateSendTokenBalance({
diff --git a/ui/app/pages/send/send.scss b/ui/app/pages/send/send.scss
index e9b8cd265..7e2459f4d 100644
--- a/ui/app/pages/send/send.scss
+++ b/ui/app/pages/send/send.scss
@@ -1,3 +1,5 @@
+@import './send-content/send-gas-row/send-gas-row';
+
.send {
&__header {
position: relative;
@@ -6,18 +8,18 @@
padding: 14px 0 3px 0;
.page-container__title {
- @extend %h4;
+ @include H4;
text-align: center;
}
.page-container__header-close-text {
- @extend %link;
-
font-size: 1rem;
line-height: 1.1875rem;
position: absolute;
right: 1rem;
+ top: 6px;
+ width: min-content;
}
}
@@ -48,13 +50,13 @@
overflow-y: auto;
&__link {
- @extend %link;
@extend %row-nowrap;
padding: 1rem;
font-size: 1rem;
border-bottom: 1px solid $alto;
align-items: center;
+ justify-content: flex-start;
}
&__back-caret {
@@ -76,13 +78,12 @@
@extend %col-nowrap;
&__load-more {
- @extend %link;
-
font-size: 0.75rem;
line-height: 1.0625rem;
padding: 0.5rem;
text-align: center;
border-bottom: 1px solid $alto;
+ justify-content: flex-start;
}
}
@@ -91,7 +92,7 @@
}
&__group-label {
- @extend %h8;
+ @include H8;
background-color: $Grey-000;
color: $Grey-600;
@@ -136,7 +137,7 @@
}
&__subtitle {
- @extend %h8;
+ @include H8;
color: $Grey-500;
}
@@ -186,7 +187,7 @@
}
&__input {
- @extend %h6;
+ @include H6;
flex: 1 1 auto;
width: 0;
diff --git a/ui/app/pages/send/send.utils.js b/ui/app/pages/send/send.utils.js
index 7ffc5dcdb..32dc1939a 100644
--- a/ui/app/pages/send/send.utils.js
+++ b/ui/app/pages/send/send.utils.js
@@ -1,3 +1,5 @@
+import abi from 'ethereumjs-abi'
+import ethUtil from 'ethereumjs-util'
import {
addCurrencies,
conversionUtil,
@@ -19,9 +21,6 @@ import {
TOKEN_TRANSFER_FUNCTION_SIGNATURE,
} from './send.constants'
-import abi from 'ethereumjs-abi'
-import ethUtil from 'ethereumjs-util'
-
export {
addGasBuffer,
calcGasTotal,
@@ -69,7 +68,7 @@ function isBalanceSufficient ({
{
value: totalAmount,
fromNumericBase: 'hex',
- conversionRate: conversionRate,
+ conversionRate,
fromCurrency: primaryCurrency,
},
)
@@ -238,6 +237,7 @@ async function estimateGas ({
// if not, fall back to block gasLimit
if (!blockGasLimit) {
+ // eslint-disable-next-line no-param-reassign
blockGasLimit = MIN_GAS_LIMIT_HEX
}
@@ -261,9 +261,9 @@ async function estimateGas ({
if (simulationFailed) {
const estimateWithBuffer = addGasBuffer(paramsForGasEstimate.gas, blockGasLimit, 1.5)
return ethUtil.addHexPrefix(estimateWithBuffer)
- } else {
- throw error
}
+ throw error
+
}
}
@@ -301,11 +301,11 @@ function addGasBuffer (initialGasLimitHex, blockGasLimitHex, bufferMultiplier =
function generateTokenTransferData ({ toAddress = '0x0', amount = '0x0', sendToken }) {
if (!sendToken) {
- return
+ return undefined
}
return TOKEN_TRANSFER_FUNCTION_SIGNATURE + Array.prototype.map.call(
abi.rawEncode(['address', 'uint256'], [toAddress, ethUtil.addHexPrefix(amount)]),
- (x) => ('00' + x.toString(16)).slice(-2),
+ (x) => (`00${x.toString(16)}`).slice(-2),
).join('')
}
@@ -314,7 +314,7 @@ function getToAddressForGasUpdate (...addresses) {
}
function removeLeadingZeroes (str) {
- return str.replace(/^0*(?=\d)/, '')
+ return str.replace(/^0*(?=\d)/u, '')
}
function ellipsify (text, first = 6, last = 4) {
diff --git a/ui/app/pages/send/tests/send-component.test.js b/ui/app/pages/send/tests/send-component.test.js
index 757b8fa63..5a157aa6b 100644
--- a/ui/app/pages/send/tests/send-component.test.js
+++ b/ui/app/pages/send/tests/send-component.test.js
@@ -1,5 +1,5 @@
-import React from 'react'
import assert from 'assert'
+import React from 'react'
import proxyquire from 'proxyquire'
import { shallow } from 'enzyme'
import sinon from 'sinon'
@@ -63,12 +63,12 @@ describe('Send Component', function () {
tokenBalance="mockTokenBalance"
tokenContract={{ method: 'mockTokenMethod' }}
updateAndSetGasLimit={propsMethodSpies.updateAndSetGasLimit}
- qrCodeDetected={() => {}}
- scanQrCode={() => {}}
- updateSendEnsResolution={() => {}}
- updateSendEnsResolutionError={() => {}}
+ qrCodeDetected={() => undefined}
+ scanQrCode={() => undefined}
+ updateSendEnsResolution={() => undefined}
+ updateSendEnsResolutionError={() => undefined}
updateSendErrors={propsMethodSpies.updateSendErrors}
- updateSendTo={() => {}}
+ updateSendTo={() => undefined}
updateSendTokenBalance={propsMethodSpies.updateSendTokenBalance}
resetSendState={propsMethodSpies.resetSendState}
updateToNicknameIfNecessary={propsMethodSpies.updateToNicknameIfNecessary}
diff --git a/ui/app/pages/send/tests/send-container.test.js b/ui/app/pages/send/tests/send-container.test.js
index 84a138d92..6cc39fe31 100644
--- a/ui/app/pages/send/tests/send-container.test.js
+++ b/ui/app/pages/send/tests/send-container.test.js
@@ -21,7 +21,7 @@ proxyquire('../send.container.js', {
return () => ({})
},
},
- 'react-router-dom': { withRouter: () => {} },
+ 'react-router-dom': { withRouter: () => undefined },
'redux': { compose: (_, arg2) => () => arg2() },
'../../store/actions': actionSpies,
'../../ducks/send/send.duck': duckActionSpies,
@@ -67,7 +67,7 @@ describe('send container', function () {
it('should dispatch an updateGasData action when editingTransactionId is falsy', function () {
const { gasPrice, selectedAddress, sendToken, blockGasLimit, to, value, data } = mockProps
mapDispatchToPropsObject.updateAndSetGasLimit(
- Object.assign({}, mockProps, { editingTransactionId: false }),
+ { ...mockProps, editingTransactionId: false },
)
assert(dispatchSpy.calledOnce)
assert.deepEqual(
@@ -85,7 +85,7 @@ describe('send container', function () {
}
it('should dispatch an action', function () {
- mapDispatchToPropsObject.updateSendTokenBalance(Object.assign({}, mockProps))
+ mapDispatchToPropsObject.updateSendTokenBalance({ ...mockProps })
assert(dispatchSpy.calledOnce)
assert.deepEqual(
actionSpies.updateSendTokenBalance.getCall(0).args[0],
diff --git a/ui/app/pages/send/tests/send-utils.test.js b/ui/app/pages/send/tests/send-utils.test.js
index 08bc30289..0d23947ff 100644
--- a/ui/app/pages/send/tests/send-utils.test.js
+++ b/ui/app/pages/send/tests/send-utils.test.js
@@ -10,18 +10,19 @@ import {
const stubs = {
addCurrencies: sinon.stub().callsFake((a, b) => {
- if (String(a).match(/^0x.+/)) {
- a = Number(String(a).slice(2))
+ let [a1, b1] = [a, b]
+ if (String(a).match(/^0x.+/u)) {
+ a1 = Number(String(a).slice(2))
}
- if (String(b).match(/^0x.+/)) {
- b = Number(String(b).slice(2))
+ if (String(b).match(/^0x.+/u)) {
+ b1 = Number(String(b).slice(2))
}
- return a + b
+ return a1 + b1
}),
conversionUtil: sinon.stub().callsFake((val) => parseInt(val, 16)),
conversionGTE: sinon.stub().callsFake((obj1, obj2) => obj1.value >= obj2.value),
multiplyCurrencies: sinon.stub().callsFake((a, b) => `${a}x${b}`),
- calcTokenAmount: sinon.stub().callsFake((a, d) => 'calc:' + a + d),
+ calcTokenAmount: sinon.stub().callsFake((a, d) => `calc:${a}${d}`),
rawEncode: sinon.stub().returns([16, 1100]),
conversionGreaterThan: sinon.stub().callsFake((obj1, obj2) => obj1.value > obj2.value),
conversionLessThan: sinon.stub().callsFake((obj1, obj2) => obj1.value < obj2.value),
@@ -69,7 +70,7 @@ describe('send utils', function () {
toNumericBase: 'hex',
multiplicandBase: 16,
multiplierBase: 16,
- } ],
+ }],
)
})
})
@@ -294,8 +295,8 @@ describe('send utils', function () {
to: '0xisContract',
estimateGasMethod: sinon.stub().callsFake(
({ to }) => {
- if (typeof to === 'string' && to.match(/willFailBecauseOf:/)) {
- throw new Error(to.match(/:(.+)$/)[1])
+ if (typeof to === 'string' && to.match(/willFailBecauseOf:/u)) {
+ throw new Error(to.match(/:(.+)$/u)[1])
}
return { toString: (n) => `0xabc${n}` }
},
@@ -311,7 +312,7 @@ describe('send utils', function () {
beforeEach(function () {
global.eth = {
getCode: sinon.stub().callsFake(
- (address) => Promise.resolve(address.match(/isContract/) ? 'not-0x' : '0x'),
+ (address) => Promise.resolve(address.match(/isContract/u) ? 'not-0x' : '0x'),
),
}
})
@@ -326,32 +327,32 @@ describe('send utils', function () {
assert.equal(baseMockParams.estimateGasMethod.callCount, 1)
assert.deepEqual(
baseMockParams.estimateGasMethod.getCall(0).args[0],
- Object.assign({ gasPrice: undefined, value: undefined }, baseExpectedCall),
+ { gasPrice: undefined, value: undefined, ...baseExpectedCall },
)
assert.equal(result, '0xabc16')
})
it('should call ethQuery.estimateGas with the expected params when initialGasLimitHex is lower than the upperGasLimit', async function () {
- const result = await estimateGas(Object.assign({}, baseMockParams, { blockGasLimit: '0xbcd' }))
+ const result = await estimateGas({ ...baseMockParams, blockGasLimit: '0xbcd' })
assert.equal(baseMockParams.estimateGasMethod.callCount, 1)
assert.deepEqual(
baseMockParams.estimateGasMethod.getCall(0).args[0],
- Object.assign({ gasPrice: undefined, value: undefined }, baseExpectedCall, { gas: '0xbcdx0.95' }),
+ { gasPrice: undefined, value: undefined, ...baseExpectedCall, gas: '0xbcdx0.95' },
)
assert.equal(result, '0xabc16x1.5')
})
it('should call ethQuery.estimateGas with a value of 0x0 and the expected data and to if passed a sendToken', async function () {
- const result = await estimateGas(Object.assign({ data: 'mockData', sendToken: { address: 'mockAddress' } }, baseMockParams))
+ const result = await estimateGas({ data: 'mockData', sendToken: { address: 'mockAddress' }, ...baseMockParams })
assert.equal(baseMockParams.estimateGasMethod.callCount, 1)
assert.deepEqual(
baseMockParams.estimateGasMethod.getCall(0).args[0],
- Object.assign({}, baseExpectedCall, {
- gasPrice: undefined,
+ {
+ ...baseExpectedCall, gasPrice: undefined,
value: '0x0',
data: '0xa9059cbb104c',
to: 'mockAddress',
- }),
+ },
)
assert.equal(result, '0xabc16')
})
@@ -370,46 +371,40 @@ describe('send utils', function () {
it(`should return ${SIMPLE_GAS_COST} if ethQuery.getCode does not return '0x'`, async function () {
assert.equal(baseMockParams.estimateGasMethod.callCount, 0)
- const result = await estimateGas(Object.assign({}, baseMockParams, { to: '0x123' }))
+ const result = await estimateGas({ ...baseMockParams, to: '0x123' })
assert.equal(result, SIMPLE_GAS_COST)
})
it(`should return ${SIMPLE_GAS_COST} if not passed a sendToken or truthy to address`, async function () {
assert.equal(baseMockParams.estimateGasMethod.callCount, 0)
- const result = await estimateGas(Object.assign({}, baseMockParams, { to: null }))
+ const result = await estimateGas({ ...baseMockParams, to: null })
assert.equal(result, SIMPLE_GAS_COST)
})
it(`should not return ${SIMPLE_GAS_COST} if passed a sendToken`, async function () {
assert.equal(baseMockParams.estimateGasMethod.callCount, 0)
- const result = await estimateGas(Object.assign({}, baseMockParams, { to: '0x123', sendToken: { address: '0x0' } }))
+ const result = await estimateGas({ ...baseMockParams, to: '0x123', sendToken: { address: '0x0' } })
assert.notEqual(result, SIMPLE_GAS_COST)
})
it(`should return ${BASE_TOKEN_GAS_COST} if passed a sendToken but no to address`, async function () {
- const result = await estimateGas(Object.assign({}, baseMockParams, { to: null, sendToken: { address: '0x0' } }))
+ const result = await estimateGas({ ...baseMockParams, to: null, sendToken: { address: '0x0' } })
assert.equal(result, BASE_TOKEN_GAS_COST)
})
it(`should return the adjusted blockGasLimit if it fails with a 'Transaction execution error.'`, async function () {
- const result = await estimateGas(Object.assign({}, baseMockParams, {
- to: 'isContract willFailBecauseOf:Transaction execution error.',
- }))
+ const result = await estimateGas({ ...baseMockParams, to: 'isContract willFailBecauseOf:Transaction execution error.' })
assert.equal(result, '0x64x0.95')
})
it(`should return the adjusted blockGasLimit if it fails with a 'gas required exceeds allowance or always failing transaction.'`, async function () {
- const result = await estimateGas(Object.assign({}, baseMockParams, {
- to: 'isContract willFailBecauseOf:gas required exceeds allowance or always failing transaction.',
- }))
+ const result = await estimateGas({ ...baseMockParams, to: 'isContract willFailBecauseOf:gas required exceeds allowance or always failing transaction.' })
assert.equal(result, '0x64x0.95')
})
it(`should reject other errors`, async function () {
try {
- await estimateGas(Object.assign({}, baseMockParams, {
- to: 'isContract willFailBecauseOf:some other error',
- }))
+ await estimateGas({ ...baseMockParams, to: 'isContract willFailBecauseOf:some other error' })
} catch (err) {
assert.equal(err.message, 'some other error')
}
diff --git a/ui/app/pages/settings/advanced-tab/advanced-tab.component.js b/ui/app/pages/settings/advanced-tab/advanced-tab.component.js
index df952eff6..055ad2977 100644
--- a/ui/app/pages/settings/advanced-tab/advanced-tab.component.js
+++ b/ui/app/pages/settings/advanced-tab/advanced-tab.component.js
@@ -422,7 +422,7 @@ export default class AdvancedTab extends PureComponent {
handleIpfsGatewaySave () {
const url = new URL(addUrlProtocolPrefix(this.state.ipfsGateway))
- const host = url.host
+ const { host } = url
this.props.setIpfsGateway(host)
}
@@ -489,9 +489,9 @@ export default class AdvancedTab extends PureComponent {
function addUrlProtocolPrefix (urlString) {
if (!urlString.match(
- /(^http:\/\/)|(^https:\/\/)/,
+ /(^http:\/\/)|(^https:\/\/)/u,
)) {
- return 'https://' + urlString
+ return `https://${urlString}`
}
return urlString
}
diff --git a/ui/app/pages/settings/advanced-tab/advanced-tab.container.js b/ui/app/pages/settings/advanced-tab/advanced-tab.container.js
index c36bc204f..64777f4fa 100644
--- a/ui/app/pages/settings/advanced-tab/advanced-tab.container.js
+++ b/ui/app/pages/settings/advanced-tab/advanced-tab.container.js
@@ -1,4 +1,3 @@
-import AdvancedTab from './advanced-tab.component'
import { compose } from 'redux'
import { connect } from 'react-redux'
import { withRouter } from 'react-router-dom'
@@ -14,6 +13,7 @@ import {
setIpfsGateway,
} from '../../../store/actions'
import { getPreferences } from '../../../selectors'
+import AdvancedTab from './advanced-tab.component'
export const mapStateToProps = (state) => {
const { appState: { warning }, metamask } = state
diff --git a/ui/app/pages/settings/advanced-tab/tests/advanced-tab-component.test.js b/ui/app/pages/settings/advanced-tab/tests/advanced-tab-component.test.js
index 69fe064c8..548623187 100644
--- a/ui/app/pages/settings/advanced-tab/tests/advanced-tab-component.test.js
+++ b/ui/app/pages/settings/advanced-tab/tests/advanced-tab-component.test.js
@@ -1,5 +1,5 @@
-import React from 'react'
import assert from 'assert'
+import React from 'react'
import sinon from 'sinon'
import { shallow } from 'enzyme'
import AdvancedTab from '../advanced-tab.component'
@@ -10,10 +10,10 @@ describe('AdvancedTab Component', function () {
const root = shallow(
{}}
- setIpfsGateway={() => {}}
- setShowFiatConversionOnTestnetsPreference={() => {}}
- setThreeBoxSyncingPermission={() => {}}
+ setAutoLockTimeLimit={() => undefined}
+ setIpfsGateway={() => undefined}
+ setShowFiatConversionOnTestnetsPreference={() => undefined}
+ setThreeBoxSyncingPermission={() => undefined}
threeBoxDisabled
threeBoxSyncingAllowed={false}
/>,
@@ -33,9 +33,9 @@ describe('AdvancedTab Component', function () {
{}}
- setShowFiatConversionOnTestnetsPreference={() => {}}
- setThreeBoxSyncingPermission={() => {}}
+ setIpfsGateway={() => undefined}
+ setShowFiatConversionOnTestnetsPreference={() => undefined}
+ setThreeBoxSyncingPermission={() => undefined}
threeBoxDisabled
threeBoxSyncingAllowed={false}
/>,
diff --git a/ui/app/pages/settings/alerts-tab/alerts-tab.js b/ui/app/pages/settings/alerts-tab/alerts-tab.js
index 1c503e06f..80aa3b00f 100644
--- a/ui/app/pages/settings/alerts-tab/alerts-tab.js
+++ b/ui/app/pages/settings/alerts-tab/alerts-tab.js
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types'
import { useDispatch, useSelector } from 'react-redux'
import { ALERT_TYPES } from '../../../../../app/scripts/controllers/alert'
-import Tooltip from '../../../components/ui/tooltip-v2'
+import Tooltip from '../../../components/ui/tooltip'
import ToggleButton from '../../../components/ui/toggle-button'
import { setAlertEnabledness } from '../../../store/actions'
import { getAlertEnabledness } from '../../../ducks/metamask/metamask'
diff --git a/ui/app/pages/settings/contact-list-tab/add-contact/add-contact.component.js b/ui/app/pages/settings/contact-list-tab/add-contact/add-contact.component.js
index 20ebdcee6..12f420186 100644
--- a/ui/app/pages/settings/contact-list-tab/add-contact/add-contact.component.js
+++ b/ui/app/pages/settings/contact-list-tab/add-contact/add-contact.component.js
@@ -1,12 +1,12 @@
import React, { PureComponent } from 'react'
import PropTypes from 'prop-types'
+import { debounce } from 'lodash'
import Identicon from '../../../../components/ui/identicon'
import TextField from '../../../../components/ui/text-field'
import { CONTACT_LIST_ROUTE } from '../../../../helpers/constants/routes'
import { isValidAddress, isValidDomainName } from '../../../../helpers/utils/util'
import EnsInput from '../../../send/send-content/add-recipient/ens-input'
import PageContainerFooter from '../../../../components/ui/page-container/page-container-footer'
-import { debounce } from 'lodash'
export default class AddContact extends PureComponent {
diff --git a/ui/app/pages/settings/contact-list-tab/add-contact/add-contact.container.js b/ui/app/pages/settings/contact-list-tab/add-contact/add-contact.container.js
index 66c40e51a..9c5993e4f 100644
--- a/ui/app/pages/settings/contact-list-tab/add-contact/add-contact.container.js
+++ b/ui/app/pages/settings/contact-list-tab/add-contact/add-contact.container.js
@@ -1,4 +1,3 @@
-import AddContact from './add-contact.component'
import { compose } from 'redux'
import { connect } from 'react-redux'
import { withRouter } from 'react-router-dom'
@@ -6,6 +5,7 @@ import { addToAddressBook, showQrScanner, qrCodeDetected } from '../../../../sto
import {
getQrCodeData,
} from '../../../../selectors'
+import AddContact from './add-contact.component'
const mapStateToProps = (state) => {
return {
diff --git a/ui/app/pages/settings/contact-list-tab/contact-list-tab.component.js b/ui/app/pages/settings/contact-list-tab/contact-list-tab.component.js
index 835963a83..74cc1b89b 100644
--- a/ui/app/pages/settings/contact-list-tab/contact-list-tab.component.js
+++ b/ui/app/pages/settings/contact-list-tab/contact-list-tab.component.js
@@ -1,15 +1,15 @@
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import ContactList from '../../../components/app/contact-list'
-import EditContact from './edit-contact'
-import AddContact from './add-contact'
-import ViewContact from './view-contact'
-import MyAccounts from './my-accounts'
import {
CONTACT_ADD_ROUTE,
CONTACT_VIEW_ROUTE,
CONTACT_MY_ACCOUNTS_ROUTE,
} from '../../../helpers/constants/routes'
+import EditContact from './edit-contact'
+import AddContact from './add-contact'
+import ViewContact from './view-contact'
+import MyAccounts from './my-accounts'
export default class ContactListTab extends Component {
static contextTypes = {
@@ -30,7 +30,7 @@ export default class ContactListTab extends Component {
renderAddresses () {
const { addressBook, history, selectedAddress } = this.props
- const contacts = addressBook.filter(({ name }) => !!name)
+ const contacts = addressBook.filter(({ name }) => Boolean(name))
const nonContacts = addressBook.filter(({ name }) => !name)
return (
@@ -121,6 +121,7 @@ export default class ContactListTab extends Component {
} else if (!hideAddressBook && showingMyAccounts) {
return ()
}
+ return null
}
render () {
diff --git a/ui/app/pages/settings/contact-list-tab/contact-list-tab.container.js b/ui/app/pages/settings/contact-list-tab/contact-list-tab.container.js
index d3bb1799a..597b74683 100644
--- a/ui/app/pages/settings/contact-list-tab/contact-list-tab.container.js
+++ b/ui/app/pages/settings/contact-list-tab/contact-list-tab.container.js
@@ -1,4 +1,3 @@
-import ContactListTab from './contact-list-tab.component'
import { compose } from 'redux'
import { connect } from 'react-redux'
import { withRouter } from 'react-router-dom'
@@ -14,13 +13,13 @@ import {
CONTACT_MY_ACCOUNTS_VIEW_ROUTE,
CONTACT_MY_ACCOUNTS_EDIT_ROUTE,
} from '../../../helpers/constants/routes'
-
+import ContactListTab from './contact-list-tab.component'
const mapStateToProps = (state, ownProps) => {
const { location } = ownProps
const { pathname } = location
- const pathNameTail = pathname.match(/[^/]+$/)[0]
+ const pathNameTail = pathname.match(/[^/]+$/u)[0]
const pathNameTailIsAddress = pathNameTail.includes('0x')
const viewingContact = Boolean(pathname.match(CONTACT_VIEW_ROUTE) || pathname.match(CONTACT_MY_ACCOUNTS_VIEW_ROUTE))
diff --git a/ui/app/pages/settings/contact-list-tab/edit-contact/edit-contact.container.js b/ui/app/pages/settings/contact-list-tab/edit-contact/edit-contact.container.js
index 3766f1ac8..b372fae5f 100644
--- a/ui/app/pages/settings/contact-list-tab/edit-contact/edit-contact.container.js
+++ b/ui/app/pages/settings/contact-list-tab/edit-contact/edit-contact.container.js
@@ -1,4 +1,3 @@
-import EditContact from './edit-contact.component'
import { compose } from 'redux'
import { connect } from 'react-redux'
import { withRouter } from 'react-router-dom'
@@ -11,11 +10,12 @@ import {
CONTACT_LIST_ROUTE,
} from '../../../../helpers/constants/routes'
import { addToAddressBook, removeFromAddressBook, setAccountLabel } from '../../../../store/actions'
+import EditContact from './edit-contact.component'
const mapStateToProps = (state, ownProps) => {
const { location } = ownProps
const { pathname } = location
- const pathNameTail = pathname.match(/[^/]+$/)[0]
+ const pathNameTail = pathname.match(/[^/]+$/u)[0]
const pathNameTailIsAddress = pathNameTail.includes('0x')
const address = pathNameTailIsAddress ? pathNameTail.toLowerCase() : ownProps.match.params.id
diff --git a/ui/app/pages/settings/contact-list-tab/index.scss b/ui/app/pages/settings/contact-list-tab/index.scss
index 02273a66f..9c33c3701 100644
--- a/ui/app/pages/settings/contact-list-tab/index.scss
+++ b/ui/app/pages/settings/contact-list-tab/index.scss
@@ -33,7 +33,6 @@
&__header,
&__header--edit {
&__name {
- font-family: Roboto;
font-style: normal;
font-weight: normal;
font-size: 24px;
@@ -179,7 +178,6 @@
}
&__header {
- font-family: Roboto;
font-style: normal;
font-weight: normal;
font-size: 18px;
@@ -193,7 +191,6 @@
}
&__text {
- font-family: Roboto;
font-style: normal;
font-weight: normal;
font-size: 14px;
diff --git a/ui/app/pages/settings/contact-list-tab/my-accounts/my-accounts.container.js b/ui/app/pages/settings/contact-list-tab/my-accounts/my-accounts.container.js
index 86e569e3d..6dab955b6 100644
--- a/ui/app/pages/settings/contact-list-tab/my-accounts/my-accounts.container.js
+++ b/ui/app/pages/settings/contact-list-tab/my-accounts/my-accounts.container.js
@@ -1,8 +1,8 @@
-import ViewContact from './my-accounts.component'
import { compose } from 'redux'
import { connect } from 'react-redux'
import { withRouter } from 'react-router-dom'
import { accountsWithSendEtherInfoSelector } from '../../../../selectors'
+import ViewContact from './my-accounts.component'
const mapStateToProps = (state) => {
const myAccounts = accountsWithSendEtherInfoSelector(state)
diff --git a/ui/app/pages/settings/contact-list-tab/view-contact/view-contact.component.js b/ui/app/pages/settings/contact-list-tab/view-contact/view-contact.component.js
index ce9312c87..6256c1134 100644
--- a/ui/app/pages/settings/contact-list-tab/view-contact/view-contact.component.js
+++ b/ui/app/pages/settings/contact-list-tab/view-contact/view-contact.component.js
@@ -6,17 +6,17 @@ import Identicon from '../../../../components/ui/identicon'
import Copy from '../../../../components/ui/icon/copy-icon.component'
import Button from '../../../../components/ui/button/button.component'
-import Tooltip from '../../../../components/ui/tooltip-v2'
+import Tooltip from '../../../../components/ui/tooltip'
import { useI18nContext } from '../../../../hooks/useI18nContext'
import { useCopyToClipboard } from '../../../../hooks/useCopyToClipboard'
function quadSplit (address) {
return (
- '0x ' +
- address
- .slice(2)
- .match(/.{1,4}/g)
- .join(' ')
+ `0x ${
+ address
+ .slice(2)
+ .match(/.{1,4}/ug)
+ .join(' ')}`
)
}
diff --git a/ui/app/pages/settings/contact-list-tab/view-contact/view-contact.container.js b/ui/app/pages/settings/contact-list-tab/view-contact/view-contact.container.js
index 7f7c5d8c1..87bf707db 100644
--- a/ui/app/pages/settings/contact-list-tab/view-contact/view-contact.container.js
+++ b/ui/app/pages/settings/contact-list-tab/view-contact/view-contact.container.js
@@ -1,4 +1,3 @@
-import ViewContact from './view-contact.component'
import { compose } from 'redux'
import { connect } from 'react-redux'
import { withRouter } from 'react-router-dom'
@@ -11,11 +10,12 @@ import {
CONTACT_MY_ACCOUNTS_ROUTE,
CONTACT_MY_ACCOUNTS_VIEW_ROUTE,
} from '../../../../helpers/constants/routes'
+import ViewContact from './view-contact.component'
const mapStateToProps = (state, ownProps) => {
const { location } = ownProps
const { pathname } = location
- const pathNameTail = pathname.match(/[^/]+$/)[0]
+ const pathNameTail = pathname.match(/[^/]+$/u)[0]
const pathNameTailIsAddress = pathNameTail.includes('0x')
const address = pathNameTailIsAddress ? pathNameTail.toLowerCase() : ownProps.match.params.id
diff --git a/ui/app/pages/settings/index.scss b/ui/app/pages/settings/index.scss
index 0c4371cf4..b72deb39e 100644
--- a/ui/app/pages/settings/index.scss
+++ b/ui/app/pages/settings/index.scss
@@ -70,7 +70,6 @@
}
&__sub-header-text {
- font-family: Roboto;
font-style: normal;
font-weight: normal;
font-size: 20px;
diff --git a/ui/app/pages/settings/info-tab/index.scss b/ui/app/pages/settings/info-tab/index.scss
index 9cc7e21b2..3cbe63b5c 100644
--- a/ui/app/pages/settings/info-tab/index.scss
+++ b/ui/app/pages/settings/info-tab/index.scss
@@ -21,6 +21,11 @@
}
}
+ &__link-text {
+ width: max-content;
+ padding: 0;
+ }
+
&__link-item {
padding: 15px 0;
@@ -29,10 +34,6 @@
}
}
- &__link-text {
- @extend %link;
- }
-
&__version-number {
padding-top: 5px;
font-size: 13px;
diff --git a/ui/app/pages/settings/info-tab/info-tab.component.js b/ui/app/pages/settings/info-tab/info-tab.component.js
index 9d522a3a1..21c2ef5f4 100644
--- a/ui/app/pages/settings/info-tab/info-tab.component.js
+++ b/ui/app/pages/settings/info-tab/info-tab.component.js
@@ -1,5 +1,6 @@
import React, { PureComponent } from 'react'
import PropTypes from 'prop-types'
+import Button from '../../../components/ui/button'
export default class InfoTab extends PureComponent {
state = {
@@ -19,71 +20,71 @@ export default class InfoTab extends PureComponent {
{ t('links') }
)
diff --git a/ui/app/pages/settings/networks-tab/index.scss b/ui/app/pages/settings/networks-tab/index.scss
index 92504f641..f6a69af39 100644
--- a/ui/app/pages/settings/networks-tab/index.scss
+++ b/ui/app/pages/settings/networks-tab/index.scss
@@ -96,7 +96,6 @@
}
&__network-form-label {
- font-family: Roboto;
font-style: normal;
font-weight: normal;
font-size: 14px;
@@ -177,7 +176,6 @@
&__networks-list-name {
margin-left: 11px;
- font-family: Roboto;
font-style: normal;
font-weight: normal;
font-size: 16px;
@@ -187,6 +185,11 @@
&:hover {
cursor: pointer;
}
+
+ svg {
+ margin-left: 10px;
+ padding-top: 3px;
+ }
}
&__networks-list-arrow {
@@ -216,6 +219,11 @@
font-weight: bold;
color: #000;
}
+
+ &__networks-list-name--disabled {
+ font-weight: 300;
+ color: #cdcdcd;
+ }
}
.network-form {
diff --git a/ui/app/pages/settings/networks-tab/network-form/network-form.component.js b/ui/app/pages/settings/networks-tab/network-form/network-form.component.js
index 34209983a..024af3a31 100644
--- a/ui/app/pages/settings/networks-tab/network-form/network-form.component.js
+++ b/ui/app/pages/settings/networks-tab/network-form/network-form.component.js
@@ -206,15 +206,15 @@ export default class NetworkForm extends PureComponent {
}
validateChainId = (chainId) => {
- this.setErrorTo('chainId', !!chainId && Number.isNaN(parseInt(chainId))
+ // eslint-disable-next-line radix
+ this.setErrorTo('chainId', Boolean(chainId) && Number.isNaN(parseInt(chainId))
? `${this.context.t('invalidInput')} chainId`
- : '',
- )
+ : '')
}
isValidWhenAppended = (url) => {
const appendedRpc = `http://${url}`
- return validUrl.isWebUri(appendedRpc) && !url.match(/^https?:\/\/$/)
+ return validUrl.isWebUri(appendedRpc) && !url.match(/^https?:\/\/$/u)
}
validateBlockExplorerURL = (url, stateKey) => {
diff --git a/ui/app/pages/settings/networks-tab/networks-tab.component.js b/ui/app/pages/settings/networks-tab/networks-tab.component.js
index e0046edfc..c9450e4c5 100644
--- a/ui/app/pages/settings/networks-tab/networks-tab.component.js
+++ b/ui/app/pages/settings/networks-tab/networks-tab.component.js
@@ -1,12 +1,13 @@
import React, { PureComponent } from 'react'
import PropTypes from 'prop-types'
+import classnames from 'classnames'
import { SETTINGS_ROUTE } from '../../../helpers/constants/routes'
import { ENVIRONMENT_TYPE_POPUP } from '../../../../../app/scripts/lib/enums'
import { getEnvironmentType } from '../../../../../app/scripts/lib/util'
-import classnames from 'classnames'
import Button from '../../../components/ui/button'
-import NetworkForm from './network-form'
+import LockIcon from '../../../components/ui/lock-icon'
import NetworkDropdownIcon from '../../../components/app/dropdowns/components/network-dropdown-icon'
+import NetworkForm from './network-form'
export default class NetworksTab extends PureComponent {
static contextTypes = {
@@ -103,7 +104,7 @@ export default class NetworksTab extends PureComponent {
return (
{
setNetworksTabAddMode(false)
@@ -117,9 +118,17 @@ export default class NetworksTab extends PureComponent {
{ label || this.context.t(labelKey) }
+ { currentProviderType !== 'rpc' && (
+
+ ) }
diff --git a/ui/app/pages/settings/networks-tab/networks-tab.container.js b/ui/app/pages/settings/networks-tab/networks-tab.container.js
index 9377a1111..5b35f3ba5 100644
--- a/ui/app/pages/settings/networks-tab/networks-tab.container.js
+++ b/ui/app/pages/settings/networks-tab/networks-tab.container.js
@@ -1,4 +1,3 @@
-import NetworksTab from './networks-tab.component'
import { compose } from 'redux'
import { connect } from 'react-redux'
import { withRouter } from 'react-router-dom'
@@ -10,6 +9,7 @@ import {
editRpc,
showModal,
} from '../../../store/actions'
+import NetworksTab from './networks-tab.component'
import { defaultNetworksData } from './networks-tab.constants'
const defaultNetworks = defaultNetworksData.map((network) => ({ ...network, viewOnly: true }))
@@ -36,7 +36,7 @@ const mapStateToProps = (state) => {
}
})
- const networksToRender = [ ...defaultNetworks, ...frequentRpcNetworkListDetails ]
+ const networksToRender = [...defaultNetworks, ...frequentRpcNetworkListDetails]
let selectedNetwork = networksToRender.find((network) => network.rpcUrl === networksTabSelectedRpcUrl) || {}
const networkIsSelected = Boolean(selectedNetwork.rpcUrl)
diff --git a/ui/app/pages/settings/security-tab/security-tab.container.js b/ui/app/pages/settings/security-tab/security-tab.container.js
index 9852b685e..cfbcfbeb9 100644
--- a/ui/app/pages/settings/security-tab/security-tab.container.js
+++ b/ui/app/pages/settings/security-tab/security-tab.container.js
@@ -1,4 +1,3 @@
-import SecurityTab from './security-tab.component'
import { compose } from 'redux'
import { connect } from 'react-redux'
import { withRouter } from 'react-router-dom'
@@ -7,6 +6,7 @@ import {
setParticipateInMetaMetrics,
setUsePhishDetect,
} from '../../../store/actions'
+import SecurityTab from './security-tab.component'
const mapStateToProps = (state) => {
const { appState: { warning }, metamask } = state
diff --git a/ui/app/pages/settings/security-tab/tests/security-tab.test.js b/ui/app/pages/settings/security-tab/tests/security-tab.test.js
index 1ac996d05..fd1b8c085 100644
--- a/ui/app/pages/settings/security-tab/tests/security-tab.test.js
+++ b/ui/app/pages/settings/security-tab/tests/security-tab.test.js
@@ -1,8 +1,8 @@
-import React from 'react'
import assert from 'assert'
+import React from 'react'
import sinon from 'sinon'
import { mount } from 'enzyme'
-import SecurityTab from '../index'
+import SecurityTab from '..'
describe('Security Tab', function () {
let wrapper
@@ -28,7 +28,7 @@ describe('Security Tab', function () {
, {
context: {
t: (str) => str,
- metricsEvent: () => {},
+ metricsEvent: () => undefined,
},
},
)
diff --git a/ui/app/pages/settings/settings-tab/index.scss b/ui/app/pages/settings/settings-tab/index.scss
index 5d9864984..39670e46f 100644
--- a/ui/app/pages/settings/settings-tab/index.scss
+++ b/ui/app/pages/settings/settings-tab/index.scss
@@ -5,12 +5,6 @@
color: $crimson;
}
- &__advanced-link {
- @extend %small-link;
-
- padding-left: 5px;
- }
-
&__rpc-save-button {
align-self: flex-end;
padding: 5px;
diff --git a/ui/app/pages/settings/settings-tab/settings-tab.component.js b/ui/app/pages/settings/settings-tab/settings-tab.component.js
index 39d67b5f9..c7d984f88 100644
--- a/ui/app/pages/settings/settings-tab/settings-tab.component.js
+++ b/ui/app/pages/settings/settings-tab/settings-tab.component.js
@@ -1,6 +1,6 @@
import React, { PureComponent } from 'react'
import PropTypes from 'prop-types'
-import availableCurrencies from '../../../helpers/constants/available-conversions'
+import availableCurrencies from '../../../helpers/constants/available-conversions.json'
import SimpleDropdown from '../../../components/app/dropdowns/simple-dropdown'
import ToggleButton from '../../../components/ui/toggle-button'
import locales from '../../../../../app/_locales/index.json'
@@ -101,7 +101,6 @@ export default class SettingsTab extends PureComponent {
)
}
-
renderBlockieOptIn () {
const { t } = this.context
const { useBlockie, setUseBlockie } = this.props
diff --git a/ui/app/pages/settings/settings-tab/settings-tab.container.js b/ui/app/pages/settings/settings-tab/settings-tab.container.js
index 1d9f65750..0915ccf7c 100644
--- a/ui/app/pages/settings/settings-tab/settings-tab.container.js
+++ b/ui/app/pages/settings/settings-tab/settings-tab.container.js
@@ -1,4 +1,3 @@
-import SettingsTab from './settings-tab.component'
import { connect } from 'react-redux'
import {
setCurrentCurrency,
@@ -8,6 +7,7 @@ import {
setParticipateInMetaMetrics,
} from '../../../store/actions'
import { getPreferences } from '../../../selectors'
+import SettingsTab from './settings-tab.component'
const mapStateToProps = (state) => {
const { appState: { warning }, metamask } = state
diff --git a/ui/app/pages/settings/settings-tab/tests/settings-tab.test.js b/ui/app/pages/settings/settings-tab/tests/settings-tab.test.js
index 7fefd559e..1803ff590 100644
--- a/ui/app/pages/settings/settings-tab/tests/settings-tab.test.js
+++ b/ui/app/pages/settings/settings-tab/tests/settings-tab.test.js
@@ -1,8 +1,8 @@
-import React from 'react'
import assert from 'assert'
+import React from 'react'
import sinon from 'sinon'
import { mount } from 'enzyme'
-import SettingsTab from '../index'
+import SettingsTab from '..'
describe('Settings Tab', function () {
let wrapper
diff --git a/ui/app/pages/settings/settings.component.js b/ui/app/pages/settings/settings.component.js
index 866ed4be7..d4372eed0 100644
--- a/ui/app/pages/settings/settings.component.js
+++ b/ui/app/pages/settings/settings.component.js
@@ -1,15 +1,8 @@
import React, { PureComponent } from 'react'
import PropTypes from 'prop-types'
import { Switch, Route, matchPath } from 'react-router-dom'
-import TabBar from '../../components/app/tab-bar'
import classnames from 'classnames'
-import SettingsTab from './settings-tab'
-import AlertsTab from './alerts-tab'
-import NetworksTab from './networks-tab'
-import AdvancedTab from './advanced-tab'
-import InfoTab from './info-tab'
-import SecurityTab from './security-tab'
-import ContactListTab from './contact-list-tab'
+import TabBar from '../../components/app/tab-bar'
import {
ALERTS_ROUTE,
ADVANCED_ROUTE,
@@ -26,6 +19,13 @@ import {
CONTACT_MY_ACCOUNTS_VIEW_ROUTE,
CONTACT_MY_ACCOUNTS_EDIT_ROUTE,
} from '../../helpers/constants/routes'
+import SettingsTab from './settings-tab'
+import AlertsTab from './alerts-tab'
+import NetworksTab from './networks-tab'
+import AdvancedTab from './advanced-tab'
+import InfoTab from './info-tab'
+import SecurityTab from './security-tab'
+import ContactListTab from './contact-list-tab'
class SettingsPage extends PureComponent {
static propTypes = {
diff --git a/ui/app/pages/settings/settings.container.js b/ui/app/pages/settings/settings.container.js
index ebeb2ae4b..f1881581b 100644
--- a/ui/app/pages/settings/settings.container.js
+++ b/ui/app/pages/settings/settings.container.js
@@ -1,4 +1,3 @@
-import Settings from './settings.component'
import { compose } from 'redux'
import { connect } from 'react-redux'
import { withRouter } from 'react-router-dom'
@@ -24,6 +23,7 @@ import {
CONTACT_MY_ACCOUNTS_EDIT_ROUTE,
CONTACT_MY_ACCOUNTS_VIEW_ROUTE,
} from '../../helpers/constants/routes'
+import Settings from './settings.component'
const ROUTES_TO_I18N_KEYS = {
[GENERAL_ROUTE]: 'general',
@@ -42,7 +42,7 @@ const ROUTES_TO_I18N_KEYS = {
const mapStateToProps = (state, ownProps) => {
const { location } = ownProps
const { pathname } = location
- const pathNameTail = pathname.match(/[^/]+$/)[0]
+ const pathNameTail = pathname.match(/[^/]+$/u)[0]
const isAddressEntryPage = pathNameTail.includes('0x')
const isMyAccountsPage = pathname.match('my-accounts')
diff --git a/ui/app/pages/token/actionable-message/actionable-message.js b/ui/app/pages/token/actionable-message/actionable-message.js
new file mode 100644
index 000000000..84cade2ec
--- /dev/null
+++ b/ui/app/pages/token/actionable-message/actionable-message.js
@@ -0,0 +1,51 @@
+import React from 'react'
+import PropTypes from 'prop-types'
+import classnames from 'classnames'
+
+export default function ActionableMessage ({
+ message = '',
+ primaryAction = null,
+ secondaryAction = null,
+ className = '',
+}) {
+ return (
+
+
+ {message}
+
+ {(primaryAction || secondaryAction) && (
+
+ {primaryAction && (
+
+ {primaryAction.label}
+
+ )}
+ {secondaryAction && (
+
+ {secondaryAction.label}
+
+ )}
+
+ )}
+
+ )
+}
+
+ActionableMessage.propTypes = {
+ message: PropTypes.string.isRequired,
+ primaryAction: PropTypes.shape({
+ label: PropTypes.string,
+ onClick: PropTypes.func,
+ }),
+ secondaryAction: PropTypes.shape({
+ label: PropTypes.string,
+ onClick: PropTypes.func,
+ }),
+ className: PropTypes.string,
+}
diff --git a/ui/app/pages/token/actionable-message/actionable-message.stories.js b/ui/app/pages/token/actionable-message/actionable-message.stories.js
new file mode 100644
index 000000000..d881fca82
--- /dev/null
+++ b/ui/app/pages/token/actionable-message/actionable-message.stories.js
@@ -0,0 +1,58 @@
+import React from 'react'
+import { action } from '@storybook/addon-actions'
+import { text } from '@storybook/addon-knobs/react'
+import ActionableMessage from '.'
+
+export default {
+ title: 'ActionableMessage',
+}
+
+export const NoAction = () => (
+
+)
+
+export const OneAction = () => (
+
+)
+
+export const TwoActions = () => (
+
+)
+
+export const LeftAligned = () => (
+
+)
diff --git a/ui/app/pages/token/actionable-message/index.js b/ui/app/pages/token/actionable-message/index.js
new file mode 100644
index 000000000..c6edbc359
--- /dev/null
+++ b/ui/app/pages/token/actionable-message/index.js
@@ -0,0 +1 @@
+export { default } from './actionable-message'
diff --git a/ui/app/pages/token/actionable-message/index.scss b/ui/app/pages/token/actionable-message/index.scss
new file mode 100644
index 000000000..516e45c44
--- /dev/null
+++ b/ui/app/pages/token/actionable-message/index.scss
@@ -0,0 +1,55 @@
+.actionable-message {
+ background: $Blue-000;
+ border: 1px solid $Blue-200;
+ border-radius: 8px;
+ padding: 16px;
+ margin-top: 18px;
+ display: flex;
+ flex-flow: column;
+ align-items: center;
+
+ @include H7;
+
+ &__message {
+ color: $Blue-600;
+ text-align: center;
+ }
+
+ &__actions {
+ display: flex;
+ width: 80%;
+ justify-content: space-evenly;
+ align-items: center;
+ margin-top: 10px;
+ color: $Blue-600;
+ }
+
+ &__action {
+ font-weight: bold;
+ cursor: pointer;
+ }
+
+ &--warning {
+ background: $Yellow-100;
+ border: 1px solid $Yellow-500;
+ justify-content: center;
+
+ .actionable-message__message,
+ .actionable-message__action {
+ color: $Black-100;
+ }
+
+ .actionable-message__action--secondary {
+ text-decoration: underline;
+ }
+ }
+
+ &--left-aligned {
+ .actionable-message__message,
+ .actionable-message__actions {
+ justify-content: flex-start;
+ text-align: left;
+ width: 100%;
+ }
+ }
+}
diff --git a/ui/app/pages/token/exchange-rate-display/exchange-rate-display.js b/ui/app/pages/token/exchange-rate-display/exchange-rate-display.js
new file mode 100644
index 000000000..85ae82fe1
--- /dev/null
+++ b/ui/app/pages/token/exchange-rate-display/exchange-rate-display.js
@@ -0,0 +1,65 @@
+import React, { useState } from 'react'
+import PropTypes from 'prop-types'
+import BigNumber from 'bignumber.js'
+import classnames from 'classnames'
+import { calcTokenAmount } from '../../../helpers/utils/token-util'
+
+export default function ExchangeRateDisplay ({
+ primaryTokenValue,
+ primaryTokenDecimals = 18,
+ primaryTokenSymbol,
+ secondaryTokenValue,
+ secondaryTokenDecimals = 18,
+ secondaryTokenSymbol,
+ arrowColor = 'black',
+ className,
+}) {
+ const [showPrimaryToSecondary, setShowPrimaryToSecondary] = useState(true)
+ const [arrowsRotation, setArrowRotation] = useState(0)
+
+ const primaryTokenAmount = calcTokenAmount(primaryTokenValue, primaryTokenDecimals)
+ const secondaryTokenAmount = calcTokenAmount(secondaryTokenValue, secondaryTokenDecimals)
+
+ const conversionRateFromPrimaryToSecondary = (new BigNumber(secondaryTokenAmount)).div(primaryTokenAmount).round(6).toString(10)
+ const conversionRateFromSecondaryToPrimary = (new BigNumber(primaryTokenAmount)).div(secondaryTokenAmount).round(6).toString(10)
+
+ const baseSymbol = showPrimaryToSecondary ? primaryTokenSymbol : secondaryTokenSymbol
+ const ratiodSymbol = showPrimaryToSecondary ? secondaryTokenSymbol : primaryTokenSymbol
+ const rate = showPrimaryToSecondary ? conversionRateFromPrimaryToSecondary : conversionRateFromSecondaryToPrimary
+
+ return (
+
+
1
+
{baseSymbol}
+
=
+
{rate}
+
{ratiodSymbol}
+
{
+ setShowPrimaryToSecondary(!showPrimaryToSecondary)
+ setArrowRotation(arrowsRotation + 360)
+ }}
+ style={{ transform: `rotate(${arrowsRotation}deg)` }}
+ >
+
+
+
+ )
+}
+
+ExchangeRateDisplay.propTypes = {
+ primaryTokenValue: PropTypes.string.isRequired,
+ primaryTokenDecimals: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
+ primaryTokenSymbol: PropTypes.string.isRequired,
+ secondaryTokenValue: PropTypes.string.isRequired,
+ secondaryTokenDecimals: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
+ secondaryTokenSymbol: PropTypes.string.isRequired,
+ className: PropTypes.string,
+ arrowColor: PropTypes.string,
+}
diff --git a/ui/app/pages/token/exchange-rate-display/exchange-rate-display.stories.js b/ui/app/pages/token/exchange-rate-display/exchange-rate-display.stories.js
new file mode 100644
index 000000000..ff939f121
--- /dev/null
+++ b/ui/app/pages/token/exchange-rate-display/exchange-rate-display.stories.js
@@ -0,0 +1,47 @@
+import React from 'react'
+import { text, number } from '@storybook/addon-knobs/react'
+import ExchangeRateDisplay from './exchange-rate-display'
+
+export default {
+ title: 'ExchangeRateDisplay',
+}
+
+export const Default = () => {
+ return (
+
+ )
+}
+
+export const WhiteOnBlue = () => {
+ return (
+
+
+
+ )
+}
diff --git a/ui/app/pages/token/exchange-rate-display/index.js b/ui/app/pages/token/exchange-rate-display/index.js
new file mode 100644
index 000000000..e572fe698
--- /dev/null
+++ b/ui/app/pages/token/exchange-rate-display/index.js
@@ -0,0 +1 @@
+export { default } from './exchange-rate-display'
diff --git a/ui/app/pages/token/exchange-rate-display/index.scss b/ui/app/pages/token/exchange-rate-display/index.scss
new file mode 100644
index 000000000..c416f1f53
--- /dev/null
+++ b/ui/app/pages/token/exchange-rate-display/index.scss
@@ -0,0 +1,26 @@
+.exchange-rate-display {
+ @include H6;
+
+ display: flex;
+ align-items: flex-end;
+ justify-content: center;
+ color: $Black-100;
+
+ span {
+ margin-right: 4px;
+ }
+
+ &__bold {
+ font-weight: bold;
+ }
+
+ &__switch-arrows {
+ cursor: pointer;
+ margin-top: 2px;
+ transition: transform 0.5s ease-in-out;
+ }
+
+ &--white {
+ color: $white;
+ }
+}
diff --git a/ui/app/pages/token/fee-card/fee-card.js b/ui/app/pages/token/fee-card/fee-card.js
new file mode 100644
index 000000000..42e751d77
--- /dev/null
+++ b/ui/app/pages/token/fee-card/fee-card.js
@@ -0,0 +1,69 @@
+import React from 'react'
+import PropTypes from 'prop-types'
+
+export default function FeeCard ({
+ onFeeRowClick = null,
+ feeRowText,
+ feeRowLinkText = '',
+ primaryFee,
+ secondaryFee = '',
+ onSecondRowClick = null,
+ secondRowText = '',
+ secondRowLinkText = '',
+ hideSecondRow = false,
+}) {
+ return (
+
+
+
onFeeRowClick && onFeeRowClick()}>
+
+
+ {feeRowText}
+
+ {onFeeRowClick && (
+
+ {feeRowLinkText}
+
+ )}
+
+
+
+ {primaryFee}
+
+ {secondaryFee && (
+
+ {secondaryFee}
+
+ )}
+
+
+ {!hideSecondRow && secondRowText && (
+
+
+
+ {secondRowText}
+
+ {secondRowLinkText && (
+
onSecondRowClick && onSecondRowClick()}>
+ {secondRowLinkText}
+
+ )}
+
+
+ )}
+
+
+ )
+}
+
+FeeCard.propTypes = {
+ onFeeRowClick: PropTypes.func,
+ feeRowText: PropTypes.string.isRequired,
+ feeRowLinkText: PropTypes.string,
+ primaryFee: PropTypes.string.isRequired,
+ secondaryFee: PropTypes.string,
+ onSecondRowClick: PropTypes.func,
+ secondRowText: PropTypes.string,
+ secondRowLinkText: PropTypes.string,
+ hideSecondRow: PropTypes.bool,
+}
diff --git a/ui/app/pages/token/fee-card/fee-card.stories.js b/ui/app/pages/token/fee-card/fee-card.stories.js
new file mode 100644
index 000000000..d29807d99
--- /dev/null
+++ b/ui/app/pages/token/fee-card/fee-card.stories.js
@@ -0,0 +1,47 @@
+import React from 'react'
+import { action } from '@storybook/addon-actions'
+import { text } from '@storybook/addon-knobs/react'
+import FeeCard from './fee-card'
+
+const containerStyle = {
+ width: '300px',
+}
+
+export default {
+ title: 'FeeCard',
+}
+
+export const WithSecondRow = () => {
+ return (
+
+
+
+ )
+}
+
+export const WithoutSecondRow = () => {
+ return (
+
+
+
+ )
+}
diff --git a/ui/app/pages/token/fee-card/index.js b/ui/app/pages/token/fee-card/index.js
new file mode 100644
index 000000000..84bc1acbb
--- /dev/null
+++ b/ui/app/pages/token/fee-card/index.js
@@ -0,0 +1 @@
+export { default } from './fee-card'
diff --git a/ui/app/pages/token/fee-card/index.scss b/ui/app/pages/token/fee-card/index.scss
new file mode 100644
index 000000000..d9acd2554
--- /dev/null
+++ b/ui/app/pages/token/fee-card/index.scss
@@ -0,0 +1,102 @@
+.fee-card {
+ border-radius: 8px;
+ border: 1px solid $Grey-100;
+ width: 100%;
+ margin-top: auto;
+ margin-bottom: 8px;
+
+ @include H7;
+
+ &__main {
+ padding: 16px 16px 12px 16px;
+ }
+
+ &__row-header {
+ display: flex;
+ align-items: center;
+ margin-top: 8px;
+ justify-content: space-between;
+
+ @media screen and (min-width: 576px) {
+ @include H6;
+ }
+
+ &:first-of-type {
+ margin-top: 0;
+ }
+
+ div {
+ display: flex;
+ align-items: center;
+ }
+ }
+
+ &__row-header-text {
+ font-weight: bold;
+ margin-right: 8px;
+ cursor: pointer;
+ }
+
+ &__row {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ margin-top: 8px;
+ }
+
+ &__row-label {
+ display: flex;
+ align-items: center;
+
+ img {
+ height: 10px;
+ width: 10px;
+ margin-left: 4px;
+ cursor: pointer;
+ }
+ }
+
+ &__row-text {
+ margin-right: 8px;
+ }
+
+ &__row-fee {
+ margin-right: 4px;
+ }
+
+ &__link {
+ color: $Blue-500;
+ cursor: pointer;
+ }
+
+ &__total-box {
+ border-top: 1px solid $Grey-100;
+ padding: 12px 16px 16px 16px;
+ }
+
+ &__total-row {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ font-weight: bold;
+ }
+
+ &__total-secondary {
+ width: 100%;
+ display: flex;
+ justify-content: flex-end;
+ font-weight: bold;
+ color: $Grey-500;
+ margin-top: 4px;
+ }
+
+ &__row-header-secondary {
+ color: $Grey-500;
+ margin-right: 20px;
+ }
+
+ &__row-header-primary {
+ font-weight: bold;
+ color: $Grey-500;
+ }
+}
diff --git a/ui/app/pages/token/index.scss b/ui/app/pages/token/index.scss
new file mode 100644
index 000000000..9cf06a407
--- /dev/null
+++ b/ui/app/pages/token/index.scss
@@ -0,0 +1,3 @@
+@import 'fee-card/index';
+@import 'exchange-rate-display/index';
+@import 'actionable-message/index';
diff --git a/ui/app/pages/unlock-page/tests/unlock-page.test.js b/ui/app/pages/unlock-page/tests/unlock-page.test.js
index ec4eb914d..48bb2b78d 100644
--- a/ui/app/pages/unlock-page/tests/unlock-page.test.js
+++ b/ui/app/pages/unlock-page/tests/unlock-page.test.js
@@ -1,8 +1,8 @@
-import React from 'react'
import assert from 'assert'
+import React from 'react'
import sinon from 'sinon'
import { mount } from 'enzyme'
-import UnlockPage from '../index'
+import UnlockPage from '..'
describe('Unlock Page', function () {
let wrapper
@@ -19,7 +19,6 @@ describe('Unlock Page', function () {
showOptInModal: sinon.spy(),
}
-
beforeEach(function () {
wrapper = mount(
diff --git a/ui/app/pages/unlock-page/unlock-page.component.js b/ui/app/pages/unlock-page/unlock-page.component.js
index ffaadc5ee..5fffbf399 100644
--- a/ui/app/pages/unlock-page/unlock-page.component.js
+++ b/ui/app/pages/unlock-page/unlock-page.component.js
@@ -1,9 +1,9 @@
+import { EventEmitter } from 'events'
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import Button from '@material-ui/core/Button'
-import TextField from '../../components/ui/text-field'
import getCaretCoordinates from 'textarea-caret'
-import { EventEmitter } from 'events'
+import TextField from '../../components/ui/text-field'
import Mascot from '../../components/ui/mascot'
import { DEFAULT_ROUTE } from '../../helpers/constants/routes'
diff --git a/ui/app/pages/unlock-page/unlock-page.container.js b/ui/app/pages/unlock-page/unlock-page.container.js
index 848f52a50..e0943a33d 100644
--- a/ui/app/pages/unlock-page/unlock-page.container.js
+++ b/ui/app/pages/unlock-page/unlock-page.container.js
@@ -31,6 +31,7 @@ const mapDispatchToProps = (dispatch) => {
}
const mergeProps = (stateProps, dispatchProps, ownProps) => {
+ // eslint-disable-next-line no-shadow
const { markPasswordForgotten, tryUnlockMetamask, ...restDispatchProps } = dispatchProps
const { history, onSubmit: ownPropsSubmit, ...restOwnProps } = ownProps
diff --git a/ui/app/selectors/confirm-transaction.js b/ui/app/selectors/confirm-transaction.js
index 553a44307..93c876ef7 100644
--- a/ui/app/selectors/confirm-transaction.js
+++ b/ui/app/selectors/confirm-transaction.js
@@ -121,7 +121,6 @@ export const unconfirmedTransactionsCountSelector = createSelector(
},
)
-
export const currentCurrencySelector = (state) => state.metamask.currentCurrency
export const conversionRateSelector = (state) => state.metamask.conversionRate
diff --git a/ui/app/selectors/custom-gas.js b/ui/app/selectors/custom-gas.js
index 816242874..b3c1b1dcd 100644
--- a/ui/app/selectors/custom-gas.js
+++ b/ui/app/selectors/custom-gas.js
@@ -1,11 +1,9 @@
+import { addHexPrefix } from 'ethereumjs-util'
import {
conversionUtil,
multiplyCurrencies,
conversionGreaterThan,
} from '../helpers/utils/conversion-util'
-import {
- getCurrentCurrency, getIsMainnet, getPreferences,
-} from '.'
import {
formatCurrency,
} from '../helpers/utils/confirm-tx.util'
@@ -18,9 +16,11 @@ import {
import {
calcGasTotal,
} from '../pages/send/send.utils'
-import { addHexPrefix } from 'ethereumjs-util'
import { GAS_ESTIMATE_TYPES } from '../helpers/constants/common'
+import {
+ getCurrentCurrency, getIsMainnet, getPreferences,
+} from '.'
const NUMBER_OF_DECIMALS_SM_BTNS = 5
@@ -132,7 +132,6 @@ export function getRenderableEthFee (estimate, gasLimit, numberOfDecimals = 9) {
return formatETHFee(fee)
}
-
export function getRenderableConvertedCurrencyFee (estimate, gasLimit, convertedCurrency, conversionRate) {
const value = conversionUtil(estimate, { fromNumericBase: 'dec', toNumericBase: 'hex' })
const fee = basicPriceEstimateToETHTotal(value, gasLimit)
@@ -164,8 +163,8 @@ export function formatTimeEstimate (totalSeconds, greaterThanMax, lessThanMin) {
symbol = '> '
}
- const formattedMin = `${minutes ? minutes + ' min' : ''}`
- const formattedSec = `${seconds ? seconds + ' sec' : ''}`
+ const formattedMin = `${minutes ? `${minutes} min` : ''}`
+ const formattedSec = `${seconds ? `${seconds} sec` : ''}`
const formattedCombined = formattedMin && formattedSec
? `${symbol}${formattedMin} ${formattedSec}`
: symbol + [formattedMin, formattedSec].find((t) => t)
@@ -199,8 +198,8 @@ export function getRenderableBasicEstimateData (state, gasLimit) {
const { showFiatInTestnets } = getPreferences(state)
const isMainnet = getIsMainnet(state)
- const showFiat = (isMainnet || !!showFiatInTestnets)
- const conversionRate = state.metamask.conversionRate
+ const showFiat = (isMainnet || Boolean(showFiatInTestnets))
+ const { conversionRate } = state.metamask
const currentCurrency = getCurrentCurrency(state)
const {
gas: {
@@ -253,9 +252,9 @@ export function getRenderableEstimateDataForSmallButtonsFromGWEI (state) {
const { showFiatInTestnets } = getPreferences(state)
const isMainnet = getIsMainnet(state)
- const showFiat = (isMainnet || !!showFiatInTestnets)
+ const showFiat = (isMainnet || Boolean(showFiatInTestnets))
const gasLimit = state.metamask.send.gasLimit || getCustomGasLimit(state) || '0x5208'
- const conversionRate = state.metamask.conversionRate
+ const { conversionRate } = state.metamask
const currentCurrency = getCurrentCurrency(state)
const {
gas: {
diff --git a/ui/app/selectors/permissions.js b/ui/app/selectors/permissions.js
index d42081153..bc7bcabe4 100644
--- a/ui/app/selectors/permissions.js
+++ b/ui/app/selectors/permissions.js
@@ -1,8 +1,8 @@
import { forOwn } from 'lodash'
-import { getMetaMaskAccountsOrdered, getOriginOfCurrentTab, getSelectedAddress } from '.'
import {
CAVEAT_NAMES,
} from '../../../app/scripts/controllers/permissions/enums'
+import { getMetaMaskAccountsOrdered, getOriginOfCurrentTab, getSelectedAddress } from '.'
// selectors
@@ -249,7 +249,7 @@ export function getPermissionsForActiveTab (state) {
export function getLastConnectedInfo (state) {
const { permissionsHistory = {} } = state.metamask
return Object.keys(permissionsHistory).reduce((acc, origin) => {
- const ethAccountsHistory = JSON.parse(JSON.stringify(permissionsHistory[origin]['eth_accounts']))
+ const ethAccountsHistory = JSON.parse(JSON.stringify(permissionsHistory[origin].eth_accounts))
return {
...acc,
[origin]: ethAccountsHistory,
@@ -261,10 +261,10 @@ export function getPermissionsMetadataHostCounts (state) {
const metadata = getPermissionDomainsMetadata(state)
return Object.values(metadata).reduce((counts, { host }) => {
if (host) {
- if (!counts[host]) {
- counts[host] = 1
- } else {
+ if (counts[host]) {
counts[host] += 1
+ } else {
+ counts[host] = 1
}
}
return counts
diff --git a/ui/app/selectors/selectors.js b/ui/app/selectors/selectors.js
index cfa680186..3789e3854 100644
--- a/ui/app/selectors/selectors.js
+++ b/ui/app/selectors/selectors.js
@@ -1,6 +1,6 @@
-import { NETWORK_TYPES } from '../helpers/constants/common'
import { stripHexPrefix, addHexPrefix } from 'ethereumjs-util'
import { createSelector } from 'reselect'
+import { NETWORK_TYPES } from '../helpers/constants/common'
import {
shortenAddress,
checksumAddress,
@@ -63,11 +63,10 @@ export const getMetaMaskAccounts = createSelector(
},
}
- } else {
- return {
- ...selectedAccounts,
- [accountID]: account,
- }
+ }
+ return {
+ ...selectedAccounts,
+ [accountID]: account,
}
}, {}),
)
@@ -78,7 +77,7 @@ export function getSelectedAddress (state) {
export function getSelectedIdentity (state) {
const selectedAddress = getSelectedAddress(state)
- const identities = state.metamask.identities
+ const { identities } = state.metamask
return identities[selectedAddress]
}
@@ -88,7 +87,7 @@ export function getNumberOfAccounts (state) {
}
export function getNumberOfTokens (state) {
- const tokens = state.metamask.tokens
+ const { tokens } = state.metamask
return tokens ? tokens.length : 0
}
@@ -119,7 +118,7 @@ export const getMetaMaskAccountsOrdered = createSelector(
getMetaMaskAccounts,
(keyrings, identities, accounts) => keyrings
.reduce((list, keyring) => list.concat(keyring.accounts), [])
- .filter((address) => !!identities[address])
+ .filter((address) => Boolean(identities[address]))
.map((address) => ({ ...identities[address], ...accounts[address] })),
)
@@ -157,7 +156,7 @@ export function getAssetImages (state) {
}
export function getAddressBook (state) {
- const network = state.metamask.network
+ const { network } = state.metamask
if (!state.metamask.addressBook[network]) {
return []
}
@@ -180,7 +179,7 @@ export function accountsWithSendEtherInfoSelector (state) {
const identities = getMetaMaskIdentities(state)
const accountsWithSendEtherInfo = Object.entries(identities).map(([key, identity]) => {
- return Object.assign({}, identity, accounts[key])
+ return { ...identity, ...accounts[key] }
})
return accountsWithSendEtherInfo
@@ -258,7 +257,7 @@ export function isEthereumNetwork (state) {
GOERLI,
} = NETWORK_TYPES
- return [ KOVAN, MAINNET, RINKEBY, ROPSTEN, GOERLI].includes(networkType)
+ return [KOVAN, MAINNET, RINKEBY, ROPSTEN, GOERLI].includes(networkType)
}
export function getPreferences ({ metamask }) {
diff --git a/ui/app/selectors/send.js b/ui/app/selectors/send.js
index 8244983a5..3fcd3e760 100644
--- a/ui/app/selectors/send.js
+++ b/ui/app/selectors/send.js
@@ -1,4 +1,5 @@
import abi from 'human-standard-token-abi'
+import { calcGasTotal } from '../pages/send/send.utils'
import {
accountsWithSendEtherInfoSelector,
getAddressBook,
@@ -6,7 +7,6 @@ import {
getTargetAccount,
getAveragePriceEstimateInHexWEI,
} from '.'
-import { calcGasTotal } from '../pages/send/send.utils'
export function getBlockGasLimit (state) {
return state.metamask.currentBlockGasLimit
@@ -157,9 +157,8 @@ export function getTitleKey (state) {
return 'edit'
} else if (isToken) {
return 'sendTokens'
- } else {
- return 'sendETH'
}
+ return 'sendETH'
}
export function isSendFormInError (state) {
diff --git a/ui/app/selectors/tests/custom-gas.test.js b/ui/app/selectors/tests/custom-gas.test.js
index 7e3e6c085..6ae6119c4 100644
--- a/ui/app/selectors/tests/custom-gas.test.js
+++ b/ui/app/selectors/tests/custom-gas.test.js
@@ -52,22 +52,30 @@ describe('custom-gas selectors', function () {
describe('getEstimatedGasPrices', function () {
it('should return price and time estimates', function () {
- const mockState = { gas: { priceAndTimeEstimates: [
- { gasprice: 12, somethingElse: 20 },
- { gasprice: 22, expectedTime: 30 },
- { gasprice: 32, somethingElse: 40 },
- ] } }
+ const mockState = {
+ gas: {
+ priceAndTimeEstimates: [
+ { gasprice: 12, somethingElse: 20 },
+ { gasprice: 22, expectedTime: 30 },
+ { gasprice: 32, somethingElse: 40 },
+ ],
+ },
+ }
assert.deepEqual(getEstimatedGasPrices(mockState), [12, 22, 32])
})
})
describe('getEstimatedGasTimes', function () {
it('should return price and time estimates', function () {
- const mockState = { gas: { priceAndTimeEstimates: [
- { somethingElse: 12, expectedTime: 20 },
- { gasPrice: 22, expectedTime: 30 },
- { somethingElse: 32, expectedTime: 40 },
- ] } }
+ const mockState = {
+ gas: {
+ priceAndTimeEstimates: [
+ { somethingElse: 12, expectedTime: 20 },
+ { gasPrice: 22, expectedTime: 30 },
+ { somethingElse: 32, expectedTime: 40 },
+ ],
+ },
+ }
assert.deepEqual(getEstimatedGasTimes(mockState), [20, 30, 40])
})
})
diff --git a/ui/app/selectors/tests/send.test.js b/ui/app/selectors/tests/send.test.js
index d232baf1b..529e03958 100644
--- a/ui/app/selectors/tests/send.test.js
+++ b/ui/app/selectors/tests/send.test.js
@@ -37,11 +37,11 @@ import {
import mockState from './send-selectors-test-data'
describe('send selectors', function () {
- const tempGlobalEth = Object.assign({}, global.eth)
+ const tempGlobalEth = { ...global.eth }
beforeEach(function () {
global.eth = {
contract: sinon.stub().returns({
- at: (address) => 'mockAt:' + address,
+ at: (address) => `mockAt:${address}`,
}),
}
})
@@ -217,9 +217,9 @@ describe('send selectors', function () {
})
it('should return null if send token is not set', function () {
- const modifiedMetamaskState = Object.assign({}, mockState.metamask, { send: {} })
+ const modifiedMetamaskState = { ...mockState.metamask, send: {} }
assert.equal(
- getSendTokenContract(Object.assign({}, mockState, { metamask: modifiedMetamaskState })),
+ getSendTokenContract({ ...mockState, metamask: modifiedMetamaskState }),
null,
)
})
@@ -280,11 +280,12 @@ describe('send selectors', function () {
it('should get the selected account balance if the send.from does not exist', function () {
const editedMockState = {
- metamask: Object.assign({}, mockState.metamask, {
+ metamask: {
+ ...mockState.metamask,
send: {
from: null,
},
- }),
+ },
}
assert.equal(
getSendFromBalance(editedMockState),
@@ -308,11 +309,12 @@ describe('send selectors', function () {
it('should return the current account if send.from does not exist', function () {
const editedMockState = {
- metamask: Object.assign({}, mockState.metamask, {
+ metamask: {
+ ...mockState.metamask,
send: {
from: null,
},
- }),
+ },
}
assert.deepEqual(
getSendFromObject(editedMockState),
@@ -532,7 +534,8 @@ describe('send selectors', function () {
editingTransactionId: true,
token: {},
}),
- ), 'edit')
+ ), 'edit',
+ )
})
it('should return the correct key when getSendEditingTransactionId is falsy and getSendToken is truthy', function () {
@@ -543,7 +546,8 @@ describe('send selectors', function () {
editingTransactionId: false,
token: {},
}),
- ), 'sendTokens')
+ ), 'sendTokens',
+ )
})
it('should return the correct key when getSendEditingTransactionId is falsy and getSendToken is falsy', function () {
@@ -554,7 +558,8 @@ describe('send selectors', function () {
editingTransactionId: false,
token: null,
}),
- ), 'sendETH')
+ ), 'sendETH',
+ )
})
})
})
@@ -571,7 +576,7 @@ describe('send selectors', function () {
it('should return true if any of the values of the object returned by getSendErrors are truthy', function () {
assert.equal(isSendFormInError(
getSendMockState({
- errors: [ true ],
+ errors: [true],
}),
), true)
})
@@ -584,7 +589,7 @@ describe('send selectors', function () {
), false)
assert.equal(isSendFormInError(
getSendMockState({
- errors: [ false ],
+ errors: [false],
}),
), false)
})
diff --git a/ui/app/selectors/tests/transactions.test.js b/ui/app/selectors/tests/transactions.test.js
index 12a931e81..65f36b3ea 100644
--- a/ui/app/selectors/tests/transactions.test.js
+++ b/ui/app/selectors/tests/transactions.test.js
@@ -184,7 +184,7 @@ describe('Transaction Selectors', function () {
const expectedResult = [
{
nonce: '0x0',
- transactions: [ tx1 ],
+ transactions: [tx1],
initialTransaction: tx1,
primaryTransaction: tx1,
hasRetried: false,
@@ -192,7 +192,7 @@ describe('Transaction Selectors', function () {
},
{
nonce: '0x1',
- transactions: [ tx2 ],
+ transactions: [tx2],
initialTransaction: tx2,
primaryTransaction: tx2,
hasRetried: false,
@@ -273,7 +273,7 @@ describe('Transaction Selectors', function () {
const expectedResult = [
{
nonce: submittedTx.txParams.nonce,
- transactions: [ submittedTx ],
+ transactions: [submittedTx],
initialTransaction: submittedTx,
primaryTransaction: submittedTx,
hasRetried: false,
@@ -281,7 +281,7 @@ describe('Transaction Selectors', function () {
},
{
nonce: unapprovedTx.txParams.nonce,
- transactions: [ unapprovedTx ],
+ transactions: [unapprovedTx],
initialTransaction: unapprovedTx,
primaryTransaction: unapprovedTx,
hasRetried: false,
@@ -289,7 +289,7 @@ describe('Transaction Selectors', function () {
},
{
nonce: approvedTx.txParams.nonce,
- transactions: [ approvedTx ],
+ transactions: [approvedTx],
initialTransaction: approvedTx,
primaryTransaction: approvedTx,
hasRetried: false,
@@ -305,7 +305,7 @@ describe('Transaction Selectors', function () {
const expectedResult = [
{
nonce: confirmedTx.txParams.nonce,
- transactions: [ confirmedTx ],
+ transactions: [confirmedTx],
initialTransaction: confirmedTx,
primaryTransaction: confirmedTx,
hasRetried: false,
@@ -318,7 +318,7 @@ describe('Transaction Selectors', function () {
it('submittedPendingTransactionsSelector', function () {
- const expectedResult = [ submittedTx ]
+ const expectedResult = [submittedTx]
assert.deepEqual(submittedPendingTransactionsSelector(state), expectedResult)
})
})
diff --git a/ui/app/selectors/transactions.js b/ui/app/selectors/transactions.js
index f0d63b115..7d62d4979 100644
--- a/ui/app/selectors/transactions.js
+++ b/ui/app/selectors/transactions.js
@@ -10,10 +10,10 @@ import {
TRANSACTION_TYPE_RETRY,
} from '../../../app/scripts/controllers/transactions/enums'
import { hexToDecimal } from '../helpers/utils/conversions.util'
+import txHelper from '../../lib/tx-helper'
import {
getSelectedAddress,
} from '.'
-import txHelper from '../../lib/tx-helper'
export const incomingTxListSelector = (state) => {
const { showIncomingTransactions } = state.metamask.featureFlags
@@ -21,7 +21,7 @@ export const incomingTxListSelector = (state) => {
return []
}
- const network = state.metamask.network
+ const { network } = state.metamask
const selectedAddress = getSelectedAddress(state)
return Object.values(state.metamask.incomingTransactions)
.filter(({ metamaskNetworkId, txParams }) => (
diff --git a/ui/app/store/actionConstants.js b/ui/app/store/actionConstants.js
index 4a11aa111..ac7cc11a0 100644
--- a/ui/app/store/actionConstants.js
+++ b/ui/app/store/actionConstants.js
@@ -36,6 +36,7 @@ export const SET_CURRENT_FIAT = 'SET_CURRENT_FIAT'
export const SHOW_SEND_TOKEN_PAGE = 'SHOW_SEND_TOKEN_PAGE'
export const SHOW_PRIVATE_KEY = 'SHOW_PRIVATE_KEY'
export const SET_ACCOUNT_LABEL = 'SET_ACCOUNT_LABEL'
+export const CLEAR_ACCOUNT_DETAILS = 'CLEAR_ACCOUNT_DETAILS'
// tx conf screen
export const COMPLETED_TX = 'COMPLETED_TX'
export const TRANSACTION_ERROR = 'TRANSACTION_ERROR'
diff --git a/ui/app/store/actions.js b/ui/app/store/actions.js
index 49a43da24..543860f5a 100644
--- a/ui/app/store/actions.js
+++ b/ui/app/store/actions.js
@@ -1,26 +1,26 @@
import abi from 'human-standard-token-abi'
import pify from 'pify'
+import ethUtil from 'ethereumjs-util'
+import log from 'loglevel'
import getBuyEthUrl from '../../../app/scripts/lib/buy-eth-url'
import { checksumAddress } from '../helpers/utils/util'
import { calcTokenBalance, estimateGas } from '../pages/send/send.utils'
-import ethUtil from 'ethereumjs-util'
import { fetchLocale, loadRelativeTimeFormatLocaleData } from '../helpers/utils/i18n-helper'
import { getMethodDataAsync } from '../helpers/utils/transactions.util'
import { fetchSymbolAndDecimals } from '../helpers/utils/token-util'
import switchDirection from '../helpers/utils/switch-direction'
-import log from 'loglevel'
import { ENVIRONMENT_TYPE_NOTIFICATION } from '../../../app/scripts/lib/enums'
import { hasUnconfirmedTransactions } from '../helpers/utils/confirm-tx.util'
import { setCustomGasLimit } from '../ducks/gas/gas.duck'
import txHelper from '../../lib/tx-helper'
import { getEnvironmentType } from '../../../app/scripts/lib/util'
-import * as actionConstants from './actionConstants'
import {
getPermittedAccountsForCurrentTab,
getSelectedAddress,
} from '../selectors'
import { switchedToUnconnectedAccount } from '../ducks/alerts/unconnected-account'
import { getUnconnectedAccountAlertEnabledness } from '../ducks/metamask/metamask'
+import * as actionConstants from './actionConstants'
let background = null
let promisifiedBackground = null
@@ -46,7 +46,8 @@ export function tryUnlockMetamask (password) {
return new Promise((resolve, reject) => {
background.submitPassword(password, (error) => {
if (error) {
- return reject(error)
+ reject(error)
+ return
}
resolve()
@@ -61,7 +62,8 @@ export function tryUnlockMetamask (password) {
background.verifySeedPhrase((err) => {
if (err) {
dispatch(displayWarning(err.message))
- return reject(err)
+ reject(err)
+ return
}
resolve()
@@ -87,7 +89,8 @@ export function createNewVaultAndRestore (password, seed) {
return new Promise((resolve, reject) => {
background.createNewVaultAndRestore(password, seed, (err, _vault) => {
if (err) {
- return reject(err)
+ reject(err)
+ return
}
vault = _vault
resolve()
@@ -146,7 +149,8 @@ export function submitPassword (password) {
return new Promise((resolve, reject) => {
background.submitPassword(password, (error) => {
if (error) {
- return reject(error)
+ reject(error)
+ return
}
resolve()
@@ -158,7 +162,8 @@ export function createNewVault (password) {
return new Promise((resolve, reject) => {
background.createNewVaultAndKeychain(password, (error) => {
if (error) {
- return reject(error)
+ reject(error)
+ return
}
resolve(true)
@@ -170,7 +175,8 @@ export function verifyPassword (password) {
return new Promise((resolve, reject) => {
background.verifyPassword(password, (error) => {
if (error) {
- return reject(error)
+ reject(error)
+ return
}
resolve(true)
@@ -182,7 +188,8 @@ export function verifySeedPhrase () {
return new Promise((resolve, reject) => {
background.verifySeedPhrase((error, seedWords) => {
if (error) {
- return reject(error)
+ reject(error)
+ return
}
resolve(seedWords)
@@ -228,7 +235,8 @@ export function fetchInfoToSync () {
background.fetchInfoToSync((err, result) => {
if (err) {
dispatch(displayWarning(err.message))
- return reject(err)
+ reject(err)
+ return
}
resolve(result)
})
@@ -245,10 +253,11 @@ export function resetAccount () {
dispatch(hideLoadingIndication())
if (err) {
dispatch(displayWarning(err.message))
- return reject(err)
+ reject(err)
+ return
}
- log.info('Transaction history reset for ' + account)
+ log.info(`Transaction history reset for ${account}`)
dispatch(showAccountsPage())
resolve(account)
})
@@ -264,9 +273,10 @@ export function removeAccount (address) {
await new Promise((resolve, reject) => {
background.removeAccount(address, (error, account) => {
if (error) {
- return reject(error)
+ reject(error)
+ return
}
- return resolve(account)
+ resolve(account)
})
})
await forceUpdateMetamaskState(dispatch)
@@ -277,7 +287,7 @@ export function removeAccount (address) {
dispatch(hideLoadingIndication())
}
- log.info('Account removed: ' + address)
+ log.info(`Account removed: ${address}`)
dispatch(showAccountsPage())
}
}
@@ -395,11 +405,12 @@ export function unlockHardwareWalletAccount (index, deviceName, hdPath) {
if (err) {
log.error(err)
dispatch(displayWarning(err.message))
- return reject(err)
+ reject(err)
+ return
}
dispatch(hideLoadingIndication())
- return resolve()
+ resolve()
})
})
}
@@ -498,8 +509,7 @@ export function decryptMsgInline (decryptedMsgData) {
}
dispatch(updateMetamaskState(newState))
- decryptedMsgData = newState.unapprovedDecryptMsgs[decryptedMsgData.metamaskId]
- return decryptedMsgData
+ return newState.unapprovedDecryptMsgs[decryptedMsgData.metamaskId]
}
}
@@ -576,7 +586,7 @@ export function signTx (txData) {
return (dispatch) => {
global.ethQuery.sendTransaction(txData, (err) => {
if (err) {
- return dispatch(displayWarning(err.message))
+ dispatch(displayWarning(err.message))
}
})
dispatch(showConfTxPage())
@@ -712,7 +722,7 @@ export function updateSendAmount (amount) {
export function updateCustomNonce (value) {
return {
type: actionConstants.UPDATE_CUSTOM_NONCE,
- value: value,
+ value,
}
}
@@ -776,7 +786,8 @@ const updateMetamaskStateFromBackground = () => {
return new Promise((resolve, reject) => {
background.getState((error, newState) => {
if (error) {
- return reject(error)
+ reject(error)
+ return
}
resolve(newState)
@@ -795,7 +806,8 @@ export function updateTransaction (txData) {
dispatch(txError(err))
dispatch(goHome())
log.error(err.message)
- return reject(err)
+ reject(err)
+ return
}
resolve(txData)
@@ -823,7 +835,8 @@ export function updateAndApproveTx (txData) {
dispatch(txError(err))
dispatch(goHome())
log.error(err.message)
- return reject(err)
+ reject(err)
+ return
}
resolve(txData)
@@ -975,7 +988,8 @@ export function cancelTx (txData) {
return new Promise((resolve, reject) => {
background.cancelTransaction(txData.id, (err) => {
if (err) {
- return reject(err)
+ reject(err)
+ return
}
resolve()
@@ -1006,7 +1020,8 @@ export function cancelTxs (txDataList) {
const cancellations = txIds.map((id) => new Promise((resolve, reject) => {
background.cancelTransaction(id, (err) => {
if (err) {
- return reject(err)
+ reject(err)
+ return
}
resolve()
@@ -1025,7 +1040,8 @@ export function cancelTxs (txDataList) {
dispatch(hideLoadingIndication())
if (getEnvironmentType() === ENVIRONMENT_TYPE_NOTIFICATION) {
- return global.platform.closeCurrentWindow()
+ global.platform.closeCurrentWindow()
+
}
}
}
@@ -1036,9 +1052,11 @@ export function markPasswordForgotten () {
await new Promise((resolve, reject) => {
return background.markPasswordForgotten((error) => {
if (error) {
- return reject(error)
+ reject(error)
+ return
}
- return resolve()
+ resolve()
+
})
})
} finally {
@@ -1130,7 +1148,8 @@ const backgroundSetLocked = () => {
return new Promise((resolve, reject) => {
background.setLocked((error) => {
if (error) {
- return reject(error)
+ reject(error)
+ return
}
resolve()
})
@@ -1220,7 +1239,8 @@ export function addPermittedAccount (origin, address) {
await new Promise((resolve, reject) => {
background.addPermittedAccount(origin, address, (error) => {
if (error) {
- return reject(error)
+ reject(error)
+ return
}
resolve()
})
@@ -1234,7 +1254,8 @@ export function removePermittedAccount (origin, address) {
await new Promise((resolve, reject) => {
background.removePermittedAccount(origin, address, (error) => {
if (error) {
- return reject(error)
+ reject(error)
+ return
}
resolve()
})
@@ -1264,7 +1285,8 @@ export function addToken (address, symbol, decimals, image) {
dispatch(hideLoadingIndication())
if (err) {
dispatch(displayWarning(err.message))
- return reject(err)
+ reject(err)
+ return
}
dispatch(updateTokens(tokens))
resolve(tokens)
@@ -1281,7 +1303,8 @@ export function removeToken (address) {
dispatch(hideLoadingIndication())
if (err) {
dispatch(displayWarning(err.message))
- return reject(err)
+ reject(err)
+ return
}
dispatch(updateTokens(tokens))
resolve(tokens)
@@ -1296,15 +1319,15 @@ export function addTokens (tokens) {
return Promise.all(tokens.map(({ address, symbol, decimals }) => (
dispatch(addToken(address, symbol, decimals))
)))
- } else {
- return Promise.all(
- Object
- .entries(tokens)
- .map(([_, { address, symbol, decimals }]) => (
- dispatch(addToken(address, symbol, decimals))
- )),
- )
}
+ return Promise.all(
+ Object
+ .entries(tokens)
+ .map(([_, { address, symbol, decimals }]) => (
+ dispatch(addToken(address, symbol, decimals))
+ )),
+ )
+
}
}
@@ -1319,7 +1342,8 @@ export function removeSuggestedTokens () {
}
dispatch(clearPendingTokens())
if (getEnvironmentType() === ENVIRONMENT_TYPE_NOTIFICATION) {
- return global.platform.closeCurrentWindow()
+ global.platform.closeCurrentWindow()
+ return
}
resolve(suggestedTokens)
})
@@ -1357,7 +1381,8 @@ export function createCancelTransaction (txId, customGasPrice) {
background.createCancelTransaction(txId, customGasPrice, (err, newState) => {
if (err) {
dispatch(displayWarning(err.message))
- return reject(err)
+ reject(err)
+ return
}
const { currentNetworkTxList } = newState
@@ -1380,7 +1405,8 @@ export function createSpeedUpTransaction (txId, customGasPrice, customGasLimit)
background.createSpeedUpTransaction(txId, customGasPrice, customGasLimit, (err, newState) => {
if (err) {
dispatch(displayWarning(err.message))
- return reject(err)
+ reject(err)
+ return
}
const { currentNetworkTxList } = newState
@@ -1402,7 +1428,8 @@ export function createRetryTransaction (txId, customGasPrice, customGasLimit) {
background.createSpeedUpTransaction(txId, customGasPrice, customGasLimit, (err, newState) => {
if (err) {
dispatch(displayWarning(err.message))
- return reject(err)
+ reject(err)
+ return
}
const { currentNetworkTxList } = newState
@@ -1504,7 +1531,6 @@ export function setRpcTarget (newRpc, chainId, ticker = 'ETH', nickname) {
} catch (error) {
log.error(error)
dispatch(displayWarning('Had a problem changing networks!'))
- return
}
}
}
@@ -1517,7 +1543,8 @@ export function delRpcTarget (oldRpc) {
if (err) {
log.error(err)
dispatch(displayWarning('Had a problem removing network!'))
- return reject(err)
+ reject(err)
+ return
}
resolve()
})
@@ -1541,7 +1568,7 @@ export function addToAddressBook (recipient, nickname = '', memo = '') {
throw error
}
if (!set) {
- return dispatch(displayWarning('Address book failed to update'))
+ dispatch(displayWarning('Address book failed to update'))
}
}
}
@@ -1570,7 +1597,6 @@ export function hideNetworkDropdown () {
}
}
-
export function showModal (payload) {
return {
type: actionConstants.MODAL_OPEN,
@@ -1688,21 +1714,22 @@ export function exportAccount (password, address) {
log.error('Error in submitting password.')
dispatch(hideLoadingIndication())
dispatch(displayWarning('Incorrect Password.'))
- return reject(err)
+ reject(err)
+ return
}
log.debug(`background.exportAccount`)
- return background.exportAccount(address, function (err, result) {
+ background.exportAccount(address, function (err2, result) {
dispatch(hideLoadingIndication())
- if (err) {
- log.error(err)
+ if (err2) {
+ log.error(err2)
dispatch(displayWarning('Had a problem exporting the account.'))
- return reject(err)
+ reject(err2)
+ return
}
dispatch(showPrivateKey(result))
-
- return resolve(result)
+ resolve(result)
})
})
})
@@ -1716,22 +1743,22 @@ export function exportAccounts (password, addresses) {
background.submitPassword(password, function (err) {
if (err) {
log.error('Error in submitting password.')
- return reject(err)
+ reject(err)
+ return
}
log.debug(`background.exportAccounts`)
- const accountPromises = addresses.map((address) =>
- new Promise(
- (resolve, reject) => background.exportAccount(address, function (err, result) {
- if (err) {
- log.error(err)
- dispatch(displayWarning('Had a problem exporting the account.'))
- return reject(err)
- }
- return resolve(result)
- }),
- ),
- )
- return resolve(Promise.all(accountPromises))
+ const accountPromises = addresses.map((address) => new Promise(
+ (resolve2, reject2) => background.exportAccount(address, function (err2, result) {
+ if (err2) {
+ log.error(err2)
+ dispatch(displayWarning('Had a problem exporting the account.'))
+ reject2(err2)
+ return
+ }
+ resolve2(result)
+ }),
+ ))
+ resolve(Promise.all(accountPromises))
})
})
}
@@ -1755,20 +1782,26 @@ export function setAccountLabel (account, label) {
if (err) {
dispatch(displayWarning(err.message))
- return reject(err)
+ reject(err)
+ return
}
dispatch({
type: actionConstants.SET_ACCOUNT_LABEL,
value: { account, label },
})
-
resolve(account)
})
})
}
}
+export function clearAccountDetails () {
+ return {
+ type: actionConstants.CLEAR_ACCOUNT_DETAILS,
+ }
+}
+
export function showSendTokenPage () {
return {
type: actionConstants.SHOW_SEND_TOKEN_PAGE,
@@ -1793,7 +1826,8 @@ export function setFeatureFlag (feature, activated, notificationType) {
dispatch(hideLoadingIndication())
if (err) {
dispatch(displayWarning(err.message))
- return reject(err)
+ reject(err)
+ return
}
dispatch(updateFeatureFlags(updatedFeatureFlags))
notificationType && dispatch(showModal({ name: notificationType }))
@@ -1819,7 +1853,8 @@ export function setPreference (preference, value) {
if (err) {
dispatch(displayWarning(err.message))
- return reject(err)
+ reject(err)
+ return
}
dispatch(updatePreferences(updatedPreferences))
@@ -1912,14 +1947,14 @@ export function setParticipateInMetaMetrics (val) {
log.debug(err)
if (err) {
dispatch(displayWarning(err.message))
- return reject(err)
+ reject(err)
+ return
}
dispatch({
type: actionConstants.SET_PARTICIPATE_IN_METAMETRICS,
value: val,
})
-
resolve([val, metaMetricsId])
})
})
@@ -1933,14 +1968,14 @@ export function setMetaMetricsSendCount (val) {
background.setMetaMetricsSendCount(val, (err) => {
if (err) {
dispatch(displayWarning(err.message))
- return reject(err)
+ reject(err)
+ return
}
dispatch({
type: actionConstants.SET_METAMETRICS_SEND_COUNT,
value: val,
})
-
resolve(val)
})
})
@@ -1954,7 +1989,7 @@ export function setUseBlockie (val) {
background.setUseBlockie(val, (err) => {
dispatch(hideLoadingIndication())
if (err) {
- return dispatch(displayWarning(err.message))
+ dispatch(displayWarning(err.message))
}
})
dispatch({
@@ -1971,7 +2006,7 @@ export function setUseNonceField (val) {
background.setUseNonceField(val, (err) => {
dispatch(hideLoadingIndication())
if (err) {
- return dispatch(displayWarning(err.message))
+ dispatch(displayWarning(err.message))
}
})
dispatch({
@@ -1988,7 +2023,7 @@ export function setUsePhishDetect (val) {
background.setUsePhishDetect(val, (err) => {
dispatch(hideLoadingIndication())
if (err) {
- return dispatch(displayWarning(err.message))
+ dispatch(displayWarning(err.message))
}
})
}
@@ -2001,7 +2036,8 @@ export function setIpfsGateway (val) {
background.setIpfsGateway(val, (err) => {
dispatch(hideLoadingIndication())
if (err) {
- return dispatch(displayWarning(err.message))
+ dispatch(displayWarning(err.message))
+
} else {
dispatch({
type: actionConstants.SET_IPFS_GATEWAY,
@@ -2022,7 +2058,8 @@ export function updateCurrentLocale (key) {
background.setCurrentLocale(key, (err, textDirection) => {
if (err) {
dispatch(hideLoadingIndication())
- return dispatch(displayWarning(err.message))
+ dispatch(displayWarning(err.message))
+ return
}
switchDirection(textDirection)
dispatch(setCurrentLocale(key, localeMessages))
@@ -2086,9 +2123,10 @@ export function rejectPermissionsRequest (requestId) {
background.rejectPermissionsRequest(requestId, (err) => {
if (err) {
dispatch(displayWarning(err.message))
- return reject(err)
+ reject(err)
+ return
}
- return forceUpdateMetamaskState(dispatch)
+ forceUpdateMetamaskState(dispatch)
.then(resolve)
.catch(reject)
})
@@ -2119,7 +2157,8 @@ export function setFirstTimeFlowType (type) {
log.debug(`background.setFirstTimeFlowType`)
background.setFirstTimeFlowType(type, (err) => {
if (err) {
- return dispatch(displayWarning(err.message))
+ dispatch(displayWarning(err.message))
+
}
})
dispatch({
@@ -2147,7 +2186,8 @@ export function setLastActiveTime () {
return (dispatch) => {
background.setLastActiveTime((err) => {
if (err) {
- return dispatch(displayWarning(err.message))
+ dispatch(displayWarning(err.message))
+
}
})
}
@@ -2201,9 +2241,7 @@ export function getContractMethodData (data = '') {
return getMethodDataAsync(fourBytePrefix)
.then(({ name, params }) => {
dispatch(loadingMethodDataFinished())
-
background.addKnownMethodData(fourBytePrefix, { name, params })
-
return { name, params }
})
}
@@ -2236,7 +2274,6 @@ export function getTokenParams (tokenAddress) {
dispatch(loadingTokenParamsStarted())
log.debug(`loadingTokenParams`)
-
return fetchSymbolAndDecimals(tokenAddress, existingTokens)
.then(({ symbol, decimals }) => {
dispatch(addToken(tokenAddress, symbol, Number(decimals)))
@@ -2252,9 +2289,10 @@ export function setSeedPhraseBackedUp (seedPhraseBackupState) {
background.setSeedPhraseBackedUp(seedPhraseBackupState, (err) => {
if (err) {
dispatch(displayWarning(err.message))
- return reject(err)
+ reject(err)
+ return
}
- return forceUpdateMetamaskState(dispatch)
+ forceUpdateMetamaskState(dispatch)
.then(resolve)
.catch(reject)
})
@@ -2268,7 +2306,8 @@ export function initializeThreeBox () {
background.initializeThreeBox((err) => {
if (err) {
dispatch(displayWarning(err.message))
- return reject(err)
+ reject(err)
+ return
}
resolve()
})
@@ -2282,7 +2321,8 @@ export function setShowRestorePromptToFalse () {
background.setShowRestorePromptToFalse((err) => {
if (err) {
dispatch(displayWarning(err.message))
- return reject(err)
+ reject(err)
+ return
}
resolve()
})
@@ -2296,7 +2336,8 @@ export function turnThreeBoxSyncingOn () {
background.turnThreeBoxSyncingOn((err) => {
if (err) {
dispatch(displayWarning(err.message))
- return reject(err)
+ reject(err)
+ return
}
resolve()
})
@@ -2310,7 +2351,8 @@ export function restoreFromThreeBox (accountAddress) {
background.restoreFromThreeBox(accountAddress, (err) => {
if (err) {
dispatch(displayWarning(err.message))
- return reject(err)
+ reject(err)
+ return
}
resolve()
})
@@ -2324,7 +2366,8 @@ export function getThreeBoxLastUpdated () {
background.getThreeBoxLastUpdated((err, lastUpdated) => {
if (err) {
dispatch(displayWarning(err.message))
- return reject(err)
+ reject(err)
+ return
}
resolve(lastUpdated)
})
@@ -2338,7 +2381,8 @@ export function setThreeBoxSyncingPermission (threeBoxSyncingAllowed) {
background.setThreeBoxSyncingPermission(threeBoxSyncingAllowed, (err) => {
if (err) {
dispatch(displayWarning(err.message))
- return reject(err)
+ reject(err)
+ return
}
resolve()
})
@@ -2368,7 +2412,8 @@ export function getNextNonce () {
background.getNextNonce(address, (err, nextNonce) => {
if (err) {
dispatch(displayWarning(err.message))
- return reject(err)
+ reject(err)
+ return
}
dispatch(setNextNonce(nextNonce))
resolve(nextNonce)
@@ -2412,7 +2457,6 @@ export function setCurrentWindowTab (currentWindowTab) {
}
}
-
export function getCurrentWindowTab () {
return async (dispatch) => {
const currentWindowTab = await global.platform.currentTab()
diff --git a/ui/index.js b/ui/index.js
index bc61913b2..9e777ed94 100644
--- a/ui/index.js
+++ b/ui/index.js
@@ -3,14 +3,14 @@ import log from 'loglevel'
import { clone } from 'lodash'
import React from 'react'
import { render } from 'react-dom'
-import Root from './app/pages'
-import * as actions from './app/store/actions'
-import configureStore from './app/store/store'
-import txHelper from './lib/tx-helper'
import { getEnvironmentType } from '../app/scripts/lib/util'
import { ALERT_TYPES } from '../app/scripts/controllers/alert'
import { SENTRY_STATE } from '../app/scripts/lib/setupSentry'
import { ENVIRONMENT_TYPE_POPUP } from '../app/scripts/lib/enums'
+import Root from './app/pages'
+import * as actions from './app/store/actions'
+import configureStore from './app/store/store'
+import txHelper from './lib/tx-helper'
import { fetchLocale, loadRelativeTimeFormatLocaleData } from './app/helpers/utils/i18n-helper'
import switchDirection from './app/helpers/utils/switch-direction'
import { getPermittedAccountsForCurrentTab, getSelectedAddress } from './app/selectors'
@@ -28,7 +28,8 @@ export default function launchMetamaskUi (opts, cb) {
// check if we are unlocked first
backgroundConnection.getState(function (err, metamaskState) {
if (err) {
- return cb(err)
+ cb(err)
+ return
}
startApp(metamaskState, backgroundConnection, opts)
.then((store) => {
@@ -74,7 +75,7 @@ async function startApp (metamaskState, backgroundConnection, opts) {
}
if (getEnvironmentType() === ENVIRONMENT_TYPE_POPUP) {
- const origin = draftInitialState.activeTab.origin
+ const { origin } = draftInitialState.activeTab
const permittedAccountsForCurrentTab = getPermittedAccountsForCurrentTab(draftInitialState)
const selectedAddress = getSelectedAddress(draftInitialState)
const unconnectedAccountAlertShownOrigins = getUnconnectedAccountAlertShown(draftInitialState)
@@ -111,8 +112,8 @@ async function startApp (metamaskState, backgroundConnection, opts) {
}))
}
- backgroundConnection.on('update', function (metamaskState) {
- store.dispatch(actions.updateMetamaskState(metamaskState))
+ backgroundConnection.on('update', function (state) {
+ store.dispatch(actions.updateMetamaskState(state))
})
// global metamask api - used by tooling
@@ -188,7 +189,8 @@ window.logStateString = function (cb) {
const state = window.getCleanAppState()
global.platform.getPlatformInfo((err, platform) => {
if (err) {
- return cb(err)
+ cb(err)
+ return
}
state.platform = platform
const stateString = JSON.stringify(state, null, 2)
diff --git a/ui/lib/account-link.js b/ui/lib/account-link.js
index 1f9ba293e..8427d41ad 100644
--- a/ui/lib/account-link.js
+++ b/ui/lib/account-link.js
@@ -1,33 +1,24 @@
export default function getAccountLink (address, network, rpcPrefs) {
if (rpcPrefs && rpcPrefs.blockExplorerUrl) {
- return `${rpcPrefs.blockExplorerUrl.replace(/\/+$/, '')}/address/${address}`
+ return `${rpcPrefs.blockExplorerUrl.replace(/\/+$/u, '')}/address/${address}`
}
+ // eslint-disable-next-line radix
const net = parseInt(network)
- let link
switch (net) {
case 1: // main net
- link = `https://etherscan.io/address/${address}`
- break
+ return `https://etherscan.io/address/${address}`
case 2: // morden test net
- link = `https://morden.etherscan.io/address/${address}`
- break
+ return `https://morden.etherscan.io/address/${address}`
case 3: // ropsten test net
- link = `https://ropsten.etherscan.io/address/${address}`
- break
+ return `https://ropsten.etherscan.io/address/${address}`
case 4: // rinkeby test net
- link = `https://rinkeby.etherscan.io/address/${address}`
- break
+ return `https://rinkeby.etherscan.io/address/${address}`
case 42: // kovan test net
- link = `https://kovan.etherscan.io/address/${address}`
- break
+ return `https://kovan.etherscan.io/address/${address}`
case 5: // goerli test net
- link = `https://goerli.etherscan.io/address/${address}`
- break
+ return `https://goerli.etherscan.io/address/${address}`
default:
- link = ''
- break
+ return ''
}
-
- return link
}
diff --git a/ui/lib/icon-factory.js b/ui/lib/icon-factory.js
index 077604195..19489819a 100644
--- a/ui/lib/icon-factory.js
+++ b/ui/lib/icon-factory.js
@@ -1,7 +1,8 @@
-let iconFactory
import { isValidAddress } from 'ethereumjs-util'
-import { checksumAddress } from '../app/helpers/utils/util'
import contractMap from 'eth-contract-metadata'
+import { checksumAddress } from '../app/helpers/utils/util'
+
+let iconFactory
export default function iconFactoryGenerator (jazzicon) {
if (!iconFactory) {
diff --git a/ui/lib/tx-helper.js b/ui/lib/tx-helper.js
index 03a7b3e1e..fcb264c0c 100644
--- a/ui/lib/tx-helper.js
+++ b/ui/lib/tx-helper.js
@@ -1,5 +1,5 @@
-import { valuesFor } from '../app/helpers/utils/util'
import log from 'loglevel'
+import { valuesFor } from '../app/helpers/utils/util'
export default function txHelper (unapprovedTxs, unapprovedMsgs, personalMsgs, decryptMsgs, encryptionPublicKeyMsgs, typedMessages, network) {
log.debug('tx-helper called with params:')
diff --git a/ui/lib/webcam-utils.js b/ui/lib/webcam-utils.js
index ef7da9496..c9b6c5503 100644
--- a/ui/lib/webcam-utils.js
+++ b/ui/lib/webcam-utils.js
@@ -25,11 +25,10 @@ class WebcamUtils {
permissions: hasWebcamPermissions,
environmentReady,
}
- } else {
- const error = new Error('No webcam found')
- error.type = 'NO_WEBCAM_FOUND'
- throw error
}
+ const error = new Error('No webcam found')
+ error.type = 'NO_WEBCAM_FOUND'
+ throw error
}
}
diff --git a/yarn.lock b/yarn.lock
index 88f90db9f..2683bd446 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1730,10 +1730,10 @@
web3 "^0.20.7"
web3-provider-engine "^15.0.4"
-"@metamask/eslint-config@^1.1.0":
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/@metamask/eslint-config/-/eslint-config-1.1.0.tgz#03c6fbec8ba3d95fa017d8b98ab5d0701f7458a4"
- integrity sha512-yFFHIxFn3cBd9brIW/+0fJGq16hT0xUyElP0YxiZHaY7j2T/l+X/414L9kqBOuPfPa9bIKulIcJJOfcrMJZp9w==
+"@metamask/eslint-config@^3.1.0":
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/@metamask/eslint-config/-/eslint-config-3.1.0.tgz#8412ddd3f660748598902fd8dbef6fadc060f25e"
+ integrity sha512-He/zV0Cb5W421mEQveaqSegLarONJbJPReJppQkwhi239PCE7j+6eRji/j2Unwq8TBuOlgQtqL49+dtvks+lPQ==
"@metamask/eth-ledger-bridge-keyring@^0.2.6":
version "0.2.6"
@@ -1823,6 +1823,13 @@
"@nodelib/fs.scandir" "2.1.3"
fastq "^1.6.0"
+"@npmcli/move-file@^1.0.1":
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/@npmcli/move-file/-/move-file-1.0.1.tgz#de103070dac0f48ce49cf6693c23af59c0f70464"
+ integrity sha512-Uv6h1sT+0DrblvIrolFtbvM1FgWm+/sy4B3pvLp67Zys+thcukzS5ekn7HsZFGpWP4Q3fYJCljbWQE/XivMRLw==
+ dependencies:
+ mkdirp "^1.0.4"
+
"@popperjs/core@^2.4.0":
version "2.4.0"
resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.4.0.tgz#0e1bdf8d021e7ea58affade33d9d607e11365915"
@@ -2552,6 +2559,11 @@
resolved "https://registry.yarnpkg.com/@types/is-function/-/is-function-1.0.0.tgz#1b0b819b1636c7baf0d6785d030d12edf70c3e83"
integrity sha512-iTs9HReBu7evG77Q4EC8hZnqRt57irBDkK9nvmHroiOIVwYMQc4IvYvdRgwKfYepunIY7Oh/dBuuld+Gj9uo6w==
+"@types/json-schema@^7.0.4":
+ version "7.0.5"
+ resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.5.tgz#dcce4430e64b443ba8945f0290fb564ad5bac6dd"
+ integrity sha512-7+2BITlgjgDhH0vvwZU/HZJVyk+2XUlvxXe8dFMedNX/aMkaOq++rMAFXc0tM7ij15QaWlbdQASBR9dihi+bDQ==
+
"@types/json5@^0.0.29":
version "0.0.29"
resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee"
@@ -3323,22 +3335,12 @@ ajv@^5.1.0:
fast-json-stable-stringify "^2.0.0"
json-schema-traverse "^0.3.0"
-ajv@^6.1.0:
- version "6.10.0"
- resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.0.tgz#90d0d54439da587cd7e843bfb7045f50bd22bdf1"
- integrity sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==
+ajv@^6.1.0, ajv@^6.10.0, ajv@^6.12.2, ajv@^6.9.1:
+ version "6.12.3"
+ resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.3.tgz#18c5af38a111ddeb4f2697bd78d68abc1cabd706"
+ integrity sha512-4K0cK3L1hsqk9xIb2z9vs/XU+PGJZ9PNpJRDS9YLzmNdX6jmVPfamLvTJr0aDAusnHyCHO6MjzlkAsgtqp9teA==
dependencies:
- fast-deep-equal "^2.0.1"
- fast-json-stable-stringify "^2.0.0"
- json-schema-traverse "^0.4.1"
- uri-js "^4.2.2"
-
-ajv@^6.10.0, ajv@^6.9.1:
- version "6.10.1"
- resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.1.tgz#ebf8d3af22552df9dd049bfbe50cc2390e823593"
- integrity sha512-w1YQaVGNC6t2UCPjEawK/vo/dG8OOrVtUmhBT1uJJYxbl5kU2Tj3v6LGqBcsysN1yhuCStJCCA3GqdvKY8sqXQ==
- dependencies:
- fast-deep-equal "^2.0.1"
+ fast-deep-equal "^3.1.1"
fast-json-stable-stringify "^2.0.0"
json-schema-traverse "^0.4.1"
uri-js "^4.2.2"
@@ -6056,27 +6058,6 @@ cacache@^12.0.2:
unique-filename "^1.1.1"
y18n "^4.0.0"
-cacache@^12.0.3:
- version "12.0.4"
- resolved "https://registry.yarnpkg.com/cacache/-/cacache-12.0.4.tgz#668bcbd105aeb5f1d92fe25570ec9525c8faa40c"
- integrity sha512-a0tMB40oefvuInr4Cwb3GerbL9xTj1D5yg0T5xrjGCGyfvbxseIXX7BAO/u/hIXdafzOI5JC3wDwHyf24buOAQ==
- dependencies:
- bluebird "^3.5.5"
- chownr "^1.1.1"
- figgy-pudding "^3.5.1"
- glob "^7.1.4"
- graceful-fs "^4.1.15"
- infer-owner "^1.0.3"
- lru-cache "^5.1.1"
- mississippi "^3.0.0"
- mkdirp "^0.5.1"
- move-concurrently "^1.0.1"
- promise-inflight "^1.0.1"
- rimraf "^2.6.3"
- ssri "^6.0.1"
- unique-filename "^1.1.1"
- y18n "^4.0.0"
-
cacache@^13.0.1:
version "13.0.1"
resolved "https://registry.yarnpkg.com/cacache/-/cacache-13.0.1.tgz#a8000c21697089082f85287a1aec6e382024a71c"
@@ -6101,6 +6082,29 @@ cacache@^13.0.1:
ssri "^7.0.0"
unique-filename "^1.1.1"
+cacache@^15.0.4:
+ version "15.0.5"
+ resolved "https://registry.yarnpkg.com/cacache/-/cacache-15.0.5.tgz#69162833da29170d6732334643c60e005f5f17d0"
+ integrity sha512-lloiL22n7sOjEEXdL8NAjTgv9a1u43xICE9/203qonkZUCj5X1UEWIdf2/Y0d6QcCtMzbKQyhrcDbdvlZTs/+A==
+ dependencies:
+ "@npmcli/move-file" "^1.0.1"
+ chownr "^2.0.0"
+ fs-minipass "^2.0.0"
+ glob "^7.1.4"
+ infer-owner "^1.0.4"
+ lru-cache "^6.0.0"
+ minipass "^3.1.1"
+ minipass-collect "^1.0.2"
+ minipass-flush "^1.0.5"
+ minipass-pipeline "^1.2.2"
+ mkdirp "^1.0.3"
+ p-map "^4.0.0"
+ promise-inflight "^1.0.1"
+ rimraf "^3.0.2"
+ ssri "^8.0.0"
+ tar "^6.0.2"
+ unique-filename "^1.1.1"
+
cache-base@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2"
@@ -6543,6 +6547,11 @@ chownr@^1.1.2:
resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.3.tgz#42d837d5239688d55f303003a508230fa6727142"
integrity sha512-i70fVHhmV3DtTl6nqvZOnIjbY0Pe4kAUjwHj8z0zAdgBtYrJyYwLKCCuRBQ5ppkyL0AkN7HKRnETdmdp1zqNXw==
+chownr@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/chownr/-/chownr-2.0.0.tgz#15bfbe53d2eab4cf70f18a8cd68ebe5b3cb1dece"
+ integrity sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==
+
chrome-trace-event@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-1.0.2.tgz#234090ee97c7d4ad1a2c4beae27505deffc608a4"
@@ -7262,23 +7271,22 @@ copy-to-clipboard@^3.0.8:
dependencies:
toggle-selection "^1.0.3"
-copy-webpack-plugin@^5.1.1:
- version "5.1.1"
- resolved "https://registry.yarnpkg.com/copy-webpack-plugin/-/copy-webpack-plugin-5.1.1.tgz#5481a03dea1123d88a988c6ff8b78247214f0b88"
- integrity sha512-P15M5ZC8dyCjQHWwd4Ia/dm0SgVvZJMYeykVIVYXbGyqO4dWB5oyPHp9i7wjwo5LhtlhKbiBCdS2NvM07Wlybg==
+copy-webpack-plugin@^6.0.3:
+ version "6.0.3"
+ resolved "https://registry.yarnpkg.com/copy-webpack-plugin/-/copy-webpack-plugin-6.0.3.tgz#2b3d2bfc6861b96432a65f0149720adbd902040b"
+ integrity sha512-q5m6Vz4elsuyVEIUXr7wJdIdePWTubsqVbEMvf1WQnHGv0Q+9yPRu7MtYFPt+GBOXRav9lvIINifTQ1vSCs+eA==
dependencies:
- cacache "^12.0.3"
- find-cache-dir "^2.1.0"
- glob-parent "^3.1.0"
- globby "^7.1.1"
- is-glob "^4.0.1"
- loader-utils "^1.2.3"
- minimatch "^3.0.4"
+ cacache "^15.0.4"
+ fast-glob "^3.2.4"
+ find-cache-dir "^3.3.1"
+ glob-parent "^5.1.1"
+ globby "^11.0.1"
+ loader-utils "^2.0.0"
normalize-path "^3.0.0"
- p-limit "^2.2.1"
- schema-utils "^1.0.0"
- serialize-javascript "^2.1.2"
- webpack-log "^2.0.0"
+ p-limit "^3.0.1"
+ schema-utils "^2.7.0"
+ serialize-javascript "^4.0.0"
+ webpack-sources "^1.4.3"
core-js-compat@^3.1.1:
version "3.1.3"
@@ -8653,13 +8661,6 @@ dir-glob@2.0.0:
arrify "^1.0.1"
path-type "^3.0.0"
-dir-glob@^2.0.0:
- version "2.2.2"
- resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-2.2.2.tgz#fa09f0694153c8918b18ba0deafae94769fc50c4"
- integrity sha512-f9LBi5QWzIW3I6e//uxZoLBlUt9kcp66qo0sSCxL6YZKc75R1c4MFCoe/LaZiBGmgujvQdxc5Bn3QhfyvK5Hsw==
- dependencies:
- path-type "^3.0.0"
-
dir-glob@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f"
@@ -11154,6 +11155,11 @@ fast-deep-equal@^2.0.1:
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49"
integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=
+fast-deep-equal@^3.1.1:
+ version "3.1.3"
+ resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525"
+ integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==
+
fast-future@~1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/fast-future/-/fast-future-1.0.2.tgz#8435a9aaa02d79248d17d704e76259301d99280a"
@@ -11171,7 +11177,7 @@ fast-glob@^2.0.2:
merge2 "^1.2.3"
micromatch "^3.1.10"
-fast-glob@^3.0.3, fast-glob@^3.1.1, fast-glob@^3.2.2:
+fast-glob@^3.0.3, fast-glob@^3.1.1, fast-glob@^3.2.2, fast-glob@^3.2.4:
version "3.2.4"
resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.4.tgz#d20aefbf99579383e7f3cc66529158c9b98554d3"
integrity sha512-kr/Oo6PX51265qeuCYsyGypiO5uJFgBS0jksyG7FUeCyQzNwYnzrNIMR1NXfkZXsMYXYLRAHgISHBz8gQcxKHQ==
@@ -11488,13 +11494,13 @@ find-cache-dir@^2.0.0, find-cache-dir@^2.1.0:
make-dir "^2.0.0"
pkg-dir "^3.0.0"
-find-cache-dir@^3.0.0, find-cache-dir@^3.2.0:
- version "3.2.0"
- resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-3.2.0.tgz#e7fe44c1abc1299f516146e563108fd1006c1874"
- integrity sha512-1JKclkYYsf1q9WIJKLZa9S9muC+08RIjzAlLrK4QcYLJMS6mk9yombQ9qf+zJ7H9LS800k0s44L4sDq9VYzqyg==
+find-cache-dir@^3.0.0, find-cache-dir@^3.2.0, find-cache-dir@^3.3.1:
+ version "3.3.1"
+ resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-3.3.1.tgz#89b33fad4a4670daa94f855f7fbe31d6d84fe880"
+ integrity sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ==
dependencies:
commondir "^1.0.1"
- make-dir "^3.0.0"
+ make-dir "^3.0.2"
pkg-dir "^4.1.0"
find-root@^1.1.0:
@@ -12303,10 +12309,10 @@ glob-parent@^3.0.1, glob-parent@^3.1.0:
is-glob "^3.1.0"
path-dirname "^1.0.0"
-glob-parent@^5.0.0, glob-parent@^5.1.0, glob-parent@~5.1.0:
- version "5.1.0"
- resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.0.tgz#5f4c1d1e748d30cd73ad2944b3577a81b081e8c2"
- integrity sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw==
+glob-parent@^5.0.0, glob-parent@^5.1.0, glob-parent@^5.1.1, glob-parent@~5.1.0:
+ version "5.1.1"
+ resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.1.tgz#b6c1ef417c4e5663ea498f1c45afac6916bbc229"
+ integrity sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==
dependencies:
is-glob "^4.0.1"
@@ -12567,18 +12573,6 @@ globby@^6.1.0:
pify "^2.0.0"
pinkie-promise "^2.0.0"
-globby@^7.1.1:
- version "7.1.1"
- resolved "https://registry.yarnpkg.com/globby/-/globby-7.1.1.tgz#fb2ccff9401f8600945dfada97440cca972b8680"
- integrity sha1-+yzP+UAfhgCUXfral0QMypcrhoA=
- dependencies:
- array-union "^1.0.1"
- dir-glob "^2.0.0"
- glob "^7.1.2"
- ignore "^3.3.5"
- pify "^3.0.0"
- slash "^1.0.0"
-
globjoin@^0.1.4:
version "0.1.4"
resolved "https://registry.yarnpkg.com/globjoin/-/globjoin-0.1.4.tgz#2f4494ac8919e3767c5cbb691e9f463324285d43"
@@ -15523,13 +15517,13 @@ jed@1.1.1:
resolved "https://registry.yarnpkg.com/jed/-/jed-1.1.1.tgz#7a549bbd9ffe1585b0cd0a191e203055bee574b4"
integrity sha1-elSbvZ/+FYWwzQoZHiAwVb7ldLQ=
-jest-worker@^24.9.0:
- version "24.9.0"
- resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-24.9.0.tgz#5dbfdb5b2d322e98567898238a9697bcce67b3e5"
- integrity sha512-51PE4haMSXcHohnSMdM42anbvZANYTqMrr52tVKPqqsPJMzoP6FYYDVqahX/HrAoKEKz3uUPzSvKs9A3qR4iVw==
+jest-worker@^25.4.0:
+ version "25.5.0"
+ resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-25.5.0.tgz#2611d071b79cea0f43ee57a3d118593ac1547db1"
+ integrity sha512-/dsSmUkIy5EBGfv/IjjqmFxrNAUpBERfGs1oHROyD7yxjG/w+t0GOJDX8O1k32ySmd7+a5IhnJU2qQFcJ4n1vw==
dependencies:
merge-stream "^2.0.0"
- supports-color "^6.1.0"
+ supports-color "^7.0.0"
jmespath@^0.15.0:
version "0.15.0"
@@ -17095,6 +17089,15 @@ loader-utils@^1.0.1, loader-utils@^1.0.2, loader-utils@^1.1.0:
emojis-list "^2.0.0"
json5 "^0.5.0"
+loader-utils@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-2.0.0.tgz#e4cace5b816d425a166b5f097e10cd12b36064b0"
+ integrity sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==
+ dependencies:
+ big.js "^5.2.2"
+ emojis-list "^3.0.0"
+ json5 "^2.1.2"
+
locale-currency@0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/locale-currency/-/locale-currency-0.0.1.tgz#c9e15a22ff575b4b4bb947a4bf92ac236bd1fe9b"
@@ -17538,6 +17541,13 @@ lru-cache@^5.1.1:
dependencies:
yallist "^3.0.2"
+lru-cache@^6.0.0:
+ version "6.0.0"
+ resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94"
+ integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==
+ dependencies:
+ yallist "^4.0.0"
+
lru-queue@0.1:
version "0.1.0"
resolved "https://registry.yarnpkg.com/lru-queue/-/lru-queue-0.1.0.tgz#2738bd9f0d3cf4f84490c5736c48699ac632cda3"
@@ -17596,10 +17606,10 @@ make-dir@^2.0.0:
pify "^4.0.1"
semver "^5.6.0"
-make-dir@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.0.0.tgz#1b5f39f6b9270ed33f9f054c5c0f84304989f801"
- integrity sha512-grNJDhb8b1Jm1qeqW5R/O63wUo4UXo2v2HMic6YT9i/HBlF93S8jkMgH7yugvY9ABDShH4VZMn8I+U8+fCNegw==
+make-dir@^3.0.0, make-dir@^3.0.2:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f"
+ integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==
dependencies:
semver "^6.0.0"
@@ -18215,6 +18225,14 @@ minizlib@^1.2.1:
dependencies:
minipass "^2.2.1"
+minizlib@^2.1.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-2.1.0.tgz#fd52c645301ef09a63a2c209697c294c6ce02cf3"
+ integrity sha512-EzTZN/fjSvifSX0SlqUERCN39o6T40AMarPbv0MrarSFtIITCBh7bi+dU8nxGFHuqs9jdIAeoYoKuQAAASsPPA==
+ dependencies:
+ minipass "^3.0.0"
+ yallist "^4.0.0"
+
mississippi@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/mississippi/-/mississippi-3.0.0.tgz#ea0a3291f97e0b5e8776b363d5f0a12d94c67022"
@@ -18266,6 +18284,11 @@ mkdirp@*, mkdirp@0.5.5, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@^
dependencies:
minimist "^1.2.5"
+mkdirp@^1.0.3, mkdirp@^1.0.4:
+ version "1.0.4"
+ resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e"
+ integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==
+
mocha@^7.2.0:
version "7.2.0"
resolved "https://registry.yarnpkg.com/mocha/-/mocha-7.2.0.tgz#01cc227b00d875ab1eed03a75106689cfed5a604"
@@ -19913,13 +19936,20 @@ p-limit@^2.0.0, p-limit@^2.2.0:
dependencies:
p-try "^2.0.0"
-p-limit@^2.2.1:
+p-limit@^2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1"
integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==
dependencies:
p-try "^2.0.0"
+p-limit@^3.0.1:
+ version "3.0.2"
+ resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.0.2.tgz#1664e010af3cadc681baafd3e2a437be7b0fb5fe"
+ integrity sha512-iwqZSOoWIW+Ew4kAGUlN16J4M7OB3ysMLSZtnhmqx7njIHFPlxWBX8xo3lVTyFVq6mI/lL9qt2IsN1sHwaxJkg==
+ dependencies:
+ p-try "^2.0.0"
+
p-locate@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43"
@@ -19965,6 +19995,13 @@ p-map@^3.0.0:
dependencies:
aggregate-error "^3.0.0"
+p-map@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/p-map/-/p-map-4.0.0.tgz#bb2f95a5eda2ec168ec9274e06a747c3e2904d2b"
+ integrity sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==
+ dependencies:
+ aggregate-error "^3.0.0"
+
p-map@~1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/p-map/-/p-map-1.1.1.tgz#05f5e4ae97a068371bc2a5cc86bfbdbc19c4ae7a"
@@ -23291,10 +23328,10 @@ rimraf@^2.6.3, rimraf@^2.7.1:
dependencies:
glob "^7.1.3"
-rimraf@^3.0.0:
- version "3.0.1"
- resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.1.tgz#48d3d4cb46c80d388ab26cd61b1b466ae9ae225a"
- integrity sha512-IQ4ikL8SjBiEDZfk+DFVwqRK8md24RWMEJkdSlgNLkyyAImcjf8SWvU1qFMDOb4igBClbTQ/ugPqXcRwdFTxZw==
+rimraf@^3.0.0, rimraf@^3.0.2:
+ version "3.0.2"
+ resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a"
+ integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==
dependencies:
glob "^7.1.3"
@@ -23627,12 +23664,13 @@ schema-utils@^1.0.0:
ajv-errors "^1.0.0"
ajv-keywords "^3.1.0"
-schema-utils@^2.0.1, schema-utils@^2.5.0, schema-utils@^2.6.0, schema-utils@^2.6.1, schema-utils@^2.6.4:
- version "2.6.4"
- resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-2.6.4.tgz#a27efbf6e4e78689d91872ee3ccfa57d7bdd0f53"
- integrity sha512-VNjcaUxVnEeun6B2fiiUDjXXBtD4ZSH7pdbfIu1pOFwgptDPLMo/z9jr4sUfsjFVPqDCEin/F7IYlq7/E6yDbQ==
+schema-utils@^2.0.1, schema-utils@^2.5.0, schema-utils@^2.6.0, schema-utils@^2.6.4, schema-utils@^2.6.6, schema-utils@^2.7.0:
+ version "2.7.0"
+ resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-2.7.0.tgz#17151f76d8eae67fbbf77960c33c676ad9f4efc7"
+ integrity sha512-0ilKFI6QQF5nxDZLFn2dMjvc4hjg/Wkg7rHd3jK6/A4a1Hl9VFdQWvgB1UMGoU94pad1P/8N7fMcEnLnSiju8A==
dependencies:
- ajv "^6.10.2"
+ "@types/json-schema" "^7.0.4"
+ ajv "^6.12.2"
ajv-keywords "^3.4.1"
scope-analyzer@^2.0.1:
@@ -23845,10 +23883,12 @@ serialize-error@^7.0.1:
dependencies:
type-fest "^0.13.1"
-serialize-javascript@^2.1.2:
- version "2.1.2"
- resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-2.1.2.tgz#ecec53b0e0317bdc95ef76ab7074b7384785fa61"
- integrity sha512-rs9OggEUF0V4jUSecXazOYsLfu7OGK2qIn3c7IPBiffz32XniEp/TX9Xmc9LQfK2nQ2QKHvZ2oygKUGU0lG4jQ==
+serialize-javascript@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-4.0.0.tgz#b525e1238489a5ecfc42afacc3fe99e666f4b1aa"
+ integrity sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==
+ dependencies:
+ randombytes "^2.1.0"
serve-favicon@^2.5.0:
version "2.5.0"
@@ -24666,6 +24706,13 @@ ssri@^7.0.0:
figgy-pudding "^3.5.1"
minipass "^3.1.1"
+ssri@^8.0.0:
+ version "8.0.0"
+ resolved "https://registry.yarnpkg.com/ssri/-/ssri-8.0.0.tgz#79ca74e21f8ceaeddfcb4b90143c458b8d988808"
+ integrity sha512-aq/pz989nxVYwn16Tsbj1TqFpD5LLrQxHf5zaHuieFV+R0Bbr4y8qUsOA45hXT/N4/9UNXTarBjnjVmjSOVaAA==
+ dependencies:
+ minipass "^3.1.1"
+
stable@^0.1.8, stable@~0.1.8:
version "0.1.8"
resolved "https://registry.yarnpkg.com/stable/-/stable-0.1.8.tgz#836eb3c8382fe2936feaf544631017ce7d47a3cf"
@@ -25362,7 +25409,7 @@ supports-color@^6.1.0:
dependencies:
has-flag "^3.0.0"
-supports-color@^7.1.0:
+supports-color@^7.0.0, supports-color@^7.1.0:
version "7.1.0"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.1.0.tgz#68e32591df73e25ad1c4b49108a2ec507962bfd1"
integrity sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==
@@ -25620,6 +25667,18 @@ tar@^4.0.2:
safe-buffer "^5.1.2"
yallist "^3.0.3"
+tar@^6.0.2:
+ version "6.0.2"
+ resolved "https://registry.yarnpkg.com/tar/-/tar-6.0.2.tgz#5df17813468a6264ff14f766886c622b84ae2f39"
+ integrity sha512-Glo3jkRtPcvpDlAs/0+hozav78yoXKFr+c4wgw62NNMO3oo4AaJdCo21Uu7lcwr55h39W2XD1LMERc64wtbItg==
+ dependencies:
+ chownr "^2.0.0"
+ fs-minipass "^2.0.0"
+ minipass "^3.0.0"
+ minizlib "^2.1.0"
+ mkdirp "^1.0.3"
+ yallist "^4.0.0"
+
tarn@^1.1.4:
version "1.1.5"
resolved "https://registry.yarnpkg.com/tarn/-/tarn-1.1.5.tgz#7be88622e951738b9fa3fb77477309242cdddc2d"
@@ -25694,35 +25753,36 @@ term-size@^2.1.0:
integrity sha512-UqvQSch04R+69g4RDhrslmGvGL3ucDRX/U+snYW0Mab4uCAyKSndUksaoqlJ81QKSpRnIsuOYQCbC2ZWx2896A==
terser-webpack-plugin@^1.4.3:
- version "1.4.3"
- resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-1.4.3.tgz#5ecaf2dbdc5fb99745fd06791f46fc9ddb1c9a7c"
- integrity sha512-QMxecFz/gHQwteWwSo5nTc6UaICqN1bMedC5sMtUc7y3Ha3Q8y6ZO0iCR8pq4RJC8Hjf0FEPEHZqcMB/+DFCrA==
+ version "1.4.5"
+ resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-1.4.5.tgz#a217aefaea330e734ffacb6120ec1fa312d6040b"
+ integrity sha512-04Rfe496lN8EYruwi6oPQkG0vo8C+HT49X687FZnpPF0qMAIHONI6HEXYPKDOE8e5HjXTyKfqRd/agHtH0kOtw==
dependencies:
cacache "^12.0.2"
find-cache-dir "^2.1.0"
is-wsl "^1.1.0"
schema-utils "^1.0.0"
- serialize-javascript "^2.1.2"
+ serialize-javascript "^4.0.0"
source-map "^0.6.1"
terser "^4.1.2"
webpack-sources "^1.4.0"
worker-farm "^1.7.0"
terser-webpack-plugin@^2.1.2:
- version "2.3.2"
- resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-2.3.2.tgz#6d3d1b0590c8f729bfbaeb7fb2528b8b62db4c74"
- integrity sha512-SmvB/6gtEPv+CJ88MH5zDOsZdKXPS/Uzv2//e90+wM1IHFUhsguPKEILgzqrM1nQ4acRXN/SV4Obr55SXC+0oA==
+ version "2.3.8"
+ resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-2.3.8.tgz#894764a19b0743f2f704e7c2a848c5283a696724"
+ integrity sha512-/fKw3R+hWyHfYx7Bv6oPqmk4HGQcrWLtV3X6ggvPuwPNHSnzvVV51z6OaaCOus4YLjutYGOz3pEpbhe6Up2s1w==
dependencies:
cacache "^13.0.1"
- find-cache-dir "^3.2.0"
- jest-worker "^24.9.0"
- schema-utils "^2.6.1"
- serialize-javascript "^2.1.2"
+ find-cache-dir "^3.3.1"
+ jest-worker "^25.4.0"
+ p-limit "^2.3.0"
+ schema-utils "^2.6.6"
+ serialize-javascript "^4.0.0"
source-map "^0.6.1"
- terser "^4.4.3"
+ terser "^4.6.12"
webpack-sources "^1.4.3"
-terser@^4.1.2, terser@^4.4.3:
+terser@^4.1.2:
version "4.6.3"
resolved "https://registry.yarnpkg.com/terser/-/terser-4.6.3.tgz#e33aa42461ced5238d352d2df2a67f21921f8d87"
integrity sha512-Lw+ieAXmY69d09IIc/yqeBqXpEQIpDGZqT34ui1QWXIUpR2RjbqEkT8X7Lgex19hslSqcWM5iMN2kM11eMsESQ==