From 89093dd7f10b5ae46fee791780136dff5c6c778b Mon Sep 17 00:00:00 2001 From: ukorvl Date: Fri, 29 Dec 2023 16:10:41 +0400 Subject: [PATCH] format and build #133 --- site/src/components/pages/OpenJobs/OpenJobs.tsx | 4 ++-- site/src/components/pages/OpenJobs/useFilterJobs.ts | 4 ++-- .../pages/OpenJobs/useGroupJobsByDepartments.ts | 8 ++++---- site/src/freshteam/mappers.ts | 6 +----- 4 files changed, 9 insertions(+), 13 deletions(-) diff --git a/site/src/components/pages/OpenJobs/OpenJobs.tsx b/site/src/components/pages/OpenJobs/OpenJobs.tsx index 51369063..4b54c9e8 100644 --- a/site/src/components/pages/OpenJobs/OpenJobs.tsx +++ b/site/src/components/pages/OpenJobs/OpenJobs.tsx @@ -8,7 +8,7 @@ import Icon from 'components/Icon' import s from './OpenJobs.module.scss' import DottedSection from './DottedSection' -import { UIJobOverview } from 'src/freshteam/types' +import { UIJob } from 'src/freshteam/types' import { HeadingXLarge, HeadingXXLarge, LabelMedium, PRIMITIVE_COLORS } from '@nilfoundation/ui-kit' import { getPageTitleOverrides, getCommonHeadingOverrides } from './overrides' import { useGroupJobsByDepartments } from './useGroupJobsByDepartments' @@ -20,7 +20,7 @@ import { Job } from './Job/Job' import uniq from 'lodash.uniq' type OpenJobsProps = { - jobsPostings: UIJobOverview[] + jobsPostings: UIJob[] } const departmensOrder = ['Engineering', 'Developer Relations', 'Marketing', 'Human Resources'] diff --git a/site/src/components/pages/OpenJobs/useFilterJobs.ts b/site/src/components/pages/OpenJobs/useFilterJobs.ts index 43938529..681c7058 100644 --- a/site/src/components/pages/OpenJobs/useFilterJobs.ts +++ b/site/src/components/pages/OpenJobs/useFilterJobs.ts @@ -1,7 +1,7 @@ -import { UIJobOverview } from 'src/freshteam/types' +import { UIJob } from 'src/freshteam/types' import { JobsFilter } from './types' -export const useFilterJobs = (positions: UIJobOverview[], filter: JobsFilter) => { +export const useFilterJobs = (positions: UIJob[], filter: JobsFilter) => { const filteredPositions = positions.filter((position) => { const titleFilter = filter.title ? position.title.toLowerCase().includes(filter.title.toLowerCase()) : true const departmentFilter = filter.department diff --git a/site/src/components/pages/OpenJobs/useGroupJobsByDepartments.ts b/site/src/components/pages/OpenJobs/useGroupJobsByDepartments.ts index 0340a72c..c648e8f0 100644 --- a/site/src/components/pages/OpenJobs/useGroupJobsByDepartments.ts +++ b/site/src/components/pages/OpenJobs/useGroupJobsByDepartments.ts @@ -1,7 +1,7 @@ import { useMemo } from 'react' -import { JobRole, UIJobOverview } from 'src/freshteam/types' +import { JobRole, UIJob } from 'src/freshteam/types' -export const useGroupJobsByDepartments = (jobs: UIJobOverview[], order?: Array) => { +export const useGroupJobsByDepartments = (jobs: UIJob[], order?: Array) => { return useMemo(() => { const departments = jobs.reduce((acc, job) => { const departmentName = job.department.name @@ -11,7 +11,7 @@ export const useGroupJobsByDepartments = (jobs: UIJobOverview[], order?: Array) + }, {} as Record) if (order) { const orderedDepartments = order @@ -21,7 +21,7 @@ export const useGroupJobsByDepartments = (jobs: UIJobOverview[], order?: Array) + }, {} as Record) return { ...orderedDepartments, ...departments } } diff --git a/site/src/freshteam/mappers.ts b/site/src/freshteam/mappers.ts index d9dcbeed..53d1ddc2 100644 --- a/site/src/freshteam/mappers.ts +++ b/site/src/freshteam/mappers.ts @@ -2,11 +2,7 @@ import { Branch, Job, JobRole, UIJob } from './types' import { convert } from 'html-to-text' import sanitizeHtml from 'sanitize-html' -export const mapRawJobToUIJob = ( - rawJob: Job, - jobRoles: JobRole[], - branches: Branch[], -): UIJob => { +export const mapRawJobToUIJob = (rawJob: Job, jobRoles: JobRole[], branches: Branch[]): UIJob => { const jobRoleMap = new Map() const branchMap = new Map()