1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-23 18:41:38 +01:00
Commit Graph

4124 Commits

Author SHA1 Message Date
Brad Decker
50728ed9ef
normalize deprecated itcss font styles (#9696) 2020-10-29 10:03:45 -05:00
Brad Decker
fe69182056
normalize app component font styles (#9695) 2020-10-29 10:03:29 -05:00
Brad Decker
186ee97d36
normalize UI component font styles (#9694) 2020-10-29 09:30:38 -05:00
David Walsh
220a82b53f
Fix 9435 - Allow speeding up of underpriced transactions (#9687) 2020-10-28 16:56:58 -05:00
David Walsh
336282d7d5
Focus on wallet address in buy workflow (#9715) 2020-10-28 11:34:06 -05:00
Brad Decker
96717cc9e0
expose variables for typography sizes (#9693)
This will allow usage in areas where getting the line-height, etc
of the typography settings will introduce issues. The mixins have been
updated to references these variables so that they can be changed in
one place in the future
2020-10-28 09:03:38 -05:00
David Walsh
5b67cf1009
Prevent React warning for custom slippage (#9706) 2020-10-28 08:58:31 -05:00
Thomas Huang
0494f72128
Check if swapTokenValue is negative and set prefix accordingly (#9743)
* Check if swapTokenValue is negative and set prefix accordingly

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

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2020-10-28 00:08:02 -07:00
Dan J Miller
557f9550d7
Use better value for average savings analytics (#9733) 2020-10-27 16:42:06 -02:30
Dan J Miller
a4f817e171
Include trade.value in calculation of displayed network fees (#9621)
* Ensure that trade.value fees are included in displayed network fees

* Remove unused getTotalEthCost function

* Remove unused getTotalEthCost function

* Update ui/app/pages/swaps/swaps.util.js

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

* Lint fix

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2020-10-27 16:32:21 -02:30
David Walsh
61e48b4a84
Switch to DIV for swaps dropdown accessibility (#9732) 2020-10-27 12:20:35 -05:00
Mark Stacey
d6d02053ff
Log when attempt to fetch quotes fails (#9723)
If the attempt to fetch quotes fails, an error message is now logged to
the console explaining why it failed. This makes it dramatically easier
to understand what's happening when quotes fail.

At some point later on we should also look specifically for errors we
expect to occur, and report to Sentry in unexpected cases. I've added a
TODO comment about this.
2020-10-26 19:52:46 -02:30
Brad Decker
7d50357684
remove matomo and route to segment (#9646) 2020-10-26 14:05:57 -05:00
David Walsh
a111702f28
Merge pull request #9702 from darkwing/swaps-keyboard-dropdown
Swaps keyboard dropdown
2020-10-26 11:10:19 -05:00
David Walsh
6e89b60a4a
Merge pull request #9671 from darkwing/9632-simple-abort
Fix 9632 - Prevent old fetches from polluting the swap state
2020-10-26 08:09:58 -05:00
David Walsh
f15b4949a1
Merge pull request #9705 from darkwing/avoid-selected-account-memory-leak
Prevent memory leak from selected account copy tooltip
2020-10-26 07:05:50 -05:00
Dan J Miller
5456d55c88
Update main-quote-summary designs/styles (#9612)
* Update main-quote-summary designs/styles

* Clean up css: use className instead of element types

* Style fixes to symbol elements in main-quote-view

* Use correct source for token iconUrls passed to main-quote-view

* Improve vertical spacing on view-quote screen and with new main-quote-view designs

* Remove unused classes

* Tweak space around large quote amount text in main-quote-summary
2020-10-25 10:53:34 -02:30
David Walsh
f4e5eeca18 Prevent React error for close 2020-10-23 16:08:46 -05:00
David Walsh
25a599c6cd Prevent memory leak from selected account copy tooltip 2020-10-23 15:39:26 -05:00
David Walsh
14fff6dcf2 Lint 2020-10-23 15:01:50 -05:00
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
David Walsh
15aba70e74 Clean up events 2020-10-23 14:29:16 -05:00
David Walsh
cdda54155e Make the dropdown widgets for swaps keyboard accessible 2020-10-23 14:19:28 -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
David Walsh
5c1c9c8f16 Fix 9632 - Prevent old fetches from polluting the swap state 2020-10-23 10:59:02 -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