feat(documents): wire folder sidebar + breadcrumb + In-progress tab
Documents hub now opens with the folder tree on the left and a breadcrumb on top. Folder selection is its own state — undefined = "All", null = "Root only", string = specific folder. Filter pushes through to /api/v1/documents via folderId query param. Drops the "Signature-based only" pill — it defaulted to true and silently hid informational documents, which confused new reps. With folders the rep organises by location, not by signature-vs-not. Adds an "In progress" hub tab covering status IN (draft, sent, partially_signed) for the everyday "what's in flight" view. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -62,6 +62,13 @@ function buildHubTabFilters(
|
||||
if (!tab || tab === 'all') return filters;
|
||||
|
||||
switch (tab) {
|
||||
case 'in_progress':
|
||||
// All document types currently in-flight — the everyday "what's in flight" view.
|
||||
filters.push(
|
||||
inArray(documents.status, ['draft', 'sent', 'partially_signed']),
|
||||
sql`${documents.status} != 'expired'`,
|
||||
);
|
||||
break;
|
||||
case 'eoi_queue':
|
||||
// EOI documents currently in-flight (drafted, sent, or partially signed).
|
||||
// Used by the dedicated tab on the documents hub to triage EOI signing
|
||||
@@ -288,6 +295,7 @@ export async function listDealDocumentsForBerth(
|
||||
|
||||
export interface HubTabCounts {
|
||||
all: number;
|
||||
in_progress: number;
|
||||
eoi_queue: number;
|
||||
awaiting_them: number;
|
||||
awaiting_me: number;
|
||||
@@ -313,16 +321,18 @@ export async function getHubTabCounts(
|
||||
return row?.count ?? 0;
|
||||
}
|
||||
|
||||
const [all, eoi_queue, awaiting_them, awaiting_me, completed, expired] = await Promise.all([
|
||||
tabCount('all'),
|
||||
tabCount('eoi_queue'),
|
||||
tabCount('awaiting_them'),
|
||||
tabCount('awaiting_me'),
|
||||
tabCount('completed'),
|
||||
tabCount('expired'),
|
||||
]);
|
||||
const [all, in_progress, eoi_queue, awaiting_them, awaiting_me, completed, expired] =
|
||||
await Promise.all([
|
||||
tabCount('all'),
|
||||
tabCount('in_progress'),
|
||||
tabCount('eoi_queue'),
|
||||
tabCount('awaiting_them'),
|
||||
tabCount('awaiting_me'),
|
||||
tabCount('completed'),
|
||||
tabCount('expired'),
|
||||
]);
|
||||
|
||||
return { all, eoi_queue, awaiting_them, awaiting_me, completed, expired };
|
||||
return { all, in_progress, eoi_queue, awaiting_them, awaiting_me, completed, expired };
|
||||
}
|
||||
|
||||
// ─── Get by ID ────────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -72,6 +72,7 @@ export type CreateDocumentWizardInput = z.infer<typeof createDocumentWizardSchem
|
||||
|
||||
export const documentsHubTabs = [
|
||||
'all',
|
||||
'in_progress',
|
||||
'eoi_queue',
|
||||
'awaiting_them',
|
||||
'awaiting_me',
|
||||
|
||||
Reference in New Issue
Block a user