-
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
Optimistic update for moving tasks for "Manage Team's Expenses" to #admins room #52314
Conversation
moveTasksToAdminsRoom.mp4 |
src/libs/actions/Report.ts
Outdated
@@ -3437,10 +3437,10 @@ function completeOnboarding( | |||
} | |||
|
|||
const integrationName = userReportedIntegration ? CONST.ONBOARDING_ACCOUNTING_MAPPING[userReportedIntegration] : ''; | |||
const actorAccountID = CONST.ACCOUNT_ID.CONCIERGE; | |||
const targetChatReport = ReportUtils.getChatByParticipants([actorAccountID, currentUserAccountID]); | |||
const actorAccountID = engagementChoice === CONST.ONBOARDING_CHOICES.MANAGE_TEAM ? CONST.ACCOUNT_ID.QA_GUIDE : CONST.ACCOUNT_ID.CONCIERGE; |
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 don't use this, as discussed here https://expensify.slack.com/archives/C07HPDRELLD/p1731436691482209?thread_ts=1730777288.450589&cid=C07HPDRELLD
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 are required for generating optimistic actions.
However, I will remove it from the params passed to CompleteGuidedSetup
if it is not used in the backend.
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.
src/CONST.ts
Outdated
@@ -2093,6 +2094,7 @@ const CONST = { | |||
NOTIFICATIONS: Number(Config?.EXPENSIFY_ACCOUNT_ID_NOTIFICATIONS ?? 11665625), | |||
PAYROLL: Number(Config?.EXPENSIFY_ACCOUNT_ID_PAYROLL ?? 9679724), | |||
QA: Number(Config?.EXPENSIFY_ACCOUNT_ID_QA ?? 3126513), | |||
QA_GUIDE: Number(Config?.EXPENSIFY_ACCOUNT_ID_QA_GUIDE ?? 14365522), |
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 seems to be not a problem anymore. CreateWorkspace
does not still return a personal detail for qa.guide
. So, I retained this for the optimistic detail update.
We can use Concierge
or currentUserAccountID
instead of qa.guide
for the optimistic report action generation. Backend overwrites these with qa.guide
as the actor.
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.
Can you try to use the guide's details that are sent along with their intro message following the call to CreatePolicy earlier in the guided setup flow?
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.
When I checked this last time, CreateWorkspace
was not returning qa.guide
details. Let me check now again.
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.
CompleteGuidedSetup
returns the assigned guide details. These optimistic task report actions etc. are created just after clicking on the accounting step and the assigned guide details are not available at that time.
The sender appears for the tasks as qa.guide
briefly before they are replaced with the actual guide details sent in the response for CompleteGuidedSetup
.
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.
guideDetailOnCompleteGuidedSetup.mov
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.
@@ -43,6 +43,20 @@ function BaseOnboardingEmployees({shouldUseNativeStyles, route}: BaseOnboardingE | |||
}); | |||
}, [translate, selectedCompanySize]); | |||
|
|||
const [allPersonalDetails] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST); | |||
|
|||
const setOptimticQAGuidePersonalDetail = () => { |
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 too is for the optimistic generation of report actions because CreateWorkspace
's response still does not have the personal detail value for qa.guide
. This can be omitted if we use Concierge
or currentUserAccountID
as the actor for the optimistic report actions. The actor is overwritten with qa.guide
in backend's response.
src/libs/actions/Report.ts
Outdated
@@ -3437,10 +3437,10 @@ function completeOnboarding( | |||
} | |||
|
|||
const integrationName = userReportedIntegration ? CONST.ONBOARDING_ACCOUNTING_MAPPING[userReportedIntegration] : ''; | |||
const actorAccountID = CONST.ACCOUNT_ID.CONCIERGE; | |||
const targetChatReport = ReportUtils.getChatByParticipants([actorAccountID, currentUserAccountID]); | |||
const actorAccountID = engagementChoice === CONST.ONBOARDING_CHOICES.MANAGE_TEAM ? CONST.ACCOUNT_ID.QA_GUIDE : CONST.ACCOUNT_ID.CONCIERGE; |
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 Is this ready for testing online or should I only be testing offline for now? |
This is ready for testing online too! |
This comment was marked as resolved.
This comment was marked as resolved.
@yuwenmemon @jjcoffee |
I guess the only thing outstanding now is waiting for the BE change to accept whatever we send from FE to avoid duplication?
|
Let's send only the tasks in order to not have duplicates. Let the guide message come from the backend. |
const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED); | ||
const session = useSession(); | ||
|
||
// A guide is assigned to the user if they choose the 'MANAGE_TEAM' onboarding option, except for users with emails containing '+'. |
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 I was thinking of something a bit more concise like "Guides are assigned for the MANAGE_TEAM
onboarding action, except for emails that have +
.". I think the rest is self-explanatory/easy to understand from a quick read of the code.
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!
src/libs/actions/Report.ts
Outdated
@@ -3489,10 +3490,29 @@ function prepareOnboardingOptimisticData( | |||
} | |||
} | |||
|
|||
// A guide is assigned to the user if they choose the 'MANAGE_TEAM' onboarding option, except for users with emails containing '+'. |
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 Also could you make this one similarly more concise.
@yuwenmemon Just to check the expected result, if we're offline before |
If we go offline before receiving the |
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.
All good from my side, just this comment for you to check @yuwenmemon.
Think that's fine for now yeah! |
✋ 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/yuwenmemon in version: 9.0.70-0 🚀
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 9.0.70-9 🚀
|
Explanation of Change
This PR moves the onboarding tasks to #admins room.
Fixed Issues
$ #51443
PROPOSAL: NA
Tests
Offline 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
guideAndroid.mp4
Android: mWeb Chrome
Screenrecorder-2024-11-26-14-13-37-829.mp4
iOS: Native
guideiOS.mp4
iOS: mWeb Safari
guideiOSmWeb-compressed.mp4
MacOS: Chrome / Safari
guideChrome.mp4
MacOS: Desktop
guideDesktop.mp4