[Payment card / Subscription] Implement changing plan actions#43029
Conversation
f8623b5 to
783689c
Compare
|
@mananjadhav Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
Does this need C+ review? |
|
@mananjadhav not sure, @amyevans can you help here? 🙏 |
|
@mananjadhav why would you think it doesn't need C+? |
Because it was reviewed by two folks from the agency. |
|
@mananjadhav it's the standard procedure for the vast majority of our PRs, so if that's the question then yes, it does need a C+ review 😄 |
|
Yep, jump on it Manan! Your 👀 and ✅ are desired here.. 😄 |
|
I reviewed the code, testing it now. |
|
@JKobrynski @amyevans We're not throwing an error if the API fails. Also I am not sure what the offline behavior is. It says same behavior as Tests. plan-change.mov |
|
Offline behavior: pattern B - you should be able to switch between plan types offline optimistically but it will be greyed out at 50% opacity until back online. We need to display a RBR if the API returns an error |
|
Thanks for confirmation @JKobrynski Can you please fix this and ping once done? |
|
@JKobrynski Based on the message from Eugene, I think the RBR will be added in #42431. So I think we can do one final review by @Expensify/design before we can finish the checklist. |
|
The UI looks good to me, and I've one small change on the code. I'll work on the checklist anyway and pending completion based on the change. |
| [WRITE_COMMANDS.SEND_INVOICE]: Parameters.SendInvoiceParams; | ||
| [WRITE_COMMANDS.PAY_INVOICE]: Parameters.PayInvoiceParams; | ||
| [WRITE_COMMANDS.MARK_AS_CASH]: Parameters.MarkAsCashParams; | ||
|
|
| onyxMethod: Onyx.METHOD.MERGE, | ||
| key: ONYXKEYS.NVP_PRIVATE_SUBSCRIPTION, | ||
| value: { | ||
| type, |
There was a problem hiding this comment.
We don't want to save the wrong type if it fails, it should restore to the existing value
|
@amyevans @mananjadhav PR updated! |
|
Thanks @JKobrynski. I’ll be able to review this in 1-2 hours |
Reviewer Checklist
Screenshots/VideosAndroid: mWeb Chromemweb-chrome-subscription-plan-change.moviOS: mWeb Safarimweb-safari-subscription-plan-change.movMacOS: Chrome / Safariweb-subscription-plan-change.movMacOS: Desktopdesktop-subscription-plan-change.mov |
|
@JKobrynski One last comment if you could replace the mobile web screenshots showing the stacked view. Rest all looks good. |
amyevans
left a comment
There was a problem hiding this comment.
1 last thing related to the failure case, otherwise good to go
| value: { | ||
| pendingAction: null, | ||
| }, |
There was a problem hiding this comment.
Sorry, just to expand on what I mentioned earlier - to restore to the existing value type value upon failure, we need to set the existing value here. So you could either pass that into the function, or since there's only 2 options, do something like
type: type === CONST.SUBSCRIPTION.TYPE.ANNUAL ? CONST.SUBSCRIPTION.TYPE.PAYPERUSE : CONST.SUBSCRIPTION.TYPE.ANNUAL,Current behavior if I force an error:
incorrect-failure-data.mov
There was a problem hiding this comment.
Ohh sorry I misread too! Thanks for clarifying.
|
@amyevans @mananjadhav PR updated 🫡 |
| { | ||
| onyxMethod: Onyx.METHOD.MERGE, | ||
| key: ONYXKEYS.NVP_PRIVATE_SUBSCRIPTION, | ||
| value: { |
There was a problem hiding this comment.
Nope those would get populated by the API response
amyevans
left a comment
There was a problem hiding this comment.
Looks good, however there's a conflict to resolve @JKobrynski
|
@amyevans conflict resolved! |
|
Looks like we want to wait for @dannymcclain's input in this thread so I'll hold on that before merging |
|
Just saw this—I agree with Shawn's suggested changes! |
|
✋ 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 production by https://github.com/mountiny in version: 1.4.83-3 🚀
|


Details
To access this newly created component, paste the following link into the browser
https://dev.new.expensify.com:8082/settings/subscription
or add this effect to
InitialSettingsPage.tsxFixed Issues
$ #38622
PROPOSAL: N/A
Tests
Offline tests
Same as Tests section above, except the log out/in part
QA Steps
Same as Tests section above
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
It's disabled on native Android
Android: mWeb Chrome
chrome-compressed.webm
iOS: Native
It's disabled on native iOS
iOS: mWeb Safari
safari-compressed.mp4
MacOS: Chrome / Safari
web-compressed.mov
MacOS: Desktop
desktop-compressed.mov