Skip to content

Commit

Permalink
Merge branch 'colorstackorg:main' into checkReviews
Browse files Browse the repository at this point in the history
  • Loading branch information
ciaracade authored Jul 17, 2024
2 parents fdccf7b + 528b80f commit 5fece86
Show file tree
Hide file tree
Showing 66 changed files with 2,003 additions and 169 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/auto-author-assign.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Auto Author Assign

on:
pull_request_target:
types: [opened, reopened]

permissions:
pull-requests: write

jobs:
assign-author:
runs-on: ubuntu-latest
steps:
- uses: toshimaru/[email protected]
5 changes: 5 additions & 0 deletions CONTRIBUTORS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,8 @@
- kkellybonilla
- ciaracade
- arelymartinez16
- efloresz
- lianarosa
- nicholasg2001
- nayoseph
- savazques
29 changes: 16 additions & 13 deletions apps/admin-dashboard/app/routes/_dashboard.applications.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ function ApplicationsTable() {

const columns: TableColumnProps<ApplicationInView>[] = [
{
displayName: 'First Name',
displayName: 'Full Name',
render: (application) => {
return (
<Link
Expand All @@ -148,16 +148,11 @@ function ApplicationsTable() {
search,
}}
>
{application.firstName}
{application.firstName} {application.lastName}
</Link>
);
},
size: '200',
},
{
displayName: 'Last Name',
size: '200',
render: (application) => application.lastName,
size: '280',
},
{
displayName: 'Email',
Expand All @@ -183,16 +178,24 @@ function ApplicationsTable() {
},
size: '160',
},
{
displayName: 'School',
size: '360',
render: (application) => application.school || '-',
},
{
displayName: 'Applied On',
size: '240',
render: (application) => application.createdAt,
},
{
displayName: 'Reviewed By',
size: '280',
render: (application) => {
const { reviewedByFirstName, reviewedByLastName } = application;

if (!reviewedByFirstName) {
return '-';
}

return `${reviewedByFirstName} ${reviewedByLastName}`;
},
},
];

