Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 28 additions & 17 deletions apps/member-profile/app/routes/_profile.home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,9 @@ async function getStudent(id: string) {
'students.lastName',
'students.number',
(eb) => {
return eb('onboardingSessionAttendees.id', 'is not', null).as(
'attendedOnboardingSession'
);
return eb('onboardingSessionAttendees.id', 'is', null)
.and('students.acceptedAt', '>=', new Date('2025-09-01'))
.as('showOnboardingSessionCard');
},
])
.where('students.id', '=', id)
Expand Down Expand Up @@ -235,6 +235,7 @@ export default function HomeLayout() {

<div className="grid grid-cols-1 items-start gap-4 @[900px]:grid-cols-2 @[1500px]:grid-cols-3">
<Home.Column>
{student.showOnboardingSessionCard && <OnboardingSessionCard />}
<ActiveStatusCard />

<div className="gap-[inherit] @container">
Expand Down Expand Up @@ -328,6 +329,30 @@ function ActiveStatusCard() {
);
}

function OnboardingSessionCard() {
return (
<Card>
<Card.Title>Attend an Onboarding Session</Card.Title>

<Card.Description>
Learn more about ColorStack, meet other members and gain access to our
Slack workspace!
</Card.Description>

<Button.Group>
<Button.Slot variant="primary">
<Link
target="_blank"
to="https://calendly.com/colorstack-onboarding-ambassador/onboarding"
>
Book Onboarding Session <ExternalLink size={16} />
</Link>
</Button.Slot>
</Button.Group>
</Card>
);
}

