-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[Payment card / Subscription] Integrate “Subscription settings” section with backend data #43367
[Payment card / Subscription] Integrate “Subscription settings” section with backend data #43367
Conversation
…nSettingsWithBackend
@DylanDylann 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] |
@VickyStash PR updated! |
@VickyStash @rezkiy37 PR updated! |
Reviewer Checklist
Screenshots/VideosAndroid: NativeThis feature isn't available in native app Android: mWeb ChromeScreen.Recording.2024-06-17.at.15.22.41.moviOS: NativeThis feature isn't available in native app iOS: mWeb SafariScreen.Recording.2024-06-17.at.15.21.18.movMacOS: Chrome / SafariScreen.Recording.2024-06-17.at.15.03.18.movMacOS: DesktopScreen.Recording.2024-06-17.at.15.23.20.mov |
@JKobrynski Auto-increase annual seats is toggled of automatically Screen.Recording.2024-06-11.at.21.49.52.mov |
I'm working on it |
return; | ||
} | ||
Navigation.navigate(ROUTES.SETTINGS_SUBSCRIPTION_DISABLE_AUTO_RENEW_SURVEY); | ||
}; | ||
const handleAutoIncreaseToggle = () => { | ||
// TODO make API call to toggle auto increase here | ||
setAutoIncrease(!autoIncrease); | ||
if (privateSubscription?.addNewUsersAutomatically === undefined) { |
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 think this is enough
const handleAutoIncreaseToggle = () => {
Subscription.updateSubscriptionAddNewUsersAutomatically(!privateSubscription?.addNewUsersAutomatically);
};
src/components/FeedbackSurvey.tsx
Outdated
@@ -57,7 +60,7 @@ function FeedbackSurvey({title, description, onSubmit, optionRowStyles}: Feedbac | |||
return; | |||
} | |||
|
|||
onSubmit(reason); | |||
onSubmit(reason.key, additionalNote); |
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 trim additionalNote
before submitting
@JKobrynski Some minor comments, everything else looks fine |
@JKobrynski @amyevans We are using pending action fields for APIs, then when executing APIs offline will make both Subscription settings and Subscription detail greyed out Screen.Recording.2024-06-17.at.15.03.18.movIf we want to fix this, we can use pendingFields instead of pendingAction to specify the offline action for each part Edited: This isn't a big problem, If this is an urgent PR we can ignore this here and create an issue to follow up |
@amyevans @JKobrynski One inconsistency is that we can't toggle off "Auto-renew" when offline, but we can toggle off "Auto increase". Although this isn't related to this PR, we can fix it by adding an enableWhenOffline parameter to the FormAlertWithSubmitButton component in FeedbackSurvey. Edited: This isn't a big problem, If this is an urgent PR we can ignore this here and create an issue to follow up |
About two of these above problems |
@DylanDylann I replaced |
src/components/FeedbackSurvey.tsx
Outdated
@@ -57,7 +60,7 @@ function FeedbackSurvey({title, description, onSubmit, optionRowStyles}: Feedbac | |||
return; | |||
} | |||
|
|||
onSubmit(reason); | |||
onSubmit(reason.key, note); |
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.
@JKobrynski Whoops, I mean note.trim()
😄
/> | ||
<Text style={[styles.mutedTextLabel, styles.mt2]}>{translate('subscription.subscriptionSettings.automaticallyIncrease')}</Text> | ||
</View> | ||
<OfflineWithFeedback pendingAction={privateSubscription?.pendingFields?.autoRenew ?? privateSubscription?.pendingFields?.addNewUsersAutomatically}> |
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.
<OfflineWithFeedback pendingAction={privateSubscription?.pendingFields?.autoRenew ?? privateSubscription?.pendingFields?.addNewUsersAutomatically}> | |
<OfflineWithFeedback pendingAction={privateSubscription?.pendingFields?.autoRenew}> |
onToggle={handleAutoRenewToggle} | ||
isActive={privateSubscription?.autoRenew ?? false} | ||
/> | ||
{!!autoRenewalDate && <Text style={[styles.mutedTextLabel, styles.mt2]}>{translate('subscription.subscriptionSettings.renewsOn', {date: autoRenewalDate})}</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.
Let's add
<OfflineWithFeedback pendingAction={privateSubscription?.pendingFields?.addNewUsersAutomatically}>
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.
@JKobrynski Minor comments. Everything else looks good
@DylanDylann PR updated again! |
@blimpich All yours 🚀 |
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.
Looks great! Great work everyone! 🎉
✋ 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 https://github.com/blimpich in version: 1.4.86-0 🚀
|
1 similar comment
🚀 Deployed to staging by https://github.com/blimpich in version: 1.4.86-0 🚀
|
🚀 Deployed to staging by https://github.com/blimpich in version: 1.4.86-0 🚀
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 9.0.0-9 🚀
|
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.tsx
Fixed Issues
$ #38627
PROPOSAL: N/A
Tests
Offline tests
Same as Tests section above (it's pattern B offline behaviour)
QA Steps
Same as Tests section above
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Subscription settings are unavailable in the native apps
Android: mWeb Chrome
chrome-compressed.webm
iOS: Native
Subscription settings are unavailable in the native apps
iOS: mWeb Safari
safari-compressed.mp4
MacOS: Chrome / Safari
web-compressed.mov
MacOS: Desktop
desktop-compressed.mov