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: create airtable table upon resume book creation πŸ“š #393

Merged
merged 5 commits into from
Jul 21, 2024
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
1 change: 1 addition & 0 deletions apps/admin-dashboard/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ SESSION_SECRET=_

# Optional for development, but won't be able to run certain features...

# AIRTABLE_API_KEY=
# AIRTABLE_FAMILY_BASE_ID=
# AIRTABLE_MEMBERS_TABLE_ID=
# AIRTABLE_RESUME_BOOKS_BASE_ID=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
Button,
ComboboxPopover,
DatePicker,
Divider,
Form,
getErrors,
Input,
Expand Down Expand Up @@ -53,7 +52,6 @@ export async function action({ request }: ActionFunctionArgs) {
}

await createResumeBook({
airtableTableId: data.airtableTableId,
endDate: data.endDate,
name: data.name,
sponsors: data.sponsors,
Expand Down Expand Up @@ -127,22 +125,6 @@ export default function CreateResumeBookModal() {

<SponsorsField />

<Divider />

<Form.Field
description="This is the ID of the Airtable table that the resume book responses will be sent to."
error={errors.airtableTableId}
label="Airtable Table ID"
labelFor={keys.airtableTableId}
required
>
<Input
id={keys.airtableTableId}
name={keys.airtableTableId}
required
/>
</Form.Field>

<Form.ErrorMessage>{error}</Form.ErrorMessage>

<Button.Group>
Expand Down
2 changes: 2 additions & 0 deletions apps/admin-dashboard/app/shared/constants.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const EnvironmentVariable = z.string().trim().min(1);

const BaseEnvironmentConfig = z.object({
ADMIN_DASHBOARD_URL: EnvironmentVariable,
AIRTABLE_API_KEY: EnvironmentVariable,
AIRTABLE_FAMILY_BASE_ID: EnvironmentVariable,
AIRTABLE_MEMBERS_TABLE_ID: EnvironmentVariable,
AIRTABLE_RESUME_BOOKS_BASE_ID: EnvironmentVariable,
Expand All @@ -24,6 +25,7 @@ const BaseEnvironmentConfig = z.object({

const EnvironmentConfig = z.discriminatedUnion('ENVIRONMENT', [
BaseEnvironmentConfig.partial({
AIRTABLE_API_KEY: true,
AIRTABLE_FAMILY_BASE_ID: true,
AIRTABLE_MEMBERS_TABLE_ID: true,
AIRTABLE_RESUME_BOOKS_BASE_ID: true,
Expand Down
48 changes: 9 additions & 39 deletions apps/member-profile/app/routes/_profile.resume-books.$id.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ import {
listResumeBookSponsors,
submitResume,
} from '@oyster/core/resume-books';
import { SubmitResumeInput } from '@oyster/core/resume-books.types';
import {
RESUME_BOOK_CODING_LANGUAGES,
RESUME_BOOK_JOB_SEARCH_STATUSES,
RESUME_BOOK_ROLES,
SubmitResumeInput,
} from '@oyster/core/resume-books.types';
import { db } from '@oyster/db';
import { FORMATTED_RACE, Race, WorkAuthorizationStatus } from '@oyster/types';
import {
Expand Down Expand Up @@ -520,26 +525,7 @@ function ResumeBookForm() {
required
>
<Checkbox.Group>
{[
'C',
'C++',
'C#',
'Go',
'Java',
'JavaScript',
'Kotlin',
'Matlab',
'Objective-C',
'PHP',
'Python',
'Ruby',
'Rust',
'Scala',
'Solidity',
'SQL',
'Swift',
'TypeScript',
].map((value) => {
{RESUME_BOOK_CODING_LANGUAGES.map((value) => {
return (
<Checkbox
key={value}
Expand All @@ -561,19 +547,7 @@ function ResumeBookForm() {
required
>
<Checkbox.Group>
{[
'Software Engineering',
'Data Science',
'Web Development',
'AI/Machine Learning',
'iOS Developer',
'Android Developer',
'Product Management',
'Product Design (UI/UX)',
'Developer Advocacy',
'Network Architecture',
'Cybersecurity Engineer/Analyst',
].map((value) => {
{RESUME_BOOK_ROLES.map((value) => {
return (
<Checkbox
key={value}
Expand All @@ -595,11 +569,7 @@ function ResumeBookForm() {
required
>
<Radio.Group>
{[
'I am actively searching for a position.',
'I have accepted an offer.',
'I am between offers, but still searching.',
].map((value) => {
{RESUME_BOOK_JOB_SEARCH_STATUSES.map((value) => {
return (
<Radio
key={value}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dayjs.extend(timezone);
// This is only meant to be imported by the `api` application.

export { job } from './infrastructure/bull/use-cases/job';
export { airtableWorker } from './modules/airtable/airtable.worker';
export { airtableWorker } from './modules/airtable/airtable.core';
export { applicationWorker } from './modules/application/application.worker';
export { OAuthCodeState } from './modules/authentication/authentication.types';
export { oneTimeCodeWorker } from './modules/authentication/one-time-code.worker';
Expand Down
Loading