return (
Expand Down
127 changes: 96 additions & 31 deletions apps/admin-dashboard/app/routes/_dashboard.resume-books.create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,29 @@ import {
type LoaderFunctionArgs,
redirect,
} from '@remix-run/node';
import { Form as RemixForm, useActionData } from '@remix-run/react';
import { Form as RemixForm, useActionData, useFetcher } from '@remix-run/react';
import { useEffect } from 'react';

import {
Button,
ComboboxPopover,
DatePicker,
Divider,
Form,
getErrors,
Input,
Modal,
MultiCombobox,
MultiComboboxDisplay,
MultiComboboxItem,
MultiComboboxSearch,
MultiComboboxValues,
validateForm,
} from '@oyster/ui';

import { createResumeBook } from '@/member-profile.server';
import { CreateResumeBookInput } from '@/member-profile.ui';
import { type SearchCompaniesResult } from '@/routes/api.companies.search';
import { Route } from '@/shared/constants';
import {
commitSession,
Expand Down Expand Up @@ -48,6 +57,7 @@ export async function action({ request }: ActionFunctionArgs) {
airtableTableId: data.airtableTableId,
endDate: data.endDate,
name: data.name,
sponsors: data.sponsors,
startDate: data.startDate,
});

Expand Down Expand Up @@ -77,41 +87,13 @@ export default function CreateResumeBookModal() {

<RemixForm className="form" method="post">
<Form.Field
description="Example: Spring '24"
error={errors.name}
label="Name"
labelFor={keys.name}
required
>
<Input
id={keys.name}
name={keys.name}
required
placeholder="Spring '24"
/>
</Form.Field>

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

<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
/>
<Input id={keys.name} name={keys.name} required />
</Form.Field>

<Form.Field
Expand Down Expand Up @@ -144,6 +126,34 @@ export default function CreateResumeBookModal() {
/>
</Form.Field>

<SponsorsField />

<Divider />

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

<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 All @@ -153,3 +163,58 @@ export default function CreateResumeBookModal() {
</Modal>
);
}

function SponsorsField() {
const fetcher = useFetcher<SearchCompaniesResult>();
const { errors } = getErrors(useActionData<typeof action>());

useEffect(() => {
fetcher.load('/api/companies/search');
}, []);

const companies = fetcher.data?.companies || [];

return (
<Form.Field
description="Please choose all of the companies that are sponsoring this resume book."
error={errors.sponsors}
label="Sponsors"
labelFor={keys.sponsors}
required
>
<MultiCombobox>
<MultiComboboxDisplay>
<MultiComboboxValues name={keys.sponsors} />
<MultiComboboxSearch
id="search"
onChange={(e) => {
fetcher.submit(
{ search: e.currentTarget.value },
{
action: '/api/companies/search',
method: 'get',
}
);
}}
/>
</MultiComboboxDisplay>

<ComboboxPopover>
<ul>
{companies.map((company) => {
return (
<MultiComboboxItem
key={company.id}
label={company.name}
value={company.id}
>
{company.name}
</MultiComboboxItem>
);
})}
</ul>
</ComboboxPopover>
</MultiCombobox>
</Form.Field>
);
}
38 changes: 18 additions & 20 deletions apps/admin-dashboard/app/routes/_dashboard.resume-books.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import {
import { Link, Outlet, useLoaderData } from '@remix-run/react';
import dayjs from 'dayjs';
import { useState } from 'react';
import { Menu, Plus } from 'react-feather';
import { ExternalLink, Menu, Plus } from 'react-feather';

import { db } from '@oyster/db';
import { listResumeBooks } from '@oyster/core/resume-books.server';
import {
Dashboard,
Dropdown,
Expand All @@ -26,20 +26,9 @@ export async function loader({ request }: LoaderFunctionArgs) {

const timezone = getTimezone(request);

const records = await db
.selectFrom('resumeBooks')
.select([
'airtableBaseId',
'airtableTableId',
'endDate',
'id',
'name',
'startDate',
])
.orderBy('startDate', 'desc')
.execute();

const resumeBooks = records.map(
const _resumeBooks = await listResumeBooks();

const resumeBooks = _resumeBooks.map(
({ airtableBaseId, airtableTableId, endDate, startDate, ...record }) => {
const format = 'MM/DD/YY @ h:mm A';

Expand Down Expand Up @@ -116,9 +105,14 @@ function ResumeBooksTable() {
const columns: TableColumnProps<ResumeBookInView>[] = [
{
displayName: 'Name',
size: '160',
size: '200',
render: (resumeBook) => resumeBook.name,
},
{
displayName: '# of Submissions',
size: '160',
render: (resumeBook) => Number(resumeBook.submissions),
},
{
displayName: 'Start Date',
size: '200',
Expand All @@ -131,11 +125,15 @@ function ResumeBooksTable() {
},
{
displayName: 'Airtable Link',
size: null,
size: '160',
render: (resumeBook) => {
return (
<Link className="link" to={resumeBook.airtableUri} target="_blank">
{resumeBook.airtableUri}
<Link
className="link flex items-center gap-1"
to={resumeBook.airtableUri}
target="_blank"
>
Airtable <ExternalLink size="16" />
</Link>
);
},
Expand Down
33 changes: 33 additions & 0 deletions apps/admin-dashboard/app/routes/api.companies.search.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import {
json,
type LoaderFunctionArgs,
type SerializeFrom,
} from '@remix-run/node';

import { listCompanies } from '@oyster/core/employment.server';

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

export async function loader({ request }: LoaderFunctionArgs) {
await ensureUserAuthenticated(request);

const url = new URL(request.url);

const search = url.searchParams.get('search') || '';

const { companies } = await listCompanies({
orderBy: 'most_employees',
pagination: {
limit: 100,
page: 1,
},
select: ['companies.id', 'companies.name'],
where: { search },
});

return json({
companies,
});
}

export type SearchCompaniesResult = SerializeFrom<typeof loader>;
3 changes: 3 additions & 0 deletions apps/member-profile/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ STUDENT_PROFILE_URL=http://localhost:3000

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

# AIRTABLE_API_KEY=
# AIRTABLE_FAMILY_BASE_ID=
# AIRTABLE_MEMBERS_TABLE_ID=
# CRUNCHBASE_BASIC_API_KEY=
# GITHUB_OAUTH_CLIENT_ID=
# GITHUB_OAUTH_CLIENT_SECRET=
Expand Down
Loading

0 comments on commit 5fece86

Please sign in to comment.