@open-mercato/core 0.4.11-develop.1418.27a299bdaf → 0.4.11-develop.1446.d277f8b435
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/modules/customers/backend/customers/deals/[id]/page.js +221 -226
- package/dist/modules/customers/backend/customers/deals/[id]/page.js.map +2 -2
- package/dist/modules/query_index/lib/engine.js +1 -1
- package/dist/modules/query_index/lib/engine.js.map +2 -2
- package/package.json +3 -3
- package/src/modules/customers/backend/customers/deals/[id]/page.tsx +1 -1
- package/src/modules/query_index/lib/engine.ts +1 -1
|
@@ -292,250 +292,245 @@ function DealDetailPage({ params }) {
|
|
|
292
292
|
const companiesSummaryLabel = data.companies.length === 1 ? t("customers.deals.detail.companiesSummaryOne") : t("customers.deals.detail.companiesSummaryMany", void 0, { count: data.companies.length });
|
|
293
293
|
const viewer = data.viewer ?? null;
|
|
294
294
|
return /* @__PURE__ */ jsxs(Page, { children: [
|
|
295
|
-
/* @__PURE__ */
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
{
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
previewData: {
|
|
317
|
-
title: data.deal.title || t("customers.deals.detail.untitled", "Untitled deal"),
|
|
318
|
-
status: data.deal.status ? statusLabel : void 0,
|
|
319
|
-
metadata: Object.keys(dealPreviewMetadata).length > 0 ? dealPreviewMetadata : void 0
|
|
320
|
-
}
|
|
321
|
-
},
|
|
322
|
-
viewHref: `/backend/customers/deals/${data.deal.id}`,
|
|
323
|
-
defaultValues: {
|
|
324
|
-
sourceEntityType: "customers.deal",
|
|
325
|
-
sourceEntityId: data.deal.id
|
|
295
|
+
/* @__PURE__ */ jsx(PageBody, { children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-6", children: [
|
|
296
|
+
/* @__PURE__ */ jsx(
|
|
297
|
+
FormHeader,
|
|
298
|
+
{
|
|
299
|
+
mode: "detail",
|
|
300
|
+
backHref: "/backend/customers/deals",
|
|
301
|
+
backLabel: t("customers.deals.detail.backToList", "Back to deals"),
|
|
302
|
+
utilityActions: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
303
|
+
/* @__PURE__ */ jsx(
|
|
304
|
+
SendObjectMessageDialog,
|
|
305
|
+
{
|
|
306
|
+
object: {
|
|
307
|
+
entityModule: "customers",
|
|
308
|
+
entityType: "deal",
|
|
309
|
+
entityId: data.deal.id,
|
|
310
|
+
sourceEntityType: "customers.deal",
|
|
311
|
+
sourceEntityId: data.deal.id,
|
|
312
|
+
previewData: {
|
|
313
|
+
title: data.deal.title || t("customers.deals.detail.untitled", "Untitled deal"),
|
|
314
|
+
status: data.deal.status ? statusLabel : void 0,
|
|
315
|
+
metadata: Object.keys(dealPreviewMetadata).length > 0 ? dealPreviewMetadata : void 0
|
|
326
316
|
}
|
|
317
|
+
},
|
|
318
|
+
viewHref: `/backend/customers/deals/${data.deal.id}`,
|
|
319
|
+
defaultValues: {
|
|
320
|
+
sourceEntityType: "customers.deal",
|
|
321
|
+
sourceEntityId: data.deal.id
|
|
327
322
|
}
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
323
|
+
}
|
|
324
|
+
),
|
|
325
|
+
/* @__PURE__ */ jsx(
|
|
326
|
+
VersionHistoryAction,
|
|
327
|
+
{
|
|
328
|
+
config: { resourceKind: "customers.deal", resourceId: data.deal.id },
|
|
329
|
+
t
|
|
330
|
+
}
|
|
331
|
+
)
|
|
332
|
+
] }),
|
|
333
|
+
title: /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
334
|
+
/* @__PURE__ */ jsx("span", { children: data.deal.title || t("customers.deals.detail.untitled", "Untitled deal") }),
|
|
335
|
+
/* @__PURE__ */ jsxs(
|
|
336
|
+
Button,
|
|
337
|
+
{
|
|
338
|
+
type: "button",
|
|
339
|
+
variant: "ghost",
|
|
340
|
+
size: "sm",
|
|
341
|
+
className: "gap-1 text-muted-foreground hover:text-foreground",
|
|
342
|
+
onClick: scrollToDealSettings,
|
|
343
|
+
children: [
|
|
344
|
+
/* @__PURE__ */ jsx(Pencil, { className: "h-4 w-4", "aria-hidden": true }),
|
|
345
|
+
/* @__PURE__ */ jsx(MousePointerClick, { className: "h-4 w-4", "aria-hidden": true }),
|
|
346
|
+
/* @__PURE__ */ jsx("span", { children: t("customers.deals.detail.goToSettings", "Edit deal details") })
|
|
347
|
+
]
|
|
348
|
+
}
|
|
349
|
+
)
|
|
350
|
+
] }),
|
|
351
|
+
subtitle: t("customers.deals.detail.summary", void 0, {
|
|
352
|
+
status: statusLabel,
|
|
353
|
+
pipeline: pipelineLabel ?? t("customers.deals.detail.noPipeline", "No pipeline")
|
|
354
|
+
}),
|
|
355
|
+
onDelete: handleDelete,
|
|
356
|
+
isDeleting,
|
|
357
|
+
deleteLabel: t("ui.actions.delete", "Delete")
|
|
358
|
+
}
|
|
359
|
+
),
|
|
360
|
+
/* @__PURE__ */ jsxs("div", { className: "grid gap-6 lg:grid-cols-[minmax(0,2fr),minmax(0,1.1fr)]", children: [
|
|
361
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
|
|
362
|
+
/* @__PURE__ */ jsxs("div", { className: "rounded-lg border bg-card p-4", children: [
|
|
363
|
+
/* @__PURE__ */ jsx("h2", { className: "mb-4 text-sm font-semibold uppercase text-muted-foreground", children: t("customers.deals.detail.highlights", "Highlights") }),
|
|
364
|
+
/* @__PURE__ */ jsxs("div", { className: "grid gap-4 sm:grid-cols-2", children: [
|
|
365
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
366
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs font-medium uppercase text-muted-foreground", children: t("customers.deals.detail.fields.value", "Deal value") }),
|
|
367
|
+
/* @__PURE__ */ jsx("p", { className: "text-base font-semibold text-foreground", children: valueLabel })
|
|
368
|
+
] }),
|
|
369
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
370
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs font-medium uppercase text-muted-foreground", children: t("customers.deals.detail.fields.probability", "Probability") }),
|
|
371
|
+
/* @__PURE__ */ jsx("p", { className: "text-base font-semibold text-foreground", children: probabilityLabel })
|
|
372
|
+
] }),
|
|
373
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
374
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs font-medium uppercase text-muted-foreground", children: t("customers.deals.detail.fields.status", "Status") }),
|
|
375
|
+
/* @__PURE__ */ jsxs("p", { className: "text-base text-foreground flex items-center gap-2", children: [
|
|
376
|
+
statusDictEntry?.color ? renderDictionaryColor(statusDictEntry.color) : null,
|
|
377
|
+
statusDictEntry?.icon ? renderDictionaryIcon(statusDictEntry.icon) : null,
|
|
378
|
+
statusLabel
|
|
379
|
+
] })
|
|
380
|
+
] }),
|
|
381
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
382
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs font-medium uppercase text-muted-foreground", children: t("customers.deals.detail.fields.pipeline", "Pipeline stage") }),
|
|
383
|
+
/* @__PURE__ */ jsxs("p", { className: "text-base text-foreground flex items-center gap-2", children: [
|
|
384
|
+
pipelineDictEntry?.color ? renderDictionaryColor(pipelineDictEntry.color) : null,
|
|
385
|
+
pipelineDictEntry?.icon ? renderDictionaryIcon(pipelineDictEntry.icon) : null,
|
|
386
|
+
pipelineLabel ?? t("customers.deals.detail.noValue", "Not provided")
|
|
387
|
+
] })
|
|
388
|
+
] }),
|
|
389
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
390
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs font-medium uppercase text-muted-foreground", children: t("customers.deals.detail.fields.expectedClose", "Expected close") }),
|
|
391
|
+
/* @__PURE__ */ jsx("p", { className: "text-base text-foreground", children: expectedCloseLabel })
|
|
392
|
+
] })
|
|
393
|
+
] })
|
|
394
|
+
] }),
|
|
395
|
+
/* @__PURE__ */ jsxs("div", { className: "rounded-lg border bg-card p-4", children: [
|
|
396
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [
|
|
397
|
+
/* @__PURE__ */ jsx("div", { className: "flex gap-2", children: tabs.map((tab) => /* @__PURE__ */ jsx(
|
|
398
|
+
Button,
|
|
331
399
|
{
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
400
|
+
variant: "ghost",
|
|
401
|
+
size: "sm",
|
|
402
|
+
onClick: () => setActiveTab(tab.id),
|
|
403
|
+
className: `h-auto rounded-none border-b-2 px-0 py-1 ${activeTab === tab.id ? "border-primary text-foreground" : "border-transparent text-muted-foreground hover:text-foreground hover:bg-transparent"}`,
|
|
404
|
+
children: tab.label
|
|
405
|
+
},
|
|
406
|
+
tab.id
|
|
407
|
+
)) }),
|
|
408
|
+
sectionAction ? /* @__PURE__ */ jsxs(
|
|
340
409
|
Button,
|
|
341
410
|
{
|
|
342
411
|
type: "button",
|
|
343
|
-
variant: "ghost",
|
|
344
412
|
size: "sm",
|
|
345
|
-
|
|
346
|
-
onClick:
|
|
413
|
+
disabled: sectionAction.disabled,
|
|
414
|
+
onClick: handleSectionAction,
|
|
347
415
|
children: [
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
/* @__PURE__ */ jsx("span", { children: t("customers.deals.detail.goToSettings", "Edit deal details") })
|
|
416
|
+
sectionAction.icon ?? null,
|
|
417
|
+
sectionAction.label
|
|
351
418
|
]
|
|
352
419
|
}
|
|
353
|
-
)
|
|
354
|
-
] }),
|
|
355
|
-
subtitle: t("customers.deals.detail.summary", void 0, {
|
|
356
|
-
status: statusLabel,
|
|
357
|
-
pipeline: pipelineLabel ?? t("customers.deals.detail.noPipeline", "No pipeline")
|
|
358
|
-
}),
|
|
359
|
-
onDelete: handleDelete,
|
|
360
|
-
isDeleting,
|
|
361
|
-
deleteLabel: t("ui.actions.delete", "Delete")
|
|
362
|
-
}
|
|
363
|
-
),
|
|
364
|
-
/* @__PURE__ */ jsxs("div", { className: "grid gap-6 lg:grid-cols-[minmax(0,2fr),minmax(0,1.1fr)]", children: [
|
|
365
|
-
/* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
|
|
366
|
-
/* @__PURE__ */ jsxs("div", { className: "rounded-lg border bg-card p-4", children: [
|
|
367
|
-
/* @__PURE__ */ jsx("h2", { className: "mb-4 text-sm font-semibold uppercase text-muted-foreground", children: t("customers.deals.detail.highlights", "Highlights") }),
|
|
368
|
-
/* @__PURE__ */ jsxs("div", { className: "grid gap-4 sm:grid-cols-2", children: [
|
|
369
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
370
|
-
/* @__PURE__ */ jsx("p", { className: "text-xs font-medium uppercase text-muted-foreground", children: t("customers.deals.detail.fields.value", "Deal value") }),
|
|
371
|
-
/* @__PURE__ */ jsx("p", { className: "text-base font-semibold text-foreground", children: valueLabel })
|
|
372
|
-
] }),
|
|
373
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
374
|
-
/* @__PURE__ */ jsx("p", { className: "text-xs font-medium uppercase text-muted-foreground", children: t("customers.deals.detail.fields.probability", "Probability") }),
|
|
375
|
-
/* @__PURE__ */ jsx("p", { className: "text-base font-semibold text-foreground", children: probabilityLabel })
|
|
376
|
-
] }),
|
|
377
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
378
|
-
/* @__PURE__ */ jsx("p", { className: "text-xs font-medium uppercase text-muted-foreground", children: t("customers.deals.detail.fields.status", "Status") }),
|
|
379
|
-
/* @__PURE__ */ jsxs("p", { className: "text-base text-foreground flex items-center gap-2", children: [
|
|
380
|
-
statusDictEntry?.color ? renderDictionaryColor(statusDictEntry.color) : null,
|
|
381
|
-
statusDictEntry?.icon ? renderDictionaryIcon(statusDictEntry.icon) : null,
|
|
382
|
-
statusLabel
|
|
383
|
-
] })
|
|
384
|
-
] }),
|
|
385
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
386
|
-
/* @__PURE__ */ jsx("p", { className: "text-xs font-medium uppercase text-muted-foreground", children: t("customers.deals.detail.fields.pipeline", "Pipeline stage") }),
|
|
387
|
-
/* @__PURE__ */ jsxs("p", { className: "text-base text-foreground flex items-center gap-2", children: [
|
|
388
|
-
pipelineDictEntry?.color ? renderDictionaryColor(pipelineDictEntry.color) : null,
|
|
389
|
-
pipelineDictEntry?.icon ? renderDictionaryIcon(pipelineDictEntry.icon) : null,
|
|
390
|
-
pipelineLabel ?? t("customers.deals.detail.noValue", "Not provided")
|
|
391
|
-
] })
|
|
392
|
-
] }),
|
|
393
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
394
|
-
/* @__PURE__ */ jsx("p", { className: "text-xs font-medium uppercase text-muted-foreground", children: t("customers.deals.detail.fields.expectedClose", "Expected close") }),
|
|
395
|
-
/* @__PURE__ */ jsx("p", { className: "text-base text-foreground", children: expectedCloseLabel })
|
|
396
|
-
] })
|
|
397
|
-
] })
|
|
420
|
+
) : null
|
|
398
421
|
] }),
|
|
422
|
+
activeTab === "notes" ? /* @__PURE__ */ jsx(
|
|
423
|
+
NotesSection,
|
|
424
|
+
{
|
|
425
|
+
entityId: null,
|
|
426
|
+
dealId: data.deal.id,
|
|
427
|
+
dealOptions,
|
|
428
|
+
entityOptions,
|
|
429
|
+
emptyLabel: t("customers.deals.detail.notesEmpty", "No notes yet."),
|
|
430
|
+
viewerUserId: viewer?.userId ?? null,
|
|
431
|
+
viewerName: viewer?.name ?? null,
|
|
432
|
+
viewerEmail: viewer?.email ?? null,
|
|
433
|
+
addActionLabel: t("customers.deals.detail.notesAdd", "Add note"),
|
|
434
|
+
emptyState: {
|
|
435
|
+
title: t("customers.deals.detail.notesEmptyTitle", "Keep everyone in the loop"),
|
|
436
|
+
actionLabel: t("customers.deals.detail.notesEmptyAction", "Add a note")
|
|
437
|
+
},
|
|
438
|
+
onActionChange: setSectionAction,
|
|
439
|
+
translator: detailTranslator,
|
|
440
|
+
onLoadingChange: handleNotesLoadingChange,
|
|
441
|
+
dataAdapter: notesAdapter,
|
|
442
|
+
renderIcon: renderDictionaryIcon,
|
|
443
|
+
renderColor: renderDictionaryColor,
|
|
444
|
+
iconSuggestions: ICON_SUGGESTIONS,
|
|
445
|
+
readMarkdownPreference: readMarkdownPreferenceCookie,
|
|
446
|
+
writeMarkdownPreference: writeMarkdownPreferenceCookie
|
|
447
|
+
}
|
|
448
|
+
) : null,
|
|
449
|
+
activeTab === "activities" ? /* @__PURE__ */ jsx(
|
|
450
|
+
ActivitiesSection,
|
|
451
|
+
{
|
|
452
|
+
entityId: null,
|
|
453
|
+
dealId: data.deal.id,
|
|
454
|
+
dealOptions,
|
|
455
|
+
entityOptions,
|
|
456
|
+
defaultEntityId: defaultEntityId ?? void 0,
|
|
457
|
+
addActionLabel: t("customers.deals.detail.activitiesAdd", "Log activity"),
|
|
458
|
+
emptyState: {
|
|
459
|
+
title: t("customers.deals.detail.activitiesEmptyTitle", "No activities yet"),
|
|
460
|
+
actionLabel: t("customers.deals.detail.activitiesEmptyAction", "Add an activity")
|
|
461
|
+
},
|
|
462
|
+
onActionChange: setSectionAction,
|
|
463
|
+
onLoadingChange: handleActivitiesLoadingChange
|
|
464
|
+
}
|
|
465
|
+
) : null
|
|
466
|
+
] }),
|
|
467
|
+
/* @__PURE__ */ jsxs("div", { className: "grid gap-4 md:grid-cols-2", children: [
|
|
399
468
|
/* @__PURE__ */ jsxs("div", { className: "rounded-lg border bg-card p-4", children: [
|
|
400
|
-
/* @__PURE__ */ jsxs("div", { className: "
|
|
401
|
-
/* @__PURE__ */ jsx("
|
|
402
|
-
|
|
403
|
-
{
|
|
404
|
-
variant: "ghost",
|
|
405
|
-
size: "sm",
|
|
406
|
-
onClick: () => setActiveTab(tab.id),
|
|
407
|
-
className: `h-auto rounded-none border-b-2 px-0 py-1 ${activeTab === tab.id ? "border-primary text-foreground" : "border-transparent text-muted-foreground hover:text-foreground hover:bg-transparent"}`,
|
|
408
|
-
children: tab.label
|
|
409
|
-
},
|
|
410
|
-
tab.id
|
|
411
|
-
)) }),
|
|
412
|
-
sectionAction ? /* @__PURE__ */ jsxs(
|
|
413
|
-
Button,
|
|
414
|
-
{
|
|
415
|
-
type: "button",
|
|
416
|
-
size: "sm",
|
|
417
|
-
disabled: sectionAction.disabled,
|
|
418
|
-
onClick: handleSectionAction,
|
|
419
|
-
children: [
|
|
420
|
-
sectionAction.icon ?? null,
|
|
421
|
-
sectionAction.label
|
|
422
|
-
]
|
|
423
|
-
}
|
|
424
|
-
) : null
|
|
469
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-3 space-y-1", children: [
|
|
470
|
+
/* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold text-foreground", children: t("customers.deals.detail.peopleSection", "People") }),
|
|
471
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: peopleSummaryLabel })
|
|
425
472
|
] }),
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
{
|
|
429
|
-
|
|
430
|
-
dealId: data.deal.id,
|
|
431
|
-
dealOptions,
|
|
432
|
-
entityOptions,
|
|
433
|
-
emptyLabel: t("customers.deals.detail.notesEmpty", "No notes yet."),
|
|
434
|
-
viewerUserId: viewer?.userId ?? null,
|
|
435
|
-
viewerName: viewer?.name ?? null,
|
|
436
|
-
viewerEmail: viewer?.email ?? null,
|
|
437
|
-
addActionLabel: t("customers.deals.detail.notesAdd", "Add note"),
|
|
438
|
-
emptyState: {
|
|
439
|
-
title: t("customers.deals.detail.notesEmptyTitle", "Keep everyone in the loop"),
|
|
440
|
-
actionLabel: t("customers.deals.detail.notesEmptyAction", "Add a note")
|
|
441
|
-
},
|
|
442
|
-
onActionChange: setSectionAction,
|
|
443
|
-
translator: detailTranslator,
|
|
444
|
-
onLoadingChange: handleNotesLoadingChange,
|
|
445
|
-
dataAdapter: notesAdapter,
|
|
446
|
-
renderIcon: renderDictionaryIcon,
|
|
447
|
-
renderColor: renderDictionaryColor,
|
|
448
|
-
iconSuggestions: ICON_SUGGESTIONS,
|
|
449
|
-
readMarkdownPreference: readMarkdownPreferenceCookie,
|
|
450
|
-
writeMarkdownPreference: writeMarkdownPreferenceCookie
|
|
451
|
-
}
|
|
452
|
-
) : null,
|
|
453
|
-
activeTab === "activities" ? /* @__PURE__ */ jsx(
|
|
454
|
-
ActivitiesSection,
|
|
455
|
-
{
|
|
456
|
-
entityId: null,
|
|
457
|
-
dealId: data.deal.id,
|
|
458
|
-
dealOptions,
|
|
459
|
-
entityOptions,
|
|
460
|
-
defaultEntityId: defaultEntityId ?? void 0,
|
|
461
|
-
addActionLabel: t("customers.deals.detail.activitiesAdd", "Log activity"),
|
|
462
|
-
emptyState: {
|
|
463
|
-
title: t("customers.deals.detail.activitiesEmptyTitle", "No activities yet"),
|
|
464
|
-
actionLabel: t("customers.deals.detail.activitiesEmptyAction", "Add an activity")
|
|
465
|
-
},
|
|
466
|
-
onActionChange: setSectionAction,
|
|
467
|
-
onLoadingChange: handleActivitiesLoadingChange
|
|
468
|
-
}
|
|
469
|
-
) : null
|
|
473
|
+
data.people.length ? /* @__PURE__ */ jsx("ul", { className: "space-y-2 text-sm", children: data.people.map((person) => /* @__PURE__ */ jsxs("li", { className: "flex flex-col gap-1", children: [
|
|
474
|
+
/* @__PURE__ */ jsx(Link, { href: `/backend/customers/people-v2/${encodeURIComponent(person.id)}`, className: "font-medium text-foreground hover:underline", children: person.label }),
|
|
475
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: person.subtitle ?? t("customers.deals.detail.peopleNoDetails", "No additional details") })
|
|
476
|
+
] }, person.id)) }) : /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: t("customers.deals.detail.noPeople", "No people linked to this deal yet.") })
|
|
470
477
|
] }),
|
|
471
|
-
/* @__PURE__ */ jsxs("div", { className: "
|
|
472
|
-
/* @__PURE__ */ jsxs("div", { className: "
|
|
473
|
-
/* @__PURE__ */
|
|
474
|
-
|
|
475
|
-
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: peopleSummaryLabel })
|
|
476
|
-
] }),
|
|
477
|
-
data.people.length ? /* @__PURE__ */ jsx("ul", { className: "space-y-2 text-sm", children: data.people.map((person) => /* @__PURE__ */ jsxs("li", { className: "flex flex-col gap-1", children: [
|
|
478
|
-
/* @__PURE__ */ jsx(Link, { href: `/backend/customers/people-v2/${encodeURIComponent(person.id)}`, className: "font-medium text-foreground hover:underline", children: person.label }),
|
|
479
|
-
/* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: person.subtitle ?? t("customers.deals.detail.peopleNoDetails", "No additional details") })
|
|
480
|
-
] }, person.id)) }) : /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: t("customers.deals.detail.noPeople", "No people linked to this deal yet.") })
|
|
478
|
+
/* @__PURE__ */ jsxs("div", { className: "rounded-lg border bg-card p-4", children: [
|
|
479
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-3 space-y-1", children: [
|
|
480
|
+
/* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold text-foreground", children: t("customers.deals.detail.companiesSection", "Companies") }),
|
|
481
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: companiesSummaryLabel })
|
|
481
482
|
] }),
|
|
482
|
-
/* @__PURE__ */
|
|
483
|
-
/* @__PURE__ */
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
] }),
|
|
487
|
-
data.companies.length ? /* @__PURE__ */ jsx("ul", { className: "space-y-2 text-sm", children: data.companies.map((company) => /* @__PURE__ */ jsxs("li", { className: "flex flex-col gap-1", children: [
|
|
488
|
-
/* @__PURE__ */ jsx(Link, { href: `/backend/customers/companies-v2/${encodeURIComponent(company.id)}`, className: "font-medium text-foreground hover:underline", children: company.label }),
|
|
489
|
-
/* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: company.subtitle ?? t("customers.deals.detail.companiesNoDetails", "No additional details") })
|
|
490
|
-
] }, company.id)) }) : /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: t("customers.deals.detail.noCompanies", "No companies linked to this deal yet.") })
|
|
491
|
-
] })
|
|
483
|
+
data.companies.length ? /* @__PURE__ */ jsx("ul", { className: "space-y-2 text-sm", children: data.companies.map((company) => /* @__PURE__ */ jsxs("li", { className: "flex flex-col gap-1", children: [
|
|
484
|
+
/* @__PURE__ */ jsx(Link, { href: `/backend/customers/companies-v2/${encodeURIComponent(company.id)}`, className: "font-medium text-foreground hover:underline", children: company.label }),
|
|
485
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: company.subtitle ?? t("customers.deals.detail.companiesNoDetails", "No additional details") })
|
|
486
|
+
] }, company.id)) }) : /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: t("customers.deals.detail.noCompanies", "No companies linked to this deal yet.") })
|
|
492
487
|
] })
|
|
493
|
-
] })
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
)
|
|
525
|
-
|
|
526
|
-
onSubmit: handleFormSubmit,
|
|
527
|
-
onCancel: () => setReloadToken((token) => token + 1),
|
|
528
|
-
onDelete: handleDelete,
|
|
529
|
-
isSubmitting: isSaving || isDeleting
|
|
488
|
+
] })
|
|
489
|
+
] }),
|
|
490
|
+
/* @__PURE__ */ jsx("div", { className: "space-y-6", children: /* @__PURE__ */ jsxs(
|
|
491
|
+
"div",
|
|
492
|
+
{
|
|
493
|
+
ref: dealSettingsRef,
|
|
494
|
+
id: "deal-settings",
|
|
495
|
+
className: "rounded-lg border bg-card p-4",
|
|
496
|
+
children: [
|
|
497
|
+
/* @__PURE__ */ jsx("h2", { className: "mb-4 text-sm font-semibold uppercase text-muted-foreground", children: t("customers.deals.detail.formTitle", "Deal settings") }),
|
|
498
|
+
/* @__PURE__ */ jsx(
|
|
499
|
+
DealForm,
|
|
500
|
+
{
|
|
501
|
+
mode: "edit",
|
|
502
|
+
initialValues: {
|
|
503
|
+
id: data.deal.id,
|
|
504
|
+
title: data.deal.title ?? "",
|
|
505
|
+
status: data.deal.status ?? "",
|
|
506
|
+
pipelineStage: data.deal.pipelineStage ?? "",
|
|
507
|
+
pipelineId: data.deal.pipelineId ?? "",
|
|
508
|
+
pipelineStageId: data.deal.pipelineStageId ?? "",
|
|
509
|
+
valueAmount: data.deal.valueAmount ? Number(data.deal.valueAmount) : null,
|
|
510
|
+
valueCurrency: data.deal.valueCurrency ?? void 0,
|
|
511
|
+
probability: data.deal.probability ?? null,
|
|
512
|
+
expectedCloseAt: data.deal.expectedCloseAt ?? null,
|
|
513
|
+
description: data.deal.description ?? "",
|
|
514
|
+
personIds: data.people.map((person) => person.id),
|
|
515
|
+
companyIds: data.companies.map((company) => company.id),
|
|
516
|
+
people: data.people.map((person) => ({ id: person.id, label: person.label })),
|
|
517
|
+
companies: data.companies.map((company) => ({ id: company.id, label: company.label })),
|
|
518
|
+
...Object.fromEntries(
|
|
519
|
+
Object.entries(data.customFields).filter(([key]) => key.startsWith("cf_")).map(([key, value]) => [key, value])
|
|
520
|
+
)
|
|
530
521
|
},
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
522
|
+
onSubmit: handleFormSubmit,
|
|
523
|
+
onCancel: () => setReloadToken((token) => token + 1),
|
|
524
|
+
onDelete: handleDelete,
|
|
525
|
+
isSubmitting: isSaving || isDeleting
|
|
526
|
+
},
|
|
527
|
+
data.deal.updatedAt
|
|
528
|
+
)
|
|
529
|
+
]
|
|
530
|
+
}
|
|
531
|
+
) })
|
|
537
532
|
] })
|
|
538
|
-
] }),
|
|
533
|
+
] }) }),
|
|
539
534
|
ConfirmDialogElement
|
|
540
535
|
] });
|
|
541
536
|
}
|