-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Refactor subscription size page to use useSubPage hook #82340
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
base: main
Are you sure you want to change the base?
Refactor subscription size page to use useSubPage hook #82340
Conversation
|
@dukenv0307 and @arosiclair will review this |
| } | ||
| if (privateSubscription?.type === CONST.SUBSCRIPTION.TYPE.ANNUAL && option === CONST.SUBSCRIPTION.TYPE.PAY_PER_USE && !account?.canDowngrade) { | ||
| Navigation.navigate(ROUTES.SETTINGS_SUBSCRIPTION_SIZE.getRoute(0)); | ||
| Navigation.navigate(ROUTES.SETTINGS_SUBSCRIPTION_DOWNGRADE_BLOCKED.route); |
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.
The canChangeSize param is used to show the downgrade blocked view when trying to downgrade from an annual to a pay-per-use plan, so instead of conditionally rendering it based on the params that can be easily changed by the user, I navigate to the already existing downgrade blocked page.
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7eff636d2e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| type ConfirmationProps = SubStepProps; | ||
|
|
||
| function Confirmation({onNext, isEditing}: ConfirmationProps) { | ||
| function Confirmation({onNext}: ConfirmationProps) { |
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.
Reinstate downgrade guard on subscription size confirmation
Removing isEditing here also removed the account.canDowngrade check that previously blocked annual-plan seat decreases. In the current flow, users with canDowngrade === false can go through Subscription Size, enter a smaller member count, and still reach Save, which sends an updateSubscriptionSize request instead of showing the downgrade-blocked state. That is a behavior regression for restricted downgrade scenarios.
Useful? React with 👍 / 👎.
Explanation of Change
Fixed Issues
Part of #79043
PROPOSAL:
Tests
Same as QA Steps
Offline tests
Same as QA Steps
QA Steps
NOTE: No subscription size page in Android/iOS
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)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
Android: mWeb Chrome
android.mweb.mp4
iOS: Native
iOS: mWeb Safari
ios.mweb.mp4
MacOS: Chrome / Safari
web.mp4