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.
This commit is contained in:
@@ -16,10 +16,23 @@ export type JobWorkspaceOpenOptions = {
|
||||
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();
|
||||
params.set('open', String(jobId));
|
||||
if (typeof options.tab === 'number') params.set('tab', String(options.tab));
|
||||
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?${params.toString()}`;
|
||||
return `/jobs/${jobId}${params.size ? `?${params.toString()}` : ""}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user