Skip to content

Commit

Permalink
Merge branch 'main' into infra-school-chapters
Browse files Browse the repository at this point in the history
  • Loading branch information
tomas-salgado authored Oct 1, 2024
2 parents 795dfeb + 3fb39a0 commit 7607727
Show file tree
Hide file tree
Showing 35 changed files with 286 additions and 923 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ export default function ActivateStudentPage() {

<Modal.Description>
Just confirming - do you want to activate {student.firstName}{' '}
{student.lastName}? They will receive an email with the ability to claim
a swag pack in their profile.
{student.lastName}? They will receive an email with a gift card to the
merch store.
</Modal.Description>

<RemixForm className="form" method="post">
Expand Down
4 changes: 2 additions & 2 deletions apps/api/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ STUDENT_PROFILE_URL=http://localhost:3000
# R2_BUCKET_NAME=
# R2_SECRET_ACCESS_KEY=
# SENTRY_DSN=
# SHOPIFY_ACCESS_TOKEN=
# SHOPIFY_STORE_NAME=
# SLACK_ANNOUNCEMENTS_CHANNEL_ID=
# SLACK_ADMIN_TOKEN=
# SLACK_BIRTHDATE_FIELD_ID=
Expand All @@ -47,5 +49,3 @@ STUDENT_PROFILE_URL=http://localhost:3000
# SMTP_HOST=
# SMTP_PASSWORD=
# SMTP_USERNAME=
# SWAG_UP_CLIENT_ID=
# SWAG_UP_CLIENT_SECRET=
8 changes: 4 additions & 4 deletions apps/api/src/shared/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ const BaseEnvironmentConfig = z.object({
R2_SECRET_ACCESS_KEY: EnvironmentVariable,
REDIS_URL: EnvironmentVariable,
SENTRY_DSN: EnvironmentVariable,
SHOPIFY_ACCESS_TOKEN: EnvironmentVariable,
SHOPIFY_STORE_NAME: EnvironmentVariable,
SLACK_ANNOUNCEMENTS_CHANNEL_ID: EnvironmentVariable,
SLACK_ADMIN_TOKEN: EnvironmentVariable,
SLACK_BIRTHDATE_FIELD_ID: EnvironmentVariable,
Expand All @@ -54,8 +56,6 @@ const BaseEnvironmentConfig = z.object({
SLACK_INTRODUCTIONS_CHANNEL_ID: EnvironmentVariable,
SLACK_SIGNING_SECRET: EnvironmentVariable,
STUDENT_PROFILE_URL: EnvironmentVariable,
SWAG_UP_CLIENT_ID: EnvironmentVariable,
SWAG_UP_CLIENT_SECRET: EnvironmentVariable,
});

const EnvironmentConfig = z.discriminatedUnion('ENVIRONMENT', [
Expand Down Expand Up @@ -84,6 +84,8 @@ const EnvironmentConfig = z.discriminatedUnion('ENVIRONMENT', [
R2_BUCKET_NAME: true,
R2_SECRET_ACCESS_KEY: true,
SENTRY_DSN: true,
SHOPIFY_ACCESS_TOKEN: true,
SHOPIFY_STORE_NAME: true,
SLACK_ANNOUNCEMENTS_CHANNEL_ID: true,
SLACK_ADMIN_TOKEN: true,
SLACK_BIRTHDATE_FIELD_ID: true,
Expand All @@ -94,8 +96,6 @@ const EnvironmentConfig = z.discriminatedUnion('ENVIRONMENT', [
SLACK_FEED_CHANNEL_ID: true,
SLACK_INTRODUCTIONS_CHANNEL_ID: true,
SLACK_SIGNING_SECRET: true,
SWAG_UP_CLIENT_ID: true,
SWAG_UP_CLIENT_SECRET: true,
}).extend({
ENVIRONMENT: z.literal(Environment.DEVELOPMENT),
SMTP_HOST: EnvironmentVariable.optional(),
Expand Down
2 changes: 0 additions & 2 deletions apps/member-profile/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,3 @@ STUDENT_PROFILE_URL=http://localhost:3000
# SMTP_HOST=
# SMTP_PASSWORD=
# SMTP_USERNAME=
# SWAG_UP_CLIENT_ID=
# SWAG_UP_CLIENT_SECRET=
13 changes: 3 additions & 10 deletions apps/member-profile/app/routes/_profile.home.activation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,7 @@ export default function ActivationModal() {
function ActivatedState() {
return (
<>
<Text color="gray-500">
Great news -- you're activated and eligible to{' '}
<Link className="link" to={Route['/home/claim-swag-pack']}>
claim your FREE swag pack
</Link>
! 🎉
</Text>

<Text color="gray-500">Great news -- you're activated! 🎉</Text>
<ActivationList />
</>
);
Expand Down Expand Up @@ -167,8 +160,8 @@ function NotActivatedState() {
<>
<Text color="gray-500">
You've completed {requirementsCompleted.length}/6 activation
requirements. Once you hit all 6, you will be eligible to claim your
FREE swag pack! 👀
requirements. Once you hit all 6, you will get a gift card to claim your
FREE merch! 👀
</Text>

<ActivationList />
Expand Down

This file was deleted.

This file was deleted.

25 changes: 4 additions & 21 deletions apps/member-profile/app/routes/_profile.home.claim-swag-pack.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,6 @@
import { json, type LoaderFunctionArgs } from '@remix-run/node';
import { Outlet } from '@remix-run/react';

import { Modal } from '@oyster/ui';

import { Route } from '@/shared/constants';
import { ensureUserAuthenticated } from '@/shared/session.server';

export async function loader({ request }: LoaderFunctionArgs) {
await ensureUserAuthenticated(request, {
redirectTo: `${Route['/login']}?context=claim-swag-pack`,
});

return json({});
}

export default function ClaimSwagPackLayout() {
return (
<Modal onCloseTo={Route['/home']}>
<Outlet />
</Modal>
export async function loader() {
return new Response(
'If you were activated recently, you should have received an email with a gift card to our merch store. Please reach out to the ColorStack team if you need further assistance.',
{ status: 404 }
);
}
Loading

0 comments on commit 7607727

Please sign in to comment.