-
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
Update the free trial badge to display Start a free trial badge when we create a workspace for a user #48512
Update the free trial badge to display Start a free trial badge when we create a workspace for a user #48512
Conversation
@abzokhattab The free trial text is not updated properly as demonstrated in the video below. This is for a case when the trial has expired. Also, the LHN shows 20240904_141103.mp4 |
What is the ETA here? When do we think we will be able to fix the review comments and merge? |
@abzokhattab Please update on the latest status on the comment here. |
Thanks for your patience, @rojiphil. It took me a bit to find the right solution for the title inconsistency. I ended up creating a component for the free trial badge and updated |
The review is in progress. I will update today on this. |
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.
@abzokhattab Thanks for the changes. I like the component approach here. And I have left few review comments too. Please have a look.
Further, the problem of LHN showing Start a free trial
briefly before transitioning to Your free trial has ended
is still there as mentioned before here. Can you please check that too? This happens when the user signs in in a free trial or trial ended state. It seems like there is a delay for openApp
to update the lastDayFreeTrial
and firstDayFreeTrial
in Onyx which causes a temporary display of Start a free trial
.
const [firstDayFreeTrial] = useOnyx(ONYXKEYS.NVP_FIRST_DAY_FREE_TRIAL); | ||
const [lastDayFreeTrial] = useOnyx(ONYXKEYS.NVP_LAST_DAY_FREE_TRIAL); | ||
|
||
const freeTrialText = SubscriptionUtils.getFreeTrialText(policies, firstDayFreeTrial, lastDayFreeTrial); |
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 am not sure if we use this pattern of passing the Onyx data directly into the function as parameters and, at the same time, initializing the function with the same Onyx data. Instead, would it not be neater to use effect
and state
to achieve the same as follows?
const [freeTrialText, setFreeTrialText] = useState<string>();
useEffect(() => {
setFreeTrialText(SubscriptionUtils.getFreeTrialText(policies));
}, [policies, firstDayFreeTrial, lastDayFreeTrial]);
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 was concerned that there might be a delay between the data being updated in useOynx
and the data fetched from the global oynx.connect
used in the function.
So, I decided to pass it as a function argument, thinking that could be the reason for the delayed transition from 'Start a free trial' to 'Your free trial has ended.'
But I will try this approach.
Also, 48512-onboardingchatissue.mp4 |
do you have a way in mind to address this issue? .. i have tried some approaches but didn't work. |
Hmm.. Interesting scenario here. Maybe BE needs to inform FE via a state like The context here is the problem of LHN showing |
Its a good idea but generally we should avoid duplicating source of truth unless really necessary. in this scenario its duplicate information because generally freeTrial start and end gives us everything we need. It seems like the catch here is that while the front end is fetching data because the nvp is not set it shows "start a free trial", but once it fetches the nvp it changes the text to "Your free trial has ended", correct? If that's the case then can we use a flag like isLoading (or nvpsLoading if there isn't an existing one) so that we don't show anything until the NVPs are fetched? |
That's correct
Thanks. That makes sense. @abzokhattab Can you please try this? This would also help us fix this comment |
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.
Regarding the blink issue mentioned here, it does not look like an issue to me.
@abzokhattab Please update the test steps 1,2 as follows as Expensify
onboarding chat will not be shown anymore:
Step 2: Complete the onboarding process using Track and Budget Expenses
Step 3: In the onboarding Concierge report, validate that the LHN and the header do not display the free trial badge.
Otherwise, LGTM and tests well.
@chiragsalian Over to you for review. Thanks.
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.
Nice, great discussions and I like how this PR is shaping up so far. I haven't tested it yet and i'll test/final review it once Roji is done. Oh hah, looks like roji just finished. 👀
Using privateSubscription to determine the NVP is loaded is pretty interesting too.
okay done! |
is it occurring on a specific platform? |
i only tested on MacOS: Chrome |
Any luck on addressing the bug? Were you guys able to reproduce the bug i mentioned @abzokhattab / @rojiphil? |
@chiragsalian I tried to reproduce just now but I noticed that the focus goes back to the Concierge Chat. Not sure what I am doing wrong. I tried some other things too but I could not get the focus to move away from Concierge chat. Strange but I will try again later. Anyway, here is a video that demonstrates this. 48512-hover-issue-1.mp4 |
Weird yeah, for you it seems to be focused on Concierge when you log in. Im unsure why. For me, actually none of the reports are focused. When i log in i end up with a URL like |
I am not able to reproduce it as well .. i couldn't get the focus away from concierge, the only way was by pasting another report URL after logging out so that it redirects to this report after logging in. however, the main issue is not yet reproducible let us know if you were able to reproduce it again @chiragsalian Screen.Recording.2024-09-18.at.1.02.06.PM.mov |
Okay i think thats fine. I just checked, on signin, normally we open concierge. I think on my dev something weird was just happening. Okay code here LGTM but you have an eslint failure. Can you update with main and address it so i can merge this PR. |
done |
Ah I see, yeah normally it would be good to address ESLint errors even though it's not related to your code. This way we keep files up to date with our expected styles. |
@chiragsalian looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
Not emergency, only eslint was failing, posted context here. |
✋ 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/chiragsalian in version: 9.0.38-0 🚀
|
🚀 Deployed to production by https://github.com/grgia in version: 9.0.38-4 🚀
|
Details
Fixed Issues
$ #48217
PROPOSAL: #48217 (comment)
Tests
Track and Budget Expenses
Start your free trial
badge.Free trial: 7 days left
badge.Offline tests
same as tests
QA Steps
same as tests
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
Screen.Recording.2024-09-04.at.12.01.37.AM.mov
Android: mWeb Chrome
Screen.Recording.2024-09-03.at.11.33.53.PM.mov
iOS: Native
Screen.Recording.2024-09-03.at.11.00.03.PM.mov
iOS: mWeb Safari
Screen.Recording.2024-09-03.at.11.01.26.PM.mov
MacOS: Chrome / Safari
Screen.Recording.2024-09-01.at.5.36.34.AM.mov
MacOS: Desktop
Screen.Recording.2024-09-03.at.11.02.38.PM.mov