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

13320 Commits

Author SHA1 Message Date
ryanml
d9d1911d11 Updating changelog 2021-11-03 10:42:44 -07:00
ryanml
d40f241288 Updating dapp learn more link (#12515) 2021-11-03 10:40:36 -07:00
MetaMask Bot
062bb4ca0d Version v10.4.1 2021-11-03 17:28:53 +00:00
Erik Marks
f2b177bff0 Update build system lockdown parameter (#12556)
* Update build system lockdown parameter

* Add @reduxjs/toolkit patch

* Fix Mozilla lint syntax error

* Standardize a thing

* Remove redundant check for globalThis
2021-11-03 10:23:36 -07:00
ryanml
763b812d30 Merge remote-tracking branch 'origin/develop' into master-sync 2021-11-03 10:06:18 -07:00
ryanml
96f9f89911 Revert "Revert "Connect Ledger via WebHID (#12411)""
This reverts commit 1c011b66aa.
2021-11-03 10:06:03 -07:00
ryanml
a03a44730c
Merge pull request #12478 from MetaMask/Version-v10.4.0
Version v10.4.0 RC
2021-11-03 09:47:49 -07:00
Dan J Miller
401c8ee7b2
Ensure ledger transport preference is set on import (#12557) 2021-11-03 13:53:13 -02:30
igorms-cons
803576c7d7
Fix/ux papercuts transaction details issue #12295 (#12401)
* transaction details - update ui

* update lint scss

* update sender & recipient name ui
2021-11-03 12:56:25 -02:30
VSaric
64e45c801d
Warn the user of insufficient funds when approving a token (#12496)
* Warn the user of insufficient funds (ETH for gas) when approving a token

* Fixing code lines while run yarn lint:fix

* Fixing test-e2e-chrome

* Fixing e2e tests

* Create shouldDisplayWarning variable
2021-11-03 12:43:31 -02:30
Erik Marks
5f0fd9d1c2
Add lockdown e2e test (#12562)
This PR adds an e2e test to ensure that the background and UI environments are locked down. It reuses the logic from the `protect-intrinsics.test.js`, and runs in both Chrome and Firefox.
2021-11-02 17:01:01 -07:00
kumavis
1298a8cdc6
deps - update sentry (#12561) 2021-11-02 13:41:33 -10:00
Olusegun Akintayo
95e3be4a85
UX improvements to the "Permission Request" section on the approve screen (#12553)
* UX improvements to the "Permission Request" section on the approve screen

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

* Fix locales.

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

* Check that hidden elements are hidden in test

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

* Lint fixes

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>
2021-11-03 02:15:05 +04:00
ryanml
afc0ee8925 Updating changelog 2021-11-02 11:57:15 -07:00
Dan J Miller
bd0a3fb416 Ensure exchange rate is stringified before passing to bignumber in confirm-token-transaction component (#12550) 2021-11-02 11:43:41 -07:00
Daniel
429025380c Fix parallel calls for quotes in swaps (#12484) 2021-11-02 11:43:25 -07:00
ryanml
1c011b66aa Revert "Connect Ledger via WebHID (#12411)"
This reverts commit 9d70c60c22.
2021-11-02 11:42:45 -07:00
Mark Stacey
e902b931c3
Update the 3D beta logo (#12497)
The 3D beta logo has been updated to match this demo: https://metamask.github.io/logo/beta/index.html
2021-11-02 15:55:15 -02:30
Dan J Miller
8ae90aec0e
Ensure exchange rate is stringified before passing to bignumber in confirm-token-transaction component (#12550) 2021-11-02 05:53:12 -02:30
Erik Marks
5560b7c3e5
Update build system lockdown parameter (#12556)
* Update build system lockdown parameter

* Add @reduxjs/toolkit patch

* Fix Mozilla lint syntax error

* Standardize a thing

* Remove redundant check for globalThis
2021-11-01 22:13:22 -10:00
Dan J Miller
1fa4b5c776
Don't show ledger live option in advanced settings if using firefox (#12494)
* Don't show ledger live option in advanced settings if using firefox

* Hide ledger transport selector in advanced settings on firefox
2021-11-02 04:54:24 -02:30
Erik Marks
a2d3d942ec
Exclude files from builds by build type (#12521)
This PR enables the exclusion of JavaScript and JSON source by `buildType`, and enables the running of `eslint` under LavaMoat. 80-90% of the changes in this PR are `.patch` files and LavaMoat policy additions.

The file exclusion is designed to work in conjunction with our code fencing. If you forget to fence an import statement of an excluded file, the application will now error on boot. **This PR commits us to a particular naming convention for files intended only for certain builds.** Continue reading for details.

### Code Fencing and ESLint

When a file is modified by the code fencing transform, we run ESLint on it to ensure that we fail early for syntax-related issues. This PR adds the first code fences that will be actually be removed in production builds. As a consequence, this was also the first time we attempted to run ESLint under LavaMoat. Making that work required a lot of manual labor because of ESLint's use of dynamic imports, but the manual changes necessary were ultimately quite minor.

### File Exclusion

For all builds, any file in `app/`, `shared/` or `ui/` in a sub-directory matching `**/${otherBuildType}/**` (where `otherBuildType` is any build type except `main`) will be added to the list of excluded files, regardless of its file extension. For example, if we want to add one or more pages to the UI settings in Flask, we'd create the folder `ui/pages/settings/flask`, add any necessary files or sub-folders there, and fence the import statements for anything in that folder. If we wanted the same thing for Beta, we would name the directory `ui/pages/settings/beta`.

As it happens, we already organize some of our source files in this way, namely the logo JSON for Beta and Flask builds. See `ui/helpers/utils/build-types.js` to see how this works in practice.

Because the list of ignored filed is only passed to `browserify.exclude()`, any files not bundled by `browserify` will be ignored. For our purposes, this is mostly relevant for `.scss`. Since we don't have anything like code fencing for SCSS, we'll have to consider how to handle our styles separately.
2021-11-01 20:20:31 -07:00
filipsekulic
0c229e2d4a
Fixed approve confirmation logic (#12511) 2021-11-01 20:38:41 -05:00
ryanml
1390d72259
Adding flexWrap prop to Box (#12542) 2021-11-01 12:16:23 -07:00
Dan J Miller
db20399d81
Turn off all old notifications (#12500)
* Turn off all old notifications

* Remove unnecessary attempt to close whats new popup in e2e test

* Remove unneeded whats new popup closes in e2e tests

* Lint fix
2021-11-01 08:16:05 -02:30
ryanml
b058cbed3b
Fixing COLORS.GRAY (#12538) 2021-10-30 11:04:09 -07:00
Erik Marks
2e8752183f
Fix off-by-one error in code fence transform (#12540)
The code fence transform was including contents after the final END directive twice. That was not covered by the tests, because none of the examples contained any content after the final END directive, and concatenating the empty string twice does not produce an observable difference in the test results.

This bug was due to an off-by-one error in the loop of the multiSplice function. The error has been fixed, and more test cases have been added.
2021-10-29 16:45:27 -07:00
Etienne Dusseault
6f6576917c
Add settings-component to Storybook (#12086)
* settings

* add id filename

* remove platform version

* readd platform version
2021-10-29 20:40:32 -03:00
Brad Decker
22f7baebdc
update anonymous id (#12503)
Co-authored-by: Dan Finlay <542863+danfinlay@users.noreply.github.com>
2021-10-29 13:17:49 -07:00
George Marshall
d72f7295a3
Docs/12367 Adding storybook essentials addons (#12393)
* Adding storybook essentials and documentation contribution guidelines

* Deprecation updates

* Update ui/2.DOCUMENTATION.stories.mdx

Co-authored-by: Elliot Winkler <elliot.winkler@gmail.com>

* Updating spelling and adding label to i18n-party plugin in toolbar

Co-authored-by: kumavis <kumavis@users.noreply.github.com>
Co-authored-by: Elliot Winkler <elliot.winkler@gmail.com>
2021-10-29 07:22:07 -10:00
ryanml
487080bd16
Adding backgroundColor prop to Box (#12524) 2021-10-29 10:02:10 -07:00
Olusegun Akintayo
7e7d0c13f4
Show error if user have insufficient gas. (#12531) 2021-10-29 19:45:50 +04:00
Jyoti Puri
ab1877ae0e
Deleting old GasFeeInputs hook (#12526) 2021-10-29 20:12:31 +05:30
filipsekulic
6221365980
Update icons on the settings page (#12359) 2021-10-29 09:25:23 -02:30
Mark Stacey
90e55a445e
Add static files for the Flask build (#12518)
Static files have been added for the Flask build. This includes logos
of each size and variety that we use, and it includes the 3D model JSON
file.

Closes #12427
2021-10-28 23:05:58 -02:30
David Walsh
a83d50a489
Provide instructions for users switching from Ledger Live to WebHID (#12519) 2021-10-28 18:38:58 -05:00
Mark Stacey
e067379f48
Remove the partially-applied dark mode styles used for beta (#12489)
The beta build currently has a couple of UI elements (the horizontal
logo and the app header) set to "dark mode", even though nothing else
in our UI supports dark mode yet. These styles have been removed. We
should make the entire UI support dark mode all at once at a later
date.

Also the horizontal logo used for beta was named incorrectly; the dark
and non-dark logos were swapped. They have been switched back so that
the logo that ends with `-dark` is for dark mode.
2021-10-28 17:29:20 -02:30
Olusegun Akintayo
b6673731e2
Implement Network Switcher designs (#12260)
* Show test networks toggle button in settings/advanced tab.

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

* Apply toggle testnet settings and show/hide testnets when on/off
Add localhost to testnet.

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

* Lint fixes.

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

* Show add network button

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

* Open full screen when add network is called.

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

* Show custonm rpc before testnet rpcs
lint fixes.

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

* Test cases for network dropdown.

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

* Test cases for toggle test networks in advanced tab component.

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

* Lint fixes.

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

* Fix Locales.

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

* E2E Tests: Custom RPC is now called Add Network

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

* Lint fix

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

* E2E: When Add Network button is clicked, wait for the full screen window to
be visible

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

* findVisibleElement should use a class. i.e start with a dot

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

* Hide Dropdown when Add Netwok is clicked.
Only show full screen if it's not already showing.
E2E tests passing.

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

* Lint fixes

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

* Fix tests for jest

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

* Testnets are not being shown by default anymore, tests should use
Mainnet instead.

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

* Import Button from ui
Change selector name to getShowTestnetworks
Fix button to show full width

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

* Fix e2e tests

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

* Remove localhost from INFURA provider types.

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

* Fix errors in Advanced Tab Component tests

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

* Lint fixes

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

* Fix unit tests for advanced tab component.

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

* Remove deleted elements from e2e tests

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

* Make sure all tests passed.

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

* Lint fixes

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>
2021-10-28 23:31:05 +04:00
ryanml
64e4ce19bc
Updating dapp learn more link (#12515) 2021-10-28 12:18:48 -07:00
Niranjana Binoy
e42fb0d640
Approve screen header and sub-header improvement (#12360) 2021-10-28 15:16:03 -04:00
Daniel
e8944e0a5d
Don't show "Unavailable on this network" if Swaps button is enabled (#12513)
* Don't show "Unavailable on this network" if Swaps button is enabled

* Hide a tooltip title if tooltip is disabled

* Update a snapshot
2021-10-28 19:36:04 +02:00
ryanml
75b032590b
Adding metrics event for Advanced Options (EditGasDisplay) (#12507) 2021-10-28 10:06:16 -07:00
Daniel
e85248aaf5
Fix parallel calls for quotes in swaps (#12484) 2021-10-28 08:53:26 +02:00
David Walsh
b5e601bc87
Use TRANSACTION_ENVELOPE_TYPES for legacy transaction type testing (#12455) 2021-10-27 18:55:02 -05:00
David Walsh
6e928c661e
Create function for hardware keyring checking (#12457) 2021-10-27 18:54:18 -05:00
Dan Finlay
0880093f40
Improve token detection wording (#12498)
Previous wording implies that we don't have token detection without this feature enabled.
2021-10-27 11:09:23 -07:00
ryanml
05a80ebeba
Adding collectibles feature flag, default NFT tab (#12463)
* Adding COLLECTIBLES_V1 feature flag

* Adding NFT's tab to home screen, default CollectiblesList view

* Handling null children in Tabs component
2021-10-27 09:55:14 -07:00
Mark Stacey
8e5acee421
Fix production builds (#12488)
The production build was accidentally broken in #12440 because of a
merge conflict with a #12441 that wasn't initially noticed. The
conflict was the renaming of the `BuildTypes` variable to `BuildType`.

This variable is used to check the current build type, but only for
production builds. `BuildTypes` is `undefined`, so this would result in
a crash when that enum was used.
2021-10-27 13:20:55 -02:30
Mark Stacey
681ab33537
Update @metamask/logo from v3.0.1 to v3.1.0 (#12490)
The new logo update includes the gradient feature.

The version of `jsdom` we're using via Jest has also been updated in
the lockfile. This was necessary to get unit tests to pass because the
version we were using previously didn't support `replaceChildren`,
which was added in `jsdom@6.6.0` [1].

[1]: 04f6c13f4a

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-27 11:15:02 -02:30
Mark Stacey
17e3ed9437
Add secrets for beta and Flask builds (#12440)
The build script has been updated to embed the correct Infura project
ID and Segment write key for beta and Flask builds. These are set via
environment variable or config file. They have already been added in CI
as environment variables.

The Segment production write key has also been moved into the set of
environment variables that can be set in the configuration file. This
was to make the way we reference it more consistent.

The new project IDs and keys are only used in the "production"
environment, which right now is the merge step into the `master`
branch. This is appropriate for Flask, but it doesn't match our plan
for how the beta release would get created. In a future PR, when the
beta release automation work is completed, the conditions for when
the beta secrets are used should be updated to ensure they're used only
for the beta builds.

Closes #11896
2021-10-26 15:02:20 -02:30