Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/make insufficient fee descriptive #2076

Merged
merged 39 commits into from
Jan 11, 2021

Conversation

rickycodes
Copy link
Member

@rickycodes rickycodes commented Dec 16, 2020

Description

Make 'Insufficient fee' error descriptive & add link to Buy ETH

Previously we were only displaying "Insufficient funds":

image

Now we display a more detailed error with the amount of ETH required along with a link to buy more ETH:

image

Checklist

  • There is a related GitHub issue
  • Tests are included if applicable
  • Any added code is fully documented

Issue

Resolves https://github.com/MetaMask/mobile-planning/issues/7

@rickycodes rickycodes force-pushed the feature/make-insufficient-fee-descriptive branch from 61b9fe2 to fe2b618 Compare December 16, 2020 19:59
@rickycodes rickycodes marked this pull request as ready for review December 17, 2020 16:29
@rickycodes rickycodes requested a review from a team as a code owner December 17, 2020 16:29
@rickycodes rickycodes added needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) needs-qa Any New Features that needs a full manual QA prior to being added to a release. labels Dec 17, 2020
@rickycodes rickycodes force-pushed the feature/make-insufficient-fee-descriptive branch from 9e62163 to 3c9e4d2 Compare December 17, 2020 17:48
@rickycodes rickycodes self-assigned this Dec 17, 2020
@rickycodes rickycodes marked this pull request as draft December 18, 2020 04:18
@rickycodes rickycodes marked this pull request as ready for review December 18, 2020 19:25
@rickycodes rickycodes force-pushed the feature/make-insufficient-fee-descriptive branch from 8519ffd to 0843d2b Compare December 18, 2020 19:26
@@ -16,6 +16,9 @@ import {
import { strings } from '../../../../../locales/i18n';
import { getTicker, getNormalizedTxState } from '../../../../util/transactions';
import TransactionReviewFeeCard from '../TransactionReviewFeeCard';
import Analytics from '../../../../core/Analytics';
import { ANALYTICS_EVENT_OPTS } from '../../../../util/analytics';
import { withNavigation } from 'react-navigation';
Copy link
Member Author

@rickycodes rickycodes Dec 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rather than passing navigation through props we use withNavigation higher order component

@@ -417,7 +417,11 @@ const Main = props => {

const renderDappTransactionModal = () =>
props.dappTransactionModalVisible && (
<Approval dappTransactionModalVisible toggleDappTransactionModal={props.toggleDappTransactionModal} />
<Approval
navigation={props.navigation}
Copy link
Member Author

@rickycodes rickycodes Dec 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is unrelated, but Approval was missing navigation prop. it needs it for this: https://github.com/MetaMask/metamask-mobile/blob/develop/app/components/Views/Approval/index.js#L92-L96. I've made the prop isRequired on it now so we don't do this

But I think this pattern of passing navigation down through props is bad and we should consider using withNavigation instead

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌

const { onCancelPress, navigation } = this.props;
/* this is kinda weird, we have to reject the transaction to collapse the modal */
onCancelPress();
navigation.navigate('PaymentMethodSelector');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would be nice to be able to leave the transaction up and be able to get the user to buy eth and come back to the aforementioned transaction but it's not really possible here. I think for this rejecting is fine and the user can just go through the trouble of setting up the transaction again

Copy link
Contributor

@ibrahimtaveras00 ibrahimtaveras00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue 1:

I'm unable to scroll to see any of the messaging in this approve modal

Screen Shot 2021-01-04 at 8 59 15 PM

I got this view by using this deeplink:

https://metamask.app.link/approve/0x1d7a9cd8c67e3c74a84bb76cbc1b606e2e460db5@1/approve?address=0x1FDb169Ef12954F20A15852980e1F0C122BfC1D6&uint256=1

Issue 2:

I do see it on the Dapp confirm modal and contract deployment modal, however, I'm wondering, should we still show the option to buy ETH on testnets not supported?

For instance there's no option to buy ETH on Ropsten however, I see the link to buy ETH still

Screen Shot 2021-01-04 at 9 03 34 PM

this is from https://metamask.github.io/test-dapp

Issue 3:

I'm not seeing this option when I come from a request, am I supposed to?
cc: @cjeria

Screen Shot 2021-01-04 at 9 17 46 PM

I got here by using this deeplink:

https://metamask.app.link/send/0x1FDb169Ef12954F20A15852980e1F0C122BfC1D6@1?value=1e15

@ibrahimtaveras00 ibrahimtaveras00 added QA'd - Issues Found QA has been complete, however issues have been discovered that need to be addressed and removed needs-qa Any New Features that needs a full manual QA prior to being added to a release. labels Jan 5, 2021
@rickycodes
Copy link
Member Author

I'm not seeing this option when I come from a request, am I supposed to?

Ah good catch. yes we should also make this work for deep links (I can add that).

For instance there's no option to buy ETH on Ropsten however, I see the link to buy ETH still

Maybe in those cases we should have links to the faucets instead?

Copy link
Contributor

@estebanmino estebanmino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@estebanmino estebanmino removed the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Jan 5, 2021
@rickycodes rickycodes force-pushed the feature/make-insufficient-fee-descriptive branch 2 times, most recently from 835ecf2 to e7dd03f Compare January 8, 2021 20:17
@rickycodes rickycodes force-pushed the feature/make-insufficient-fee-descriptive branch from 511617a to 05dcde4 Compare January 8, 2021 22:18
@rickycodes rickycodes added needs-qa Any New Features that needs a full manual QA prior to being added to a release. and removed QA'd - Issues Found QA has been complete, however issues have been discovered that need to be addressed labels Jan 11, 2021
@rickycodes rickycodes force-pushed the feature/make-insufficient-fee-descriptive branch from 5e70c46 to 790b097 Compare January 11, 2021 21:16
Copy link
Contributor

@ibrahimtaveras00 ibrahimtaveras00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes look good, QA Passed 👍🏽

@ibrahimtaveras00 ibrahimtaveras00 added QA Passed A successful QA run through has been done and removed needs-qa Any New Features that needs a full manual QA prior to being added to a release. labels Jan 11, 2021
@rickycodes rickycodes merged commit 7908f50 into develop Jan 11, 2021
@rickycodes rickycodes deleted the feature/make-insufficient-fee-descriptive branch January 11, 2021 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
next release QA Passed A successful QA run through has been done
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants