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

3837 Commits

Author SHA1 Message Date
Erik Marks
d1e645f671 fixup! fix redirect alignment and css class names 2020-06-12 09:09:42 -07:00
Erik Marks
0cec119fc8 fix redirect alignment and css class names 2020-06-12 09:09:24 -07:00
Erik Marks
d8e7fb4c42 address review feedback 2020-06-11 14:11:50 -07:00
Erik Marks
14a5e77edd fix classes 2020-06-11 13:56:29 -07:00
Mark Stacey
4ac4790cfa
Rename 'History' tab to 'Activity' (#8785)
'Activity' is a better name for this tab because it contains more than
just transactions. Signature requests are also included, and more non-
transaction activity may be included in the future.
2020-06-11 17:14:07 -03:00
Erik Marks
8bf1410f06 fix calling redirect immediately on cancel 2020-06-11 12:55:35 -07:00
Mark Stacey
058c63cf80
Use localized tab names on Home screen (#8784)
The tab names on the Home screen are now localized messages, rather
than being hard-coded as English.
2020-06-11 15:19:13 -03:00
ricky
71e7966b6a
Update Seed Phrase Functionality on Account Import (#8730)
Update seed phrase functionality to be able to conceal seed phrase (as a password field) so it remains hidden on screen.
2020-06-11 10:24:13 -04:00
Erik Marks
a5f4115969 fixup! only run beforeunload in notification UI 2020-06-10 22:14:17 -07:00
Erik Marks
222ccd9d44 only run beforeunload in notification UI 2020-06-10 22:13:55 -07:00
Erik Marks
c090bc7f40 remove home page flicker on notification close 2020-06-10 22:09:04 -07:00
Erik Marks
51956b2a14 handle multiple pending permissions requests 2020-06-10 21:50:49 -07:00
Erik Marks
854e06b3ae fixup! only close notification in redirectFlow 2020-06-10 17:49:26 -07:00
Erik Marks
12d2315f18 only close notification in redirectFlow 2020-06-10 17:35:16 -07:00
Erik Marks
3eb33ef492 remove cancel redirect 2020-06-10 17:27:47 -07:00
Erik Marks
e86fc77d16 fixup! delete buttonsDisabled boolean 2020-06-10 16:44:10 -07:00
Erik Marks
0de56203fc delete buttonsDisabled boolean 2020-06-10 16:44:10 -07:00
Erik Marks
567b5634ca cleanup; update metadata as needed 2020-06-10 16:44:10 -07:00
Erik Marks
a94dc15349 removed unused styles 2020-06-10 16:44:09 -07:00
Erik Marks
ea398abc5d make redirect flow consistent 2020-06-10 16:44:09 -07:00
Brad Decker
a4e5fc934d
restore status tooltip (#8745)
initially set out to add the failed tooltip back to the transaction list, but
in the process rediscovered the transaction-status component which illuminated
a fair number of statuses that were not properly handled by the refactor of the
list. These statuses were discussed with UX and engineering team members to come
up with a definitive list of statuses that should be reflected in the UI

Changes:
1. normalized the color of status labels to use Red-500 and Orange-500 where applicable
2. added a new color of icon for pending transactions -- grey
3. added support for dropped and rejected labels
4. failed, dropped, rejected and cancelled all have red icons now.
5. cancelled transactions will reflect a change in the user's balance
6. tooltip displayed for failed transactions
7. Icon logic isolated to a new component.
2020-06-10 15:38:34 -05:00
Mark Stacey
0b86283c10
Create useTokenFiatAmount hook (#8778)
This hook is responsible for converting a token balance to fiat. It has
been extracted from the `TokenCell` component, and will be used
elsewhere in a future PR.
2020-06-10 16:04:29 -03:00
Thomas Huang
e124a9b467
Remove default sendToken value in send.component.js (#8764)
Fixes #8763
2020-06-10 11:34:16 -07:00
Brad Decker
13d6803698
Adds the rule of hooks eslint rule (#8779) 2020-06-10 13:31:14 -05:00
Mark Stacey
e4a77ea631
Extract token to fiat conversion (#8777)
The conversion of token amounts to fiat amounts was extracted from the
`TokenCell` component, and moved to a utility function. This will be
used elsewhere in an upcoming PR.
2020-06-10 15:04:56 -03:00
Whymarrh Whitby
87c2c81da7
Remove some unused state keys (#8776)
* Remove unused networkEndpointType state key

* Remove unused coinOptions state key
2020-06-10 14:51:12 -02:30
Mark Stacey
cfadc7592e
Avoid mutating module export (#8775)
The `eth-contracts-metadata` export was mutated in `token-list.js` to
add the token address to the contract metadata, and this was taken
advantage of in the token search component.

Instead, the address is now added to a copy of the token metadata in
the one place it's used. The module export is no longer mutated, and
the unused `defaultTokens` variable in `token-list.js` has been
removed.
2020-06-10 13:27:35 -03:00
Erik Marks
a84eedb7da
Permissions: Do not display HTTP/HTTPS URL schemes for unique hosts (#8768)
* only show URL.host in connected-accounts component

* strip scheme from URL for unique hosts

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2020-06-09 13:56:24 -07:00
Mark Stacey
4706401f4f
Refactor confirm approve page (#8757)
The `confirm-approve` page has been converted from a set of container/
component components to a functional component. The `withTokenTracker`
higher-order component has been deleted, as it was replaced by the
`useTokenTracker` hook.
2020-06-09 17:10:07 -03:00
Erik Marks
53c55d8522
Order accounts on connect page (#8762) 2020-06-08 13:23:48 -07:00
Brad Decker
e82a8a5f52
Fix prop type mismatch (#8754) 2020-06-05 15:06:15 -07:00
Brad Decker
1eed8dc167
use grid template to position list item (#8753)
Using flex was getting out of hand, I noticed on develop that when
a pending transaction is coming in the speed up and cancel buttons
cause the icon to center according ot their height as well. A grid
is really what is needed. This seemingly greatly simplifies the CSS
AND html (removes unnecessary nesting of divs)
2020-06-05 16:33:51 -05:00
Mark Stacey
f5ec16c65a
Fix account menu entry for imported accounts (#8747)
The entry for imported accounts in the account menu looked wrong with
the new connected site icon - there was no padding between the site
icon and the 'imported' label. The entry was pretty crowded with these
three symbols as well (the third being the 'x' used to remove the
account).

The site icon has been made the right-most icon, so that it lines up
with the site icons shown for other accounts, and spacing has been
added between the site icon and the 'imported' label.

The 'x' used to remove accounts has been removed. Accounts can still be
removed from the 'Account Options' menu on the Home screen. This seemed
like the wrong place for this button to exist, as it's the only action
that can be taken from that menu aside from navigation.
2020-06-05 17:24:51 -03:00
Erik Marks
bb78512bd6
Fix permissions connect close and redirect behavior (#8751)
* fix permissions connect close/redirect behavior

* improve permissions connect fullscreen close behavior

* fix multi ui perm conf redirect; consolidate perm selectors
2020-06-05 13:24:38 -07:00
Mark Stacey
9a1f27fe04
Refactor TokenBalance component (#8752)
The `TokenBalance` component now uses the new `useTokenTracker` hook
instead of the `withTokenTracker` higher-order component. The component
was converted from a split container/component to a functional
component so that the hook could be used.

The prop `withSymbol` was removed from a few call sites, as it was no
longer used. An empty string was substituted for any falsy `string` or
`symbol` because that's what the `withTokenTracker` higher-order
component did.
2020-06-05 17:19:27 -03:00
Mark Stacey
799536c35f
Fix 'Remove account' in Account Options menu (#8748)
The 'Remove account' button in the Account Options menu was broken.
Clicking it would crash the UI. It now correctly opens the 'Remove
Account' modal.
2020-06-05 16:01:06 -03:00
Brad Decker
7fcf625549
asset outdated warning inline on full screen (#8734)
The asset list item and transaction list item do not make great use of
screen realestate when in fullscreen mode on larger displays/windows.
This PR adds in a new prop for list-item for displaying content in the
middle of the list-item when on these types of screens. To facilitate
this, some updates were made to styling to allow for the list item to
better control how items are laid out in various breakpoints.

This works makes it possible to display the outdated balance warning
inline in the middle section of the list item, and convert to a tooltip
when on small displays.
2020-06-05 13:36:40 -05:00
Mark Stacey
8e1f40aedb
Handle connected accounts with no last active time (#8746)
The "Connected accounts" modal was throwing an exception when
attempting to render an account that has no `lastActive` time. The
component and related selector has been updated to no longer expect
the `lastActive` time to be set.

Prior to #8653 there was a guarantee that all connected accounts had a
`lastActive` time set, as the time would be set on any account returned
from the `eth_requestAccounts` call. But after #8653 only the primary
account was returned, so only the primary account had a `lastActive`
time set.

Fixes #8733
2020-06-05 13:07:23 -03:00
Mark Stacey
e85b162651
Add MESSAGE_TYPE enum (#8743)
Each "message" requiring a user confirmation has a unique `type`
property. These `type` properties have all been added as enums, and the
enum is now used wherever the literal string was used previously.
2020-06-04 16:22:45 -03:00
Brad Decker
ab06595a5d
refactor token list (#8726)
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2020-06-04 13:13:11 -05:00
Mark Stacey
b96eb55c76
Add box shadow to Home screen tabs (#8739)
This matches the box shadow on the asset page. Some CSS specificity
hijinks were required to override the base `Tabs` CSS rules, and a new
`tabsClassName` prop was added to the `Tabs` component.
2020-06-04 13:42:45 -03:00
Mark Stacey
cac3bf5c56
Increase padding of empty transaction list (#8738)
The top padding of the empty transaction list now mirrors the space
below the buttons in the overview.
2020-06-04 12:52:21 -03:00
Mark Stacey
1553f70a65
Make asset page breadcrumb clickable (#8737)
The entire asset page breadcrumb is now clickable. Clicking it will
bring the user back to the home page.
2020-06-04 12:51:44 -03:00
Whymarrh Whitby
731efcb36d
Move terms of use strings into localized messages (#8736) 2020-06-04 12:28:21 -02:30
Brad Decker
591d84d2bb
refactor asset-list-item to use list-item component (#8725)
* refactor asset items to use list-item

Refactors the asset-list-item and token-cell to rely on the list-item
component for UI. Little changes were needed to the list-item code
to make this work! The result should be lots of eliminated code

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2020-06-03 12:50:12 -05:00
Whymarrh Whitby
b9028397cb
Fix parsing of seed phrases on import and restore (#8721) 2020-06-03 14:37:07 -02:30
Brad Decker
c6b77c9734
fix grid repositioning on label change (#8713) 2020-06-03 09:47:12 -05:00
Mark Stacey
171704d980
Fix gas price intermittent test failure (#8728)
The "the transaction has the expected gas price" test was assuming the
fifth element with the `transaction-breakdown__value` class was the
element with the gas price. In practice that was sometimes not the
case, because some transaction detail fields would not be present, or
would appear after the first render.

The field is now looked up with a test id, ensuring it always finds the
correct field.
2020-06-03 10:54:55 -03:00
Mark Stacey
56b157f692
Fix hide token e2e test (#8724)
The e2e test for the "Hide token" functionality was incorrectly
clicking "Cancel" on the "Hide token" modal, thus not actually testing
that that token was hidden at all.

The "Confirm" button is now selected using a test id, to ensure the
wrong button isn't selected.
2020-06-02 18:47:55 -03:00
Mark Stacey
e1c3778446
Fix disabled prop type in AddToken component (#8723)
The `disabled` prop being passed to the `PageContainer` component in
the render function for the `AddToken` component was a string in some
cases. It should always be a boolean. It has been cast to a boolean in
the one case where it was a string.
2020-06-02 18:47:43 -03:00
Erik Marks
616a446832
Use URL origin instead of hostname for permission domains (#8717)
* use URL.origin instead of hostname for tabs and permissions
2020-06-01 16:24:27 -07:00
Erik Marks
8afb295e1d
Fix connect long URL styling (#8719)
* fix connect long URL styling
2020-06-01 15:28:05 -07:00
Brad Decker
c8de0b70fa
Add nonce to transaction details (#8716) 2020-06-01 17:19:49 -05:00
Thomas Huang
fb906e2150
Consistent rounded corners on tx details modal/popup (#8714) 2020-06-01 13:04:39 -07:00
Mark Stacey
df85ab6e10
Implement asset page (#8696)
A new page has been created for viewing assets. This replaces the old
`selectedToken` state, which previously would augment the home page
to show token-specific information.

The new asset page shows the standard token overview as seen previously
on the home page, plus a history filtered to show just transactions
relevant to that token.

The actions that were available in the old token list menu have been
moved to a "Token Options" menu that mirrors the "Account Options"
menu.

The `selectedTokenAddress` state has been removed, as it is no longer
being used for anything.

`getMetaMetricState` has been renamed to `getBackgroundMetaMetricState`
because its sole purpose is extracting data from the background state
to send metrics from the background. It's not really a selector, but
it was convenient for it to use the same selectors the UI uses to
extract background data, so I left it there for now.

A new Redux store has been added to track state related to browser history.
The most recent "overview" page (i.e. the home page or the asset page) is
currently being tracked, so that actions taken from the asset page can return
the user back to the asset page when the action has finished.
2020-06-01 14:54:32 -03:00
Brad Decker
ec2e5c848b
fix crash on signature request (#8709) 2020-06-01 12:27:51 -05:00
Erik Marks
9193522bd5
Fix accounts menu styling (#8707)
* fix accounts menu styling
2020-06-01 10:01:51 -07:00
Mark Stacey
df4b757479
Remove unused getToErrorObject parameters (#8705)
The third and fourth parameters were unused, so they have been removed.
The tests descriptions for both `getToErrorObject` and
`getToWarningObject` have been improved as well.
2020-05-29 15:31:57 -03:00
Brad Decker
c3b29e192a
hide connected-status on metamask ext (#8703)
Co-authored-by: Erik Marks <25517051+rekmarks@users.noreply.github.com>
2020-05-29 13:14:25 -05:00
Mark Stacey
ddaa492751
Use send state for send flow token (#8695)
The chosen token in the `send` flow was set from one of two places:
`metamask.selectedTokenAddress` or `metamask.send.token`. The former is
used most of the time, but the latter is used for the 'Edit' button
shown in the upper-left of the confirmation UI.

The send flow will now exclusively use `metamask.send.token` for the
token state during the send flow. `metamask.selectedTokenAddress` is
now only used for the selected token state on the Home screen. This
simplifies the Redux state, as the send token is now in one place
instead of two, and `metamask.selectedTokenAddress` has only one
purpose.
2020-05-29 14:46:10 -03:00
Brad Decker
e481166052
do not display extension id in connection modal (#8699) 2020-05-29 12:12:14 -05:00
Whymarrh Whitby
ad85382824
Fix tab content disappearing during scrolling on macOS Firefox (#8702) 2020-05-29 14:41:34 -02:30
Brad Decker
68f8abbbca
close details when button is pressed (#8694) 2020-05-29 11:15:33 -05:00
Mark Stacey
88bed7181f
Refactor token selectors (#8671)
Unused token selectors have been removed, and the remaining token
selector has been moved to the `metamask` Redux store.
2020-05-28 21:43:44 -03:00
Erik Marks
606618ee28
Update eth_accounts permission description (#8693)
* update eth_accounts permission description

* make it easier to find permission name locale message

* handle longer permissions descriptions in UI
2020-05-28 15:53:11 -07:00
Mark Stacey
7ff3b4c928
Extract selected token from token input (#8692)
The `TokenInput` component now takes the token as a prop, instead of
using the `selectedTokenAddress` state. The `UserPreferencedTokenInput`
component that wrapped `TokenInput` has also been updated to take the
token as a prop.
2020-05-28 19:08:11 -03:00
Whymarrh Whitby
91a26bae89
Fix propType for Home defaultHomeActiveTabName (#8683) 2020-05-28 19:15:04 -02:30
Erik Marks
eb7ef4047f
Fix create account form styling (#8689)
* ensure space between create account buttons

* delete wrapper div class name
2020-05-28 13:23:50 -07:00
Mark Stacey
8ed4510d90
Remove unused getSelectedTokenAssetImage selector (#8691)
This selector has been unused as of #8637
2020-05-28 17:17:04 -03:00
Mark Stacey
795676d3ec
Remove getTxParams (#8676)
This function primarily ensured that there was a reasonable fallback
for `txParams` if the given transaction was missing it. This fallback
was only used in one place: the customize gas modal, during the send
flow specifically.

The helper function has been removed, and the default `txParams` is set
in the one place it was needed. In the future we should attempt to
simplify this modal so it doesn't need to know details about the
context in which it's being used.
2020-05-28 16:39:33 -03:00
Brad Decker
00834f5de6
do not show account mismatch alert on details (#8678) 2020-05-28 14:20:56 -05:00
Erik Marks
22699cb1d9
Fix connect hardware styling (#8680)
* Connect -> Hardware

* fix connect hardware styling

* rename some components and classes

* make hardware account scrolling sane
2020-05-28 11:47:48 -07:00
Erik Marks
b34ccbb904
Fix Firefox account menu styling (#8681)
* Fix Firefox account menu styling
2020-05-28 11:02:59 -07:00
Brad Decker
fbe16e8a5f
various fixes to transaction list (#8673) 2020-05-28 13:00:51 -05:00
Whymarrh Whitby
93c2184bd9
Add metrics events for Wyre and CoinSwitch (#8677) 2020-05-28 13:54:52 -02:30
Whymarrh Whitby
f8137b7a66
Fix height of connect screen (#8675) 2020-05-28 12:22:16 -02:30
Whymarrh Whitby
a75dcae9bb
Merge branch 'develop' into manual-connect 2020-05-28 07:20:26 -02:30
Mark Stacey
95a95ee4bc
Refactor transaction list token filtering (#8669)
The transaction list now filters by token in the `TransactionList`
component instead of in the transaction selector. This was done in
preparation for the asset page work.

Technically this approach is slightly less efficient than before, as
we're now filtering the transactions after they've been grouped
together rather than beforehand. The difference is minimal though, and
this method is more correct.

The old filtering was broken because it inappropriately filtered out
cancel transactions. Cancel transactions always have the `to` address
set to the same as the `from` address, and the token filter only
returned transactions where the `to` address was set to the token
address.

Now that we're only filtering by the `to` address of the initial
transaction, token transaction groups will be included in their
entirety, including any cancel transactions.
2020-05-28 00:11:15 -03:00
Mark Stacey
e89540fd94
Fix token decimal type (#8670)
The `decimals` property of tokens was being set as a string instead of
a Number for any tokens added via `getTokenParams`. It's now cast to a
Number instead.
2020-05-27 22:33:59 -03:00
Whymarrh Whitby
5b1608681c Manually connect via the full connect flow 2020-05-27 21:45:41 -02:30
Whymarrh Whitby
145edbe99d
Make address display wider in Account Details (#8665) 2020-05-27 20:11:44 -02:30
Whymarrh Whitby
3931427db8
Show hostname in the disconnect confirmation (#8663) 2020-05-27 19:39:14 -02:30
Whymarrh Whitby
34adccec7c
Fix JSDoc for Tabs#_findChildByName (#8664) 2020-05-27 19:10:26 -02:30
Mark Stacey
cc1170f577
Remove unused isWideViewport prop (#8662)
This prop is no longer required, now that the new fullscreen redesign
has been implemented. This was unused before the redesign as well,
seemingly by accident.
2020-05-27 18:36:55 -03:00
Whymarrh Whitby
4802ed1df5
Localize permission descriptions (#8661) 2020-05-27 18:15:10 -02:30
Mark Stacey
a0d64c7932
Implement new fullscreen design (#8657)
The fullscreen UI now shows roughly the same design as the popup UI.
A few additional changes depicted in the new fullscreen designs will
be implemented in subsequent PRs (e.g. the inline buttons on assets)

This was done now to make asset pages easier to implement. Implementing
asset pages solely for the popup UI would have been complicated by the
fact that we use viewport size to switch between the two layouts, so we
would have had to re-route upon resizing the window.
2020-05-27 17:28:33 -03:00
Brad Decker
398f2647c0
resolve remaining issues with transaction list (#8659) 2020-05-27 14:45:20 -05:00
Mark Stacey
a6f2156386
Update account options menu design (#8654)
The `AccountDetailsDropdown` component has been rewritten to use the
new `Menu` component, and to follow the latest designs.

This should be functionally equivalent. A couple of the icons have
changed, but that's about it.

Support for a subtitle was added to `MenuItem` to support the `origin`
subtitle used for the explorer link for custom RPC endpoints.

A few adjustments were required to `test/helper.js` to accommodate
the use of `Menu` from a JSDOM context (this is the first time it's
been used in a unit test). A `popover-content` element was added to the
fake DOM, and another global was added that `react-popper` used
internally.

An additional driver method (`clickPoint`) was added to the e2e driver
to allow clicking the background behind the menu to dismiss it. This
wasn't possible using the `clickElement` method, because that method
would refuse to click an obscured element. The only non-obscured
element to click was the menu backdrop, and that didn't work either
because the center was obscured by the menu (Selenium clicks the center
of whichever element is targeted).
2020-05-27 12:31:53 -03:00
Brad Decker
706dc02cb4
Implement new transaction list design (#8564)
Co-authored-by: Whymarrh Whitby <whymarrh.whitby@gmail.com>
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2020-05-26 15:49:11 -05:00
Whymarrh Whitby
ab11e0b623
Rename preferencesSelector selector to getPreferences (#8647) 2020-05-26 03:41:58 -02:30
Whymarrh Whitby
835386bf35
Persist home tab state (#8612) 2020-05-25 16:31:28 -02:30
Mark Stacey
3cedf708e9
Remove duplicate 'Account options' tooltip (#8644)
The `title` HTML attribute already resulted in this having a tooltip.
We didn't need to add an extra one.
2020-05-22 14:42:09 -03:00
Mark Stacey
8379dd6a07
Refactor MenuBar component (#8643)
The `MenuBar` component has been converted to a functional component.
This was done to make upcoming changes related to the home screen
redesign easier to implement.
2020-05-22 14:11:42 -03:00
Brad Decker
684c58b94e
fix prop name for disconnect icon (#8641) 2020-05-21 16:12:38 -05:00
Brad Decker
389df9dd37
warn user when sending from different account (#8601) 2020-05-21 15:21:34 -05:00
Mark Stacey
dd41870f1d
Split TransactionViewBalance component (#8637)
The `TransactionViewBalance` component has been split into three
separate components. This was done primarily to make the asset page
easier to implement. Also the name `TransactionViewBalance` didn't
describe this component very well anymore.

Instead of the Ethereum and token-specific logic being in the same
component, the two cases were split into the `EthOverview` and
`TokenOverview` components respectively. They both use the
`WalletOverview` component, which has the structure shared by both
cases.
2020-05-21 14:33:48 -03:00
Mark Stacey
57531ad100
Fix AssetList metric events (#8639)
The metric events in the `AssetList` component were using the
`useMetricEvent` hook incorrectly.
2020-05-21 13:06:06 -03:00
Brad Decker
f9ea9b541a
add useI18nContext shortcut hook (#8635) 2020-05-21 10:26:49 -05:00
Brad Decker
ec99cc82b8
Design QA fixes for v8 (#8630) 2020-05-20 15:42:18 -05:00
Mark Stacey
f886686db2
Extract Menu component from ConnectedAccountsListOptions (#8632)
A `Menu` component has been extracted from the
`ConnectedAccountsListOptions` component. The menu and the menu items
are now the `Menu` and `MenuItem` components respectively.

A custom body was added to the Storybook preview to ensure that the
`popover-content` element was present in the DOM before the Menu was
constructed.
2020-05-20 14:52:23 -03:00