Files
jobtrackingapp/job-tracker-ui/src/jobWorkspaceRoute.ts
cesnimda 109745edb0
CI and Deploy / test (pull_request) Failing after 2m51s
CI and Deploy / deploy (pull_request) Has been skipped
feat(jobs): add dedicated workspace page
Make /jobs/:id the canonical application workspace while preserving list state and compatibility links. Replace popup and expandable-row navigation with accessible whole-row routing and richer job details.
2026-08-15 13:33:00 +02:00

39 lines
1.2 KiB
TypeScript

export const JOB_DETAILS_TABS = {
overview: 0,
correspondence: 1,
attachments: 2,
tailoredCv: 3,
followUp: 4,
candidateFit: 5,
focusPlan: 6,
interviewPrep: 7,
readiness: 8,
history: 9,
} as const;
export type JobWorkspaceOpenOptions = {
tab?: number;
followMode?: string;
};
const WORKSPACE_SECTION_BY_TAB: Record<number, string> = {
[JOB_DETAILS_TABS.overview]: "overview",
[JOB_DETAILS_TABS.correspondence]: "communication",
[JOB_DETAILS_TABS.attachments]: "documents",
[JOB_DETAILS_TABS.tailoredCv]: "cv",
[JOB_DETAILS_TABS.followUp]: "communication",
[JOB_DETAILS_TABS.candidateFit]: "match",
[JOB_DETAILS_TABS.focusPlan]: "analysis",
[JOB_DETAILS_TABS.interviewPrep]: "interview",
[JOB_DETAILS_TABS.readiness]: "checklist",
[JOB_DETAILS_TABS.history]: "timeline",
};
export function buildJobWorkspacePath(jobId: number, options: JobWorkspaceOpenOptions = {}) {
const params = new URLSearchParams();
const section = typeof options.tab === "number" ? WORKSPACE_SECTION_BY_TAB[options.tab] : undefined;
if (section && section !== "overview") params.set("section", section);
if (options.followMode) params.set('followMode', options.followMode);
return `/jobs/${jobId}${params.size ? `?${params.toString()}` : ""}`;
}