function MessagesSentCard() {
const { messagesSentCount } = useLoaderData<typeof loader>();

Expand Down Expand Up @@ -424,13 +449,6 @@ function ImportantResourcesCard() {
<Card.Title>Important Resources</Card.Title>

<ul className="flex flex-col gap-3">
<ResourceItem
description="The heartbeat of our community."
href="https://colorstack-family.slack.com/"
>
Slack
</ResourceItem>

<ResourceItem
description="A collection of career, community, and academic related resources."
href="https://wiki.colorstack.org/the-colorstack-family"
Expand All @@ -445,13 +463,6 @@ function ImportantResourcesCard() {
Chapters
</ResourceItem>

<ResourceItem
description="The codebase where our software, called Oyster, lives. Go read + contribute to the codebase!"
href="https://github.com/colorstackorg/oyster"
>
GitHub
</ResourceItem>

<ResourceItem
description="A collection of our past event recordings. Don't miss a beat!"
href="https://youtube.com/@colorstackinc.2266"
Expand Down
10 changes: 8 additions & 2 deletions apps/member-profile/app/routes/onboarding.community.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,15 @@ export async function action({ request }: ActionFunctionArgs) {
await updateMember(memberId, {
...result.data,
ethnicities: result.data.ethnicities || [],
onboardedAt: new Date(),
});

return redirect(Route['/onboarding/slack']);
const url = new URL(request.url);

url.pathname = Route['/home'];
url.searchParams.set('new', '1');

return redirect(url.toString());
} catch (e) {
return data({ error: (e as Error).message }, { status: 500 });
}
Expand Down Expand Up @@ -221,7 +227,7 @@ export default function OnboardingCommunityForm() {

<OnboardingButtonGroup>
<OnboardingBackButton to="/onboarding/emails" />
<OnboardingContinueButton />
<OnboardingContinueButton label="Finish" />
</OnboardingButtonGroup>
</Form>
);
Expand Down
83 changes: 0 additions & 83 deletions apps/member-profile/app/routes/onboarding.slack.tsx

This file was deleted.

9 changes: 2 additions & 7 deletions apps/member-profile/app/routes/onboarding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,17 @@ function ProgressBar() {
}

return (
<div className="mx-auto my-4 grid w-full grid-cols-11 items-center sm:px-4">
<div className="mx-auto my-4 grid w-full grid-cols-5 items-center sm:px-4">
<ProgressBarStep step="1" />
<ProgressBarLine step="2" />
<ProgressBarStep step="2" />
<ProgressBarLine step="3" />
<ProgressBarStep step="3" />
<ProgressBarLine step="4" />
<ProgressBarStep step="4" />
</div>
);
}

type ProgressStep = '1' | '2' | '3' | '4';
type ProgressStep = '1' | '2' | '3';

type ProgressBarStepProps = {
step: ProgressStep;
Expand Down Expand Up @@ -113,14 +111,12 @@ const STEP_TO_ROUTE_MAP: Record<ProgressStep, string> = {
'1': Route['/onboarding/general'],
'2': Route['/onboarding/emails'],
'3': Route['/onboarding/community'],
'4': Route['/onboarding/slack'],
};

const STEP_LABEL_MAP: Record<ProgressStep, string> = {
'1': 'General',
'2': 'Email',
'3': 'Community',
'4': 'Slack',
};

function ProgressBarStepLabel({ step }: ProgressBarStepProps) {
Expand Down Expand Up @@ -163,7 +159,6 @@ const ROUTE_TO_STEP_MAP: Record<string, ProgressStep> = {
[Route['/onboarding/emails']]: '2',
[Route['/onboarding/emails/verify']]: '2',
[Route['/onboarding/community']]: '3',
[Route['/onboarding/slack']]: '4',
};

type StepStatus = 'active' | 'completed' | 'inactive';
Expand Down
1 change: 0 additions & 1 deletion apps/member-profile/app/shared/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ const ROUTES = [
'/onboarding/emails',
'/onboarding/emails/verify',
'/onboarding/general',
'/onboarding/slack',
'/offers',
'/offers/full-time',
'/offers/full-time/add',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export async function addOnboardingSessionAttendees(
.where('id', '=', onboardingSessionId)
.executeTakeFirstOrThrow();

await db.transaction().execute(async (trx) => {
const attendees = await db.transaction().execute(async (trx) => {
await Promise.all(
input.attendees.map(async (studentId) => {
await trx
Expand All @@ -40,12 +40,22 @@ export async function addOnboardingSessionAttendees(
.execute();
})
);

return trx
.selectFrom('students')
.select(['email', 'id', 'slackId'])
.where('id', 'in', input.attendees)
.execute();
});

input.attendees.forEach((studentId) => {
attendees.forEach((attendee) => {
job('onboarding_session.attended', {
onboardingSessionId,
studentId,
studentId: attendee.id,
});

if (!attendee.slackId) {
job('slack.invite', { email: attendee.email });
}
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export async function uploadOnboardingSession(
) {
const onboardingSessionId = id();

await db.transaction().execute(async (trx) => {
const attendees = await db.transaction().execute(async (trx) => {
await trx
.insertInto('onboardingSessions')
.values({
Expand Down Expand Up @@ -45,12 +45,22 @@ export async function uploadOnboardingSession(
.execute();
})
);

return trx
.selectFrom('students')
.select(['email', 'id', 'slackId'])
.where('id', 'in', input.attendees)
.execute();
});

input.attendees.forEach((studentId) => {
attendees.forEach((attendee) => {
job('onboarding_session.attended', {
onboardingSessionId,
studentId,
studentId: attendee.id,
});

if (!attendee.slackId) {
job('slack.invite', { email: attendee.email });
}
});
}
4 changes: 2 additions & 2 deletions packages/db/src/scripts/seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ if (IS_PRODUCTION) {
throw new Error('Cannot seed database in non-development environment.');
}

let email = '';

main();

async function main() {
Expand All @@ -37,8 +39,6 @@ async function main() {
}
}

let email = '';

function setEmailFromCommandLine() {
const answer = prompt(
'In order to log into the Member Profile and Admin Dashboard, you will need both a member record and an admin record. Please provide an email so we can create those for you.\n' +
Expand Down