-
Notifications
You must be signed in to change notification settings - Fork 7k
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
feat: app install flow followup #15193
Conversation
* refactor InstallAppButtonChild
* send location data to the handler * add the newly installed to the locations dropdown (prefillLocation)
* only add app if not already added
Thank you for following the naming conventions! 🙏 Feel free to join our discord and post your PR link. |
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.
instead of querying all teams and then looking weather this team has current user as admin/owner (which is slow because we have to look at all the teams in db)
queried the user using userId got all his teams and then filter all the teams that have the current user as admin/owner
(this should be faster because user_id is the primary key for the table so getting all the teams of user should be fast)
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.
Love the refactor here. Feels like this would be a good time to move this to the user repository.
accepted: true, | ||
role: { in: [MembershipRole.ADMIN, MembershipRole.OWNER] }, | ||
}, | ||
select: { teamId: true }, |
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.
only select the required fields
@@ -155,47 +182,46 @@ const OnboardingPage = ({ | |||
}); | |||
|
|||
const handleSelectAccount = async (teamId?: number) => { |
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.
decided to remove this api call and use useAddAppMutation instead
}, | ||
mutation.mutate( | ||
{ | ||
isOmniInstall: true, |
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.
setting isOmniInstall to true so that we can be redirected back to /apps/installation/[step]?slug
if not set it redirects to apps/installed/[category] and the redirection can't be controlled
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 wonder if we still need this prop. All instances are set to true.
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.
Fair point @joeauyeung
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.
@@ -7,9 +7,6 @@ export function decodeOAuthState(req: NextApiRequest) { | |||
return undefined; | |||
} | |||
const state: IntegrationOAuthCallbackState = JSON.parse(req.query.state); | |||
if (state.appOnboardingRedirectUrl) { |
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.
no longer needed as we now use returnTo only
- tests weren't actually running - Refactored so tests can run in parallel
Made some changes to the conferencing apps tests to they can run in parallel. Also fixed some flaky tests. |
love the refactor here, pushed a similar refactor for analytics app tests too 3bdabfe |
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 again @SomayChauhan. Good enough for now. There's still some areas of opportunity but we can address them in more follow ups.
What does this PR do?
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
Test Cases
Conferencing apps
Calendar apps (GCal)
Messaging
Payment
Analytics
Others