diff --git a/index.html b/index.html index 5caebd7..b8bf14e 100644 --- a/index.html +++ b/index.html @@ -12,6 +12,6 @@
- + diff --git a/src/App.jsx b/src/App.tsx similarity index 100% rename from src/App.jsx rename to src/App.tsx diff --git a/src/main.jsx b/src/main.tsx similarity index 82% rename from src/main.jsx rename to src/main.tsx index 6037e58..ce397dc 100644 --- a/src/main.jsx +++ b/src/main.tsx @@ -1,5 +1,5 @@ import ReactDOM from 'react-dom/client' -import App from '@/App.jsx' +import App from '@/App' import '@/index.css' ReactDOM.createRoot(document.getElementById('root')).render( diff --git a/src/pages/CreatePosition.jsx b/src/pages/CreatePosition.tsx similarity index 97% rename from src/pages/CreatePosition.jsx rename to src/pages/CreatePosition.tsx index fb5e8f9..b72b5ee 100644 --- a/src/pages/CreatePosition.jsx +++ b/src/pages/CreatePosition.tsx @@ -22,7 +22,13 @@ import { usePublishPageActions, usePublishPageContext } from '@/components/ai-as * and both paths share one field definition — `lib/positionModel.js` — so * neither can drift into a different shape of position. */ -export default function CreatePosition({ prefill: prefillProp, embedded = false, onDone }) { +interface CreatePositionProps { + prefill?: any; + embedded?: any; + onDone?: (...args: any[]) => void; +} + +export default function CreatePosition({ prefill: prefillProp, embedded = false, onDone }: CreatePositionProps) { const navigate = useNavigate(); /* Owliver opens this page with the fields it could infer from the request. It is a starting point, not a submission: every field stays editable and @@ -79,7 +85,10 @@ export default function CreatePosition({ prefill: prefillProp, embedded = false, update('vetting_criteria', { ...form.vetting_criteria, [key]: parseInt(value) || 0 }); }; - const totalWeight = Object.values(form.vetting_criteria).reduce((a, b) => a + b, 0); + /* `vetting_criteria` is a `jsonb` column, so the registry types its values + `unknown`. It holds the five weighting percentages this page edits. */ + const totalWeight = Object.values(form.vetting_criteria as Record) + .reduce((a, b) => a + b, 0); /* What a skill on this surface reads: the position being specified, as it stands right now. The draft carries the same fields a saved position does, @@ -402,7 +411,7 @@ export default function CreatePosition({ prefill: prefillProp, embedded = false, {showWeights && (
- {Object.entries(form.vetting_criteria).map(([key, val]) => ( + {Object.entries(form.vetting_criteria as Record).map(([key, val]) => (
diff --git a/src/pages/PositionDetail.jsx b/src/pages/PositionDetail.tsx similarity index 99% rename from src/pages/PositionDetail.jsx rename to src/pages/PositionDetail.tsx index 3bd7204..41a346f 100644 --- a/src/pages/PositionDetail.jsx +++ b/src/pages/PositionDetail.tsx @@ -1,3 +1,4 @@ +import type { JobPosting } from '@/types/entities'; import React, { useState } from 'react'; import { useParams, useNavigate } from 'react-router-dom'; import { useJobPosting, useApplications, useScreenAllCandidates, useUpdateJobPosting, useHireCandidate, useUpdateApplication, useCreateApplication, useWorkerProfiles, useCourses, useAssignments, useStaff } from '@/lib/krowHooks'; @@ -35,7 +36,12 @@ const STATUS_ACTIONS = [ * interviews on file. Nothing is derived here; sections that have nothing to * report say so in one line rather than reserving a panel for it. */ -function WorkforceStatus({ workforce, job }) { +interface WorkforceStatusProps { + workforce?: any; + job: JobPosting; +} + +function WorkforceStatus({ workforce, job }: WorkforceStatusProps) { const { demand, existingAvailable, applicants, newToday, strong, interviewReady } = workforce; /* Coverage figures depend on a declared headcount; the rest are facts about diff --git a/src/pages/University.jsx b/src/pages/University.tsx similarity index 100% rename from src/pages/University.jsx rename to src/pages/University.tsx diff --git a/src/pages/UserTracking.jsx b/src/pages/UserTracking.tsx similarity index 100% rename from src/pages/UserTracking.jsx rename to src/pages/UserTracking.tsx