Skip to content

Commit

Permalink
run prettier on some files
Browse files Browse the repository at this point in the history
  • Loading branch information
jackbravo committed Jun 22, 2024
1 parent 628aeee commit a78d1c6
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 45 deletions.
16 changes: 6 additions & 10 deletions app/routes/applicants.$applicantId._index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
type SubmitOptions,
useFetcher,
useNavigation,
useSubmit
useSubmit,
} from "@remix-run/react";
import { withZod } from "@remix-validated-form/with-zod";
import MarkdownStyles from "@uiw/react-markdown-preview/markdown.css";
Expand Down Expand Up @@ -226,15 +226,11 @@ export default function Applicant() {
>
<EditSharp />
</IconButton>
) : (
<IconButton
aria-label="Edit"
onClick={() => editApplicant()}
>
<EditSharp />
</IconButton>
)
}
) : (
<IconButton aria-label="Edit" onClick={() => editApplicant()}>
<EditSharp />
</IconButton>
)}
<Stack direction="column" spacing={1}>
<Paper>
<Typography
Expand Down
109 changes: 80 additions & 29 deletions app/routes/applicationForm.$applicantId._index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -209,51 +209,102 @@ export default function FormPage() {
validator={validator}
//action="./createapplicant"
//TODO: Maybe this is not the correct approach
action={applicantByEmail?.email ? "./editApplicant" : "./createapplicant"}
action={
applicantByEmail?.email ? "./editApplicant" : "./createapplicant"
}
method="post"
defaultValues={{
personalEmail: profile.email,
fullName: applicantByEmail?.fullName
? applicantByEmail?.fullName
: profile.name,
nationality: applicantByEmail?.nationality ? applicantByEmail.nationality : "",
dayOfBirth: applicantByEmail?.dayOfBirth ? new Date(applicantByEmail.dayOfBirth).toISOString().split('T')[0] : '',
nationality: applicantByEmail?.nationality
? applicantByEmail.nationality
: "",
dayOfBirth: applicantByEmail?.dayOfBirth
? new Date(applicantByEmail.dayOfBirth)
.toISOString()
.split("T")[0]
: "",
gender: applicantByEmail?.gender ? applicantByEmail?.gender : "",
country: applicantByEmail?.country ? applicantByEmail.country : "",
homeAddress: applicantByEmail?.homeAddress ? applicantByEmail?.homeAddress : "",
homeAddress: applicantByEmail?.homeAddress
? applicantByEmail?.homeAddress
: "",
phone: applicantByEmail?.phone ? applicantByEmail?.phone : "",
university: applicantByEmail?.universityName
? { id: applicantByEmail?.universityId ?? '', name: applicantByEmail?.universityName }
: { id: '', name: '' },
universityContactId: applicantByEmail?.universityPointOfContactId ? applicantByEmail?.universityPointOfContactId : "",
universityEmail: applicantByEmail?.universityEmail ? applicantByEmail?.universityEmail : "",
emergencyContactName: applicantByEmail?.emergencyContactName ? applicantByEmail?.emergencyContactName : "",
emergencyRelationship: applicantByEmail?.emergencyRelationship ? applicantByEmail?.emergencyRelationship : "",
emergencyContactPhone: applicantByEmail?.emergencyContactPhone ? applicantByEmail?.emergencyContactPhone : "",
experience: applicantByEmail?.experience ? applicantByEmail?.experience : "",
englishLevel: applicantByEmail?.englishLevel ? applicantByEmail?.englishLevel : "",
? {
id: applicantByEmail?.universityId ?? "",
name: applicantByEmail?.universityName,
}
: { id: "", name: "" },
universityContactId: applicantByEmail?.universityPointOfContactId
? applicantByEmail?.universityPointOfContactId
: "",
universityEmail: applicantByEmail?.universityEmail
? applicantByEmail?.universityEmail
: "",
emergencyContactName: applicantByEmail?.emergencyContactName
? applicantByEmail?.emergencyContactName
: "",
emergencyRelationship: applicantByEmail?.emergencyRelationship
? applicantByEmail?.emergencyRelationship
: "",
emergencyContactPhone: applicantByEmail?.emergencyContactPhone
? applicantByEmail?.emergencyContactPhone
: "",
experience: applicantByEmail?.experience
? applicantByEmail?.experience
: "",
englishLevel: applicantByEmail?.englishLevel
? applicantByEmail?.englishLevel
: "",
major: applicantByEmail?.major ? applicantByEmail?.major : "",
graduationDate: applicantByEmail?.graduationDate ? new Date(applicantByEmail.graduationDate).toISOString().split('T')[0] : '',
semester: applicantByEmail?.semester ? applicantByEmail?.semester : "",
interest: applicantByEmail?.interest ? applicantByEmail?.interest : "",
graduationDate: applicantByEmail?.graduationDate
? new Date(applicantByEmail.graduationDate)
.toISOString()
.split("T")[0]
: "",
semester: applicantByEmail?.semester
? applicantByEmail?.semester
: "",
interest: applicantByEmail?.interest
? applicantByEmail?.interest
: "",
cvLink: applicantByEmail?.cvLink ? applicantByEmail?.cvLink : "",
interestedRoles: applicantByEmail?.interestedRoles ? applicantByEmail?.interestedRoles : "",
preferredTools: applicantByEmail?.preferredTools ? applicantByEmail?.preferredTools : "",
startDate: applicantByEmail?.startDate ? new Date(applicantByEmail.startDate).toISOString().split('T')[0] : '',
endDate: applicantByEmail?.endDate ? new Date(applicantByEmail.endDate).toISOString().split('T')[0] : '',
interestedRoles: applicantByEmail?.interestedRoles
? applicantByEmail?.interestedRoles
: "",
preferredTools: applicantByEmail?.preferredTools
? applicantByEmail?.preferredTools
: "",
startDate: applicantByEmail?.startDate
? new Date(applicantByEmail.startDate).toISOString().split("T")[0]
: "",
endDate: applicantByEmail?.endDate
? new Date(applicantByEmail.endDate).toISOString().split("T")[0]
: "",
hoursPerWeek: applicantByEmail?.hoursPerWeek
? applicantByEmail?.hoursPerWeek !== undefined && applicantByEmail?.hoursPerWeek !== null
? applicantByEmail?.hoursPerWeek !== undefined &&
applicantByEmail?.hoursPerWeek !== null
? applicantByEmail?.hoursPerWeek.toString()
: ""
: "",
howDidYouHearAboutUs: applicantByEmail?.howDidYouHearAboutUs ? applicantByEmail?.howDidYouHearAboutUs : "",
participatedAtWizeline : applicantByEmail?.participatedAtWizeline !== undefined
howDidYouHearAboutUs: applicantByEmail?.howDidYouHearAboutUs
? applicantByEmail?.howDidYouHearAboutUs
: "",
participatedAtWizeline:
applicantByEmail?.participatedAtWizeline !== undefined
? applicantByEmail.participatedAtWizeline
? 'Yes'
: 'No'
: '',
wizelinePrograms: applicantByEmail?.wizelinePrograms ? applicantByEmail?.wizelinePrograms : "",
comments: applicantByEmail?.comments ? applicantByEmail?.comments : "",
? "Yes"
: "No"
: "",
wizelinePrograms: applicantByEmail?.wizelinePrograms
? applicantByEmail?.wizelinePrograms
: "",
comments: applicantByEmail?.comments
? applicantByEmail?.comments
: "",
}}
>
<Grid container spacing={10}>
Expand Down Expand Up @@ -553,7 +604,7 @@ export default function FormPage() {
<SelectField
name="participatedAtWizeline"
label="Have you participated in any program at Wizeline before?"
options={['Yes', 'No']}
options={["Yes", "No"]}
style={{ width: "100%", marginBottom: "20px" }}
/>
<SelectField
Expand Down
13 changes: 7 additions & 6 deletions app/routes/profiles._index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,11 @@ export const loader: LoaderFunction = async ({ request }) => {
const benchStatus = url.searchParams.getAll("benchStatus");
const employeeStatus = url.searchParams.getAll("employeeStatus");
const skill = url.searchParams.getAll("skill");

const isBillable = url.searchParams.get("isBillable") === null ?
undefined :
url.searchParams.get("isBillable") === "true";

const isBillable =
url.searchParams.get("isBillable") === null
? undefined
: url.searchParams.get("isBillable") === "true";
const data = await searchProfilesFull({
searchTerm,
page,
Expand Down Expand Up @@ -273,12 +274,12 @@ const Profiles = () => {
items={benchStatuses}
/>
) : null}
{isBillables.length > 0 ?(
{isBillables.length > 0 ? (
<FilterAccordion
title="Is Billable"
filter="isBillable"
items={isBillables}
/>
/>
) : null}
<FilterAccordion title="Skill" filter="skill" items={skills} />
</Paper>
Expand Down

0 comments on commit a78d1c6

Please sign in to comment.