@baack-software/baack-ts-crm 0.0.7 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/leads.d.ts +25 -1
- package/dist/leads.d.ts.map +1 -1
- package/dist/leads.js +25 -0
- package/dist/leads.js.map +1 -1
- package/dist/pipeline.d.ts +25 -4
- package/dist/pipeline.d.ts.map +1 -1
- package/dist/pipeline.js +43 -4
- package/dist/pipeline.js.map +1 -1
- package/dist/react/DashboardCards.d.ts +14 -1
- package/dist/react/DashboardCards.d.ts.map +1 -1
- package/dist/react/DashboardCards.js +15 -3
- package/dist/react/DashboardCards.js.map +1 -1
- package/dist/react/Details.d.ts +3 -1
- package/dist/react/Details.d.ts.map +1 -1
- package/dist/react/Details.js +13 -5
- package/dist/react/Details.js.map +1 -1
- package/dist/react/LeadsTable.d.ts +6 -3
- package/dist/react/LeadsTable.d.ts.map +1 -1
- package/dist/react/LeadsTable.js +39 -7
- package/dist/react/LeadsTable.js.map +1 -1
- package/dist/react/format.d.ts +6 -0
- package/dist/react/format.d.ts.map +1 -1
- package/dist/react/format.js +9 -0
- package/dist/react/format.js.map +1 -1
- package/dist/react/text.d.ts +19 -0
- package/dist/react/text.d.ts.map +1 -1
- package/dist/react/text.js +19 -0
- package/dist/react/text.js.map +1 -1
- package/dist/react/views.d.ts +13 -4
- package/dist/react/views.d.ts.map +1 -1
- package/dist/react/views.js +42 -11
- package/dist/react/views.js.map +1 -1
- package/dist/store.d.ts +2 -0
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +6 -1
- package/dist/store.js.map +1 -1
- package/package.json +1 -1
- package/src/leads.ts +48 -1
- package/src/pipeline.ts +53 -6
- package/src/react/DashboardCards.tsx +65 -4
- package/src/react/Details.tsx +51 -1
- package/src/react/LeadsTable.tsx +42 -6
- package/src/react/format.ts +11 -0
- package/src/react/text.ts +20 -0
- package/src/react/views.tsx +96 -7
- package/src/store.ts +7 -1
|
@@ -6,16 +6,19 @@ export declare const leadCompany: (lead: Lead, names?: CrmNames) => string;
|
|
|
6
6
|
/** Leads as CSV, one row each, for a spreadsheet. */
|
|
7
7
|
export declare function leadsCsv(leads: readonly Lead[], names?: CrmNames): string;
|
|
8
8
|
/**
|
|
9
|
-
* Leads,
|
|
10
|
-
* `onOpen` makes each lead's title a button.
|
|
9
|
+
* Leads, in the order to work them (byLeadPriority), filtered by words, status and source, a page at a time, with an export of the rows filtered.
|
|
10
|
+
* `onOpen` makes each lead's title a button. With `fill`, a page is as many leads as fit the window's height, and
|
|
11
|
+
* never fewer than `pageSize`.
|
|
11
12
|
*/
|
|
12
|
-
export declare function LeadsTable({ leads, names, onOpen, selected, pageSize, sample, text, }: {
|
|
13
|
+
export declare function LeadsTable({ leads, names, onOpen, selected, pageSize: minimumPageSize, fill, sample, text, }: {
|
|
13
14
|
leads: readonly Lead[];
|
|
14
15
|
names?: CrmNames | undefined;
|
|
15
16
|
onOpen?: ((lead: Lead) => void) | undefined;
|
|
16
17
|
/** The open lead, highlighted. */
|
|
17
18
|
selected?: string | undefined;
|
|
18
19
|
pageSize?: number;
|
|
20
|
+
/** Show as many leads as fit the window's height, for a page that is mostly this table. */
|
|
21
|
+
fill?: boolean | undefined;
|
|
19
22
|
sample?: boolean | undefined;
|
|
20
23
|
text?: Partial<CrmText> | undefined;
|
|
21
24
|
}): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LeadsTable.d.ts","sourceRoot":"","sources":["../../src/react/LeadsTable.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LeadsTable.d.ts","sourceRoot":"","sources":["../../src/react/LeadsTable.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,IAAI,EAAc,MAAM,aAAa,CAAC;AACpD,OAAO,EAA6D,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGvG,OAAO,EAAY,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AAQnD,uEAAuE;AACvE,eAAO,MAAM,WAAW,GAAI,MAAM,IAAI,EAAE,QAAQ,QAAQ,WAAyD,CAAC;AAElH,qDAAqD;AACrD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,EAAE,KAAK,CAAC,EAAE,QAAQ,GAAG,MAAM,CAezE;AAwCD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,KAAK,EACL,MAAM,EACN,QAAQ,EACR,QAAQ,EAAE,eAAoB,EAC9B,IAAY,EACZ,MAAM,EACN,IAAI,GACL,EAAE;IACD,KAAK,EAAE,SAAS,IAAI,EAAE,CAAC;IACvB,KAAK,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC7B,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAC5C,kCAAkC;IAClC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2FAA2F;IAC3F,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC3B,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B,IAAI,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,SAAS,CAAC;CACrC,+BA8JA"}
|
package/dist/react/LeadsTable.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Download, Search } from 'lucide-react';
|
|
3
|
-
import { useMemo, useState } from 'react';
|
|
3
|
+
import { useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
4
4
|
import { toDecimal } from "../money.js";
|
|
5
|
-
import { LEAD_OUTCOME_LABELS, LEAD_SOURCES, LEAD_STATES, LEAD_STATE_LABELS, LEAD_STATUS_LABELS, SOURCE_LABELS, leadOutcome, leadState, } from "../leads.js";
|
|
5
|
+
import { LEAD_OUTCOME_LABELS, LEAD_SOURCES, LEAD_STATES, LEAD_STATE_LABELS, LEAD_STATUS_LABELS, SOURCE_LABELS, byLeadPriority, leadOutcome, leadState, } from "../leads.js";
|
|
6
6
|
import { companyNameOf, formatDate, formatMaybeMoney, personNameOf } from "./format.js";
|
|
7
7
|
import { CrmCard, LeadStatusBadge } from "./parts.js";
|
|
8
8
|
import { recordItemId } from "./SidePanel.js";
|
|
@@ -39,16 +39,47 @@ function download(name, csv) {
|
|
|
39
39
|
link.click();
|
|
40
40
|
URL.revokeObjectURL(url);
|
|
41
41
|
}
|
|
42
|
+
/** Space kept below the rows for the paging line and the card's padding, in pixels. */
|
|
43
|
+
const ROOM_BELOW = 96;
|
|
42
44
|
/**
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
+
* How many rows fit between the table's top and the bottom of the window, never fewer than `minimum`: the rows on
|
|
46
|
+
* screen are measured for their height, and it's measured again when the window is resized. Without `fill`, or before
|
|
47
|
+
* there are rows to measure, it's `minimum`.
|
|
45
48
|
*/
|
|
46
|
-
|
|
49
|
+
function useRowsThatFit(table, minimum, fill, rows) {
|
|
50
|
+
const [fit, setFit] = useState(minimum);
|
|
51
|
+
useLayoutEffect(() => {
|
|
52
|
+
if (!fill)
|
|
53
|
+
return;
|
|
54
|
+
const measure = () => {
|
|
55
|
+
const element = table.current;
|
|
56
|
+
const shown = Array.from(element?.tBodies[0]?.rows ?? []);
|
|
57
|
+
const height = shown.reduce((sum, row) => sum + row.getBoundingClientRect().height, 0) / (shown.length || 1);
|
|
58
|
+
if (!element || !height)
|
|
59
|
+
return;
|
|
60
|
+
// From where the table starts on the page, whatever is scrolled, to the bottom of the window.
|
|
61
|
+
const head = element.tHead?.getBoundingClientRect().height ?? 0;
|
|
62
|
+
const top = element.getBoundingClientRect().top + window.scrollY + head;
|
|
63
|
+
setFit(Math.max(minimum, Math.floor((window.innerHeight - top - ROOM_BELOW) / height)));
|
|
64
|
+
};
|
|
65
|
+
measure();
|
|
66
|
+
window.addEventListener('resize', measure);
|
|
67
|
+
return () => window.removeEventListener('resize', measure);
|
|
68
|
+
}, [table, minimum, fill, rows]);
|
|
69
|
+
return fill ? fit : minimum;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Leads, in the order to work them (byLeadPriority), filtered by words, status and source, a page at a time, with an export of the rows filtered.
|
|
73
|
+
* `onOpen` makes each lead's title a button. With `fill`, a page is as many leads as fit the window's height, and
|
|
74
|
+
* never fewer than `pageSize`.
|
|
75
|
+
*/
|
|
76
|
+
export function LeadsTable({ leads, names, onOpen, selected, pageSize: minimumPageSize = 10, fill = false, sample, text, }) {
|
|
47
77
|
const words = withText(text);
|
|
48
78
|
const [query, setQuery] = useState('');
|
|
49
79
|
const [status, setStatus] = useState(ALL);
|
|
50
80
|
const [source, setSource] = useState(ALL);
|
|
51
81
|
const [page, setPage] = useState(0);
|
|
82
|
+
const table = useRef(null);
|
|
52
83
|
const filtered = useMemo(() => {
|
|
53
84
|
const needle = query.trim().toLowerCase();
|
|
54
85
|
return leads
|
|
@@ -59,8 +90,9 @@ export function LeadsTable({ leads, names, onOpen, selected, pageSize = 10, samp
|
|
|
59
90
|
.join(' ')
|
|
60
91
|
.toLowerCase()
|
|
61
92
|
.includes(needle))
|
|
62
|
-
.toSorted(
|
|
93
|
+
.toSorted(byLeadPriority);
|
|
63
94
|
}, [leads, names, query, status, source]);
|
|
95
|
+
const pageSize = useRowsThatFit(table, minimumPageSize, fill, Math.min(filtered.length, minimumPageSize));
|
|
64
96
|
const pages = Math.max(1, Math.ceil(filtered.length / pageSize));
|
|
65
97
|
const current = Math.min(page, pages - 1);
|
|
66
98
|
const shown = filtered.slice(current * pageSize, (current + 1) * pageSize);
|
|
@@ -69,7 +101,7 @@ export function LeadsTable({ leads, names, onOpen, selected, pageSize = 10, samp
|
|
|
69
101
|
apply();
|
|
70
102
|
setPage(0);
|
|
71
103
|
};
|
|
72
|
-
return (_jsxs(CrmCard, { title: words.leads, sample: sample, text: text, action: _jsxs(Button, { variant: "outline", size: "sm", onClick: () => download('leads.csv', leadsCsv(filtered, names)), children: [_jsx(Download, { "aria-hidden": "true" }), words.export] }), children: [_jsxs("div", { className: "mb-3 flex flex-wrap items-center gap-2", children: [_jsxs("div", { className: "relative min-w-48 flex-1", children: [_jsx(Search, { "aria-hidden": "true", className: "text-muted-foreground absolute top-1/2 left-2.5 size-4 -translate-y-1/2" }), _jsx(Input, { type: "search", "aria-label": words.filterLeads, placeholder: words.filterLeads, value: query, onChange: (event) => filter(() => setQuery(event.target.value)), className: "pl-8" })] }), _jsxs(Select, { value: status, onValueChange: (value) => filter(() => setStatus(value)), children: [_jsx(SelectTrigger, { "aria-label": words.status, className: "w-40", children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: ALL, children: words.allStatuses }), LEAD_STATES.map((value) => (_jsx(SelectItem, { value: value, children: LEAD_STATE_LABELS[value] }, value)))] })] }), _jsxs(Select, { value: source, onValueChange: (value) => filter(() => setSource(value)), children: [_jsx(SelectTrigger, { "aria-label": words.source, className: "w-36", children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: ALL, children: words.allSources }), LEAD_SOURCES.map((value) => (_jsx(SelectItem, { value: value, children: SOURCE_LABELS[value] }, value)))] })] })] }), _jsxs(Table, { children: [_jsx("caption", { className: "sr-only", children: words.leads }), _jsx(TableHeader, { children: _jsxs(TableRow, { children: [_jsx(TableHead, { children: words.lead }), _jsx(TableHead, { children: words.company }), _jsx(TableHead, { children: words.source }), _jsx(TableHead, { children: words.status }), _jsx(TableHead, { className: "text-right", children: words.value }), _jsx(TableHead, { children: words.date })] }) }), _jsx(TableBody, { children: shown.length === 0 ? (_jsx(TableRow, { children: _jsx(TableCell, { colSpan: 6, className: "text-muted-foreground py-6 text-center", children: words.noLeads }) })) : (shown.map((lead) => {
|
|
104
|
+
return (_jsxs(CrmCard, { title: words.leads, sample: sample, text: text, action: _jsxs(Button, { variant: "outline", size: "sm", onClick: () => download('leads.csv', leadsCsv(filtered, names)), children: [_jsx(Download, { "aria-hidden": "true" }), words.export] }), children: [_jsxs("div", { className: "mb-3 flex flex-wrap items-center gap-2", children: [_jsxs("div", { className: "relative min-w-48 flex-1", children: [_jsx(Search, { "aria-hidden": "true", className: "text-muted-foreground absolute top-1/2 left-2.5 size-4 -translate-y-1/2" }), _jsx(Input, { type: "search", "aria-label": words.filterLeads, placeholder: words.filterLeads, value: query, onChange: (event) => filter(() => setQuery(event.target.value)), className: "pl-8" })] }), _jsxs(Select, { value: status, onValueChange: (value) => filter(() => setStatus(value)), children: [_jsx(SelectTrigger, { "aria-label": words.status, className: "w-40", children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: ALL, children: words.allStatuses }), LEAD_STATES.map((value) => (_jsx(SelectItem, { value: value, children: LEAD_STATE_LABELS[value] }, value)))] })] }), _jsxs(Select, { value: source, onValueChange: (value) => filter(() => setSource(value)), children: [_jsx(SelectTrigger, { "aria-label": words.source, className: "w-36", children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: ALL, children: words.allSources }), LEAD_SOURCES.map((value) => (_jsx(SelectItem, { value: value, children: SOURCE_LABELS[value] }, value)))] })] })] }), _jsxs(Table, { ref: table, children: [_jsx("caption", { className: "sr-only", children: words.leads }), _jsx(TableHeader, { children: _jsxs(TableRow, { children: [_jsx(TableHead, { children: words.lead }), _jsx(TableHead, { children: words.company }), _jsx(TableHead, { children: words.source }), _jsx(TableHead, { children: words.status }), _jsx(TableHead, { className: "text-right", children: words.value }), _jsx(TableHead, { children: words.date })] }) }), _jsx(TableBody, { children: shown.length === 0 ? (_jsx(TableRow, { children: _jsx(TableCell, { colSpan: 6, className: "text-muted-foreground py-6 text-center", children: words.noLeads }) })) : (shown.map((lead) => {
|
|
73
105
|
const contact = personNameOf(names, lead.contactIdentity?.urn);
|
|
74
106
|
return (_jsxs(TableRow, { "data-state": selected === lead.urn ? 'selected' : undefined, children: [_jsxs(TableCell, { className: "max-w-72 whitespace-normal", children: [onOpen ? (_jsx("button", { type: "button", id: recordItemId(lead.urn), "aria-current": selected === lead.urn ? 'true' : undefined, className: "text-left font-medium hover:underline", onClick: () => onOpen(lead), children: lead.title })) : (_jsx("span", { className: "font-medium", children: lead.title })), contact && _jsx("span", { className: "text-muted-foreground block text-xs", children: contact })] }), _jsx(TableCell, { children: leadCompany(lead, names) || '-' }), _jsx(TableCell, { children: SOURCE_LABELS[lead.source] }), _jsx(TableCell, { children: _jsx(LeadStatusBadge, { lead: lead }) }), _jsx(TableCell, { className: "text-right tabular-nums", children: formatMaybeMoney(lead.targetValue) }), _jsx(TableCell, { children: formatDate(lead.createdTimestamp) })] }, lead.urn));
|
|
75
107
|
})) })] }), _jsxs("div", { className: "mt-3 flex items-center justify-between gap-2 text-sm", children: [_jsx("p", { className: "text-muted-foreground", "aria-live": "polite", children: filtered.length === 0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LeadsTable.js","sourceRoot":"","sources":["../../src/react/LeadsTable.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"LeadsTable.js","sourceRoot":"","sources":["../../src/react/LeadsTable.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AACnF,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EACL,mBAAmB,EACnB,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,WAAW,EACX,SAAS,GAEV,MAAM,aAAa,CA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AAW,QAAQ,YACpD,QAAQ,CAAC,MAAM,KAAK,CAAC;4BACpB,CAAC,CAAC,KAAK,KAAK,CAAC,KAAK,CAAC,WAAW,EAAE,EAAE;4BAClC,CAAC,CAAC,GAAG,KAAK,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC,EAAE,IAAI,QAAQ,CAAC,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,WAAW,EAAE,EAAE,GACtG,EACJ,eAAK,SAAS,EAAC,YAAY,aACzB,KAAC,MAAM,IAAC,OAAO,EAAC,SAAS,EAAC,IAAI,EAAC,IAAI,EAAC,QAAQ,EAAE,OAAO,KAAK,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,GAAG,CAAC,CAAC,YAC7F,KAAK,CAAC,QAAQ,GACR,EACT,KAAC,MAAM,IAAC,OAAO,EAAC,SAAS,EAAC,IAAI,EAAC,IAAI,EAAC,QAAQ,EAAE,OAAO,IAAI,KAAK,GAAG,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,GAAG,CAAC,CAAC,YACpG,KAAK,CAAC,IAAI,GACJ,IACL,IACF,IACE,CACX,CAAC;AACJ,CAAC"}
|
package/dist/react/format.d.ts
CHANGED
|
@@ -18,6 +18,12 @@ export declare function formatTotals(totals: MoneyTotals, fallbackCurrency?: str
|
|
|
18
18
|
/** Money, or a dash when there's none. */
|
|
19
19
|
export declare const formatMaybeMoney: (money: Money | null | undefined, locale?: string) => string;
|
|
20
20
|
/** A short date such as "24 Oct 2026", or a dash. */
|
|
21
|
+
/** A length of time in whole days, such as "12 days", for averages in a table; "-" when unknown. */
|
|
22
|
+
export declare function formatDays(milliseconds: number | undefined, words: {
|
|
23
|
+
day: string;
|
|
24
|
+
days: string;
|
|
25
|
+
underADay: string;
|
|
26
|
+
}): string;
|
|
21
27
|
export declare function formatDate(timestamp: string | null | undefined, locale?: string): string;
|
|
22
28
|
/** A fraction as a percentage: 0.104 is "10.4%". */
|
|
23
29
|
export declare const formatPercent: (fraction: number, locale?: string) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/react/format.ts"],"names":[],"mappings":"AACA,OAAO,EAA8B,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAC3E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEzC;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACvB,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IAC9C,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;CAC9C;AAED,eAAO,MAAM,aAAa,GAAI,OAAO,QAAQ,GAAG,SAAS,EAAE,KAAK,MAAM,GAAG,SAAS,uBACzC,CAAC;AAE1C,eAAO,MAAM,YAAY,GAAI,OAAO,QAAQ,GAAG,SAAS,EAAE,KAAK,MAAM,GAAG,SAAS,uBACzC,CAAC;AAEzC;;;GAGG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,WAAW,EAAE,gBAAgB,SAAQ,EAAE,MAAM,SAAU,GAAG,MAAM,CAIpG;AAED,0CAA0C;AAC1C,eAAO,MAAM,gBAAgB,GAAI,OAAO,KAAK,GAAG,IAAI,GAAG,SAAS,EAAE,eAAgB,WACxC,CAAC;AAE3C,qDAAqD;AACrD,wBAAgB,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,MAAM,SAAU,GAAG,MAAM,CAKzF;AAED,oDAAoD;AACpD,eAAO,MAAM,aAAa,GAAI,UAAU,MAAM,EAAE,eAAgB,WACgC,CAAC;AAEjG,mDAAmD;AACnD,eAAO,MAAM,YAAY,GAAI,UAAU,MAAM,EAAE,eAAgB,WAG5D,CAAC;AAEJ,kEAAkE;AAClE,eA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AU,MAAM,EAAE,eAAgB,WACgC,CAAC;AAEjG,mDAAmD;AACnD,eAAO,MAAM,YAAY,GAAI,UAAU,MAAM,EAAE,eAAgB,WAG5D,CAAC;AAEJ,kEAAkE;AAClE,eAAO,MAAM,SAAS,GAAI,OAAO,MAAM,WAAwE,CAAC"}
|
package/dist/react/format.js
CHANGED
|
@@ -15,6 +15,15 @@ export function formatTotals(totals, fallbackCurrency = 'GBP', locale = 'en-GB')
|
|
|
15
15
|
/** Money, or a dash when there's none. */
|
|
16
16
|
export const formatMaybeMoney = (money, locale = 'en-GB') => money ? formatMoney(money, locale) : '-';
|
|
17
17
|
/** A short date such as "24 Oct 2026", or a dash. */
|
|
18
|
+
/** A length of time in whole days, such as "12 days", for averages in a table; "-" when unknown. */
|
|
19
|
+
export function formatDays(milliseconds, words) {
|
|
20
|
+
if (milliseconds === undefined)
|
|
21
|
+
return '-';
|
|
22
|
+
const days = Math.round(milliseconds / 86_400_000);
|
|
23
|
+
if (days < 1)
|
|
24
|
+
return words.underADay;
|
|
25
|
+
return `${days} ${days === 1 ? words.day : words.days}`;
|
|
26
|
+
}
|
|
18
27
|
export function formatDate(timestamp, locale = 'en-GB') {
|
|
19
28
|
const date = parseTimestamp(timestamp);
|
|
20
29
|
return date
|
package/dist/react/format.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../src/react/format.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAoB,MAAM,aAAa,CAAC;AAY3E,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAA2B,EAAE,GAAuB,EAAE,EAAE,CACpF,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAE1C,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,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CAAC,MAAM,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;QACvG,CAAC,CAAC,GAAG,CAAC;AACV,CAAC;AAED,oDAAoD;AACpD,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,QAAgB,EAAE,MAAM,GAAG,OAAO,EAAE,EAAE,CAClE,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,qBAAqB,EAAE,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AAEjG,mDAAmD;AACnD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,QAAgB,EAAE,MAAM,GAAG,OAAO,EAAE,EAAE,CACjE,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,qBAAqB,EAAE,CAAC,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC,CAAC,MAAM,CAC7G,QAAQ,CACT,CAAC;AAEJ,kEAAkE;AAClE,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC"}
|
package/dist/react/text.d.ts
CHANGED
|
@@ -34,6 +34,17 @@ export declare const CRM_TEXT: {
|
|
|
34
34
|
readonly week: "Week";
|
|
35
35
|
readonly weekOf: "Week of";
|
|
36
36
|
readonly pipeline: "Sales pipeline";
|
|
37
|
+
readonly leadsPipeline: "Leads pipeline";
|
|
38
|
+
readonly leadsPipelineHint: "Every lead by status: new, contacted and qualified ones still need action.";
|
|
39
|
+
readonly waitingSince: "Oldest waiting";
|
|
40
|
+
readonly toNextStage: "To next stage";
|
|
41
|
+
readonly dropOff: "Drop-off";
|
|
42
|
+
readonly averageTime: "Average time";
|
|
43
|
+
readonly pipelineHint: "Conversion assumes a deal passed every stage before its own. Average time runs from creation to now, or to close.";
|
|
44
|
+
readonly leadsPipelineAgeHint: "Average time runs from creation to now, to conversion, or to closing.";
|
|
45
|
+
readonly day: "day";
|
|
46
|
+
readonly days: "days";
|
|
47
|
+
readonly underADay: "Under a day";
|
|
37
48
|
readonly stage: "Stage";
|
|
38
49
|
readonly workflow: "Workflow";
|
|
39
50
|
readonly deals: "Deals";
|
|
@@ -80,6 +91,13 @@ export declare const CRM_TEXT: {
|
|
|
80
91
|
readonly convertedTo: "Converted to";
|
|
81
92
|
readonly created: "Created";
|
|
82
93
|
readonly noDeals: "No deals here.";
|
|
94
|
+
readonly noDealsYet: "No deals yet. Deals start here, or from a lead you convert.";
|
|
95
|
+
readonly noPipeline: "Deals move through the stages of a sales workflow, and this company has none yet.";
|
|
96
|
+
readonly createPipeline: "Create a sales workflow";
|
|
97
|
+
readonly createPipelineHint: "Makes a workflow called Sales with the stages Lead, Qualified, Proposal, Negotiation and Closed. You can rename it and change its stages in Workflows.";
|
|
98
|
+
readonly creatingPipeline: "Creating...";
|
|
99
|
+
readonly createPipelineFailed: "The workflow couldn't be created. Try again, or create one in Workflows.";
|
|
100
|
+
readonly noPipelineAsk: "Ask an administrator to create a sales workflow in Workflows, then add deals here.";
|
|
83
101
|
readonly account: "Account";
|
|
84
102
|
readonly openValue: "Open deals";
|
|
85
103
|
readonly wonValue: "Won";
|
|
@@ -129,6 +147,7 @@ export declare const CRM_TEXT: {
|
|
|
129
147
|
readonly newCompany: "New company";
|
|
130
148
|
readonly newCompanyHint: "Makes the client company, owned by yours, when the lead is saved.";
|
|
131
149
|
readonly addCompany: "Add a new company";
|
|
150
|
+
readonly openCompany: "Open company";
|
|
132
151
|
readonly companyNameRequired: "Enter the company name.";
|
|
133
152
|
readonly noContact: "No contact";
|
|
134
153
|
readonly newContact: "New contact";
|
package/dist/react/text.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../src/react/text.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,QAAQ
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../src/react/text.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6PX,CAAC;AAEX,MAAM,MAAM,OAAO,GAAG;IAAE,QAAQ,EAAE,CAAC,IAAI,MAAM,OAAO,QAAQ,GAAG,MAAM;CAAE,CAAC;AAExE,oDAAoD;AACpD,eAAO,MAAM,QAAQ,GAAI,OAAO,OAAO,CAAC,OAAO,CAAC,KAAG,OAAuD,CAAC"}
|
package/dist/react/text.js
CHANGED
|
@@ -34,6 +34,17 @@ export const CRM_TEXT = {
|
|
|
34
34
|
week: 'Week',
|
|
35
35
|
weekOf: 'Week of',
|
|
36
36
|
pipeline: 'Sales pipeline',
|
|
37
|
+
leadsPipeline: 'Leads pipeline',
|
|
38
|
+
leadsPipelineHint: 'Every lead by status: new, contacted and qualified ones still need action.',
|
|
39
|
+
waitingSince: 'Oldest waiting',
|
|
40
|
+
toNextStage: 'To next stage',
|
|
41
|
+
dropOff: 'Drop-off',
|
|
42
|
+
averageTime: 'Average time',
|
|
43
|
+
pipelineHint: 'Conversion assumes a deal passed every stage before its own. Average time runs from creation to now, or to close.',
|
|
44
|
+
leadsPipelineAgeHint: 'Average time runs from creation to now, to conversion, or to closing.',
|
|
45
|
+
day: 'day',
|
|
46
|
+
days: 'days',
|
|
47
|
+
underADay: 'Under a day',
|
|
37
48
|
stage: 'Stage',
|
|
38
49
|
workflow: 'Workflow',
|
|
39
50
|
deals: 'Deals',
|
|
@@ -80,6 +91,13 @@ export const CRM_TEXT = {
|
|
|
80
91
|
convertedTo: 'Converted to',
|
|
81
92
|
created: 'Created',
|
|
82
93
|
noDeals: 'No deals here.',
|
|
94
|
+
noDealsYet: 'No deals yet. Deals start here, or from a lead you convert.',
|
|
95
|
+
noPipeline: 'Deals move through the stages of a sales workflow, and this company has none yet.',
|
|
96
|
+
createPipeline: 'Create a sales workflow',
|
|
97
|
+
createPipelineHint: 'Makes a workflow called Sales with the stages Lead, Qualified, Proposal, Negotiation and Closed. You can rename it and change its stages in Workflows.',
|
|
98
|
+
creatingPipeline: 'Creating...',
|
|
99
|
+
createPipelineFailed: "The workflow couldn't be created. Try again, or create one in Workflows.",
|
|
100
|
+
noPipelineAsk: 'Ask an administrator to create a sales workflow in Workflows, then add deals here.',
|
|
83
101
|
account: 'Account',
|
|
84
102
|
openValue: 'Open deals',
|
|
85
103
|
wonValue: 'Won',
|
|
@@ -129,6 +147,7 @@ export const CRM_TEXT = {
|
|
|
129
147
|
newCompany: 'New company',
|
|
130
148
|
newCompanyHint: 'Makes the client company, owned by yours, when the lead is saved.',
|
|
131
149
|
addCompany: 'Add a new company',
|
|
150
|
+
openCompany: 'Open company',
|
|
132
151
|
companyNameRequired: 'Enter the company name.',
|
|
133
152
|
noContact: 'No contact',
|
|
134
153
|
newContact: 'New contact',
|
package/dist/react/text.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.js","sourceRoot":"","sources":["../../src/react/text.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,UAAU,EAAE,aAAa;IACzB,cAAc,EAAE,+EAA+E;IAC/F,W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AoC;IAChD,YAAY,EAAE,eAAe;IAC7B,aAAa,EAAE,gBAAgB;IAC/B,MAAM,EAAE,QAAQ;IAChB,YAAY,EAAE,cAAc;IAC5B,aAAa,EAAE,cAAc;IAC7B,UAAU,EAAE,WAAW;CACf,CAAC;AAIX,oDAAoD;AACpD,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,IAAuB,EAAW,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,QAAQ,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC"}
|
package/dist/react/views.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
import { type DateRange } from '../period.ts';
|
|
3
|
+
import { DEFAULT_SALES_PIPELINE } from '../pipeline.ts';
|
|
3
4
|
import { type CrmStore, type CrmStoreState } from '../store.ts';
|
|
4
5
|
import type { Deal, Invoice, Lead } from '../types.ts';
|
|
5
6
|
import type { CrmNames } from './format.ts';
|
|
@@ -20,18 +21,19 @@ interface ViewProps {
|
|
|
20
21
|
* The CRM dashboard for a period: `range`, else the one picked (the last 30 days to start with), with figures against
|
|
21
22
|
* the period before, then from realised revenue back up the funnel: revenue over time with what's overdue, the target
|
|
22
23
|
* with the new deals that make it up, the pipeline, leads by source and over time beside the host's tasks panel, and
|
|
23
|
-
* the leads
|
|
24
|
+
* the leads pipeline: every lead by status, with those still to action first. Cards in a row share its height.
|
|
24
25
|
*/
|
|
25
|
-
export declare function CrmDashboard({ store, names, text, range, ownCompanies, tasks,
|
|
26
|
+
export declare function CrmDashboard({ store, names, text, range, ownCompanies, tasks, }: ViewProps & {
|
|
26
27
|
range?: DateRange | undefined;
|
|
27
28
|
/** The companies the business counts as itself (the owner and its child companies), to leave its costs out. */
|
|
28
29
|
ownCompanies?: readonly string[] | undefined;
|
|
29
30
|
/** The host's tasks panel, such as baack-ts-tasks' TasksAbout. */
|
|
30
31
|
tasks?: ReactNode;
|
|
32
|
+
/** @deprecated The dashboard no longer lists leads (the leads pipeline replaced the table): not called. */
|
|
31
33
|
onOpenLead?: ((lead: Lead) => void) | undefined;
|
|
32
34
|
}): import("react").JSX.Element;
|
|
33
35
|
/** Leads in a table; the opened lead shows to the right, as tasks do, where it can be converted into a deal. */
|
|
34
|
-
export declare function CrmLeadsView({ store, names, text, companies, people, team, selected, onSelect, onConverted, }: ViewProps & {
|
|
36
|
+
export declare function CrmLeadsView({ store, names, text, companies, people, team, selected, onSelect, onConverted, onOpenCompany, }: ViewProps & {
|
|
35
37
|
/** People a lead's contact can be chosen from: the host's customers' people. */
|
|
36
38
|
people?: readonly CrmPersonChoice[] | undefined;
|
|
37
39
|
/** People a lead can be assigned to: the host's team. */
|
|
@@ -40,6 +42,8 @@ export declare function CrmLeadsView({ store, names, text, companies, people, te
|
|
|
40
42
|
onSelect?: ((lead: Lead | undefined) => void) | undefined;
|
|
41
43
|
/** After a lead becomes a deal, for example to open the deal. */
|
|
42
44
|
onConverted?: ((deal: Deal) => void) | undefined;
|
|
45
|
+
/** Opens a lead's company's own page in the host: the open lead's company is then a link. */
|
|
46
|
+
onOpenCompany?: ((company: string) => void) | undefined;
|
|
43
47
|
}): import("react").JSX.Element;
|
|
44
48
|
/**
|
|
45
49
|
* Deals as a board, one workflow at a time: the one this user last chose, else the one with the most deals (see
|
|
@@ -47,13 +51,18 @@ export declare function CrmLeadsView({ store, names, text, companies, people, te
|
|
|
47
51
|
* and the columns' order sit above it; the opened deal shows to the right, as tasks do, and the board moves to its
|
|
48
52
|
* workflow.
|
|
49
53
|
*/
|
|
50
|
-
export declare function CrmDealsView({ store, names, text, companies, people, team, selected, onSelect, }: ViewProps & {
|
|
54
|
+
export declare function CrmDealsView({ store, names, text, companies, people, team, selected, onSelect, onCreatePipeline, }: ViewProps & {
|
|
51
55
|
/** People a deal's contact can be chosen from: the host's customers' people. */
|
|
52
56
|
people?: readonly CrmPersonChoice[] | undefined;
|
|
53
57
|
/** People a deal can be assigned to: the host's team. */
|
|
54
58
|
team?: readonly CrmPersonChoice[] | undefined;
|
|
55
59
|
selected?: string | undefined;
|
|
56
60
|
onSelect?: ((deal: Deal | undefined) => void) | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* Creates the company's sales workflow (DEFAULT_SALES_PIPELINE), for a company with none, as the host makes
|
|
63
|
+
* workflows. The pipelines are read again after it. Without it, a company with no workflow is asked to make one.
|
|
64
|
+
*/
|
|
65
|
+
onCreatePipeline?: ((pipeline: typeof DEFAULT_SALES_PIPELINE) => Promise<unknown>) | undefined;
|
|
57
66
|
}): import("react").JSX.Element;
|
|
58
67
|
/**
|
|
59
68
|
* Sales for a period (`range`, else the one picked, the last 30 days to start with): invoiced, received, outstanding,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"views.d.ts","sourceRoot":"","sources":["../../src/react/views.tsx"],"names":[],"mappings":"AACA,OAAO,EAA6D,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGlG,OAAO,EAAe,KAAK,SAAS,EAAwB,MAAM,cAAc,CAAC;AAEjF,OAAO,EAA+C,KAAK,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAC7G,OAAO,KAAK,EAAc,IAAI,EAAe,OAAO,EAAE,IAAI,EAAiB,MAAM,aAAa,CAAC;AAM/F,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAU5C,OAAO,EAKL,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACrB,MAAM,aAAa,CAAC;AAIrB,OAAO,EAAY,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AAOnD,uDAAuD;AACvD,wBAAgB,WAAW,CAAC,KAAK,EAAE,QAAQ,GAAG,aAAa,CAE1D;AAED,+GAA+G;AAC/G,wBAAgB,WAAW,CAAC,KAAK,EAAE,QAAQ,GAAG,SAAS,EAAE,KAAK,EAAE,aAAa,GAAG,QAAQ,CAUvF;AAwED,UAAU,SA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SAAS,GAAG;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,UAAU,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAChD,UAAU,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;CACjD,+BAoBA"}
|
package/dist/react/views.js
CHANGED
|
@@ -4,10 +4,11 @@ import { useEffect, useId, useMemo, useState, useSyncExternalStore } from 'react
|
|
|
4
4
|
import { ref } from '@baack-software/baack-ts-tasks';
|
|
5
5
|
import { DEAL_ORDERS, filterDeals } from "../deal-order.js";
|
|
6
6
|
import { periodRange } from "../period.js";
|
|
7
|
-
import {
|
|
7
|
+
import { leadsByState } from "../leads.js";
|
|
8
|
+
import { DEFAULT_SALES_PIPELINE, pipelineOf } from "../pipeline.js";
|
|
8
9
|
import { selectAccount, selectDashboard, selectSales } from "../store.js";
|
|
9
10
|
import { LeadsBySourceCard, RevenueChart, TimelineCard } from "./Charts.js";
|
|
10
|
-
import { MetricCards, PipelineCard, TargetCard } from "./DashboardCards.js";
|
|
11
|
+
import { LeadsPipelineCard, MetricCards, PipelineCard, TargetCard } from "./DashboardCards.js";
|
|
11
12
|
import { DealFilters, DealsBoard } from "./DealsBoard.js";
|
|
12
13
|
import { DealDetail, LeadDetail } from "./Details.js";
|
|
13
14
|
import { CompanyAccountView } from "./CompanyAccountView.js";
|
|
@@ -16,7 +17,7 @@ import { InvoiceDetail, InvoicesTable, OutstandingByAgeCard, PaymentMethodsCard,
|
|
|
16
17
|
import { NewDealForm, NewInvoiceForm, NewLeadForm, } from "./Forms.js";
|
|
17
18
|
import { recallDeals, rememberDeals, usePipeline } from "./pipeline-choice.js";
|
|
18
19
|
import { SidePanelLayout, recordItemId } from "./SidePanel.js";
|
|
19
|
-
import { PeriodSelect, SampleDataNotice, periodText } from "./parts.js";
|
|
20
|
+
import { CrmCard, PeriodSelect, SampleDataNotice, periodText } from "./parts.js";
|
|
20
21
|
import { withText } from "./text.js";
|
|
21
22
|
import { Alert, AlertDescription, AlertTitle } from "./ui/alert.js";
|
|
22
23
|
import { Label } from "./ui/label.js";
|
|
@@ -75,6 +76,29 @@ function Problems({ state, concepts, text }) {
|
|
|
75
76
|
const currencyOf = (state) => state.invoices[0]?.currencyCode ??
|
|
76
77
|
[...state.deals, ...state.leads].find((record) => record.targetValue)?.targetValue?.currencyCode ??
|
|
77
78
|
'GBP';
|
|
79
|
+
/**
|
|
80
|
+
* The first step of a new deal for a company with no sales workflow: why it needs one, and a button to create the
|
|
81
|
+
* default one (`onCreate`), after which the panel goes on to the new deal's form. Without `onCreate`, who to ask.
|
|
82
|
+
*/
|
|
83
|
+
function NoPipelineStep({ onCreate, text, }) {
|
|
84
|
+
const words = withText(text);
|
|
85
|
+
const [pending, setPending] = useState(false);
|
|
86
|
+
const [failed, setFailed] = useState(false);
|
|
87
|
+
const create = async () => {
|
|
88
|
+
setPending(true);
|
|
89
|
+
setFailed(false);
|
|
90
|
+
try {
|
|
91
|
+
await onCreate?.();
|
|
92
|
+
}
|
|
93
|
+
catch {
|
|
94
|
+
setFailed(true);
|
|
95
|
+
}
|
|
96
|
+
finally {
|
|
97
|
+
setPending(false);
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
return (_jsxs("div", { className: "grid gap-3 text-sm", children: [_jsx("p", { children: words.noPipeline }), onCreate ? (_jsxs(_Fragment, { children: [_jsx("p", { className: "text-muted-foreground", children: words.createPipelineHint }), _jsx("div", { children: _jsx(Button, { onClick: () => void create(), disabled: pending, children: pending ? words.creatingPipeline : words.createPipeline }) }), failed && (_jsx("p", { role: "alert", className: "text-destructive", children: words.createPipelineFailed }))] })) : (_jsx("p", { className: "text-muted-foreground", children: words.noPipelineAsk }))] }));
|
|
101
|
+
}
|
|
78
102
|
/**
|
|
79
103
|
* "New ...": opens the form in the side panel, in place of a record. Its id is the panel's, so closing the form
|
|
80
104
|
* returns focus to it.
|
|
@@ -86,12 +110,13 @@ function NewButton({ panel, label, onClick }) {
|
|
|
86
110
|
* The CRM dashboard for a period: `range`, else the one picked (the last 30 days to start with), with figures against
|
|
87
111
|
* the period before, then from realised revenue back up the funnel: revenue over time with what's overdue, the target
|
|
88
112
|
* with the new deals that make it up, the pipeline, leads by source and over time beside the host's tasks panel, and
|
|
89
|
-
* the leads
|
|
113
|
+
* the leads pipeline: every lead by status, with those still to action first. Cards in a row share its height.
|
|
90
114
|
*/
|
|
91
|
-
export function CrmDashboard({ store, names, text, range, ownCompanies, tasks,
|
|
115
|
+
export function CrmDashboard({ store, names, text, range, ownCompanies, tasks, }) {
|
|
92
116
|
const state = useCrmStore(store);
|
|
93
117
|
names = useCrmNames(names, state);
|
|
94
118
|
const words = withText(text);
|
|
119
|
+
const leadStates = useMemo(() => leadsByState(state.leads, state.deals), [state.leads, state.deals]);
|
|
95
120
|
const [picked, setPicked] = useState('last30');
|
|
96
121
|
const period = useMemo(() => range ?? periodRange(picked), [range, picked]);
|
|
97
122
|
const ownKey = ownCompanies?.join(',');
|
|
@@ -103,10 +128,10 @@ export function CrmDashboard({ store, names, text, range, ownCompanies, tasks, o
|
|
|
103
128
|
const leadCharts = (_jsxs(_Fragment, { children: [_jsx(LeadsBySourceCard, { counts: dashboard.leadsBySource, text: text }), _jsx(TimelineCard, { title: words.leadsOverTime, description: words.leadsOverTimeHint, timeline: dashboard.leadsOverTime, countLabel: words.leads, color: "var(--chart-2)", fallbackCurrency: dashboard.revenue.currencyCode, text: text })] }));
|
|
104
129
|
return (_jsxs("div", { className: "grid gap-6", children: [_jsx(Sample, { store: store, concepts: concepts, text: text }), _jsx(Problems, { state: state, concepts: concepts, text: words }), !range && _jsx(PeriodSelect, { value: picked, onChange: setPicked, text: text }), _jsx(MetricCards, { dashboard: dashboard, text: range ? text : periodText(picked, text) }), _jsx(RevenueChart, { days: dashboard.revenueByDay, overdue: dashboard.overdueByDay, currencyCode: dashboard.revenue.currencyCode, text: text }), _jsxs("div", { className: "grid gap-6 lg:grid-cols-3", children: [_jsx(TargetCard, { target: dashboard.target, text: text }), _jsx(TimelineCard, { title: words.dealsOverTime, description: words.dealsOverTimeHint, timeline: dashboard.dealsOverTime, countLabel: words.deals, color: "var(--chart-3)", fallbackCurrency: dashboard.revenue.currencyCode, text: text, className: "lg:col-span-2" })] }), _jsx(PipelineCard, { stages: dashboard.pipeline, text: text }), tasks ? (
|
|
105
130
|
// The tasks panel keeps its own height, so a long list doesn't stretch the charts beside it.
|
|
106
|
-
_jsxs("div", { className: "grid items-start gap-6 lg:grid-cols-3", children: [_jsx("div", { className: "grid gap-6 lg:col-span-2 lg:grid-cols-2", children: leadCharts }), tasks] })) : (_jsx("div", { className: "grid gap-6 lg:grid-cols-2", children: leadCharts })), _jsx(
|
|
131
|
+
_jsxs("div", { className: "grid items-start gap-6 lg:grid-cols-3", children: [_jsx("div", { className: "grid gap-6 lg:col-span-2 lg:grid-cols-2", children: leadCharts }), tasks] })) : (_jsx("div", { className: "grid gap-6 lg:grid-cols-2", children: leadCharts })), _jsx(LeadsPipelineCard, { states: leadStates, text: text })] }));
|
|
107
132
|
}
|
|
108
133
|
/** Leads in a table; the opened lead shows to the right, as tasks do, where it can be converted into a deal. */
|
|
109
|
-
export function CrmLeadsView({ store, names, text, companies, people = [], team = [], selected, onSelect, onConverted, }) {
|
|
134
|
+
export function CrmLeadsView({ store, names, text, companies, people = [], team = [], selected, onSelect, onConverted, onOpenCompany, }) {
|
|
110
135
|
const state = useCrmStore(store);
|
|
111
136
|
names = useCrmNames(names, state);
|
|
112
137
|
const words = withText(text);
|
|
@@ -127,7 +152,7 @@ export function CrmLeadsView({ store, names, text, companies, people = [], team
|
|
|
127
152
|
};
|
|
128
153
|
if (state.status === 'idle' || state.status === 'loading')
|
|
129
154
|
return _jsx(Loading, { label: words.loading });
|
|
130
|
-
return (_jsxs("div", { className: "grid gap-6", children: [_jsx(Sample, { store: store, concepts: ['leads'], text: text }), _jsx(Problems, { state: state, concepts: ['leads'], text: words }), _jsx(NewButton, { panel: "new-lead", label: words.newLead, onClick: () => setCreating(true) }), _jsx(SidePanelLayout, { open: creating ? 'new-lead' : lead?.urn, title: creating ? words.newLead : (lead?.title ?? words.lead), onClose: () => select(undefined), text: text, panel: creating ? (_jsx(NewLeadForm, { owner: store.options.owner, companies: customers, people: contacts, team: team, currencyCode: currencyOf(state), text: text, onCreate: async (input, options) => select(await store.createLead(input, options)) })) : (lead && (_jsx(LeadDetail, { lead: lead, names: names, companies: customers, people: contacts, team: team, onChange: (changes, options) => store.updateLead(lead, changes, options), text: text, converting: state.saving.has(lead.urn), contactDetails: contactDetails, onSetOutcome: (closing, outcome, closedReason) => void store
|
|
155
|
+
return (_jsxs("div", { className: "grid gap-6", children: [_jsx(Sample, { store: store, concepts: ['leads'], text: text }), _jsx(Problems, { state: state, concepts: ['leads'], text: words }), _jsx(NewButton, { panel: "new-lead", label: words.newLead, onClick: () => setCreating(true) }), _jsx(SidePanelLayout, { open: creating ? 'new-lead' : lead?.urn, title: creating ? words.newLead : (lead?.title ?? words.lead), onClose: () => select(undefined), text: text, panel: creating ? (_jsx(NewLeadForm, { owner: store.options.owner, companies: customers, people: contacts, team: team, currencyCode: currencyOf(state), text: text, onCreate: async (input, options) => select(await store.createLead(input, options)) })) : (lead && (_jsx(LeadDetail, { lead: lead, names: names, companies: customers, people: contacts, team: team, onChange: (changes, options) => store.updateLead(lead, changes, options), text: text, converting: state.saving.has(lead.urn), contactDetails: contactDetails, onOpenCompany: onOpenCompany, onSetOutcome: (closing, outcome, closedReason) => void store
|
|
131
156
|
.setLeadOutcome(closing, outcome, closedReason === undefined ? {} : { closedReason })
|
|
132
157
|
.catch(() => undefined), onConvert: pipeline
|
|
133
158
|
? async (open, choice) => {
|
|
@@ -136,7 +161,7 @@ export function CrmLeadsView({ store, names, text, companies, people = [], team
|
|
|
136
161
|
if (result)
|
|
137
162
|
onConverted?.(result.deal);
|
|
138
163
|
}
|
|
139
|
-
: undefined }, lead.urn))), children: _jsx(LeadsTable, { leads: state.leads, names: names, onOpen: select, selected: lead?.urn, text: text }) })] }));
|
|
164
|
+
: undefined }, lead.urn))), children: _jsx(LeadsTable, { leads: state.leads, names: names, onOpen: select, selected: lead?.urn, text: text, fill: true }) })] }));
|
|
140
165
|
}
|
|
141
166
|
function recall(owner) {
|
|
142
167
|
const saved = recallDeals(owner).order;
|
|
@@ -148,7 +173,7 @@ function recall(owner) {
|
|
|
148
173
|
* and the columns' order sit above it; the opened deal shows to the right, as tasks do, and the board moves to its
|
|
149
174
|
* workflow.
|
|
150
175
|
*/
|
|
151
|
-
export function CrmDealsView({ store, names, text, companies, people = [], team = [], selected, onSelect, }) {
|
|
176
|
+
export function CrmDealsView({ store, names, text, companies, people = [], team = [], selected, onSelect, onCreatePipeline, }) {
|
|
152
177
|
const state = useCrmStore(store);
|
|
153
178
|
names = useCrmNames(names, state);
|
|
154
179
|
const words = withText(text);
|
|
@@ -190,7 +215,13 @@ export function CrmDealsView({ store, names, text, companies, people = [], team
|
|
|
190
215
|
const setOutcome = (closing, outcome, lostReason) => void store.setOutcome(closing, outcome, lostReason === undefined ? {} : { lostReason }).catch(() => undefined);
|
|
191
216
|
if (state.status === 'idle' || state.status === 'loading')
|
|
192
217
|
return _jsx(Loading, { label: words.loading });
|
|
193
|
-
return (_jsxs("div", { className: "grid gap-6", children: [_jsx(Sample, { store: store, concepts: ['deals', 'pipelines'], text: text }), _jsx(Problems, { state: state, concepts: ['deals', 'pipelines'], text: words }), pipeline && (
|
|
218
|
+
return (_jsxs("div", { className: "grid gap-6", children: [_jsx(Sample, { store: store, concepts: ['deals', 'pipelines'], text: text }), _jsx(Problems, { state: state, concepts: ['deals', 'pipelines'], text: words }), !pipeline && (
|
|
219
|
+
// No workflow yet: the same page as with one, empty, and "New deal" first makes the sales workflow.
|
|
220
|
+
_jsxs(_Fragment, { children: [_jsx(NewButton, { panel: "new-deal", label: words.newDeal, onClick: () => setCreating(true) }), _jsx(SidePanelLayout, { open: creating ? 'new-deal' : undefined, title: words.newDeal, onClose: () => setCreating(false), text: text, panel: _jsx(NoPipelineStep, { onCreate: onCreatePipeline &&
|
|
221
|
+
(async () => {
|
|
222
|
+
await onCreatePipeline(DEFAULT_SALES_PIPELINE);
|
|
223
|
+
await store.reloadPipelines();
|
|
224
|
+
}), text: text }), children: _jsx(CrmCard, { title: words.deals, text: text, children: _jsx("p", { className: "text-muted-foreground text-sm", children: words.noDealsYet }) }) })] })), pipeline && (_jsxs("div", { className: "flex flex-wrap items-end justify-between gap-3", children: [state.pipelines.length > 1 ? (_jsxs("div", { className: "grid gap-1.5", children: [_jsx(Label, { htmlFor: `${ids}-workflow`, children: words.workflow }), _jsxs(Select, { value: pipeline.urn, onValueChange: setShown, children: [_jsx(SelectTrigger, { id: `${ids}-workflow`, className: "w-56", children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: state.pipelines.map((option) => (_jsx(SelectItem, { value: option.urn, children: option.name }, option.urn))) })] })] })) : (_jsx("span", {})), _jsx(NewButton, { panel: "new-deal", label: words.newDeal, onClick: () => setCreating(true) })] })), pipeline && (_jsx(DealFilters, { value: filter, onChange: setFilter, order: order, onOrder: (next) => update({ order: next }), team: team, companies: customers, shown: visible.filter((shownDeal) => pipelineOf(shownDeal, [pipeline])).length, text: text })), pipeline && (_jsx(SidePanelLayout, { open: creating ? 'new-deal' : deal?.urn, title: creating ? words.newDeal : (deal?.title ?? words.deals), onClose: () => select(undefined), text: text, panel: creating ? (_jsx(NewDealForm
|
|
194
225
|
// The workflow shown on the board first, so a new deal lands where it's being looked at.
|
|
195
226
|
, {
|
|
196
227
|
// The workflow shown on the board first, so a new deal lands where it's being looked at.
|