feat(ui): redesign job workspace sections
This commit is contained in:
@@ -77,15 +77,16 @@ export const CHECKLIST_CATEGORIES: { key: string; label: string }[] = [
|
||||
{ key: "custom", label: "Your own tasks" },
|
||||
];
|
||||
|
||||
// Workspace navigation. Sections map to the Phase 5 milestones; each is added as its milestone lands
|
||||
// so the workspace is always usable rather than a shell of placeholders.
|
||||
export type WorkspaceSectionKey = "overview" | "analysis" | "cv" | "cover-letter" | "interview";
|
||||
// URL-addressable presentation; domain components remain the data owners.
|
||||
export type WorkspaceSectionKey = "overview" | "match" | "application" | "documents" | "timeline" | "tasks" | "interview";
|
||||
|
||||
export const WORKSPACE_SECTIONS: { key: WorkspaceSectionKey; label: string }[] = [
|
||||
{ key: "overview", label: "Overview" },
|
||||
{ key: "analysis", label: "Analysis" },
|
||||
{ key: "cv", label: "CV" },
|
||||
{ key: "cover-letter", label: "Cover Letter" },
|
||||
{ key: "match", label: "Match" },
|
||||
{ key: "application", label: "Application" },
|
||||
{ key: "documents", label: "Documents" },
|
||||
{ key: "timeline", label: "Timeline" },
|
||||
{ key: "tasks", label: "Notes & tasks" },
|
||||
{ key: "interview", label: "Interview Prep" },
|
||||
];
|
||||
|
||||
@@ -95,14 +96,14 @@ export function checklistSystemTranslationToken(systemKey?: string | null): stri
|
||||
}
|
||||
|
||||
const LEGACY_WORKSPACE_SECTIONS: Record<string, WorkspaceSectionKey> = {
|
||||
match: "analysis",
|
||||
analysis: "match",
|
||||
cv: "application",
|
||||
"cover-letter": "application",
|
||||
"job-details": "overview",
|
||||
checklist: "overview",
|
||||
documents: "overview",
|
||||
timeline: "overview",
|
||||
communication: "overview",
|
||||
portfolio: "overview",
|
||||
notes: "cover-letter",
|
||||
checklist: "tasks",
|
||||
communication: "timeline",
|
||||
portfolio: "documents",
|
||||
notes: "tasks",
|
||||
};
|
||||
|
||||
/** Preserve old shared/bookmarked workspace links while keeping one clear primary navigation. */
|
||||
@@ -111,6 +112,15 @@ export const workspaceSection = (value: string | null): WorkspaceSectionKey => {
|
||||
return WORKSPACE_SECTIONS.some((section) => section.key === value) ? value as WorkspaceSectionKey : "overview";
|
||||
};
|
||||
|
||||
/** Legacy links select their original content, even when unrelated sub metadata is present. */
|
||||
export function workspaceSubsection(section: string | null, sub: string | null): string {
|
||||
if (section === "cv") return "cv";
|
||||
if (section === "cover-letter") return "letter";
|
||||
if (section === "communication") return "correspondence";
|
||||
if (workspaceSection(section) === "application") return ["cv", "letter", "answers", "submission"].includes(sub ?? "") ? sub! : "cv";
|
||||
return sub === "correspondence" ? "correspondence" : "activity";
|
||||
}
|
||||
|
||||
export const applicationWorkspaceApi = {
|
||||
overview: (jobId: number) =>
|
||||
api.get<WorkspaceOverview>(`/jobapplications/${jobId}/workspace`).then((r) => r.data),
|
||||
|
||||
Reference in New Issue
Block a user