-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Refactor Terms step of Wallet_Activate into AcceptWalletTerms
#10443
Conversation
AcceptWalletTerms
AcceptWalletTerms
<View style={[styles.pageWrapper, styles.flex1, styles.flexColumn, styles.alignItemsCenter, styles.justifyContentCenter]}> | ||
<Icon | ||
src={Illustrations.TadaBlue} | ||
height={100} | ||
width={100} | ||
fill={defaultTheme.iconSuccessFill} | ||
/> | ||
<View style={[styles.ph5]}> | ||
<Text style={[styles.mt5, styles.h1, styles.textAlignCenter]}> | ||
{this.props.translate('activateStep.activated')} | ||
</Text> | ||
</View> | ||
</View> | ||
<FixedFooter> | ||
<Button | ||
text={this.props.translate('common.continue')} | ||
onPress={PaymentMethods.continueSetup} | ||
style={[styles.mt4]} | ||
iconStyles={[styles.mr5]} | ||
success | ||
/> | ||
</FixedFooter> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't quite match the mockup from the doc :)
{this.props.userWallet.tierName === CONST.WALLET.TIER_NAME.SILVER && ( | ||
<Text>{this.props.translate('activateStep.checkBackLater')}</Text> | ||
)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created an issue for a mockup for the Check back later
screen here: https://github.com/Expensify/Expensify/issues/223443
Doesn't have to be part of this PR, can be a follow up improvement.
onyxMethod: CONST.ONYX.METHOD.MERGE, | ||
key: ONYXKEYS.USER_WALLET, | ||
value: { | ||
shouldShowWalletActivationSuccess: null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed this to null
instead of false
so it gets removed, I figured it's no longer needed at that point.
src/languages/es.js
Outdated
activatedTitle: 'Billetera Expensify lista!', | ||
activatedMessage: 'Enhorabuena, tu billetera Expensify está lista para usar.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting confirmation for these here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I think we just need those translations and then we should be good to go!
AcceptWalletTerms
AcceptWalletTerms
Updated and removed the hold. One thing I'm not sure about is that I get an error in the JS console that seems to point to something unrelated, but it's also happening on
it points to the |
AcceptWalletTerms
AcceptWalletTerms
Fixed the conflicts with your other PR we just merged, and also I'm putting this back on hold until https://github.com/Expensify/Web-Expensify/pull/34588 is on staging. |
…rAcceptWalletTerms
@@ -19,4 +19,7 @@ export default PropTypes.shape({ | |||
|
|||
/** Status of wallet - e.g. SILVER or GOLD */ | |||
tierName: PropTypes.string, | |||
|
|||
/** Whether we should show the ActivateStep view success view after the user finished the KYC flow */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/** Whether we should show the ActivateStep view success view after the user finished the KYC flow */ | |
/** Whether we should show the ActivateStep success view after the user finished the KYC flow */ |
<Text style={[styles.formError, styles.mb2]}> | ||
{_.last(_.values(errors))} | ||
</Text> | ||
)} | ||
<Button |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's replace the Button component with the FormAlertWithSubmitButton. It's more consistent with all other forms and we can get rid of these lines
const bool isButtonDisabled = !this.state.hasAcceptedDisclosure || !this.state.hasAcceptedPrivacyPolicyAndWalletAgreement;
...
<FormAlertWithSubmitButton
buttonText={this.props.translate('termsStep.enablePayments')}
onSubmit={() => {
if (!this.state.hasAcceptedDisclosure
|| !this.state.hasAcceptedPrivacyPolicyAndWalletAgreement) {
this.setState({error: true});
return;
}
this.setState({error: false});
BankAccounts.acceptWalletTerms({
hasAcceptedTerms: this.state.hasAcceptedDisclosure
&& this.state.hasAcceptedPrivacyPolicyAndWalletAgreement,
});
}}
isDisabled={isButtonDisabled || this.props.network.isOffline}
message={this.state.error ? this.props.translate('common.error.acceptedTerms') : !_.isEmpty(errors) ? _.last(_.values(errors)) : ''}
isAlertVisible={this.state.error || !_.isEmpty(errors)}
/>
<FixedFooter> | ||
<Button | ||
text={this.props.translate('common.continue')} | ||
onPress={PaymentMethods.continueSetup} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't tested but just wanted to confirm if clicking this will lead the user back to the action they were previously taking i.e. paying via the wallet or transferring their wallet balance?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a huge pain to test on dev for some reason, but yes. It calls this function, which at the bottom ends up calling the onSuccessfulKYC()
prop method.
Screen.Recording.2022-08-22.at.3.38.56.PM.mov
</View> | ||
<FixedFooter> | ||
<Button | ||
text={this.props.translate('common.continue')} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a big deal but we can probably adjust this now or in a follow up PR.
The green success button will either state “Continue to payment” or “Continue to transfer” based on the action that we will be returning the user to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah at the moment I don't see how we would do that so I don't mind if we do this in a follow-up PR.
Yeah, I see this is happening for the
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor change but otherwise looks good to me!
Co-authored-by: Maria D'Costa <maria@expensify.com>
Updated, thanks for the reviews! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
AcceptWalletTerms
AcceptWalletTerms
Removed the Hold on this. I don't know if @Justicea83 you want to review? Otherwise Maria feel free to merge! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes LGTM!
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by @Justicea83 in version: 1.1.89-0 🚀
|
cc @MariaHCD
Hold until https://github.com/Expensify/Web-Expensify/pull/34588 is at least on staging.
Details
AcceptWalletTerms
when the user accepts the terms of the Expensify Wallet, instead of using the deprecatedWallet_Activate
commandActivateStep
component to be prettier when the user finishes setting up a Gold wallet.This PR does not implement the Red Brick Road for KYC errors. This will come in follow-up PRs.
Fixed Issues
Part of https://github.com/Expensify/Expensify/issues/218502
Tests
Pre-requisites:
bankAccountID
of that account in auth, and then run (replace thebankAccountID
at the end):Tests
/enable-payments
3. Scroll down to the bottom, and make sure you can't click the "Enable Payments" button without checking both buttons
Check both checkboxes, click the Enable Payments button
Since the wallet technically doesn't pass all identity checks at that point, it will be a Silver wallet, and you should see a "We're still reviewing your information. Please check back later." message
Run the flow again but for a Gold wallet. Start by resetting and configuring the wallet as follows:
validator:wallet
CLI Tool on the accountUPDATE bankAccounts SET additionalData = JSON_SET(COALESCE(NULLIF(additionalData, ''), '{}'), '$.currentStep', 'TermsStep') WHERE bankAccountID = <walletID>;
Onyx.merge('userWallet', {shouldShowWalletActivationSuccess:null})
Navigate to
/enable-payments
again. Check both boxes at the bottom, and click the buttonMake sure you see the following Tada page
PR Review Checklist
Contributor (PR Author) Checklist
### Fixed Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
filesSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
displayName
propertythis
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)PR Reviewer Checklist
The Contributor+ will copy/paste it into a new comment and complete it after the author checklist is completed
### Fixed Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
).src/languages/*
filesSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
have been tested & I retested again)/** comment above it */
displayName
propertythis
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)QA Steps
Screenshots
Web
Mobile Web
Desktop
iOS
Android