Skip to content

Commit

Permalink
format and build #133
Browse files Browse the repository at this point in the history
  • Loading branch information
ukorvl committed Dec 29, 2023
1 parent 5c47f22 commit 89093dd
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 13 deletions.
4 changes: 2 additions & 2 deletions site/src/components/pages/OpenJobs/OpenJobs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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']
Expand Down
4 changes: 2 additions & 2 deletions site/src/components/pages/OpenJobs/useFilterJobs.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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<JobRole['name']>) => {
export const useGroupJobsByDepartments = (jobs: UIJob[], order?: Array<JobRole['name']>) => {
return useMemo(() => {
const departments = jobs.reduce((acc, job) => {
const departmentName = job.department.name
Expand All @@ -11,7 +11,7 @@ export const useGroupJobsByDepartments = (jobs: UIJobOverview[], order?: Array<J
...acc,
[departmentName]: [...departmentJobs, job],
}
}, {} as Record<string, UIJobOverview[]>)
}, {} as Record<string, UIJob[]>)

if (order) {
const orderedDepartments = order
Expand All @@ -21,7 +21,7 @@ export const useGroupJobsByDepartments = (jobs: UIJobOverview[], order?: Array<J
...acc,
[department]: departments[department],
}
}, {} as Record<string, UIJobOverview[]>)
}, {} as Record<string, UIJob[]>)

return { ...orderedDepartments, ...departments }
}
Expand Down
6 changes: 1 addition & 5 deletions site/src/freshteam/mappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 89093dd

Please sign in to comment.