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

3102 Commits

Author SHA1 Message Date
Whymarrh Whitby
4d88e1cf86 Enable indent linting via ESLint (#6936)
* Enable indent linting via ESLint

* yarn run lint:fix
2019-07-31 10:17:11 -10:00
Dan J Miller
e9c7df28ed
Address book send plus contact list (#6914)
* Style Send Header

* Move Send to-row to send view and restyle

* Add "Recents" group to select recipient view

* Rename SendToRow to AddRecipient

* Basic UI and Layout

* New ENSInput component

* wip - fuzzy search for input

* small refactor

* Add Dialog

* contact list initial

* initial error on invalid address

* clean up edit

* Click to open modal

* Create AddToAddressBookModal component

* Modal styling and layout

* modal i18n

* Add to Addressbook

* ens wip

* ens wip

* ENS Resolution

* Reset input

* Send to explicit address

* Happy Path Complete

* Add back error checking

* Reset send-to when emptying input

* Add back warning object

* Fix linter

* Fix unit test #1 - fix import paths

* Remove dead tests

* One more to go

* Fix all unit tests

* add unit test for reducers and actions

* test rendering AddRecipient

* Add tests for dialog boxes in AddRecipient

* Add test for validating

* Fix linter

* Fix e2e tests

* Token send e2e fix

* Style View Contact

* Style edit-contact

* Fix e2e

* Fix from-import-beta-ui e2e spec

* Make section header say "add recipient” by default

* Auto-focus add recipient input

* Update placeholder text

* Update input title font size

* Auto advance to next step if user paste a valid address

* Ellipsify address when recipient is selected

* Fix app header background color on desktop

* Give each form row a margin of 16px

* Use .container/.component naming pattern for ens-input

* Auto-focus on input when add to addressbook modal is opened; Save on Enter

* Fix and add unit test

* Fix selectors name in e2e tests

* Correct e2e test token amount for address-book-send changes

* Adds e2e test for editing a transaction

* Delete test/integration/lib/send-new-ui.js

* Add tests for amount max button and high value error on send screen to test/e2e/metamask-ui.spec.js

* lint and revert to address as object keys

* add chainId based on current network to address book entry

* fix test

* only display contacts for the current network

* Improve ENS message when not found on current network

* Add error to indicate when network does not support ENS

* bump gaba

* address book, resolve comments

* Move contact-list to its own component

* De-duplicate getaddressbook selector and refactor name selection logic in contact-list-tab/

* Use contact-list component in contact-list-tab.component (i.e. in settings)

* Improve/fix settings headers for popup and browser views

* Lint fixes related to address book updates

* Add 'My accounts' page to settings address book

* Update add new contact button in settings to match floating circular design

* Improve styles of view contact page

* Improve styles and labels of the add-contact.component

* Further lint fixes related to address book updates

* Update unit tests as per address book updates

* Ensure that contact list groups are sorted alphabetically

* Refactor settings component to use a container for connection to redux; allow display of addressbook name in settings header

* Decouple ens-input.component from send context

* Add ens resolution to add contact screen in settings

* Switching networks when an ens address is shown on send form removes the ens address.

* Resolve send screen search for ensAddress to matching address book entry if it exists

* Show resolved ens icon and address if exists (settings: add-contact.component)

* Make the displayed and copied address in view-contact.component the checksummed address

* Default alias state prop in AddToAddressBookModal to empty string

* Use keyCode to detect enter key in AddToAddressBookModal

* Ensure add-contact component properly updates after QR code detection

* Fix display of all recents after clicking 'Load More' in contact list

* Fix send screen contact searching after network switching

* Code cleanup related to address book changes

* Update unit tests for address book changes

* Update ENS name not found on network message

* Add ens registration error message

* Cancel on edit mode takes user back to view screen

* Adds support for memo to settings contact list view and edit screens

* Modify designs of edit and view contact in popup environment

* Update settings content list UX to show split columns in fullscreen and proper internal navigation

* Correct background address book API usages in UI
2019-07-31 17:26:44 -02:30
Whymarrh Whitby
2761cc5a2d
Hide Copy Tx ID and block explorer link for txns w/o hash (#6928) 2019-07-29 22:12:29 -02:30
Mark Stacey
329c376449
Remove unused props from routes and network dropdown (#6919)
These props were discovered to be unused while I was working on #6680
2019-07-29 08:44:18 -03:00
Mark Stacey
1f45798707
Override ownProps with state props in SignatureRequest (#6911)
The `accounts` prop of `SignatureRequest` was throwing a PropType
warning because `accounts` was an object instead of an array. It looks
like when the `mergeProps` function was added in #6340, the ownProps
were accidentally set to override the state props.

The now ignored props have been removed from the parent `ConfirmTxScreen`
component as well. `conversionRate` was identical to the one retrieved
in `SignatureRequest`, and `selectedAddress` differed only in the
fallback behaviour when `state.metamask.selectedAddress` does not exist;
it will now default to the first account instead (as was the original
behavior, prior to #6340).
2019-07-26 10:39:13 -03:00
Mark Stacey
1112277cd6
Remove seedWords completely from metamask state (#6920)
`seedWords` used to be stored on the metamask state temporarily at
certain points. This hasn't been the case since #5994, but references
to this state remained. All of the logic remained for correctly updating
these `seedWords`, handling them during navigation, and scrubbing them
from the state.

However the state was never updated in practice. The `seedWords` are
still returned by `verifySeedPhrase`, and they're still stored in
component state in a few places. But they aren't ever set in the Redux
metadata state or the Preferences controller.

All references to this state have been removed, along with any logic
for interacting with this state. A few unused actions were removed as
well.
2019-07-26 10:35:21 -03:00
Mark Stacey
58965ed164
Remove unused route constants (#6918)
These constants were not referenced outside of this file
2019-07-26 08:26:27 -03:00
Mark Stacey
a578c725c8
Remove unused seedPhrase prop (#6913)
The `seedPhrase` prop has not been passed into the
`first-time-flow-switch` component since #5994.
2019-07-25 10:59:40 -03:00
Mark Stacey
adac1de822
Remove AccountDropdownMini component (#6906)
The `AccountDropdownMini` component featured the ability to switch
accounts using a dropdown, but this functionality was disabled in #6024.
It has been acting as a restyled `AccountListItem` since then.

The component has been removed, and the style changes moved to the sole
parent component (`RequestSignature`).
2019-07-25 08:55:43 -03:00
Mark Stacey
74639ab3ae
Remove unused time-remaining component (#6912)
The `time-remaining` component hasn't been used since #5704, aside from
a few styles. Those styles have been integrated into the
`advanced-tab-content` styles, and the unused component has been
deleted.
2019-07-25 08:55:18 -03:00
Kristian Tapia
934433e4be Single asset dropdown fix (#6900)
* Disable open dropdown for single asset

* add test to check single asset in dropdown

* fix lint errors, remove unused import
2019-07-23 21:21:13 -02:30
Mark Stacey
0f8a9a5d49
Serve CSS as an external file (#6894)
The CSS is now served as an external file instead of being injected.
This was done to improve performance. Ideally we would come to a middle
ground between this and the former behaviour by injecting only the CSS
that was required for the initial page load, then lazily loading the
rest. However that change would be more complex. The hope was that
making all CSS external would at least be a slight improvement.

Performance metrics were collected before and after this change to
determine whether this change actually helped. The metrics collected
were the timing events provided by Chrome DevTools:

* DOM Content Loaded (DCL) [1]
* Load (L) [2]
* First Paint (FP) [3]
* First Contentful Paint (FCP) [3]
* First Meaningful Paint (FMP) [3]

Here are the results (units in milliseconds):

Injected CSS:

| Run | DCL | L | FP | FCP | FMP |
| :--- | ---: | ---: | ---: | ---: | ---: |
| 1 | 1569.45 | 1570.97 | 1700.36 | 1700.36 | 1700.36 |
| 2 | 1517.37 | 1518.84 | 1630.98 | 1630.98 | 1630.98 |
| 3 | 1603.71 | 1605.31 | 1712.56 | 1712.56 | 1712.56 |
| 4 | 1522.15 | 1523.72 | 1629.3 | 1629.3 | 1629.3 |
| **Min** | 1517.37 | 1518.84 | 1629.3 | 1629.3 | 1629.3 |
| **Max** | 1603.71 | 1605.31 | 1712.56 | 1712.56 | 1712.56 |
| **Mean** | 1553.17 | 1554.71 | 1668.3 | 1668.3 | 1668.3 |
| **Std. dev.** | 33.41 | 33.43 | 38.16 | 38.16 | 38.16 |

External CSS:

| Run | DCL | L | FP | FCP | FMP |
| :--- | ---: | ---: | ---: | ---: | ---: |
| 1 | 1595.4 | 1598.91 | 284.97 | 1712.86 | 1712.86 |
| 2 | 1537.55 | 1538.99 | 199.38 | 1633.5 | 1633.5 |
| 3 | 1571.28 | 1572.74 | 268.65 | 1677.03 | 1677.03 |
| 4 | 1510.98 | 1512.33 | 206.72 | 1607.03 | 1607.03 |
| **Min** | 1510.98 | 1512.33 | 199.38 | 1607.03 | 1607.03 |
| **Max** | 1595.4 | 1598.91 | 284.97 | 1712.86 | 1712.86 |
| **Mean** | 1553.8025 | 1555.7425 | 239.93 | 1657.605 | 1657.605 |
| **Std. dev.** | 29.5375 | 30.0825 | 36.88 | 37.34 | 37.34 |

Unfortunately, using an external CSS file made no discernible improvement
to the overall page load time. DCM and L were practically identical, and
FCP and FMP were marginally better (well within error margins).

However, the first paint time was _dramatically_ improved. This change
seems worthwhile for the first paint time improvement alone. It also
allows us to delete some code and remove a dependency.

The old `css.js` module included two third-party CSS files as well, so
those have been imported into the main Sass file. This was easier than
bundling them in the gulpfile.

The resulting CSS bundle needs to be served from the root because we're
using a few `@include` rules that make this assumption. We could move
this under `/css/` if desired, but we'd need to update each of these
`@include` rules.

Relates to #6646

[1]: https://developer.mozilla.org/en-US/docs/Web/Events/DOMContentLoaded
[2]: https://developer.mozilla.org/en-US/docs/Web/Events/load
[3]: https://developers.google.com/web/fundamentals/performance/user-centric-performance-metrics
2019-07-23 14:10:13 -03:00
Terry Smith
33071e3014 Targets base inputs and only prevents outline if user uses a mouse (#6871) 2019-07-16 22:58:00 -02:30
Terry Smith
5cc4a5c6b7 Broke the close notification window logic out into it's own action. (#6864) 2019-07-16 06:25:52 -02:30
Terry Smith
721215973a Re enable the setMouseUserState styles. (#6860)
Typo
2019-07-16 00:06:57 -02:30
Whymarrh Whitby
c7c090d19c
Remove stray period from Learn More link (#6853) 2019-07-15 14:18:44 -02:30
Mark Stacey
270d1d0fa9
Add eslint dependency (#6842)
We had forgotten to add `eslint` as a dependency, even though we use it
directly. It had always worked because we have dependencies that also
depend upon it.

`eslint` has also been updated to v6, which necessitated two minor
changes.
2019-07-15 10:15:49 -03:00
Terry Smith
ded3dc1381 Add translation support for Learn more and All done on end-of-flow (#6847) 2019-07-14 23:22:20 -03:00
Thomas Huang
96a12a627e
Merge pull request #6832 from MetaMask/master-rebased
Master rebased
2019-07-12 10:58:19 -07:00
Mark Stacey
2eea388680
Remove unused expressions (#6839)
Unused expressions are generally a mistake, as they don't do anything.
The exceptions to this rule (short-circuit expressions and ternary
expressions) have been allowed.

The `webrtc-adapter` was previously ignored by eslint because it has a
side-effect upon being imported. I removed the local variable instead,
which should preserve the same side-effect without making eslint
complain.
2019-07-12 12:41:39 -03:00
Whymarrh Whitby
830c801ec3
Add React and Redux DevTools (#6793)
* Add React and Redux DevTools

* Conditionally load react-devtools

* Add start:dev npm script to run the app with devtools

Co-Authored-By: Mark Stacey <markjstacey@gmail.com>
2019-07-11 12:27:06 -02:30
ryanml
daccb06a60 Create MetaFoxLogo component (#6819) 2019-07-09 14:47:58 -02:30
Dan J Miller
32a3f5ad7b
Address various UI styling issues (#6744)
* Add loading spinner to pending tx status label.

* Add border around account icon in top right

* Change style of settings toggle buttons; wrap with local components

* Eliminate large space after settings labels when no description

* Remove network form from advanced tab of settings

* Keep new account container height to contents when in full screen
2019-07-08 15:28:35 -02:30
Mark Stacey
6df65069a2
Replace react-addons-css-transition-group (#6816)
This package is deprecated, and is incompatible with React v16. It has
been replaced by `react-test-renderer`, which has a drop-in replacement
for `react-addons-css-transition-group`.

Strangely, `react-test-renderer` was already listed as a dependency
despite not being used. I had to downgrade it, as the version already
listed was for React v16, and we're still using React v15.
2019-07-08 10:12:00 -03:00
Mark Stacey
95f198550e
Declare variables before use (#6806)
While working on #6805, I noticed that many variables were being used
before they were declared. Technically this worked fine in practice
because we were using the `transform-es2015-block-scoping` Babel plugin,
which transforms `let` and `const` to `var`, which is hoisted. However,
after removing that Babel transformation, many things broke.

All instances of variables or classes being used before declared have
been fixed.

The `no-use-before-define` eslint rule has been added to catch these
cases going forward. The rule is disabled for function declarations for
the moment, because those are always hoisted. We could disable that too
if we want to, but it's purely stylistic and would require a lot more
changes.
2019-07-05 14:01:34 -03:00
Mark Stacey
ec40b2a325
Check for invalid gas estimates from local storage (#6800)
* Remove unused state 'gas.basicPriceAndTimeEstimates'

* Check for invalid estimates from local storage

Gas estimates were being cached in local storage then later retrieved,
but the retrieved values were not being checked. If the data failed to
save, failed to load, or was cleared since being saved, it would result
in the gas estimates being set to undefined.

The estimates retrieved from local storage are now checked before they
are used. If they are falsy, the estimates are retrieved from the
network instead.

This should fix this Sentry issue:
[METAMASK-6W0T](https://sentry.io/share/issue/cfe470314a5741768b19050815322aa4/)

A few additional changes were made to the gas-duck tests to accommodate
the use of `sinon.restore`. `restore` is strongly recommended by the
`sinon` team, as neglecting to use it can result in memory leaks. It has
the additional benefit of ensuring you create fresh stubs/spies for each
test, which means they no longer need to be reset between tests.
2019-07-04 16:18:12 -03:00
Dan J Miller
05e2120814 Version 6.7.2 gas limit fix (#6786)
* Introduce delay for eth_estimateGas calls with in test

* Add test that fails when gas estimates of contract method calls without gas are too high.

* Get transaction gas data from unApprovedTxs instead of confirmTransaction

* Fix selection of gas data in gas-modal-page-container.container

* Lint changes related to Version-6.7.2-gasLimitFix

* Fix e2e tests on Version-6.7.2-gasLimitFix

* Fix unit and integration tests for changes from Version-6.7.2-gasLimitFix

* more e2e fixes

* Add assertions for transaction values on confirm screen

* Fix display of transaction amount on confirm screen.
2019-07-04 14:14:03 -02:30
Whymarrh Whitby
df17853502
Remove UiMigrationAnnouncement and associated state (#6794) 2019-07-04 12:21:21 -02:30
Dan Finlay
797f0c6ced
Reduce time to show tx "speed up" buttons to 5 seconds. (#6797) 2019-07-03 22:10:17 -07:00
Mark Stacey
a44f38e640
Fix PropType warning (#6792) 2019-07-03 22:48:22 -03:00
Akshit Kr Nagpal
687984a938 Added Confirmation Modal for Delete Network (#6776) 2019-07-02 09:43:02 -02:30
Dan Finlay
448720327b
Merge pull request #6765 from MetaMask/master
Using admin privilege to bypass code owner review because it has already [been reviewed](https://github.com/MetaMask/metamask-extension/pull/6763) and those code owners are out today.
2019-07-01 10:58:25 -07:00
Dan Miller
789fc8b8ad Fixes display of confirm screen token decimals by not relying on confirmTransaction state. 2019-06-28 01:51:33 -03:00
Whymarrh Whitby
d566543bf5
Handle invalid strings during seed phrase import (#6743)
* Add tests for ImportWithSeedPhrase#parseSeedPhrase

* Handle importing whitespace-only seed phrases

Fixes #6694

This changeset fixes our parsing of seed phrases during import to handle the
case where a user tries to import a seed phrase that consists solely of whitespace.
We no longer produce an error and instead treat it as an incorrect seed phrase.

* Handle importing more invalid seed phrases
2019-06-27 14:44:41 -02:30
Mark Stacey
a6bfc6f441
Fix seed phrase import back button (#6758)
The back button on the import seed phrase page leaves the Redux store
with `appState.forgottenPassword` set to true, which prevents the user
from logging in. That flag is now unset when the user leaves the page.

Fixes #6740
2019-06-27 12:26:25 -03:00
Mark Stacey
6d191f2617
Refactor account-details-modal (#6751)
Refactor the AccountDetailsModal to follow newer conventions. Changes
include:
- Create a directory for the component with separate files for the
  component, the container, and the entrypoint.
- Use jsx rather than hyperscript

Fixes #6741
2019-06-27 12:03:18 -03:00
ryanml
59d3a3d312 Fixes #6760, correct PropTypes for nextRoute (#6761) 2019-06-27 10:41:16 -02:30
Thomas
a37a5acbe1 Add simulation failure to tx confirmation when transaction simulationFails 2019-06-25 12:42:35 -07:00
Mark Stacey
313def1ce2 Remove shapeshift deposit form (#6746)
Closes #6478
2019-06-24 14:17:48 -02:30
Whymarrh Whitby
748801f417 4byte fallback (#6551)
* Adds 4byte registry fallback to getMethodData() (#6435)

* Adds fetchWithCache to guard against unnecessary API calls

* Add custom fetch wrapper with abort on timeout

* Use opts and cacheRefreshTime in fetch-with-cache util

* Use custom fetch wrapper with timeout for fetch-with-cache

* Improve contract method data fetching (#6623)

* Remove async call from getTransactionActionKey()

* Stop blocking confirm screen rendering on method data loading, and base screen route on transactionCategory

* Remove use of withMethodData, fix use of knownMethodData, in relation to transaction-list-item.component

* Load data contract method data progressively, making it non-blocking; requires simplifying conf-tx-base lifecycle logic.

* Allow editing of gas price while loading on the confirm screen.

* Fix transactionAction component and its unit tests.

* Fix confirm transaction components for cases of route transitions within metamask.

* Only call toString on id if truthy in getNavigateTxData()

* Fix knownMethodData retrieval and data fetching from fourbyte
2019-06-18 09:47:14 -02:30
Dan J Miller
18179fd345 Add delete to custom RPC form (#6718, #6650) 2019-06-17 11:35:47 -02:30
Kirill Goncharov
a47370057e Fix styles on 'import account' page, update help link (#6700)
* Fix styles on 'import account' page, update help link

* Update changelog
2019-06-17 08:37:34 -02:30
Thomas Huang
6fb0d4af27 Wrap smaller custom block explorer url text (#6714) 2019-06-17 08:32:12 -02:30
Chi Kei Chan
9a1a207ffa
MetaMorph - Spacing and Typeface on Extension Main view (#6584)
* wip

* Style Update: Mobile App Header

* wip

* Style Update: mobile menu-bar

* Style Update: Primary and Secondary balance on mobile main view

* Style Update: Spacing for transaction-list and transaction-list-item

* Address PR Comments

* Fix full-width view

* line-height fixes
2019-06-12 19:56:04 -07:00
Esteban Miño
71390db4a3
Feature: sync with mobile v2 (#6673)
* handle two steps

* generate new qr each 30 secs

* handle change of channel cipher without changing qr code

* fix typo
2019-06-12 10:54:45 -04:00
Jenny Pollack
9180e39b08 Revert "fixed #5524"
This reverts commit c8cb4ba370.
2019-06-06 19:20:33 +02:00
Mathew Kamkar
79d2eaffac
lint cleanup 2019-05-24 22:16:56 -07:00
Mathew Kamkar
c7266067ce
Enable Ledger hardware wallet support on Firefox
Firefox 67 support U2F by default
2019-05-24 21:42:48 -07:00
Dan J Miller
5e2fd8ae86
Ensures that transactions cannot be confirmed if gas limit is below 21000. (#6625) 2019-05-23 11:26:40 -02:30
Whymarrh Whitby
5f307040f2 Remove unused fn arguments in AmountMaxButton 2019-05-20 15:06:28 -02:30
Dan J Miller
3254738360 MetaMetrics documentation (#6624) 2019-05-20 15:02:26 -02:30
Etienne Dusseault
0e9c8fb5cc Improved UX for sweeping accounts (#6488)
* Changed max button to checkbox, disabled input if max mode is on, recalculate price according to gas fee if max mode is on

* Disabled insufficient funds message in the modal if max mode is on, displays proper amounts in modal when max mode is on, sets the send amount according to custom gas price after gas modal save, resets the send amount after resetting custom gas price

* Disabled max mode checkbox if gas buttons are loading, refactored gas-modal-page-container

* Implemented new max button & max mode message. Moved insufficient funds error to underneath the send amount field

* Fixed existing integration test to pass, created new tests to ensure send amount field is disabled when max button is clicked and the amount changes when the gas price is changed. Refactored some components
2019-05-20 14:08:08 -02:30
Alex Ivasyuv
c8cb4ba370 fixed #5524 2019-05-14 22:00:53 +03:00
Whymarrh Whitby
28c4001f52 Update auto-logout to recognize idle time in background (#6593)
* Fix wording of autoLogoutTimeLimitDescription

* AppStateController and update auto-logout functionality
2019-05-13 13:46:09 -02:30
Whymarrh Whitby
0cdce533e2 Fix RPC URL message key casing (#6595) 2019-05-10 11:54:52 -02:30
Dan J Miller
13be683701
New settings custom rpc form (#6490)
* Add networks tab to settings, with header.

* Adds network list to settings network tab.

* Adds form to settings networks tab and connects it to network list.

* Network tab: form adding and editing working

* Settings network form properly handles input errors

* Add translations for settings network form

* Clean up styles of settings network tab.

* Add popup-view styles and behaviour to settings network tab.

* Fix save button on settings network form

* Adds 'Add Network' button and addMode to settings networks tab

* Lint fix for settings networks tab addition

* Fix navigation in settings networks tab.

* Editing an rpcurl in networks tab does not create new network, just changes rpc of old

* Fix layout of settings tabs other than network

* Networks dropdown 'Custom Rpc' item links to networks tab in settings.

* Update settings sidebar networks subheader.

* Make networks tab buttons width consistent with input widths in extension view.

* Fix settings screen subheader height in popup view

* Fix height of add networks button in popup view

* Add optional label to chainId and symbol form labels in networks setting tab

* Style fixes for networks tab headers

* Add ability to customize block explorer used by custom rpc

* Stylistic improvements+fixes to custom rpc form.

* Hide cancel button.

* Highlight and show network form of provider by default.

* Standardize network subheader name to 'Networks'

* Update e2e tests for new settings network form

* Update unit tests for new rpcPrefs prop

* Extract blockexplorer url construction into method.

* Fix broken styles on non-network tabs in popup mode

* Fix block explorer url links for cases when provider in state has not been updated.

* Fix vertical spacing of network form

* Don't allow click of save button on network form if nothing has changed

* Ensure add network button is shown in popup view

* Lint fix for networks tab

* Fix block explorer url preference setting.

* Fix e2e tests for custom blockexplorer in account details modal changes.

* Update integration test states to include frequentRpcList property

* Fix some capitalizations in en/messages.json

* Remove some console.logs added during custom rpc form work

* Fix external account link text and url for modal and dropdown.

* Documentation, url validation, proptype required additions and lint fixes on network tab and form.
2019-05-09 14:57:14 -02:30
Whymarrh Whitby
094e4cf555 Check for unused function arguments (#6583)
* eslint: Check for unused function arguments

* eslint: Ignore unused '_' in argument list

Also allow any number of '_' e.g., '__' or '___' which is to be used sparingly

* Remove and rename unused arguments
2019-05-08 15:51:33 -04:00
Chi Kei Chan
56ed189aeb
Auto logout after specific time (#6558)
* Add i18n strings

* Finish Auto timeout

* Fix linter

* Fix copies

* Add unit test to Advanced Tab component

* Add back actions and container

* Add basic test to ensure container completeness

* No zero, fix linters

* restrict negative in input
2019-05-08 11:57:21 -07:00
Chi Kei Chan
0497d209b2
Remove KNOWN_ADDRESS_ERROR from error objects (#6578)
* Remove KNOWN_ADDRESS_ERROR from error objects

* Update test comments
2019-05-08 10:34:56 -07:00
Whymarrh Whitby
d730da8caa Use metricsEvent in AmountMaxButton component 2019-05-07 13:48:50 -02:30
Chi Kei Chan
581128503c Allow dragging seed phrase during Confirm Seed Phrase (#6557)
* Add basic drag and drop functionality

* Refactor seed phrase data structure

* Insert to list when drop

* Save before refactor

* Finish DND

* Fix linter

* update package-lock.json

* Address styling feedbacks

* Add box shadow on hover

* Finish adding unit tests

* Remove describe.only
2019-05-07 12:33:26 -02:30
Whymarrh Whitby
a58e549c3f Skip null and undefined keys when translating via context (#6543)
* i18n: Don't translate null or undefined keys

* Add JSDoc for I18nProvider#t context fn
2019-05-06 15:04:16 -02:30
Whymarrh Whitby
6aa889280d Add suffix to title text only when it exists (#6546) 2019-05-06 10:55:18 -02:30
kumavis
2845398c3d Refactor ProviderApprovalController to use rpc and publicConfigStore (#6410)
* Ensure home screen does not render if there are unapproved txs (#6501)

* Ensure that the confirm screen renders before the home screen if there are unapproved txs.

* Only render confirm screen before home screen on mount.

* inpage - revert _metamask api to isEnabled isApproved isUnlocked
2019-05-03 13:32:05 -04:00
Whymarrh Whitby
e6b9b5c5a9 Use tOrKey for actionKey in ConfirmTransactionBase 2019-05-01 00:23:19 -02:30
Whymarrh Whitby
12cfe8e543 Fix binding of this for I18nProvider#tOrKey 2019-05-01 00:23:19 -02:30
Dan J Miller
4fea9d0cc2
Send metrics event from backend for on chain transaction failures (#6500)
* Send metrics event from backend for on chain transaction failures

* Passes state object to backEndMetaMetricsEvent, and adds getMetaMetricState selector
2019-04-29 03:48:40 -02:30
Chi Kei Chan
0095889408 Add subheader to all settings subviews (#6502)
* Add subheader to all settings subviews

* add margin right to subheader
2019-04-29 03:48:03 -02:30
Dan J Miller
39b7145423
Ensure home screen does not render if there are unapproved txs (#6501)
* Ensure that the confirm screen renders before the home screen if there are unapproved txs.

* Only render confirm screen before home screen on mount.
2019-04-27 06:59:55 -02:30
Thomas Huang
608796398e Revert "Adds 4byte registry fallback to getMethodData() (#6435)"
This reverts commit 09f2a2a547.
2019-04-26 10:05:38 -07:00
Chi Kei Chan
13605c2b5e
Always show private network when RPC is not whitelisted (#6495) 2019-04-25 13:54:35 -07:00
Chi Kei Chan
429bb5e7aa
Fix button colors on mobile (#6493) 2019-04-24 20:01:41 -07:00
Chi Kei Chan
ec712d5d8f
Set max-width on network dropdown and ellipsis long network name (#6494) 2019-04-24 20:01:24 -07:00
Thomas Huang
4fa9576cc1
Merge pull request #6481 from MetaMask/address-prop-types-errors
Address prop types errors
2019-04-18 08:22:45 -06:00
Chi Kei Chan
3519e90ffd Make height consistent on all row in send-content (#6480)
* Update all send-content row to 54px height

* Remove header subtitle

* Remove tests that check for send screen subheader
2019-04-18 00:41:04 -02:30
Thomas Huang
ed23801490
Merge pull request #6477 from MetaMask/metrics-screen-button-type
Update button type on metrics opt-in screen.
2019-04-17 18:26:43 -06:00
Dan Miller
cca73f33f3 Update button type on metrics opt-in screen. 2019-04-17 21:44:39 -02:30
Dan Miller
8a82e629bf Ensure future tokens add decimals as numbers while supporting numbers and strings in send-asset-row 2019-04-17 21:26:25 -02:30
Dan Miller
8c075b7158 getSeletedAsset to only return symbol strings, not token objects 2019-04-17 20:59:45 -02:30
Thomas Huang
1ba7afe34b
Merge pull request #6475 from chikeichan/send-asset
Fix PropTypes validation in send-asset-row
2019-04-17 16:15:56 -06:00
Chi Kei Chan
ed28ca60e0 Fix PropTypes validation in send-asset-row 2019-04-17 13:50:47 -07:00
Chi Kei Chan
d8b536982e
Update confirm to use btn-primary (#6473)
* Update confirm to use btn-primary

* Remove console

* Fix e2e test
2019-04-17 13:34:47 -07:00
Chi Kei Chan
931aaeb700 Add token selection to the send screen (#6445)
* Move send to pages/

* Fix unit tests

* Finish UI

* Integrate asset dropdown to send actions

* Remove console.log

* Hide asset change during edit

* Enable switch from send token to seand eth

* Enable switching from token to eth when editing

* Fix linter

* Fixing test

* Fix unit tests

* Fix linter

* Fix react warning; remove console.log

* fix flat test

* Add metrics

* Address code review comments

* Consistent spacing between send screen form rows.

* Reduce height of gas buttons on send screen.

* Make send screen gas button height dependent on size of contents.
2019-04-17 16:45:13 -02:30
Thomas Huang
83f3e8ab98
Merge pull request #6468 from chikeichan/network-indicator-style-fix
Fix switcher height when Custom RPC is selected or loading
2019-04-17 12:42:49 -05:00
Paul Bouchon
0db0a187c8 feature: add Goerli support (#6459) 2019-04-17 15:04:49 -02:30
Chi Kei Chan
597c490928 Fix switcher height when Custom RPC is selected or when network is loading 2019-04-16 23:47:11 -07:00
Thomas Huang
00133d31b1
Merge pull request #6444 from MetaMask/localhost-network-dropdown
Fixes #6321 & #6421 - Add Localhost 8545 for network dropdown names
2019-04-16 14:39:00 -05:00
Dan J Miller
09f2a2a547
Adds 4byte registry fallback to getMethodData() (#6435)
* Get contract method data from 4byte if we can't get it from eth-method-registry

* Clarify token method name fallback code in getMethodData

* Bugfix: don't attempt to translate falsy actionKeys in confirm-transaction-base.component.js

* Rewrite getMethodFrom4Byte with async-await

* Call four byte and method-registry requests in parallel in getMethodData()
2019-04-16 17:07:47 -02:30
Chi Kei Chan
92c03bdff2 Update buttons & colors to match design system (#6446)
* Refactoring button styles

* renaming buttons

* Add Link and Button styles

* Update new btn styles and storybook

* Fix tests

* Change font weight; Update storybook

* Fix linter
2019-04-16 17:05:22 -02:30
Whymarrh Whitby
c4a3d4ea82 Remove unneeded array cloning in getSendToAccounts selector
The use of `Object.entries` here to map the accounts into a new array effectively
produces a shallow clone of the array without guaranteeing the order of the original
array (as object iteration order is implementation-specific and variable). From MDN [1]:

> The **`Object.entries()`** method returns an array of a given object's own enumerable
> string-keyed property `[key, value]` pairs, in the same order as that provided by a
> `for...in` loop

And also:

> The ordering of the properties is the same as that given by looping over the
> property values of the object manually.

Both of which suggest that the iteration order is the same as `for...in`, which is to
say that it's not specified. [2] [3]

This changeset removes the cloning, keeping the shallow clone created the line before
which preserves the order of the items in the array.

  [1]:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries
  [2]:https://stackoverflow.com/a/5525820/1267663
  [3]:https://stackoverflow.com/a/30919039/1267663
2019-04-11 21:50:06 -02:30
Sneh Koul
2786932576 repeated getSelectedAddress() func send.selectors.js removed (#6056) 2019-04-11 15:20:03 -02:30
Thomas Huang
d7a2ea9a2b Add Localhost 8545 for network dropdown names 2019-04-10 16:34:13 -05:00
Dan Miller
c80b295ccc Only pass english function names to functionType metric 2019-04-08 13:31:11 -02:30
Dan Miller
5d948360c0 Distinguish between token and eth selected in home screen send button metrics event. 2019-04-08 11:06:13 -02:30
Dan Miller
5454266d7c Metrics tracking gas changed - slow, average, fast, custom - on edit screen.- 2019-04-08 11:06:05 -02:30
Dan Miller
4963ed65c0 Track seed phrase validation errors with MetaMetrics 2019-04-05 01:32:18 -02:30
kumavis
cf4eac3f2c
Merge pull request #6397 from MetaMask/wyre-deposit-modal
Change coinbase to wyre
2019-04-04 10:16:26 +08:00
Thomas Huang
6a80ff2718 Change coinbase to wyre 2019-04-03 16:45:43 -05:00
Dan J Miller
95a2480074 Fix display of gas chart on Ethereum networks (#6389) 2019-04-03 13:31:43 -02:30
Thomas Huang
a46ec83c9b Remove NoticeController (#6382) 2019-04-01 22:33:54 -02:30