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

448 Commits

Author SHA1 Message Date
Mark Stacey
49e65a7061 Fix SrpInput small viewport styles (#14087)
The styles for smaller viewports were broken because I forgot to update
the small-screen grid template after adding the "paste-tip". The styles
have now been updated to fit the content properly on all of our
supported screen sizes.
2022-03-21 23:05:42 -02:30
Mark Stacey
00341cd3b3 Split SRP input by word (#14016)
* Initial implementation of new SrpInput component

This new version of the SrpInput component uses a separate field for
each word of the SRP. Only one field can be revealed at a time, making
it less likely that it gets accidentally revealed to somebody.

* Fix copy mistakes

* Move container div from 'create vault' to 'srp-input', and setup grid layout

* Increase size of title

* Remove hard-coded width in Storybook to allow testing different viewport sizes

* Improve layout

* Improve margins

* Update dropdown text

* Expand SRP input section

* Remove unused localized messages

* Update dropdown option names in unit tests

* Replace checkbox with show/hide toggle

* Remove unused localized message

* Fix 'data-testid' prop name

* Fix e2e test imports using paste

* Use 'ActionableMessage' component for error message

* Convert error popover to actionable message

* Add tip about pasting the SRP

* Remove invalid prop

The "info" style of `ActionableMessage` is the default, so no type is
required.

* Use more readable test convenience methods

The method `toBeInTheDocument()` is now used over `not.toBeNull()` to
improve the readability of tests. Likewise, the convenience method
`.clear` is now used to clear fields rather than manually entering the
key combination to clear a field.

* Fix misspelled word
2022-03-21 18:53:07 -02:30
Mark Stacey
4adadd3325 Add ShowHideToggle component (#13979)
Add a new component for controlling whether a field should be shown
or hidden. This will be used in later PRs as a control for sensitive
fields that are hidden by default.

This component should be fully accessible. Both mouse and keyboard
interactions have been tested, and `aria-label` attributes have been
added to explain the two "eye" icons that don't have any corresponding
text.

Thorough unit tests have been written, testing all props except
`className` (I don't know how to test that using Jest/`jsdom`).
2022-03-21 18:51:19 -02:30
Mark Stacey
c154145e85 Add IconEye and IconEyeSlash icon components (#13978)
Add two new FontAwesome icon components. The first is an eye, and the
second is an eye with a slash through it. These will be used in a
subsequent PR for a "Show/Hide" toggle.
2022-03-21 18:51:18 -02:30
Mark Stacey
851f9b30b4 Add data-test-id prop to TextField component (#13973)
The `data-test-id` prop has been added to `TextField`. This prop allows
selecting this component more easily from e2e and unit tests. This is
required for a subsequent PR that includes a text field that cannot be
selected for by placeholder or contents or label (any of which would
have been preferable).
2022-03-21 18:51:18 -02:30
Mark Stacey
1eecc59969 Improve unit tests for SrpInput component (#13803)
The library `@testing-library/user-event` has been updated to the
latest beta version, so that our unit tests better model real user
interactions. In particular, I found that previously the `paste` event
was missing the `clipboardData` API, so it was impossible to implement
any custom handling of paste events (which we will need in later PRs).

See the `v14.0.0-beta.1` release notes for a list of all breaking
changes [1]. The main change is that all methods now return Promises.
The `paste` method has also been dramatically simplified.

The unit tests have also been updated to reset all mocks before each
test. These tests don't have any shared mocks, but this is generally a
good practice, to ensure that tests don't develop accidental inter-
dependencies.

[1]: https://github.com/testing-library/user-event/releases/tag/v14.0.0-beta.1
2022-03-21 18:51:18 -02:30
Mark Stacey
22f9de9a2c Refactor: Extract SRP input from create vault component (#13720)
This is a pure refactor that extracts the SRP input from the
`CreateNewVault` component. This is intended to make future changes to
the SRP input easier, and to reduce duplication between the old and new
onboarding flows.

Extensive unit tests have been added for the new SRP input component.

A new test library was added (`@testing-library/user-event`) for
simulating user events with components rendered using the
`@testing-library` library.

A new helper method has been added (`renderWithLocalization`) for
rendering components using `@testing-library` with just our
localization contexts added as a wrapper. The localization contexts
were already added by the `renderWithProviders` helper function, but
there is no need for a Redux provider in these unit tests.
2022-03-21 18:51:18 -02:30
Olusegun Akintayo
13f385aa30 Fix for connected sites throwing error if name is null. (#13974)
* Fix for connected sites throwing error if name is null.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Reverted yarn.lock changes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>
2022-03-16 10:55:29 -02:30
André Ogle
0361aa6a93 Use pre-wrap instead of pre for signature content (#13828) 2022-03-11 11:34:11 -03:30
Ariella Vu
34bf555e50 Fix v10.11: Unable to find value of key "eth_accounts" for locale "en" in Permissions Modal (#13833)
* ConnectedAccountsPermissions: convert to FC

* permissions: add usePermissionsDescriptions
- fix ConnectedAccountsPermissions eth_accounts i18n

* ConnectedAccountsPermissions: rm .component
from path

* ConnectedAccountsPermissions: fix toggleExpanded

ensure we change previous state value

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

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2022-03-04 13:40:58 -03:30
ryanml
532cf54307 Revert "Allow sending up to 15 decimals on the send screen (#12707)" (#13823)
This reverts commit 8597cd1401.
2022-03-02 17:30:40 -07:00
Olusegun Akintayo
eb5dc7d8b0 Fixed these issues in v10.11.0 (#13806)
After landing on Swap, a disclaimer of Smart Transactions appear, and an error on devTools shows the following: “invalid prop ‘type’ of value ‘ul’” supplied to ‘Typography’
    After enabling Smart Transactions, an error on devTools shows the following: “invalid prop ‘smartTransactionsOptInSatus’ of type ‘boolean supplied to ‘SlippageButtons’

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>
2022-03-02 09:05:24 -07:00
Daniel
730f977939 Small fixes for Swaps (#13732)
* Fix: Insufficient number of substitutions for key "stxSuccessDescription"

* Only calculate "approvalGas" if the "approvalNeeded" param is truthy in a quote

* "Swap from" has to be set to enable "Review Swap", set a default token for "Swap from"

* Fix: Unable to find value of key "undefined" for locale

* Use array destructuring
2022-02-23 14:28:31 -07:00
Daniel
2585f45bde
Add support for Smart Transactions (#12676) 2022-02-18 17:48:38 +01:00
Tom McGuire
d2c292bead
Add argTypes for color-indicator (#13659) 2022-02-18 10:00:07 -06:00
Rob Dawson
ef3199ebd1
Mįgrate truncated definition list stories from addon knobs to use controls. (#13628) 2022-02-17 10:14:24 -06:00
Rob Dawson
4a6082f1d7
Updated the Callout story to convert knobs and actions to controls / args. (#13624) 2022-02-17 10:11:17 -06:00
ryanml
b954ca447d
Ensure pre-selected account on connect screen is visible in list (#13621)
* Ensure pre-selected account on connect screen is visible in list

* adding smooth scroll behavior

* Change conditional
2022-02-16 11:00:44 -07:00
dragana8
5095071083
Make default icons the same on mobile and extension #13264 (#13408) 2022-02-16 11:03:17 -06:00
VSaric
2cd242252f
Created "Token details" page (#13216)
* Created new screen/page "Token details"

* Change color in scss

* Modify elements to the latest requirements and added unit tests

* Review requested changes

* Condensing files into one component

* Added unit tests for token details page

* Added redirection when switching networks, added image for a token and update unit tests

* Requested review changes

* Modify index.scss regarding of the requested review

* Delete data-testid's from Typography and token-details-page.js

* Requested review changes
2022-02-16 13:29:39 -03:30
Dan J Miller
d1c5274738
Ensure sign message button is only enabled on scroll (#13645)
* Ensure sign message button is only enabled on scroll

* Add button for message scrolling to signature request screen

* lint fix

* Only show scroll button if message is scrollable

Co-authored-by: ryanml <ryanlanese@gmail.com>
2022-02-15 16:59:59 -07:00
ryanml
40269ad13c
Fixing sign type data message formatting, requiring content scroll before sign (#13642)
* Fixing signature request formatting, requiring scroll before sign

* Ensure sign button not disable when no scroll is required

* Test fix attempt #1

* Clean up e2e tests

Co-authored-by: Dan Miller <danjm.com@gmail.com>
2022-02-15 11:39:57 -07:00
Erik Marks
35ac762e10
Add Snaps via Flask (#13462)
This PR adds `snaps` under Flask build flags to the extension. This branch is mostly equivalent to the current production version of Flask, excepting some bug fixes and tweaks.

Closes #11626
2022-02-14 16:02:51 -08:00
Jyoti Puri
2b5b787ca9
Fix: advance defaults should never be used for swaps (#13617) 2022-02-15 00:37:46 +05:30
ryanml
2ad0b85cb1
Untranslated string fix (#13615) 2022-02-14 08:52:04 -07:00
Jyoti Puri
eb39290dcd
Fixes in EIP-1559 V2 implementation (#13574)
* Fixes in EIP-1559 V2 implementation

* Adding check for transaction.id in useTransactionEventFragment hook

* Update ui/components/app/advanced-gas-fee-popover/advanced-gas-fee-gas-limit/advanced-gas-fee-gas-limit.js

Co-authored-by: Alex Donesky <adonesky@gmail.com>

* fix

* fix

* fix

* fix

* fix

* fix build

Co-authored-by: Dan J Miller <danjm.com@gmail.com>
Co-authored-by: Alex Donesky <adonesky@gmail.com>
2022-02-11 10:59:17 -03:30
Dan J Miller
8597cd1401
Allow sending up to 15 decimals on the send screen (#12707) 2022-02-10 17:35:41 -05:00
Niranjana Binoy
59b0ae4b40
Updating the direct deposit messages to native currency (#13576) 2022-02-10 13:27:29 -05:00
dragana8
31eb5fc88a
[BUILD FIX #12920] Updated style for full screen mode in settings page (#13569) 2022-02-09 11:49:41 -06:00
dragana8
47e2e37712
Setting search feature - Setting component UI updates #12761 (#12920)
* updated settings page

removed unused messages

fixed width

moved icons into one folder

review comments update

removed unused strings

renamed components

removed class

added prop

updated e2e test

e2e

extracted icons

* locales fix

* update

* margin-inline
2022-02-08 13:00:20 -03:30
Alex Donesky
48cc9d5ad3
Add currency symbol validation in the add network form (#12431)
* validate ticker symbol in add/edit network form
2022-02-04 12:14:52 -06:00
Mark Stacey
429451de23
Extract "create vault" form to separate component (#13461)
The form used for creating a vault on the "Import" page of onboarding
and on the "Restore vault" page is nearly identical, yet the
implementation is totally separate. It has now been extracted to a
separate component, consolidating the two implementations.

There is a "terms of use" checkbox on the import page that isn't on the
restore vault page, so that part has been made optional. The "submit"
button text differs between the two uses as well, so that is
customizable.

There are slight styling differences between the old and new versions
of this form. The fonts and spacing are all using our new standard
design system guidelines, and we're using our standard checkbox now as
well. The spacing and font sizes were chosen somewhat arbitrarily by me
to resemble the old styles, so please feel free to suggest changes if
you think they can be improved upon.

There are some slight copy changes to the "Restore vault" page as well;
the placeholder text and the label for the "Secret Recovery Phrase"
field now matches the "Import" page copy.
2022-02-03 10:36:43 -03:30
Jyoti Puri
760ed3457d
Removing EIP_1559_V2 feature flag (#13481) 2022-02-03 05:58:28 +05:30
MG
3301fd8121
Feat/hide 0 balances (#13306)
* Added token list functional component

* Added list - img not showing up

* Changed render list

* Removed unused code

* Clean up

* Lint

* Linted

* Add newline

* Filter out isERC721

* Added token list

* Cleaned up style

* Fixed typography

* Fixed lint

* Fixed spacing measure

* Lint cleanup
2022-02-02 12:32:16 +01:00
ryanml
5e07c0768b
Handling array type values for image in Identicon component (#13484)
* Handling array type values for image in Identicon component

* Adding additional type check
2022-02-01 20:11:42 -07:00
Jyoti Puri
cc1861a34e
Adding metrics events for EIP-1559 V2 flow (#13329) 2022-02-01 23:23:03 +05:30
Ariella Vu
3a75f68a15
#10168 - Fix to Can't open settings if browser zoom level > 100% part 2 (#13460)
* AccountMenu: fix #10168 w/ position: absolute
- use right: 1rem to match .app-header padding

* scss: Use px instead of rem for positioning

Co-authored-by: George Marshall <george.marshall@consensys.net>

Co-authored-by: George Marshall <george.marshall@consensys.net>
2022-02-01 03:32:43 +00:00
Hassan Malik
d02facf17e
changed icon to button for connected-sites-list (#13476)
* changed icon to button for connected-sites-list

* made CSS changes
2022-01-31 15:33:35 -05:00
Alex Donesky
dc217dd536
Yet more NFT UX cleanups (#13435)
* yet more nft ux cleanups
2022-01-31 12:56:49 -06:00
Shane
09ac38977e
Add TextArea to safe components list (#13468)
These changes were split off from the snaps branch [here](https://github.com/MetaMask/metamask-extension/pull/11837#discussion_r792944264).
2022-01-31 10:41:07 -08:00
Shane
516de24cbe
Fixed multiple-notifications css (#13469) 2022-01-31 09:09:21 -08:00
Jyoti Puri
11c61a3ead
EIP-1559 V2 UI/UX improvements (#13419) 2022-01-31 11:21:43 +05:30
Ariella Vu
869d7a21bf
Revert "#10168 - Fix to Can't open settings if browser zoom level > 100% (#13281)" (#13459)
This reverts commit 05f9ceda77.
2022-01-28 21:59:15 +00:00
Shane
bac20099e5
Removed memo status from snap-settings-card (#13458) 2022-01-28 13:40:13 -08:00
Hassan Malik
2825b74a55
added extension changes from snaps branch (#13433) 2022-01-28 12:39:32 -05:00
yanjade
3eb99babf2
batch fix misspelling (#13449) 2022-01-28 09:09:07 -06:00
David Walsh
851fce9a3b
Enable buying MATIC on Polygon, BNB on BSC, AVAX on Avalanche, FTM on Fantom, CELO on Celo, and respective stablecoins on Transak (#13398) 2022-01-28 07:46:26 -06:00
Alex Donesky
be65eb7339
More nft ux fixes (#13388)
* a batch of nft ux fixes
2022-01-27 11:26:33 -06:00
Jyoti Puri
a0e97f4681
EIP-1559 v2 - small fixes (#13392) 2022-01-26 23:48:43 +05:30
filipsekulic
fcd5f89e2f
Move component into another folder (#13380) 2022-01-26 11:48:28 -06:00