Feat/team invite flow (#8804)

* completeOnboarding drives invite flow changes

* Username prefil - force getting started when acc doesnt exist

* Change subtitle text and unique error on multiple invites

* User exists and no password set - generate signup link still

* Fix callback param

* Update packages/trpc/server/routers/viewer/teams/inviteMember.handler.ts

* Fix spacing

* Add password hints

* Fix translations

---------

Co-authored-by: Bailey Pumfleet <[email protected]>
This commit is contained in:
sean-brydonandBailey Pumfleet authored and GitHub committed 2023-05-12 12:52:09 +00:00
1 parent f47c3cd538
commit c55e432bc3
5 files changed
+100 -33

No files matched your search

@@ -80,6 +80,17 @@ const OnboardingPage = (props: IOnboardingPageProps) => {
},
];
// TODO: Add this in when we have solved the ability to move to tokens accept invite and note invitedto
// Ability to accept other pending invites if any (low priority)
// if (props.hasPendingInvites) {
// headers.unshift(
// props.hasPendingInvites && {
// title: `${t("email_no_user_invite_heading", { appName: APP_NAME })}`,
// subtitle: [], // TODO: come up with some subtitle text here
// }
// );
// }
const goToIndex = (index: number) => {
const newStep = steps[index];
router.push(
@@ -196,6 +207,18 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) =>
allowDynamicBooking: true,
defaultScheduleId: true,
completedOnboarding: true,
teams: {
select: {
accepted: true,
team: {
select: {
id: true,
name: true,
logo: true,
},
},
},
},
},
});
@@ -214,6 +237,7 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) =>
...user,
emailMd5: crypto.createHash("md5").update(user.email).digest("hex"),
},
hasPendingInvites: user.teams.find((team) => team.accepted === false) ?? false,
},
};
};