1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-25 12:52:33 +02:00
Commit Graph

4085 Commits

Author SHA1 Message Date
Brad Decker
e5688c024e
consolidate segment setup (#9617)
Consolidates the background and UI segment implementations into a shared solution.

This results in the introduction of our first shared module.

Co-authored-by: Erik Marks <25517051+rekmarks@users.noreply.github.com>
2020-10-21 16:10:55 -05:00
Mark Stacey
7d0a7ab301
Update @metamask/eslint-config to v4.1.0 (#9663)
`@metamask/eslint-config` has been updated to v4.1.0. This update
requires that we update `eslint` to v7 as well, which in turn requires
updating most `eslint`-related packages.

Most notably, `babel-eslint` was replaced with `@babel/eslint-parser`,
and `babel-eslint-plugin` was replaced by `@babel/eslint-plugin`. This
required renaming all the `babel/*` rules to `@babel/*`.

Most new or updated rules that resulted in lint errors have been
temporarily disabled. They will be fixed and re-enabled in subsequent
PRs.
2020-10-21 14:01:03 -02:30
David Walsh
6e7a8428d8
Merge pull request #9626 from darkwing/loading-screen-update
Make loading screen more concise
2020-10-21 10:40:39 -05:00
ricky
51187179bb
Use undefined as default prop for onClick (#9654) 2020-10-21 00:30:01 -04:00
Dan J Miller
2c9a082af9
Add average_savings event to analytics (#9622) 2020-10-20 14:12:30 -02:30
Mark Stacey
5789bd86c0
Fix sorting Quote Source column of quote sort list (#9658)
Sorting was broken for the "Quote Source" column of the quote sort
list. Attempting to sort by this column would arrange the quotes in a
seemingly random order.

It appears that this was due to this column being programmed to sort by
a property called `liquiditySource`, which does not exist in the quote
data. I'm unsure what the difference between `liquiditySource` and
`quoteSource` was supposed to be; the values in the mocks are all
identical.

All references to `liquiditySource` have been updated to refer to
`quoteSource` instead, and the sorting now works correctly.
2020-10-20 12:14:04 -02:30
David Walsh
fe970a7be8
Merge pull request #9642 from darkwing/9638-swap-overflow-2
Fix 9638 - Prevent excessive overflow from swap dropdowns
2020-10-20 09:16:34 -05:00
Mark Stacey
a9a432db0c
Fix conversionRate PropType of GasModalPageContainer (#9651)
The `conversionRate` prop of `GasModalPageContainer` was updated
recently in PR #9623 to have a PropType of `string` instead of
`number`. This resulted in a PropType error whenever this modal was
rendered, as `conversionRate` is always a `number`.

The PropType has been reverted to the correct type, `number`.
2020-10-20 10:37:14 -02:30
Mark Stacey
4197ff7295
Fix contentText PropType of InfoTooltip (#9652)
The `InfoTooltip` component had a `contentText` prop with a PropType of
`string` that was being passed a `node` as of #9614. This resulted in a
PropType error.

The `contentText` prop was being passed directly to `Tooltip` component
as the prop `html`, which has a PropType of `node`. A string is a valid
`node` type, which is why this worked before.

The `contentText` prop is now of type `node`, and the error no longer
appears.
2020-10-20 10:36:57 -02:30
Mark Stacey
7f1bbbc9a3
Fix message PropType of ActionableMessage (#9653)
The `message` prop of `ActionableMessage` had a PropType of `string`,
but it was being passed a `node`. This was resulting in a PropType
error in the console on the view quote page.

The PropType has been changed to `node`, and the error is now gone.
2020-10-20 10:36:44 -02:30
Mark Stacey
d43738448c
Fix React warning about missing key in AwaitingSwap (#9655)
The `AwaitingSwap` component was emitting a React warning when rendered
because a component was being rendered in an array without having a
`key` prop set.

A key has been added to the `CountdownTimer` component, which is passed
into the translation helper in an array. The warning no longer appears.
2020-10-20 10:36:15 -02:30
Mark Stacey
f4838194d6
Remove unused customGasLimit parameter (#9656)
This parameter to the `quotesToRenderableData` function was never
passed in. It has been removed.
2020-10-20 10:36:00 -02:30
Mark Stacey
97450cd8fd
Remove non-existent metaMaskFee property (#9657)
The `metaMaskFee` property on the "quote data" PropType was not used,
and it never existed in practice. This resulted in PropType errors.

The non-existent property has been removed.
2020-10-20 10:35:34 -02:30
Erik Marks
edefdc4ede
Fix estimated network fee line split (#9648) 2020-10-19 20:59:31 -02:30
Mark Stacey
4cab30eae1
Remove duplicate percent sign from MetaMask fee (#9647)
The MetaMask fee is shown with two percent signs on the view quote page, because the percent sign is embedded in the fee amount as well as in the localized message.

The fee amount used now comes from the API, and does not have a percent sign. The percent sign is now only in the localized message. This allows for different locales to display the percentage differently. The old hard-coded value with a percent sign embedded has been removed, as it is no longer used anywhere.
2020-10-19 20:58:48 -02:30
David Walsh
a6fd1266aa Fix 9638 - Prevent excessive overflow from swap dropdowns 2020-10-19 16:11:34 -05:00
Dan J Miller
43d97ebe4f
getStatusKey to return an empty string when passed a falsy value (#9640) 2020-10-19 18:29:48 -02:30
Dan J Miller
c8526bc687
Update view-quote designs to better represent the metamask fee (#9633)
* Update view-quote designs to better represent the metamask fee

* Code clean up

* Copy updates
2020-10-19 17:15:32 -02:30
Dan J Miller
d44c03b882
Cast MIN_GAS_LIMIT_DEC to number before passing to minimumGasLimit (#9636) 2020-10-19 15:21:36 -02:30
Dan J Miller
b1adc0d1e8
Fix use transaction time remaining (#9630)
* Only format timeRemaining if in useTransactionTimeRemaining if it is truthy

* Only setTimeRemaining in useTransactionTimeRemaining if submitted time is a number

* Use isSubmitted as a check, instead of isPending and submittedTime, before calculating timeRemaining
2020-10-19 12:15:21 -02:30
Dan J Miller
7925a767b8
Add a minimumGasLimit to the original gas customization modal (#9623)
* Add a minimumGasLimit to the gas customization modal in swaps

* Update app/_locales/en/messages.json

Co-authored-by: Mark Stacey <markjstacey@gmail.com>

* Set default for minimum gas limit in gas-modal-page-container.container and make required in sub components

* Update unit tests

* Default value for minimumGasLimit in advanced-gas-inputs.component.js

* Preserve existing gasLimitTooLow message key by creating new gasLimitTooLowWithDynamicFee

* Fix failing unit test

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
Co-authored-by: Erik Marks <rekmarks@protonmail.com>
2020-10-19 10:41:23 -02:30
Dan J Miller
397e3a2c7f
Update swaps network fee tooltip (#9614)
* Update network fee tooltip in fee-card to match latest designs

* Clean up css classes and div
2020-10-19 05:54:59 -02:30
Dan J Miller
3191d9e014
Help users avoid insufficient gas prices in swaps (#9624)
* Don't show average (slowest) button in custom gas modal while in swaps

* In swaps, show warning in custom gas modal if price set below average price

* Update ui/app/selectors/custom-gas.js

Co-authored-by: Erik Marks <25517051+rekmarks@users.noreply.github.com>

* Fix typo

Co-authored-by: Erik Marks <25517051+rekmarks@users.noreply.github.com>
2020-10-17 06:43:51 -02:30
David Walsh
d9af9986bb Make loading screen more concise 2020-10-16 20:43:13 -05:00
Dan J Miller
e546314e3f
Update fee card storybook to utilize latest fee-card api (#9613)
* Update fee card storybook to utilize latest fee-card api

* Update ui/app/pages/swaps/fee-card/fee-card.stories.js

Co-authored-by: Mark Stacey <markjstacey@gmail.com>

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2020-10-16 13:29:32 -02:30
David Walsh
0a874e2a87
Merge pull request #9616 from darkwing/prevent-button-warning
Fix #9577 - Use contained button type for unlock button
2020-10-16 09:15:20 -05:00
David Walsh
b1f7fbf343
Merge pull request #9608 from darkwing/9043-camera
Fix #9043 - Ensure QR code scanner works
2020-10-16 09:15:00 -05:00
David Walsh
971f5b0056 Fix #9577 - Use contained button type for unlock button 2020-10-15 10:36:15 -05:00
Dan J Miller
af018a2d74
Clear all gas slice state on entering and leaving swaps (#9609) 2020-10-14 21:50:37 -02:30
David Walsh
9987484301 Fix lint 2020-10-14 17:07:15 -05:00
David Walsh
15654b3d0b Prevent unnecessary teardown 2020-10-14 17:05:36 -05:00
David Walsh
947bfb7a11 Fix #9043 - Ensure QR code scanner works 2020-10-14 17:00:40 -05:00
Brad Decker
83fe472779
fix issue with unmatched routes (#9595)
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2020-10-14 14:23:38 -05:00
Dan J Miller
0558689636
Compare convert ethBalance to decimal before comparing to fromTokenBalance in useEffect for eth token balance update (#9607) 2020-10-14 16:48:21 -02:30
Erik Marks
c39617e111
Make FeeCard component specific to swaps (#9603)
* Make FeeCard component specific to swaps

* Fix some prop types
2020-10-14 11:59:03 -07:00
Erik Marks
a0d7aa56aa Loosen isBestQuote PropType 2020-10-14 10:17:41 -07:00
Erik Marks
799df99bd0 Rename some props 2020-10-14 10:12:35 -07:00
Erik Marks
b31816d6f7 Make FeeCard component specific to swaps 2020-10-14 10:06:17 -07:00
David Walsh
ec70f33eca
Try disable swap button so it cannot be focused (#9602) 2020-10-14 14:16:14 -02:30
David Walsh
d0152aad51
Use localizations for placeholders in Swap (#9587) 2020-10-14 14:15:44 -02:30
David Walsh
48dd3fe069
AutoFocus the from input on swaps screen (#9581) 2020-10-14 14:13:55 -02:30
David Walsh
bbd4ee5fdf
Autofocus the appropriate text fields in the Create/Import/Hardware screen (#9576) 2020-10-14 14:13:26 -02:30
David Walsh
674107da3f
Ensure proper hover display for accounts in main menu (#9575) 2020-10-14 14:13:09 -02:30
Dan J Miller
2563180a88
Data consistency swaps token balance (#9588)
* Explicitly set balance and string on the swaps from token in token-overview

* Set swapsFromToken balance to a decimal instead of a hex on eth balance change in build-quote
2020-10-14 14:09:04 -02:30
Mark Stacey
e53f970458
Use localized strings for MetaMetrics opt-in page (#9593)
The MetaMetrics opt-in page during onboarding now uses localized
strings. This allows us to add translations.
2020-10-14 13:33:34 -02:30
Thomas Huang
38a0c5ec75
Fix FF overflow list-item right-content/primaryCurrency wrapper (#9591)
Over flow .list-item__right-content rather than the text.
2020-10-13 21:45:21 -07:00
Mark Stacey
7a1d93002d
Remove commitment to maintain a public metrics dashboard (#9592)
We were unable to deliver this public dashboard as we had originally
anticipated, and this is no longer a priority for the team. We may
revisit this idea in the future, but for now it has been removed from
our list of commitments.
2020-10-13 22:16:02 -02:30
Erik Marks
59212f7a2b
Remove dead gas estimation functions, rename function (#9579) 2020-10-13 14:13:54 -07:00
Dan J Miller
dfb722b6ed
Hex prefix newly fetched token balances in build-quote (#9586)
* Hex prefix newly fetched token balances in build-quote

* Set balance to dec WEI string instead of hex when adding token via swap from select
2020-10-13 17:38:24 -02:30
Mark Stacey
c11b7cc5ea
Update setRpcTarget parameter name (#9585)
The `network` parameter of `setRpcTarget` was changed to `chainId` in
a recent commit, but there was an interim variable that we forgot to
rename.
2020-10-13 16:37:29 -02:30