From 6094b85f83ea2bba7c3be4fb2e8c26d737da5963 Mon Sep 17 00:00:00 2001 From: nemisis84 Date: Thu, 14 Nov 2024 18:13:28 +0100 Subject: [PATCH] Biome:fix and removed imports --- .../RecruitmentApplicantAdminPage.tsx | 138 +++++++++--------- .../RecruitmentInterviewNotesForm.tsx | 46 +++--- 2 files changed, 91 insertions(+), 93 deletions(-) diff --git a/frontend/src/PagesAdmin/RecruitmentApplicantAdminPage/RecruitmentApplicantAdminPage.tsx b/frontend/src/PagesAdmin/RecruitmentApplicantAdminPage/RecruitmentApplicantAdminPage.tsx index eeb2b5a7f..66d9a015c 100644 --- a/frontend/src/PagesAdmin/RecruitmentApplicantAdminPage/RecruitmentApplicantAdminPage.tsx +++ b/frontend/src/PagesAdmin/RecruitmentApplicantAdminPage/RecruitmentApplicantAdminPage.tsx @@ -1,13 +1,14 @@ +import { useMutation, useQuery } from '@tanstack/react-query'; import classNames from 'classnames'; import { useEffect, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useNavigate, useParams } from 'react-router-dom'; import { toast } from 'react-toastify'; -import { BackButton, Button, FormControl, FormField, FormItem, FormLabel, FormMessage, Link, Page, SamfundetLogoSpinner, Textarea, TextAreaField } from '~/Components'; +import { BackButton, Button, Link, SamfundetLogoSpinner } from '~/Components'; import { Table } from '~/Components/Table'; import { Text } from '~/Components/Text/Text'; import { getRecruitmentApplicationsForRecruiter, withdrawRecruitmentApplicationRecruiter } from '~/api'; -import type { InterviewDto, RecruitmentApplicationDto, } from '~/dto'; +import type { InterviewDto } from '~/dto'; import { STATUS } from '~/http_status_codes'; import { KEY } from '~/i18n/constants'; import { reverse } from '~/named-urls'; @@ -15,11 +16,8 @@ import { ROUTES } from '~/routes'; import { dbT } from '~/utils'; import { AdminPage } from '../AdminPageLayout'; import styles from './RecruitmentApplicantAdminPage.module.scss'; -import { useMutation, useQuery } from '@tanstack/react-query'; import { RecruitmentInterviewNotesForm } from './RecruitmentInterviewNotesForm'; - - export function RecruitmentApplicantAdminPage() { const { t } = useTranslation(); const navigate = useNavigate(); @@ -47,7 +45,7 @@ export function RecruitmentApplicantAdminPage() { }, onSuccess: () => { toast.success(t(KEY.common_update_successful)); - } + }, }); if (isLoading) { @@ -60,7 +58,7 @@ export function RecruitmentApplicantAdminPage() { const initialData: Partial = { notes: interviewNotes || '', - }; + }; return ( @@ -88,12 +86,9 @@ export function RecruitmentApplicantAdminPage() { {recruitmentApplication?.application_text}
- - +
- +
{t(KEY.recruitment_all_applications)} @@ -106,59 +101,61 @@ export function RecruitmentApplicantAdminPage() { t(KEY.recruitment_recruiter_status), t(KEY.recruitment_interview_time), ]} - - data={otherRecruitmentApplication ? otherRecruitmentApplication.map((element) => { - return { - cells: [ - { - sortable: true, - content: ( - - {element.applicant_priority} - - ), - }, - { - content: ( - - {dbT(element.recruitment_position, 'name')} - - ), - }, - { - content: ( - - {dbT(element.recruitment_position.gang, 'name')} - - ), - }, - element.recruiter_priority ? element.recruiter_priority : t(KEY.common_not_set), - element.interview_time ? element.interview_time : t(KEY.common_not_set), - ], - }; - }) :[]} - + data={ + otherRecruitmentApplication + ? otherRecruitmentApplication.map((element) => { + return { + cells: [ + { + sortable: true, + content: ( + + {element.applicant_priority} + + ), + }, + { + content: ( + + {dbT(element.recruitment_position, 'name')} + + ), + }, + { + content: ( + + {dbT(element.recruitment_position.gang, 'name')} + + ), + }, + element.recruiter_priority ? element.recruiter_priority : t(KEY.common_not_set), + element.interview_time ? element.interview_time : t(KEY.common_not_set), + ], + }; + }) + : [] + } />
@@ -167,9 +164,14 @@ export function RecruitmentApplicantAdminPage() { {t(KEY.recruitment_withdrawn)} ) : ( - )} diff --git a/frontend/src/PagesAdmin/RecruitmentApplicantAdminPage/RecruitmentInterviewNotesForm.tsx b/frontend/src/PagesAdmin/RecruitmentApplicantAdminPage/RecruitmentInterviewNotesForm.tsx index 393d151c1..39b9de9d4 100644 --- a/frontend/src/PagesAdmin/RecruitmentApplicantAdminPage/RecruitmentInterviewNotesForm.tsx +++ b/frontend/src/PagesAdmin/RecruitmentApplicantAdminPage/RecruitmentInterviewNotesForm.tsx @@ -1,25 +1,21 @@ -import { useForm } from "react-hook-form"; -import { z } from "zod"; -import { zodResolver } from "@hookform/resolvers/zod"; -import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage, Textarea } from "~/Components"; -import { KEY } from "~/i18n/constants"; -import { useTranslation } from "react-i18next"; +import { zodResolver } from '@hookform/resolvers/zod'; +import { useForm } from 'react-hook-form'; +import { useTranslation } from 'react-i18next'; +import { z } from 'zod'; +import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage, Textarea } from '~/Components'; +import { KEY } from '~/i18n/constants'; const recruitmentNotesSchema = z.object({ notes: z.string(), }); - type RecruitmentInterviewNotesFormType = z.infer; - interface RecruitmentInterviewNotesFormProps { initialData: Partial; } - -export function RecruitmentInterviewNotesForm ({initialData }: RecruitmentInterviewNotesFormProps) { - +export function RecruitmentInterviewNotesForm({ initialData }: RecruitmentInterviewNotesFormProps) { const { t } = useTranslation(); const form = useForm({ @@ -32,7 +28,6 @@ export function RecruitmentInterviewNotesForm ({initialData }: RecruitmentInterv console.log(value); } - return (
@@ -44,19 +39,20 @@ export function RecruitmentInterviewNotesForm ({initialData }: RecruitmentInterv {t(KEY.recruitment_interview_notes)} -