-
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
Move free trial banner to #admins room for users selecting MANAGE_TEAM onboarding intent #53895
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! |
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.
Works well!
There is an issue
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.
@c3024, could you please verify it?
…nage-teams-onboarding-intent
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.
Thanks for the changes!
…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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Best comments say why, not what. So why is 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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this undefined and not CONST.DEFAULT_NUMBER_ID
?
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.
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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! |
@@ -47,13 +56,13 @@ function OptionRowLHN({reportID, isFocused = false, onSelectRow = () => {}, opti | |||
const {shouldUseNarrowLayout} = useResponsiveLayout(); | |||
|
|||
// 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't reportID a string?
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should use the string fallback for strings, no?
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.
Yes. I think we should. Let me change and hope nothing breaks.🤞
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.
We shouldn't use any fallback for strings as per the guide.
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.
Done!
…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 |
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 Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)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
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