chore: Onboarding path service plus redirects (#24679)
* i18n * WIP icon stuff * More icon work * More gradient tuning * Mvoe plan-icon to planicon.tsx * Fix cubic suggestion * Fix darkmode icon and gradients * Fix type error * Onboarding path service * Update usages of onboarding path and getting started hook
This commit is contained in:
1 parent
3418a25a85
commit
fa884e8516
10 files changed
+72
-16
No files matched your search
@@ -7,6 +7,7 @@ import { TeamRepository } from "@calcom/features/ee/teams/repositories/TeamRepos
|
||||
import { WorkflowService } from "@calcom/features/ee/workflows/lib/service/WorkflowService";
|
||||
import { createAProfileForAnExistingUser } from "@calcom/features/profile/lib/createAProfileForAnExistingUser";
|
||||
import { ProfileRepository } from "@calcom/features/profile/repositories/ProfileRepository";
|
||||
import { OnboardingPathService } from "@calcom/features/onboarding/lib/onboarding-path.service";
|
||||
import { WEBAPP_URL } from "@calcom/lib/constants";
|
||||
import { deleteDomain } from "@calcom/lib/domainManager/organization";
|
||||
import logger from "@calcom/lib/logger";
|
||||
@@ -76,7 +77,7 @@ export class TeamService {
|
||||
if (!existingToken) throw new TRPCError({ code: "NOT_FOUND", message: "Invite token not found" });
|
||||
return {
|
||||
token: existingToken.token,
|
||||
inviteLink: TeamService.buildInviteLink(existingToken.token, isOrganizationOrATeamInOrganization),
|
||||
inviteLink: await TeamService.buildInviteLink(existingToken.token, isOrganizationOrATeamInOrganization),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -93,14 +94,18 @@ export class TeamService {
|
||||
|
||||
return {
|
||||
token,
|
||||
inviteLink: TeamService.buildInviteLink(token, isOrganizationOrATeamInOrganization),
|
||||
inviteLink: await TeamService.buildInviteLink(token, isOrganizationOrATeamInOrganization),
|
||||
};
|
||||
}
|
||||
|
||||
private static buildInviteLink(token: string, isOrgContext: boolean): string {
|
||||
private static async buildInviteLink(token: string, isOrgContext: boolean): Promise<string> {
|
||||
const teamInviteLink = `${WEBAPP_URL}/teams?token=${token}`;
|
||||
const orgInviteLink = `${WEBAPP_URL}/signup?token=${token}&callbackUrl=/getting-started`;
|
||||
return isOrgContext ? orgInviteLink : teamInviteLink;
|
||||
if (!isOrgContext) {
|
||||
return teamInviteLink;
|
||||
}
|
||||
const gettingStartedPath = await OnboardingPathService.getGettingStartedPath(prisma);
|
||||
const orgInviteLink = `${WEBAPP_URL}/signup?token=${token}&callbackUrl=${gettingStartedPath}`;
|
||||
return orgInviteLink;
|
||||
}
|
||||
/**
|
||||
* Deletes a team and all its associated data in a safe, transactional order.
|
||||
|
||||
Reference in new issue
Block a user