Move free trial banner to #admins room for users selecting MANAGE_TEAM onboarding intent#53895
Conversation
|
@thesahindia 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] |
|
@c3024, please resolve the conflicts. |
…nage-teams-onboarding-intent
|
Done. The Jest Unit Tests workflow is failing for all PRs. But, the failing PolicyUtilsTests succeeds when ran locally. |
…nage-teams-onboarding-intent
|
@c3024, could you please fix the lint issue in this? |
…nage-teams-onboarding-intent
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-12-19.at.12.58.50.PM.movScreen.Recording.2024-12-19.at.12.58.07.PM.movAndroid: mWeb ChromeScreen.Recording.2024-12-19.at.12.57.35.PM.movScreen.Recording.2024-12-19.at.12.55.24.PM.moviOS: NativeScreen.Recording.2024-12-19.at.12.45.00.PM.movScreen.Recording.2024-12-19.at.12.44.07.PM.moviOS: mWeb SafariScreen.Recording.2024-12-19.at.12.46.45.PM.movScreen.Recording.2024-12-19.at.12.46.30.PM.movMacOS: Chrome / SafariScreen.Recording.2024-12-19.at.12.41.53.PM.movScreen.Recording.2024-12-19.at.1.21.10.PM.movMacOS: DesktopScreen.Recording.2024-12-19.at.1.20.37.PM.movScreen.Recording.2024-12-19.at.12.41.08.PM.mov |
…nage-teams-onboarding-intent
|
@thesahindia , fixed! |
…nage-teams-onboarding-intent
…nage-teams-onboarding-intent
src/libs/ReportUtils.ts
Outdated
| if (isEmptyObject(onboarding)) { | ||
| return (optionOrReport as OptionData)?.isConciergeChat ?? isConciergeChatReport(optionOrReport); | ||
| } | ||
| // For users with emails that do not contain a ‘+’, and who select the MANAGE_TEAM intent, the onboarding tasks are in the #admins room. |
There was a problem hiding this comment.
Best comments say why, not what. So why is this?
There was a problem hiding this comment.
That was an already existing design choice because onboarding guide is added to the #admins room. The 'why' of that is unrelated to this PR. The code seems to be self-explanatory here. I will remove that comment.
There was a problem hiding this comment.
What do you mean existing, the logic seems new to me, especially the team and + thing.
I rather leave the comment, but explain why we do what we do
There was a problem hiding this comment.
This was the logic. Backend does not assign a guide for signups with emails containing '+' in them and rejects posting tasks in the #admins room. So, tasks are posted in Concierge for these signups.
src/pages/home/HeaderView.tsx
Outdated
| ); | ||
| // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing | ||
| const [parentReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${report?.parentReportID || report?.reportID || '-1'}`); | ||
| const [parentReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${report?.parentReportID || report?.reportID || undefined}`); |
There was a problem hiding this comment.
Why is this undefined and not CONST.DEFAULT_NUMBER_ID?
There was a problem hiding this comment.
There was a problem hiding this comment.
Oh right, I always forget reportID is string in JS, then why did we use the default number here?
There was a problem hiding this comment.
These changes were lint failures unrelated to the changes required for the PR. So, I just replaced the fallbacks for number and strings as per the style guide. One used -1 and another '-1'. But, I found now that CONST.DEFAULT_NUMBER_ID is used at most places as fallback for reportID in the repo. CONST.DEFAULT_NUMBER_ID can be used here as well.
…nage-teams-onboarding-intent
…nage-teams-onboarding-intent
…nage-teams-onboarding-intent
…nage-teams-onboarding-intent
|
@iwiznia , updated the comment to explain the 'why'. Please have a look! |
|
|
||
| // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing | ||
| const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${optionItem?.reportID || -1}`); | ||
| const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${optionItem?.reportID || CONST.DEFAULT_NUMBER_ID}`); |
There was a problem hiding this comment.
It is. I didn't change the fallback value from string to Number. The existing fallback was the Number -1. I replaced it with CONST. This Number fallback is used as fallback for reportID at other places too.
I don't know why Number was used there as fallback instead of string.
There was a problem hiding this comment.
I think we should use the string fallback for strings, no?
There was a problem hiding this comment.
Yes. I think we should. Let me change and hope nothing breaks.🤞
There was a problem hiding this comment.
We shouldn't use any fallback for strings as per the guide.
…nage-teams-onboarding-intent
|
✋ 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/iwiznia in version: 9.0.87-0 🚀
|
|
This PR is failing because of issue #55408 |
|
🚀 Deployed to production by https://github.com/Beamanator in version: 9.0.87-3 🚀
|
Explanation of Change
This PR adds the logic to display the "Free trial" banner and button in header on #admins room for users selecting "Manage my team's expenses" intent during onboarding.
Fixed Issues
$ #53526
PROPOSAL: NA
Tests
Test 1:
Test 2:
Offline tests
QA Steps
Same as Tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)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
freeAndroid.mov
Android: mWeb Chrome
freeAndroidmWeb.mp4
iOS: Native
freeiOS.mov
iOS: mWeb Safari
freeiOSmWeb.MP4
MacOS: Chrome / Safari
freeChrome1.mp4
freeChrome2.mp4
MacOS: Desktop
freeDesktop.mov