Skip to content
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

Merged
merged 91 commits into from
Jul 8, 2024
Merged

feat: app install flow followup #15193

merged 91 commits into from
Jul 8, 2024

Conversation

SomayChauhan
Copy link
Member

@SomayChauhan SomayChauhan commented May 24, 2024

What does this PR do?

  • Fixes CAL-3603
  • Fixes CAL-3604

Screenshot 2024-04-22 at 6 38 18 PM

Screenshot 2024-05-11 at 1 31 02 PM

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected)
  • (N/A) I have added a Docs issue here if this PR makes changes that would require a documentation change
  • I have added or modified automated tests that prove my fix is effective or that my feature works (PRs might be rejected if logical changes are not properly tested)

How should this be tested?

Test Cases

  • Conferencing apps

    • LOOM
    • OAuth (Zoom)
    • Link based (Campfire)
  • Calendar apps (GCal)

  • Messaging

    • No Change
  • Payment

  • Analytics

  • Others

Copy link
Contributor

github-actions bot commented May 24, 2024

Thank you for following the naming conventions! 🙏 Feel free to join our discord and post your PR link.

@keithwillcode keithwillcode added consumer core area: core, team members only labels May 24, 2024
Copy link
Member Author

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)

Copy link
Contributor

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 },
Copy link
Member Author

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) => {
Copy link
Member Author

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,
Copy link
Member Author

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

Copy link
Contributor

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair point @joeauyeung

Copy link
Member Author

@SomayChauhan SomayChauhan Jul 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pushed a refactor in

b2f478c and 6937803

@joeauyeung @zomars

@@ -7,9 +7,6 @@ export function decodeOAuthState(req: NextApiRequest) {
return undefined;
}
const state: IntegrationOAuthCallbackState = JSON.parse(req.query.state);
if (state.appOnboardingRedirectUrl) {
Copy link
Member Author

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
@zomars
Copy link
Member

zomars commented Jul 8, 2024

Made some changes to the conferencing apps tests to they can run in parallel. Also fixed some flaky tests. f0a5e90 (#15193)

@SomayChauhan
Copy link
Member Author

SomayChauhan commented Jul 8, 2024

Made some changes to the conferencing apps tests to they can run in parallel.

love the refactor here, pushed a similar refactor for analytics app tests too 3bdabfe

Copy link
Member

@zomars zomars left a 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.

@zomars zomars merged commit f1b4d7d into main Jul 8, 2024
36 checks passed
@zomars zomars deleted the app-install-flow-followup branch July 8, 2024 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app-store area: app store, apps, calendar integrations, google calendar, outlook, lark, apple calendar automated-tests area: unit tests, e2e tests, playwright consumer core area: core, team members only event-types area: event types, event-types ✨ feature New feature or request High priority Created by Linear-GitHub Sync high-risk Requires approval by Foundation team ready-for-e2e
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants