1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-23 11:46:13 +02:00
Commit Graph

4007 Commits

Author SHA1 Message Date
David Walsh
046b495670
Merge pull request #9700 from darkwing/ux-search-icon
Provide image sizing so there's no jump when opening the swaps token search
2020-10-23 14:42:44 -05:00
Whymarrh Whitby
80e2a4496e
Fix mocha/max-top-level-suites issues (#9699)
Refs #9663

This change enables `mocha/max-top-level-suites` and fixes the issues raised by the rule.
2020-10-23 16:19:49 -02:30
David Walsh
f0202f2d2c Provide image sizing so there's no jump when opening the swaps token search 2020-10-23 13:28:38 -05:00
Mark Stacey
400881b1b1
Remove broken Storybook stories (#9690)
These two stories showcased components that used React context and
Redux state that was not made available in the stories themselves. They
both crashed with an error when rendered in Storybook.

Instead of going through a great deal of effort to setup mocks for the
global Redux state and context, they have been removed. They are
perhaps the wrong layer for us to showcase in Storybook. Storybook is
more well suited for individual components that contain just UI logic.
2020-10-23 12:44:45 -02:30
Mark Stacey
209f2afd3d
Fix PropType error on Awaiting Swap page (#9688)
A PropType error was shown in the console when on the Awaiting Swap
page in certain error scenarios. The `symbol` property was sometimes
not set if `destinationTokenInfo` was missing.

The `symbol` prop has been removed, as the `AwaitingSwap` component
already selected the `fetchParams`, and the `destinationTokenInfo`
object within. The prop was effectively a duplicate.
2020-10-23 11:41:10 -02:30
Dan J Miller
5cc40bff41
Gas metrics tweaks for swaps failed and completed events (#9676)
* Change base of estimated_gas sent to analytics

* Add suggested_gas_price and used_gas_price to analytics
2020-10-22 17:34:34 -02:30
Whymarrh Whitby
6038a1f3f5
Fix dot-notation issues (#9679)
Refs #9663

This change enables `dot-notation` and fixes the issues raised by the rule.
2020-10-22 14:37:02 -02:30
David Walsh
e46c063fed
Merge pull request #9667 from darkwing/9649-qr-contact
Fix 9649 - Ensure QR codes work properly when adding contact
2020-10-22 11:42:31 -05:00
David Walsh
9c25775b69 Prevent conflicting values when network change and QR code in same render 2020-10-22 10:08:54 -05:00
Dan J Miller
21ab6fb7b5
Use our local ETH_SWAPS_TOKEN_OBJECT in place of the swaps api ETH 'token', in the swaps token array (#9678) 2020-10-22 12:29:58 -02:30
Dan J Miller
07c03e362e
Get swaps fee from api (#9677)
* Use fee from quote object instead of from fee api

* Remove code related to the metaMaskFeeAmount property in state and the /fee api
2020-10-22 12:28:19 -02:30
Whymarrh Whitby
362e717eef
Fix node/no-deprecated-api issues (#9670)
Refs #9663

See [`node/no-deprecated-api`][1] for more information.

This change enables `node/no-deprecated-api` and fixes the issues raised by the rule.

  [1]:https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/no-deprecated-api.md

The change to the way that `punycode` is imported is to address the fact that
third-party module is hidden by the built-in. This is a silly hack but it works.
2020-10-22 11:33:45 -02:30
David Walsh
cdef338c85 Prevent multiple state changes 2020-10-22 08:08:59 -05:00
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
David Walsh
6704aab16c Lint 2020-10-21 13:22:00 -05:00
David Walsh
21875d1dd3 Fix for tests 2020-10-21 12:55:03 -05:00
David Walsh
4892a3e0e1 Fix 9649 - Ensure QR codes work properly when adding contact 2020-10-21 11:35:56 -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