@open-mercato/core 0.10.1-develop.7879.1.80d3740285 → 0.10.1-develop.7883.1.44ac2125f5
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/.turbo/turbo-build.log +1 -1
- package/dist/modules/attachments/lib/transferClient.js +72 -0
- package/dist/modules/attachments/lib/transferClient.js.map +7 -0
- package/dist/modules/attachments/lib/transferLimits.js +5 -0
- package/dist/modules/attachments/lib/transferLimits.js.map +7 -0
- package/dist/modules/catalog/backend/catalog/products/[productId]/variants/create/page.js +23 -26
- package/dist/modules/catalog/backend/catalog/products/[productId]/variants/create/page.js.map +2 -2
- package/dist/modules/catalog/backend/catalog/products/create/page.js +31 -23
- package/dist/modules/catalog/backend/catalog/products/create/page.js.map +2 -2
- package/dist/modules/catalog/components/products/mediaTransfer.js +27 -0
- package/dist/modules/catalog/components/products/mediaTransfer.js.map +7 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/Lane.js +5 -2
- package/dist/modules/customers/backend/customers/deals/pipeline/components/Lane.js.map +2 -2
- package/dist/modules/customers/backend/customers/deals/pipeline/page.js +2 -1
- package/dist/modules/customers/backend/customers/deals/pipeline/page.js.map +2 -2
- package/package.json +7 -7
- package/src/modules/attachments/lib/transferClient.ts +87 -0
- package/src/modules/attachments/lib/transferLimits.ts +1 -0
- package/src/modules/catalog/backend/catalog/products/[productId]/variants/create/page.tsx +23 -32
- package/src/modules/catalog/backend/catalog/products/create/page.tsx +31 -28
- package/src/modules/catalog/components/products/mediaTransfer.ts +40 -0
- package/src/modules/catalog/i18n/de.json +2 -0
- package/src/modules/catalog/i18n/en.json +2 -0
- package/src/modules/catalog/i18n/es.json +2 -0
- package/src/modules/catalog/i18n/ko.json +2 -0
- package/src/modules/catalog/i18n/pl.json +2 -0
- package/src/modules/customers/backend/customers/deals/pipeline/components/Lane.tsx +6 -2
- package/src/modules/customers/backend/customers/deals/pipeline/page.tsx +3 -2
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { transferAttachmentsInChunks } from "@open-mercato/core/modules/attachments/lib/transferClient";
|
|
2
|
+
async function transferDraftMedia({
|
|
3
|
+
entityId,
|
|
4
|
+
draftId,
|
|
5
|
+
recordId,
|
|
6
|
+
mediaItems
|
|
7
|
+
}) {
|
|
8
|
+
const attachmentIds = mediaItems.map((item) => item.id).filter((id) => typeof id === "string" && id.length > 0);
|
|
9
|
+
if (!draftId || !recordId || !attachmentIds.length) {
|
|
10
|
+
return { requestedCount: 0, failedCount: 0, errors: [] };
|
|
11
|
+
}
|
|
12
|
+
const result = await transferAttachmentsInChunks({
|
|
13
|
+
entityId,
|
|
14
|
+
attachmentIds,
|
|
15
|
+
fromRecordId: draftId,
|
|
16
|
+
toRecordId: recordId
|
|
17
|
+
});
|
|
18
|
+
return {
|
|
19
|
+
requestedCount: attachmentIds.length,
|
|
20
|
+
failedCount: result.failedIds.length + result.unconfirmedCount,
|
|
21
|
+
errors: result.errors
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
transferDraftMedia
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=mediaTransfer.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/modules/catalog/components/products/mediaTransfer.ts"],
|
|
4
|
+
"sourcesContent": ["import { transferAttachmentsInChunks } from '@open-mercato/core/modules/attachments/lib/transferClient'\nimport type { ProductMediaItem } from './ProductMediaManager'\n\nexport type DraftMediaTransferInput = {\n entityId: string\n draftId?: string | null\n recordId: string\n mediaItems: ProductMediaItem[]\n}\n\nexport type DraftMediaTransferResult = {\n requestedCount: number\n failedCount: number\n errors: string[]\n}\n\nexport async function transferDraftMedia({\n entityId,\n draftId,\n recordId,\n mediaItems,\n}: DraftMediaTransferInput): Promise<DraftMediaTransferResult> {\n const attachmentIds = mediaItems\n .map((item) => item.id)\n .filter((id): id is string => typeof id === 'string' && id.length > 0)\n if (!draftId || !recordId || !attachmentIds.length) {\n return { requestedCount: 0, failedCount: 0, errors: [] }\n }\n const result = await transferAttachmentsInChunks({\n entityId,\n attachmentIds,\n fromRecordId: draftId,\n toRecordId: recordId,\n })\n return {\n requestedCount: attachmentIds.length,\n failedCount: result.failedIds.length + result.unconfirmedCount,\n errors: result.errors,\n }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,mCAAmC;AAgB5C,eAAsB,mBAAmB;AAAA,EACvC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAA+D;AAC7D,QAAM,gBAAgB,WACnB,IAAI,CAAC,SAAS,KAAK,EAAE,EACrB,OAAO,CAAC,OAAqB,OAAO,OAAO,YAAY,GAAG,SAAS,CAAC;AACvE,MAAI,CAAC,WAAW,CAAC,YAAY,CAAC,cAAc,QAAQ;AAClD,WAAO,EAAE,gBAAgB,GAAG,aAAa,GAAG,QAAQ,CAAC,EAAE;AAAA,EACzD;AACA,QAAM,SAAS,MAAM,4BAA4B;AAAA,IAC/C;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd,YAAY;AAAA,EACd,CAAC;AACD,SAAO;AAAA,IACL,gBAAgB,cAAc;AAAA,IAC9B,aAAa,OAAO,UAAU,SAAS,OAAO;AAAA,IAC9C,QAAQ,OAAO;AAAA,EACjB;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -92,6 +92,7 @@ function LaneImpl({
|
|
|
92
92
|
stage,
|
|
93
93
|
deals,
|
|
94
94
|
aggregate,
|
|
95
|
+
paginationTotal,
|
|
95
96
|
selectedDealIds,
|
|
96
97
|
buildMenuItems,
|
|
97
98
|
activeDragDealId,
|
|
@@ -119,7 +120,8 @@ function LaneImpl({
|
|
|
119
120
|
const totalLabel = stats.primaryAmount > 0 && stats.primaryCurrency ? `${compactCurrency(stats.primaryAmount)} ${stats.primaryCurrency}` : null;
|
|
120
121
|
const visibleCount = deals.length;
|
|
121
122
|
const totalCount = stats.count;
|
|
122
|
-
const
|
|
123
|
+
const remainingCount = (paginationTotal ?? totalCount) - visibleCount;
|
|
124
|
+
const hasMoreDeals = remainingCount > 0;
|
|
123
125
|
const accentClass = getAccentClass(stage.tone);
|
|
124
126
|
const countBadgeClass = getCountBadgeClass(stage.tone);
|
|
125
127
|
const handleQuickAdd = React.useCallback(() => {
|
|
@@ -231,7 +233,7 @@ function LaneImpl({
|
|
|
231
233
|
t,
|
|
232
234
|
"customers.deals.kanban.lane.loadMore",
|
|
233
235
|
"Show more ({remaining})",
|
|
234
|
-
{ remaining:
|
|
236
|
+
{ remaining: remainingCount }
|
|
235
237
|
)
|
|
236
238
|
}
|
|
237
239
|
) : null
|
|
@@ -254,6 +256,7 @@ const Lane = React.memo(LaneImpl, (prev, next) => {
|
|
|
254
256
|
if (prev.stage !== next.stage) return false;
|
|
255
257
|
if (prev.deals !== next.deals) return false;
|
|
256
258
|
if (prev.aggregate !== next.aggregate) return false;
|
|
259
|
+
if (prev.paginationTotal !== next.paginationTotal) return false;
|
|
257
260
|
if (prev.selectedDealIds !== next.selectedDealIds) return false;
|
|
258
261
|
if (prev.buildMenuItems !== next.buildMenuItems) return false;
|
|
259
262
|
if (prev.activeDragDealId !== next.activeDragDealId) return false;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../../src/modules/customers/backend/customers/deals/pipeline/components/Lane.tsx"],
|
|
4
|
-
"sourcesContent": ["\"use client\"\n\nimport * as React from 'react'\nimport { useDroppable } from '@dnd-kit/core'\nimport { EmptyState } from '@open-mercato/ui/primitives/empty-state'\nimport type { RowActionItem } from '@open-mercato/ui/backend/RowActions'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport { translateWithFallback } from '@open-mercato/shared/lib/i18n/translate'\nimport type { FilterOptionTone } from '@open-mercato/shared/lib/query/advanced-filter'\nimport { toneToDotClass } from './toneClasses'\nimport { DealCard, type DealCardData } from './DealCard'\nimport { DashedTileButton } from './DashedTileButton'\nimport { LANE_WIDTH_PX } from './constants'\nimport { LaneCurrencyBreakdown } from './LaneCurrencyBreakdown'\nimport { LaneResizeHandle } from './LaneResizeHandle'\n\nexport type LaneStage = {\n id: string\n label: string\n tone: FilterOptionTone | null\n}\n\nexport type LaneAggregateProp = {\n count: number\n totalInBaseCurrency: number\n byCurrency: Array<{ currency: string; total: number; count: number }>\n baseCurrencyCode: string | null\n /** `true` when every currency in `byCurrency` was convertible to the base currency. */\n convertedAll: boolean\n /** Currencies present in `byCurrency` that lack an FX rate to base \u2014 excluded from totals. */\n missingRateCurrencies: string[]\n}\n\ntype LaneProps = {\n stage: LaneStage\n deals: DealCardData[]\n /** Server-side aggregate for accurate counts/totals across all deals in this stage, not just loaded ones */\n aggregate?: LaneAggregateProp | null\n selectedDealIds: Set<string>\n buildMenuItems: (deal: DealCardData) => RowActionItem[]\n activeDragDealId?: string | null\n isLoadingMore?: boolean\n /** Pixel width override (when the user has resized the column). Falls back to the default class. */\n width?: number | null\n onToggleSelect: (dealId: string) => void\n onComposeActivity: (dealId: string, type: 'call' | 'email' | 'note') => void\n onOpenDetail: (dealId: string) => void\n onQuickAddClick: (stageId: string) => void\n onLoadMore?: (stageId: string) => void\n /** Drag-resize callbacks. When provided, a vertical drag handle is rendered on the lane edge. */\n onResize?: (stageId: string, deltaPx: number) => void\n onResizeEnd?: (stageId: string) => void\n onResetWidth?: (stageId: string) => void\n}\n\n// 4px color bar tone \u2014 saturated icon tokens shared with the status filter pills\n// (toneClasses.ts) so the lane bar and the filter dots stay in lockstep (#5107 review).\nfunction getAccentClass(tone: FilterOptionTone | null): string {\n return toneToDotClass(tone, 'bg-border')\n}\n\n// Count pill bg uses very-light status background, text uses status text color\nconst COUNT_BADGE_TONE_CLASS: Record<FilterOptionTone, string> = {\n success: 'bg-status-success-bg text-status-success-text',\n error: 'bg-status-error-bg text-status-error-text',\n warning: 'bg-status-warning-bg text-status-warning-text',\n info: 'bg-status-info-bg text-status-info-text',\n neutral: 'bg-status-neutral-bg text-status-neutral-text',\n brand: 'bg-brand-violet/14 text-brand-violet',\n pink: 'bg-status-pink-bg text-status-pink-text',\n}\n\nfunction getCountBadgeClass(tone: FilterOptionTone | null): string {\n if (tone && tone in COUNT_BADGE_TONE_CLASS) return COUNT_BADGE_TONE_CLASS[tone]\n return 'bg-muted text-muted-foreground'\n}\n\nfunction compactCurrency(amount: number): string {\n if (amount >= 1_000_000) {\n const value = amount / 1_000_000\n return value >= 100 ? `${Math.round(value)}M` : `${value.toFixed(1).replace(/\\.0$/, '')}M`\n }\n if (amount >= 1_000) {\n const value = amount / 1_000\n return value >= 100 ? `${Math.round(value)}k` : `${value.toFixed(1).replace(/\\.0$/, '')}k`\n }\n return String(Math.round(amount))\n}\n\ntype CurrencyRow = { currency: string; total: number; count: number }\n\ntype LaneStats = {\n count: number\n /** Headline amount and the currency it is denominated in (largest single currency, raw, never converted). */\n primaryAmount: number\n primaryCurrency: string | null\n /** Per-currency rows sorted desc by total \u2014 the popover renders these one per line. */\n rows: CurrencyRow[]\n /** Sum of `rows` converted to base currency (zero when no base is configured / nothing converted). */\n totalInBaseCurrency: number\n baseCurrencyCode: string | null\n convertedAll: boolean\n missingRateCurrencies: string[]\n}\n\n/**\n * Build display stats.\n * - If a server aggregate is provided, prefer it (covers all deals, converts to tenant base currency).\n * - Otherwise fall back to summing loaded deals (used before aggregate query loads).\n *\n * The headline currency on the lane header is intentionally the LARGEST raw currency\n * (not the base-currency converted total) because the converted total can be misleading\n * when FX rates are missing \u2014 operators see a smaller number than the headline suggests.\n * The base-currency converted total is reserved for the breakdown popover footer, where\n * a partial-conversion indicator can disclose what's excluded.\n */\nfunction buildLaneStats(deals: DealCardData[], aggregate?: LaneAggregateProp | null): LaneStats {\n if (aggregate) {\n const rows = aggregate.byCurrency\n // Pick the single currency with the largest raw total to surface in the header. This\n // is always honest: the operator sees the actual largest cluster of value rather than\n // a synthetic base-currency total that may be partial.\n const headline = rows.length > 0 ? rows[0] : null\n return {\n count: aggregate.count,\n primaryAmount: headline ? headline.total : 0,\n primaryCurrency: headline ? headline.currency : null,\n rows,\n totalInBaseCurrency: aggregate.totalInBaseCurrency,\n baseCurrencyCode: aggregate.baseCurrencyCode,\n convertedAll: aggregate.convertedAll,\n missingRateCurrencies: aggregate.missingRateCurrencies,\n }\n }\n const totalsByCurrency = new Map<string, { total: number; count: number }>()\n for (const deal of deals) {\n if (typeof deal.valueAmount !== 'number' || !Number.isFinite(deal.valueAmount)) continue\n const code = deal.valueCurrency && deal.valueCurrency.length === 3\n ? deal.valueCurrency.toUpperCase()\n : 'USD'\n const entry = totalsByCurrency.get(code) ?? { total: 0, count: 0 }\n entry.total += deal.valueAmount\n entry.count += 1\n totalsByCurrency.set(code, entry)\n }\n const rows: CurrencyRow[] = Array.from(totalsByCurrency.entries())\n .map(([currency, value]) => ({ currency, total: value.total, count: value.count }))\n .sort((a, b) => b.total - a.total)\n if (rows.length === 0) {\n return {\n count: deals.length,\n primaryAmount: 0,\n primaryCurrency: null,\n rows,\n totalInBaseCurrency: 0,\n baseCurrencyCode: null,\n convertedAll: true,\n missingRateCurrencies: [],\n }\n }\n return {\n count: deals.length,\n primaryAmount: rows[0].total,\n primaryCurrency: rows[0].currency,\n rows,\n totalInBaseCurrency: 0,\n baseCurrencyCode: null,\n // We don't have rates client-side; mark as \"not converted\" only when there are\n // multiple currencies so the popover can show a \"configure FX rates\" hint.\n convertedAll: rows.length === 1,\n missingRateCurrencies: rows.length > 1 ? rows.slice(1).map((row) => row.currency) : [],\n }\n}\n\nfunction LaneImpl({\n stage,\n deals,\n aggregate,\n selectedDealIds,\n buildMenuItems,\n activeDragDealId,\n isLoadingMore = false,\n width,\n onToggleSelect,\n onComposeActivity,\n onOpenDetail,\n onQuickAddClick,\n onLoadMore,\n onResize,\n onResizeEnd,\n onResetWidth,\n}: LaneProps): React.ReactElement {\n const t = useT()\n const { setNodeRef, isOver } = useDroppable({\n id: `lane:${stage.id}`,\n data: { type: 'lane', stageId: stage.id },\n })\n const isDragActive = !!activeDragDealId\n const sourceLane = isDragActive && deals.some((deal) => deal.id === activeDragDealId)\n // Highlight drop zone when:\n // - the lane has the pointer over it during a drag, OR\n // - any drag is active and this lane is not the source (so all candidate targets are clearly tagged)\n const showDropHighlight = isOver || (isDragActive && !sourceLane)\n const stats = React.useMemo(() => buildLaneStats(deals, aggregate), [deals, aggregate])\n // Pull boolean out of the Set so each DealCard receives a stable primitive \u2014 that lets\n // React.memo on DealCard skip re-renders when the Set reference changes but its emptiness\n // does not. Flipping false\u2192true (first selection) or true\u2192false (last cleared) forces a\n // full pass over the lane's cards so their checkbox visibility updates atomically.\n const bulkSelectionActive = selectedDealIds.size > 0\n const totalLabel = stats.primaryAmount > 0 && stats.primaryCurrency\n ? `${compactCurrency(stats.primaryAmount)} ${stats.primaryCurrency}`\n : null\n const visibleCount = deals.length\n const totalCount = stats.count\n const hasMoreDeals = totalCount > visibleCount\n const accentClass = getAccentClass(stage.tone)\n const countBadgeClass = getCountBadgeClass(stage.tone)\n\n const handleQuickAdd = React.useCallback(() => {\n onQuickAddClick(stage.id)\n }, [onQuickAddClick, stage.id])\n\n return (\n <div\n className=\"relative flex flex-none flex-col gap-3\"\n style={{ width: typeof width === 'number' && Number.isFinite(width) ? `${width}px` : `${LANE_WIDTH_PX}px` }}\n >\n <div className=\"flex flex-col gap-2.5 overflow-clip rounded-lg bg-muted/40 px-4 py-3.5\">\n <div className={`h-1.5 w-full rounded-sm ${accentClass}`} aria-hidden=\"true\" />\n <div className=\"flex items-center justify-between gap-2\">\n <div className=\"flex min-w-0 items-center gap-2.5\">\n <span className=\"truncate text-sm font-bold uppercase leading-normal text-foreground\">\n {stage.label}\n </span>\n <span\n className={`inline-flex shrink-0 items-center rounded-full px-2 py-1 text-xs font-bold leading-normal ${countBadgeClass}`}\n title={\n hasMoreDeals\n ? translateWithFallback(\n t,\n 'customers.deals.kanban.lane.aria.partialCount',\n 'Showing {visible} of {total}',\n { visible: visibleCount, total: totalCount },\n )\n : undefined\n }\n >\n {totalCount}\n </span>\n </div>\n <div className=\"flex shrink-0 items-center gap-2\">\n {totalLabel ? (\n <span className=\"text-sm font-bold leading-normal text-foreground\">\n {totalLabel}\n </span>\n ) : null}\n {stats.rows.length > 1 ? (\n <LaneCurrencyBreakdown\n rows={stats.rows}\n baseCurrencyCode={stats.baseCurrencyCode}\n totalInBaseCurrency={stats.totalInBaseCurrency}\n convertedAll={stats.convertedAll}\n missingRateCurrencies={stats.missingRateCurrencies}\n triggerLabel={`+${stats.rows.length - 1}`}\n headingLabel={stage.label.toUpperCase()}\n headingCount={totalCount}\n />\n ) : null}\n </div>\n </div>\n </div>\n\n <DashedTileButton\n onClick={handleQuickAdd}\n className=\"h-11\"\n ariaLabel={translateWithFallback(\n t,\n 'customers.deals.kanban.lane.aria.quickAdd',\n 'Quickly add a deal to {stage}',\n { stage: stage.label },\n )}\n >\n <span className=\"text-base font-bold leading-none\">+</span>\n <span>{translateWithFallback(t, 'customers.deals.kanban.cta.quickDeal', 'Quick deal')}</span>\n </DashedTileButton>\n\n <div\n ref={setNodeRef}\n className={`flex min-h-[40vh] flex-col gap-3 rounded-lg p-1.5 ${\n isOver\n ? 'bg-accent-indigo/10 outline-dashed outline-2 outline-accent-indigo -outline-offset-[2px]'\n : showDropHighlight\n ? 'bg-muted/40 outline-dashed outline-1 outline-muted-foreground/40 -outline-offset-[2px]'\n : ''\n }`}\n >\n {deals.length === 0 ? (\n <EmptyState\n size=\"sm\"\n title={translateWithFallback(\n t,\n 'customers.deals.kanban.lane.empty',\n 'No deals in this stage yet.',\n )}\n />\n ) : (\n deals.map((deal) => (\n <DealCard\n key={deal.id}\n deal={deal}\n selected={selectedDealIds.has(deal.id)}\n bulkSelectionActive={bulkSelectionActive}\n buildMenuItems={buildMenuItems}\n isActiveDrag={activeDragDealId === deal.id}\n onToggleSelect={onToggleSelect}\n onComposeActivity={onComposeActivity}\n onOpenDetail={onOpenDetail}\n />\n ))\n )}\n {hasMoreDeals && onLoadMore ? (\n <DashedTileButton\n onClick={() => onLoadMore(stage.id)}\n disabled={isLoadingMore}\n className=\"mt-0.75 px-3 py-2.5 text-muted-foreground\"\n ariaLabel={translateWithFallback(\n t,\n 'customers.deals.kanban.lane.aria.loadMore',\n 'Load more deals in {stage}',\n { stage: stage.label },\n )}\n >\n {isLoadingMore\n ? translateWithFallback(t, 'customers.deals.kanban.lane.loadingMore', 'Loading\u2026')\n : translateWithFallback(\n t,\n 'customers.deals.kanban.lane.loadMore',\n 'Show more ({remaining})',\n { remaining: totalCount - visibleCount },\n )}\n </DashedTileButton>\n ) : null}\n </div>\n {onResize ? (\n <LaneResizeHandle\n onResize={(delta) => onResize(stage.id, delta)}\n onResizeEnd={() => onResizeEnd?.(stage.id)}\n onReset={() => onResetWidth?.(stage.id)}\n />\n ) : null}\n </div>\n )\n}\n\n// Memoize the lane so changes in a different lane (or in the active drag) don't re-render us.\n// Page passes booleans (isDragActive) instead of activeDragDealId so most lanes can skip re-rendering.\nexport const Lane = React.memo(LaneImpl, (prev, next) => {\n if (prev.stage !== next.stage) return false\n if (prev.deals !== next.deals) return false\n if (prev.aggregate !== next.aggregate) return false\n if (prev.selectedDealIds !== next.selectedDealIds) return false\n if (prev.buildMenuItems !== next.buildMenuItems) return false\n if (prev.activeDragDealId !== next.activeDragDealId) return false\n if (prev.isLoadingMore !== next.isLoadingMore) return false\n if (prev.width !== next.width) return false\n return true\n})\n\nexport default Lane\n"],
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"sourcesContent": ["\"use client\"\n\nimport * as React from 'react'\nimport { useDroppable } from '@dnd-kit/core'\nimport { EmptyState } from '@open-mercato/ui/primitives/empty-state'\nimport type { RowActionItem } from '@open-mercato/ui/backend/RowActions'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport { translateWithFallback } from '@open-mercato/shared/lib/i18n/translate'\nimport type { FilterOptionTone } from '@open-mercato/shared/lib/query/advanced-filter'\nimport { toneToDotClass } from './toneClasses'\nimport { DealCard, type DealCardData } from './DealCard'\nimport { DashedTileButton } from './DashedTileButton'\nimport { LANE_WIDTH_PX } from './constants'\nimport { LaneCurrencyBreakdown } from './LaneCurrencyBreakdown'\nimport { LaneResizeHandle } from './LaneResizeHandle'\n\nexport type LaneStage = {\n id: string\n label: string\n tone: FilterOptionTone | null\n}\n\nexport type LaneAggregateProp = {\n count: number\n totalInBaseCurrency: number\n byCurrency: Array<{ currency: string; total: number; count: number }>\n baseCurrencyCode: string | null\n /** `true` when every currency in `byCurrency` was convertible to the base currency. */\n convertedAll: boolean\n /** Currencies present in `byCurrency` that lack an FX rate to base \u2014 excluded from totals. */\n missingRateCurrencies: string[]\n}\n\ntype LaneProps = {\n stage: LaneStage\n deals: DealCardData[]\n /** Server-side aggregate for accurate counts/totals across all deals in this stage, not just loaded ones */\n aggregate?: LaneAggregateProp | null\n paginationTotal?: number\n selectedDealIds: Set<string>\n buildMenuItems: (deal: DealCardData) => RowActionItem[]\n activeDragDealId?: string | null\n isLoadingMore?: boolean\n /** Pixel width override (when the user has resized the column). Falls back to the default class. */\n width?: number | null\n onToggleSelect: (dealId: string) => void\n onComposeActivity: (dealId: string, type: 'call' | 'email' | 'note') => void\n onOpenDetail: (dealId: string) => void\n onQuickAddClick: (stageId: string) => void\n onLoadMore?: (stageId: string) => void\n /** Drag-resize callbacks. When provided, a vertical drag handle is rendered on the lane edge. */\n onResize?: (stageId: string, deltaPx: number) => void\n onResizeEnd?: (stageId: string) => void\n onResetWidth?: (stageId: string) => void\n}\n\n// 4px color bar tone \u2014 saturated icon tokens shared with the status filter pills\n// (toneClasses.ts) so the lane bar and the filter dots stay in lockstep (#5107 review).\nfunction getAccentClass(tone: FilterOptionTone | null): string {\n return toneToDotClass(tone, 'bg-border')\n}\n\n// Count pill bg uses very-light status background, text uses status text color\nconst COUNT_BADGE_TONE_CLASS: Record<FilterOptionTone, string> = {\n success: 'bg-status-success-bg text-status-success-text',\n error: 'bg-status-error-bg text-status-error-text',\n warning: 'bg-status-warning-bg text-status-warning-text',\n info: 'bg-status-info-bg text-status-info-text',\n neutral: 'bg-status-neutral-bg text-status-neutral-text',\n brand: 'bg-brand-violet/14 text-brand-violet',\n pink: 'bg-status-pink-bg text-status-pink-text',\n}\n\nfunction getCountBadgeClass(tone: FilterOptionTone | null): string {\n if (tone && tone in COUNT_BADGE_TONE_CLASS) return COUNT_BADGE_TONE_CLASS[tone]\n return 'bg-muted text-muted-foreground'\n}\n\nfunction compactCurrency(amount: number): string {\n if (amount >= 1_000_000) {\n const value = amount / 1_000_000\n return value >= 100 ? `${Math.round(value)}M` : `${value.toFixed(1).replace(/\\.0$/, '')}M`\n }\n if (amount >= 1_000) {\n const value = amount / 1_000\n return value >= 100 ? `${Math.round(value)}k` : `${value.toFixed(1).replace(/\\.0$/, '')}k`\n }\n return String(Math.round(amount))\n}\n\ntype CurrencyRow = { currency: string; total: number; count: number }\n\ntype LaneStats = {\n count: number\n /** Headline amount and the currency it is denominated in (largest single currency, raw, never converted). */\n primaryAmount: number\n primaryCurrency: string | null\n /** Per-currency rows sorted desc by total \u2014 the popover renders these one per line. */\n rows: CurrencyRow[]\n /** Sum of `rows` converted to base currency (zero when no base is configured / nothing converted). */\n totalInBaseCurrency: number\n baseCurrencyCode: string | null\n convertedAll: boolean\n missingRateCurrencies: string[]\n}\n\n/**\n * Build display stats.\n * - If a server aggregate is provided, prefer it (covers all deals, converts to tenant base currency).\n * - Otherwise fall back to summing loaded deals (used before aggregate query loads).\n *\n * The headline currency on the lane header is intentionally the LARGEST raw currency\n * (not the base-currency converted total) because the converted total can be misleading\n * when FX rates are missing \u2014 operators see a smaller number than the headline suggests.\n * The base-currency converted total is reserved for the breakdown popover footer, where\n * a partial-conversion indicator can disclose what's excluded.\n */\nfunction buildLaneStats(deals: DealCardData[], aggregate?: LaneAggregateProp | null): LaneStats {\n if (aggregate) {\n const rows = aggregate.byCurrency\n // Pick the single currency with the largest raw total to surface in the header. This\n // is always honest: the operator sees the actual largest cluster of value rather than\n // a synthetic base-currency total that may be partial.\n const headline = rows.length > 0 ? rows[0] : null\n return {\n count: aggregate.count,\n primaryAmount: headline ? headline.total : 0,\n primaryCurrency: headline ? headline.currency : null,\n rows,\n totalInBaseCurrency: aggregate.totalInBaseCurrency,\n baseCurrencyCode: aggregate.baseCurrencyCode,\n convertedAll: aggregate.convertedAll,\n missingRateCurrencies: aggregate.missingRateCurrencies,\n }\n }\n const totalsByCurrency = new Map<string, { total: number; count: number }>()\n for (const deal of deals) {\n if (typeof deal.valueAmount !== 'number' || !Number.isFinite(deal.valueAmount)) continue\n const code = deal.valueCurrency && deal.valueCurrency.length === 3\n ? deal.valueCurrency.toUpperCase()\n : 'USD'\n const entry = totalsByCurrency.get(code) ?? { total: 0, count: 0 }\n entry.total += deal.valueAmount\n entry.count += 1\n totalsByCurrency.set(code, entry)\n }\n const rows: CurrencyRow[] = Array.from(totalsByCurrency.entries())\n .map(([currency, value]) => ({ currency, total: value.total, count: value.count }))\n .sort((a, b) => b.total - a.total)\n if (rows.length === 0) {\n return {\n count: deals.length,\n primaryAmount: 0,\n primaryCurrency: null,\n rows,\n totalInBaseCurrency: 0,\n baseCurrencyCode: null,\n convertedAll: true,\n missingRateCurrencies: [],\n }\n }\n return {\n count: deals.length,\n primaryAmount: rows[0].total,\n primaryCurrency: rows[0].currency,\n rows,\n totalInBaseCurrency: 0,\n baseCurrencyCode: null,\n // We don't have rates client-side; mark as \"not converted\" only when there are\n // multiple currencies so the popover can show a \"configure FX rates\" hint.\n convertedAll: rows.length === 1,\n missingRateCurrencies: rows.length > 1 ? rows.slice(1).map((row) => row.currency) : [],\n }\n}\n\nfunction LaneImpl({\n stage,\n deals,\n aggregate,\n paginationTotal,\n selectedDealIds,\n buildMenuItems,\n activeDragDealId,\n isLoadingMore = false,\n width,\n onToggleSelect,\n onComposeActivity,\n onOpenDetail,\n onQuickAddClick,\n onLoadMore,\n onResize,\n onResizeEnd,\n onResetWidth,\n}: LaneProps): React.ReactElement {\n const t = useT()\n const { setNodeRef, isOver } = useDroppable({\n id: `lane:${stage.id}`,\n data: { type: 'lane', stageId: stage.id },\n })\n const isDragActive = !!activeDragDealId\n const sourceLane = isDragActive && deals.some((deal) => deal.id === activeDragDealId)\n // Highlight drop zone when:\n // - the lane has the pointer over it during a drag, OR\n // - any drag is active and this lane is not the source (so all candidate targets are clearly tagged)\n const showDropHighlight = isOver || (isDragActive && !sourceLane)\n const stats = React.useMemo(() => buildLaneStats(deals, aggregate), [deals, aggregate])\n // Pull boolean out of the Set so each DealCard receives a stable primitive \u2014 that lets\n // React.memo on DealCard skip re-renders when the Set reference changes but its emptiness\n // does not. Flipping false\u2192true (first selection) or true\u2192false (last cleared) forces a\n // full pass over the lane's cards so their checkbox visibility updates atomically.\n const bulkSelectionActive = selectedDealIds.size > 0\n const totalLabel = stats.primaryAmount > 0 && stats.primaryCurrency\n ? `${compactCurrency(stats.primaryAmount)} ${stats.primaryCurrency}`\n : null\n const visibleCount = deals.length\n const totalCount = stats.count\n const remainingCount = (paginationTotal ?? totalCount) - visibleCount\n const hasMoreDeals = remainingCount > 0\n const accentClass = getAccentClass(stage.tone)\n const countBadgeClass = getCountBadgeClass(stage.tone)\n\n const handleQuickAdd = React.useCallback(() => {\n onQuickAddClick(stage.id)\n }, [onQuickAddClick, stage.id])\n\n return (\n <div\n className=\"relative flex flex-none flex-col gap-3\"\n style={{ width: typeof width === 'number' && Number.isFinite(width) ? `${width}px` : `${LANE_WIDTH_PX}px` }}\n >\n <div className=\"flex flex-col gap-2.5 overflow-clip rounded-lg bg-muted/40 px-4 py-3.5\">\n <div className={`h-1.5 w-full rounded-sm ${accentClass}`} aria-hidden=\"true\" />\n <div className=\"flex items-center justify-between gap-2\">\n <div className=\"flex min-w-0 items-center gap-2.5\">\n <span className=\"truncate text-sm font-bold uppercase leading-normal text-foreground\">\n {stage.label}\n </span>\n <span\n className={`inline-flex shrink-0 items-center rounded-full px-2 py-1 text-xs font-bold leading-normal ${countBadgeClass}`}\n title={\n hasMoreDeals\n ? translateWithFallback(\n t,\n 'customers.deals.kanban.lane.aria.partialCount',\n 'Showing {visible} of {total}',\n { visible: visibleCount, total: totalCount },\n )\n : undefined\n }\n >\n {totalCount}\n </span>\n </div>\n <div className=\"flex shrink-0 items-center gap-2\">\n {totalLabel ? (\n <span className=\"text-sm font-bold leading-normal text-foreground\">\n {totalLabel}\n </span>\n ) : null}\n {stats.rows.length > 1 ? (\n <LaneCurrencyBreakdown\n rows={stats.rows}\n baseCurrencyCode={stats.baseCurrencyCode}\n totalInBaseCurrency={stats.totalInBaseCurrency}\n convertedAll={stats.convertedAll}\n missingRateCurrencies={stats.missingRateCurrencies}\n triggerLabel={`+${stats.rows.length - 1}`}\n headingLabel={stage.label.toUpperCase()}\n headingCount={totalCount}\n />\n ) : null}\n </div>\n </div>\n </div>\n\n <DashedTileButton\n onClick={handleQuickAdd}\n className=\"h-11\"\n ariaLabel={translateWithFallback(\n t,\n 'customers.deals.kanban.lane.aria.quickAdd',\n 'Quickly add a deal to {stage}',\n { stage: stage.label },\n )}\n >\n <span className=\"text-base font-bold leading-none\">+</span>\n <span>{translateWithFallback(t, 'customers.deals.kanban.cta.quickDeal', 'Quick deal')}</span>\n </DashedTileButton>\n\n <div\n ref={setNodeRef}\n className={`flex min-h-[40vh] flex-col gap-3 rounded-lg p-1.5 ${\n isOver\n ? 'bg-accent-indigo/10 outline-dashed outline-2 outline-accent-indigo -outline-offset-[2px]'\n : showDropHighlight\n ? 'bg-muted/40 outline-dashed outline-1 outline-muted-foreground/40 -outline-offset-[2px]'\n : ''\n }`}\n >\n {deals.length === 0 ? (\n <EmptyState\n size=\"sm\"\n title={translateWithFallback(\n t,\n 'customers.deals.kanban.lane.empty',\n 'No deals in this stage yet.',\n )}\n />\n ) : (\n deals.map((deal) => (\n <DealCard\n key={deal.id}\n deal={deal}\n selected={selectedDealIds.has(deal.id)}\n bulkSelectionActive={bulkSelectionActive}\n buildMenuItems={buildMenuItems}\n isActiveDrag={activeDragDealId === deal.id}\n onToggleSelect={onToggleSelect}\n onComposeActivity={onComposeActivity}\n onOpenDetail={onOpenDetail}\n />\n ))\n )}\n {hasMoreDeals && onLoadMore ? (\n <DashedTileButton\n onClick={() => onLoadMore(stage.id)}\n disabled={isLoadingMore}\n className=\"mt-0.75 px-3 py-2.5 text-muted-foreground\"\n ariaLabel={translateWithFallback(\n t,\n 'customers.deals.kanban.lane.aria.loadMore',\n 'Load more deals in {stage}',\n { stage: stage.label },\n )}\n >\n {isLoadingMore\n ? translateWithFallback(t, 'customers.deals.kanban.lane.loadingMore', 'Loading\u2026')\n : translateWithFallback(\n t,\n 'customers.deals.kanban.lane.loadMore',\n 'Show more ({remaining})',\n { remaining: remainingCount },\n )}\n </DashedTileButton>\n ) : null}\n </div>\n {onResize ? (\n <LaneResizeHandle\n onResize={(delta) => onResize(stage.id, delta)}\n onResizeEnd={() => onResizeEnd?.(stage.id)}\n onReset={() => onResetWidth?.(stage.id)}\n />\n ) : null}\n </div>\n )\n}\n\n// Memoize the lane so changes in a different lane (or in the active drag) don't re-render us.\n// Page passes booleans (isDragActive) instead of activeDragDealId so most lanes can skip re-rendering.\nexport const Lane = React.memo(LaneImpl, (prev, next) => {\n if (prev.stage !== next.stage) return false\n if (prev.deals !== next.deals) return false\n if (prev.aggregate !== next.aggregate) return false\n if (prev.paginationTotal !== next.paginationTotal) return false\n if (prev.selectedDealIds !== next.selectedDealIds) return false\n if (prev.buildMenuItems !== next.buildMenuItems) return false\n if (prev.activeDragDealId !== next.activeDragDealId) return false\n if (prev.isLoadingMore !== next.isLoadingMore) return false\n if (prev.width !== next.width) return false\n return true\n})\n\nexport default Lane\n"],
|
|
5
|
+
"mappings": ";AAuOQ,cAEE,YAFF;AArOR,YAAY,WAAW;AACvB,SAAS,oBAAoB;AAC7B,SAAS,kBAAkB;AAE3B,SAAS,YAAY;AACrB,SAAS,6BAA6B;AAEtC,SAAS,sBAAsB;AAC/B,SAAS,gBAAmC;AAC5C,SAAS,wBAAwB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,KAAK,mBAAmB,KAAK,eAAgB,QAAO;AACxD,MAAI,KAAK,qBAAqB,KAAK,iBAAkB,QAAO;AAC5D,MAAI,KAAK,kBAAkB,KAAK,cAAe,QAAO;AACtD,MAAI,KAAK,UAAU,KAAK,MAAO,QAAO;AACtC,SAAO;AACT,CAAC;AAED,IAAO,eAAQ;",
|
|
6
6
|
"names": ["rows"]
|
|
7
7
|
}
|
|
@@ -2312,7 +2312,7 @@ function DealsKanbanPage() {
|
|
|
2312
2312
|
className: "h-[50vh] w-full"
|
|
2313
2313
|
}
|
|
2314
2314
|
) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2315
|
-
lanes.map((stage) => {
|
|
2315
|
+
lanes.map((stage, stageIndex) => {
|
|
2316
2316
|
const laneDeals = sortedDealsByStage.get(stage.id) ?? EMPTY_DEAL_ARRAY;
|
|
2317
2317
|
return /* @__PURE__ */ jsx(
|
|
2318
2318
|
Lane,
|
|
@@ -2320,6 +2320,7 @@ function DealsKanbanPage() {
|
|
|
2320
2320
|
stage,
|
|
2321
2321
|
deals: laneDeals,
|
|
2322
2322
|
aggregate: aggregateByStage.get(stage.id) ?? null,
|
|
2323
|
+
paginationTotal: laneQueries[stageIndex]?.data?.total ?? 0,
|
|
2323
2324
|
selectedDealIds,
|
|
2324
2325
|
buildMenuItems,
|
|
2325
2326
|
activeDragDealId,
|