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

4985 Commits

Author SHA1 Message Date
Jyoti Puri
9dd5af3523
Implementing design feedbacks in EIP-1559 V2 flow (#12943) 2021-12-06 21:10:20 +05:30
Mark Stacey
b983971bfd
Disable remote-redux-devtools in non-dev builds (#12956)
`remote-redux-devtools` is now explicitly excluded and disabled in non-
dev builds, and in the `testDev` build. This was causing console errors
in the `testDev` build during e2e tests, which would cause certain
tests to fail.

This was already only supposed to be enabled for development builds,
but this library used the `NODE_ENV` environment variable to make that
determination. This gives us more control over when it's disabled.
2021-12-06 11:55:40 -03:30
Mark Stacey
b75ef5f0eb
Remove redundant EIP_1559_V2_ENABLED comparison (#12954)
A redundant comparison for the `EIP_1559_V2_ENABLED` variable has been
removed. This variable is a boolean, so it can be treated as a boolean
directly in most cases.

One such comparison has been preserved for the purpose of allowing unit
testing, because `process.env` entries are always strings in Node.js. A
comment was added to explain this.
2021-12-06 11:23:02 -03:30
George Marshall
6d34d85f6e
Textarea UI component (#12688)
* Initial Textarea component

* added no-scroll class and css

* added tests

* removed comment from prettier, updated README title

* updated tests

* added resize tests

* fixed grammar

* updated scss

* changes per linter

* updated title to match new folder structure for storybook

* reverted unintended change

Co-authored-by: hmalik88 <hassan.malik@consensys.net>
Co-authored-by: Hassan Malik <41640681+hmalik88@users.noreply.github.com>
2021-12-03 11:54:29 -05:00
Jyoti Puri
cd4ddffd9c
Adding gas limit section on advance gas fee modal (#12865) 2021-12-03 21:29:48 +05:30
Alex Donesky
6542d16349
1559 v2 tooltips (#12750)
* add tooltips
2021-12-03 09:44:23 -06:00
Mark Stacey
91af73b211
Remove invalid disableRipple prop (#12948)
The `disableRipple` prop was resulting in a React error in development
builds because it was unrecognized by React. This prop dates back to
when we were using the `@material-ui` Button class. It no longer serves
any purpose, so it has been removed.
2021-12-03 11:22:14 -03:30
Mark Stacey
7226357422
Fix isMainnet propType error (#12951)
A propType error was showing up during e2e tests with a `testDev`
build. It was caused by `process.env.IN_TEST` being treated as a
boolean, when in fact it is either the string `'true'` or a boolean.

`IN_TEST` has been updated to always be a boolean. `loose-envify` has
no trouble injecting boolean values, so there's no reason to treat this
as a string.
2021-12-02 14:46:46 -03:30
Mark Stacey
fac68980e0
Fix signature request propTypes (#12952)
There were two propType errors in the signature request and signature
request footer components. A boolean was wrongly declared as a
function, and that same boolean was later declared with an invalid
propType (`PropTypes.boolean` rather than `PropTypes.bool`). Both
errors have been fixed.
2021-12-02 14:39:18 -03:30
Olaf Tomalka
90b656bd66
Added SiteOrigin and PermissionList components (#12832)
* Changed back button to the one in design

* PermissionConnect now uses Chip component

* Added SiteOrigin widget

* WIP

* Added new permission list

* Fix linting errors

* Removed unused messages

* Removed more unused messages

* Make SiteOrigin bigger

* Fix lint

* Code Review fixes

* Fix SiteOrigin overflowing

* Add stories

* Fix lint

* Added useMemo to constant

* Fix Chip's max-content overflowing SiteOrigin

* Fix code review issues

Co-authored-by: Olaf Tomalka <olaftomalka@Olafs-MacBook-Pro-2.local>
2021-12-02 18:22:18 +01:00
igorms-cons
6dbf6e3ab3
Latest update conversion date - issue #10741 (#12422)
* conversion date fix

* update in settings conversion date - no internet

* update conversionDate fetch - setting container

* no currency date message updated
2021-12-02 08:48:09 -03:30
Alex Donesky
9e2935dd55
Revert "Feat/collectibles display (#12873)" (#12934)
This reverts commit 81ea24f08a.
2021-12-01 17:46:26 -06:00
Hassan Malik
79867bcebe
Adding snaps authorship pill (#12740)
* added npm icon

* added snaps-authorship-pill component and story

* updated npm icon

* added classname

* added comments

* changed label to an h7

* updated default label, removed unnecessary font-weight prop

* moved npm icon to flask/icons and added storybook file

* added hover/focus logic

* updated hover logic

* updated hover logic

* added authorship pill scss to app-components, removed unnecessary handlers

* removed npm icon, added font-awesome icon, added font-awesome brands to scss imports

* removed icons directory, updated scss file to use the proper color for npm icon, updated component with correct size and added class to change color

* fixed linter errors

* added link to pill and its story, changed title of story

* changed link to open in new tab, moved classname to root element and made it inline-block

* fixed proptype comment

* fixed linter error
2021-12-01 17:45:55 -05:00
Alex Donesky
c29afd110b
put new collectibles related preferences behind feature flag (#12936) 2021-12-01 16:10:24 -06:00
George Marshall
eb4f051b23
Adding SnapSettingsCard ui component (#12655)
* parent d89e5336a6
author georgewrmarshall <george.marshall@consensys.net> 1636692862 -0800
committer hmalik88 <hassan.malik@consensys.net> 1637342043 -0500

Initial SnapSettingsCard component

Updates to styles but having specificity issues so increased specificity

Updates to styles but having specificity issues so increased specificity

added overflow fix and added tests

lockfile update

prettier fix

added stylelint ignore

yarn.lock fixed

* merge conflict fix

* package/yarn fix

* fixed package.json

* updated lockfile...

* removed comment

* removed unnecessary key/val for chip status indicator color

* bumped lattice to 0.4.0 in package json, fixed yarn lock

* removed dupe entry in yarn lock

* ran yarn setup to update lock file

* updated chip label prop

* parent d89e5336a6
author georgewrmarshall <george.marshall@consensys.net> 1636692862 -0800
committer hmalik88 <hassan.malik@consensys.net> 1637342043 -0500

Initial SnapSettingsCard component

Updates to styles but having specificity issues so increased specificity

Updates to styles but having specificity issues so increased specificity

added overflow fix and added tests

lockfile update

prettier fix

added stylelint ignore

yarn.lock fixed

* merge conflict fix

* package/yarn fix

* fixed package.json

* updated lockfile...

* removed comment

* bumped lattice to 0.4.0 in package json, fixed yarn lock

* removed dupe entry in yarn lock

* ran yarn setup to update lock file

* Using IconWithFallback instead of SiteIcon, fixing icon prop, and adding status story and docs page

* Updating to follow storybook folder convention

* Updates to styles

* Adding localization

* added todo comment

Co-authored-by: hmalik88 <hassan.malik@consensys.net>
2021-12-01 16:10:51 -05:00
George Marshall
854fc71ae7
Organizing storybook to echo app folder structure (#12796)
* Organizing storybook to echo app folder structure

* Updating new stories to follow new convention from develop
2021-12-01 11:27:57 -08:00
Mark Stacey
b6b202ca13
Convert nonce background calls to async/await (#12853)
The calls to the background in `actions.js` that relate to the custom
nonce feature now use `async/await` and `promisifiedBackground`.

The behaviour should be unchanged except that when setting the nonce
field, the warning is shown in case of error before the loading
indicator drops, which seems like it would be a minor improvement (if
it has any user-facing impact at all).
2021-12-01 15:16:10 -03:30
Alaa Hadad
e056c88ba7
Feature: Transaction Insights (#12881)
* integration for tx decoding confirmation and history view

* upgrading @truffle/decoder to latest release 5.1.0

* Update acorn and colors patches

* feat: remove redundant styling

* feat: basic integration for nickname components

* feat: wiring functionality of adding new nickname

* feat: wire functionality of showing nickname modal

* feat: link the nickname popover with add/update popover

* feat: moving forward with address nicknames integration

* feat: fixing a bug related to passing chainId in addressBook

* feat: populating memo prop in addressbook entry

* feat: add explorer link

* feat: bug fixing update nickname component

* feat: fix proptypes

* feat: adding tooltip for copying nickname address

* featL fix styling for tx-details page

* feat: optimize code for error handling

* feat: limiting transaction decoding to tx with data

* feat: remove tree UI component

* feat: adding request to check for tx decoding supported networks

* feat: showing data hex component

* feat: fix react warnings

* feat: remove extra margin in tx decoding

* Remove unused package @truffle/source-map-utils

* Ensure messages get translated

* feat: link tx-decoding addresses with nicknames

* Omit value for boolean attributes

* Fix props reading in CopyRawData

* fix: fixing issue with transaltion

* Fix lint errors in TransactionDecoding

- Remove unused import
- Reorder imports
- Address conflict between caught `error` and error state flag by
  renaming state flag to `hasError`
- Fix requestUrl identifier casing and use of template string
- Ensure `useEffect` gets passed the deps it needs
- Add scope braces around case statement where it's needed
- Omit literal `true` for boolean jsx attribute
- Refactor nested ternary as `if` statements

* fix: revert fetchWithCache modifications

* Fix linting for TransactionListItemDetails

- Remove unused import
- Fix import spacing
- Remove unused prop dereference
- Fix string interpolation for translated From/To

* Moving to popover pattern

* fix: sass color variable

* Omit value for boolean attribute

* Remove changes from modal.js

* fix: refactor nickname popovers

* Ensure const gets declared before it's used

* Fix linting for ConfirmTransactionBase

- Remove unused prop chainId
- Stop destructuring an unused field

* fix: refactor usage of nicknames popovers in send-content-container

* fix: remove extra prop updateAccountNicknameModal

* fix: refactor code for address.component

* fix: remove extra tooltip

* Ensure NicknamePopovers always returns component

* Fix linting for NicknamePopover component

- Fix useCallback deps
- Switch ternary to logical-or

* Fix linting for SenderToRecipient

... by fixing import order

* Remove unused addressCopied state

* Delete empty file

* fix: remove sender-to-recipient.container

* fix: refactor usage of nickname popovers in confirm-page-container

* fix: bug related to state variable

* Stylelint fix

* Lint fix

* Change "Total Amount" to "Total"

* Lint fix locales

* Update address-book.spec.js

* e2e test update

* Update e2e tests

* Fix issue where absence of function params in data hex tab would result in rendering a  string

* Fix border radius, and width and height in small notification windows, of the update-nickname-popover

* Remove fake await

* Clean up

* Clean up

Co-authored-by: Alaa Hadad <alaahd@Alaas-MacBook-M1-Pro-14-inch.local>
Co-authored-by: Dan Miller <danjm.com@gmail.com>
Co-authored-by: g. nicholas d'andrea <gnidan@trufflesuite.com>
2021-12-01 13:52:08 -03:30
Olaf Tomalka
70386726f6
Implement Flask onboarding UI (#12745)
* Added Flask Experimental Area warning to OnboardingV2

* Added first time flow Flask Experimental Area warning

* Made both onboarding flows use one Experimental Area component

* Fix comments in React divs

* Fix unreachable code

* Fix build lint problems

* Changes after code review

* Added guards around route constants imports

* Code Review changes

* Update ui/components/app/flask/experimental-area/index.scss

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

* Code review changes

* Fix lint

* Update ui/components/app/flask/experimental-area/index.scss

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

* Update ui/components/app/flask/experimental-area/index.scss

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

* Update ui/components/app/flask/experimental-area/index.scss

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

* Update ui/components/app/flask/experimental-area/index.scss

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

* Update ui/components/app/flask/experimental-area/index.scss

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

* fix lint

Co-authored-by: George Marshall <george.marshall@consensys.net>
2021-12-01 17:53:30 +01:00
Matthew Epps
7a92e22111
Swaps optimizations (#12842)
* Trigger Build

* Trigger Build

* Move swaps index variables to redux

* all optimizations so far

* Add better equality checks for selectors in swaps index and build quote

* Clean up PR, remove extra code and logs

* Clean up lavamoat file

* Fixes for optimizations

* Update tests and test snapshots

* Remove unnecessary tests

* Remove unnecessary console log

* Trigger Build

* Trigger Build

* Add delay to account for remote call made by trezor keyring

Co-authored-by: Dan Miller <danjm.com@gmail.com>
2021-12-01 12:55:09 -03:30
Alex Donesky
81ea24f08a
Feat/collectibles display (#12873)
* Wiring up Collectibles lists/items

* wip

* more wip

* more more wip

* yet more wip

* wippp

* more wipppp

* closer

* wroking

* more wip

* cleanup

* cleanup

* add-collectible form validation

* update default ipfs-gateway

* update refresh button

* fix proptypes issue + add more padding to asset background

* css tweaking

* more cleanup

* more cleanup

* more cleanup

* add migration

* address feedback

* fix migration + cleanup

* bumping controllers version + adapting new collectiblesController shape

* fix yarn dedupe
2021-12-01 10:10:17 -06:00
Alex Donesky
3434b9f80a
add openSeaEnabled preference (#12909)
* add openSeaEnabled preference

* cleanup

* add description copy
2021-11-30 22:12:27 -06:00
Jyoti Puri
a020281c96
Implementing save button on advance gas fee modal (#12854) 2021-12-01 06:01:21 +05:30
Matthew Epps
8e6a0ff879
Send all swaps requests to api2, remove useNewSwapsApi boolean (#12792)
* Send all swaps requests to api2, remove useNewSwapsApi boolean

* Switch token bucket priority

* Fix tests

* Trigger Build

* Trigger Build
2021-11-30 19:56:28 +01:00
Mark Stacey
8835642c6d
Remove unnecessary unlock step (#12840)
As part of the unlock process, currently the seed phrase is retrieved
from the background then discarded. This step is pointless, so it has
been deleted.
2021-11-30 12:13:49 -03:30
Dan J Miller
2856ea7606
Add support for eip-1559 on Trezor (#12627)
* Add support for eip-1559 on Trezor

* temp

* Lint fix

* Store trezor model type in background state instead attempting to get it in the frontend

* code simplification

* Temp update to eth-trezor-keyring version

* Tempory update to eth-trezor-keyring version

* Temp update to eth-trezor-keyring version

* Fix display of hdpath selector in connect hardware flow for trezor

* Updating the package version but we still need to run yarn setup and update the lockfile, once the package is updated

* Update yarn.lock

* Fix unit tests
2021-11-30 10:58:28 -03:30
VSaric
35c1eaa2bd
Created a Nickname popover (#12632)
* Created a Nickname popover

* Fixing lines in index.scss

* Handle copy button and fix some paddings

* Added text to be editable in the storybook component

* Simplify nickname scss and html

* Delete harcoded address

* Change color usage with new color system
2021-11-29 16:05:56 -03:30
Jyoti Puri
7ace0497c8
Removing un-necessary comma (#12883)
* Confirm transaction screen style fixes
2021-11-30 00:32:54 +05:30
Niranjana Binoy
3f8cbd5202
Removing the token detection announcement when the token detection is ON (#12776) 2021-11-29 13:28:35 -05:00
Niranjana Binoy
4b975adc85
EIP-1559 V2 : Advanced gas fee modal - Max base fee and Priority fee inputs (#12619) 2021-11-29 23:10:48 +05:30
Dan J Miller
c2ea04c775
Adds multilayer fee display to erc20 token approval screen (#12824)
* Adds multilayer fee display to erc20 token approval screen

* Change bold property name
2021-11-29 13:23:37 -03:30
Jyoti Puri
0e0e7ac830
Legacy transactions to use old transaction flow (#12782) 2021-11-29 21:38:24 +05:30
Alex Donesky
5aa191fd2e
Feat/add collectible manually (#12834)
* hook up add collectible manually flow

* address feedback
2021-11-26 14:03:35 -06:00
ryanml
279c8072ed
Adding collectibles items overview (#12506)
* Adding collectibles items overview

* addressing feedback

Co-authored-by: Alex <adonesky@gmail.com>
2021-11-26 12:59:46 -06:00
Alex Donesky
0bed51b936
add and hook up setting to toggle on/off collectible autodetection (#12839) 2021-11-26 12:54:57 -06:00
Dan J Miller
74b3a3a1c8
Remove _removeBeforeUnload calls in confirm-encryption-public-key.component.js and confirm-decrypt-message.component.js (#12825) 2021-11-25 14:42:40 -03:30
Etienne Dusseault
02177c4575
checkbox storybook (#12757) 2021-11-24 14:20:39 -08:00
George Marshall
1523b2353d
Adding className to togglebutton (#12838) 2021-11-24 14:15:10 -08:00
Etienne Dusseault
d5ba78f90f
Fix button-group.stories for new Storybook documentation (#12621)
* button-group

* remove usage table

* Update ui/components/ui/button-group/button-group.component.js

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

* Update ui/components/ui/button-group/README.mdx

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

* Update ui/components/ui/button-group/README.mdx

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

* Update ui/components/ui/button-group/README.mdx

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

* Update ui/components/ui/button-group/README.mdx

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

Co-authored-by: George Marshall <george.marshall@consensys.net>
2021-11-24 13:46:45 -08:00
Dan J Miller
8721c80054
Ensure that handleChange in token-input.component handles empty values (#12835) 2021-11-24 16:40:13 -03:30
George Marshall
07f16d37be
Updating IconWithFallback to functional component, adding stories and docs (#12797) 2021-11-24 11:43:22 -08:00
Mingliang Liu
e7b82915fa
update scams and network security risks link (#12752) 2021-11-24 15:18:01 -03:30
Thomas Huang
d179344712
Convert token input to BigNumber to handle decimals. (#12773)
* Fixes #12762

Adds a decimal length check for inputs and drops excess fractional part.
Another edgecase not accounted for is when a token's decimal precision is 0 and attempting sending decimals will result in omitting the fractional part.

* Change spies from sinon to jest and change onChange value to string.

* Adjust

* Remove sinon

* Add test for issue case

* DRY

* Simplify logic by using BigNumber

Co-authored-by: Dan Miller <danjm.com@gmail.com>
2021-11-24 12:08:23 -06:00
Mark Stacey
7929a92c66
Clear the clipboard after the seed phrase is pasted (#12828)
* Clear the clipboard after the seed phrase is pasted

On the "Import" page of the import onboarding flow, we now clear the
clipboard after the secret recovery phrase is pasted. This ensures that
the SRP isn't accidentally pasted somewhere else by the user, which can
be an easy and disastrous mistake to make.

* Clear clipboard during new onboarding flow as well
2021-11-24 13:39:12 -03:30
Jyoti Puri
7609841902
Confirm transaction page - onchain failure handling (#12743) 2021-11-24 22:32:53 +05:30
Etienne Dusseault
5a14a1a54a
Add storybook render tests with CI integration (#12477)
* add storybook unit tests with CI integration

* fix command and fix casing for test

* change ci ordering for storybook tasks

* fix syntax error

* fix jest

* lint

* Add transaction-total-banner render test to Storybook (#12517)

* transaction-total-banner

* lint

* confirm to spec

* lint

* fix jest ocnfig for snapshot test failure
2021-11-23 16:41:30 -08:00
George Marshall
dd77700e65
Updating tags in Typography component (#12682) 2021-11-23 15:32:59 -08:00
kumavis
d9d1a831a6
ci - enforce yarn lock deduplications (#12737)
* ci - test for yarn lock deduplications

* deps - update yarn.lock and patches

* lavamoat - update policy

* test - ui/helpers/utils/optimism/buildUnserializedTransaction - test against json obj

* lint fix

* patch-package - patch @babel/runtime for lavamoat support

* patch-package - fix additional @babel/runtime lockdown incompats

* patch-package - cleanup sass patch
2021-11-23 09:17:27 -10:00
Jyoti Puri
f65063ac6c
Eip1559 v2 12593 (#12719) 2021-11-23 23:48:44 +05:30
Niranjana Binoy
582882b3ed
Adding the AdvancedGasFeePopover template (#12780) 2021-11-23 23:16:33 +05:30