@open-mercato/core 0.6.6-develop.5491.1.469e89d368 → 0.6.6-develop.5503.1.6cdc4dda5f
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/people-v2/[id]/page.js +18 -0
- package/dist/modules/customers/backend/customers/people-v2/[id]/page.js.map +2 -2
- package/dist/modules/customers/components/detail/PersonDetailTabs.js +11 -3
- package/dist/modules/customers/components/detail/PersonDetailTabs.js.map +2 -2
- package/dist/modules/sales/commands/documents.js +7 -5
- package/dist/modules/sales/commands/documents.js.map +2 -2
- package/package.json +7 -7
- package/src/modules/customers/backend/customers/people-v2/[id]/page.tsx +18 -0
- package/src/modules/customers/components/detail/PersonDetailTabs.tsx +12 -2
- package/src/modules/sales/commands/documents.ts +7 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-mercato/core",
|
|
3
|
-
"version": "0.6.6-develop.
|
|
3
|
+
"version": "0.6.6-develop.5503.1.6cdc4dda5f",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -245,16 +245,16 @@
|
|
|
245
245
|
"zod": "^4.4.3"
|
|
246
246
|
},
|
|
247
247
|
"peerDependencies": {
|
|
248
|
-
"@open-mercato/ai-assistant": "0.6.6-develop.
|
|
249
|
-
"@open-mercato/shared": "0.6.6-develop.
|
|
250
|
-
"@open-mercato/ui": "0.6.6-develop.
|
|
248
|
+
"@open-mercato/ai-assistant": "0.6.6-develop.5503.1.6cdc4dda5f",
|
|
249
|
+
"@open-mercato/shared": "0.6.6-develop.5503.1.6cdc4dda5f",
|
|
250
|
+
"@open-mercato/ui": "0.6.6-develop.5503.1.6cdc4dda5f",
|
|
251
251
|
"react": "^19.0.0",
|
|
252
252
|
"react-dom": "^19.0.0"
|
|
253
253
|
},
|
|
254
254
|
"devDependencies": {
|
|
255
|
-
"@open-mercato/ai-assistant": "0.6.6-develop.
|
|
256
|
-
"@open-mercato/shared": "0.6.6-develop.
|
|
257
|
-
"@open-mercato/ui": "0.6.6-develop.
|
|
255
|
+
"@open-mercato/ai-assistant": "0.6.6-develop.5503.1.6cdc4dda5f",
|
|
256
|
+
"@open-mercato/shared": "0.6.6-develop.5503.1.6cdc4dda5f",
|
|
257
|
+
"@open-mercato/ui": "0.6.6-develop.5503.1.6cdc4dda5f",
|
|
258
258
|
"@testing-library/dom": "^10.4.1",
|
|
259
259
|
"@testing-library/jest-dom": "^6.9.1",
|
|
260
260
|
"@testing-library/react": "^16.3.1",
|
|
@@ -37,6 +37,7 @@ import { ScheduleActivityDialog, type ScheduleActivityEditData } from '../../../
|
|
|
37
37
|
import { PersonDetailHeader } from '../../../../components/detail/PersonDetailHeader'
|
|
38
38
|
import { ChangelogTab } from '../../../../components/detail/ChangelogTab'
|
|
39
39
|
import { PersonDetailTabs, resolveLegacyTab, type PersonTabId } from '../../../../components/detail/PersonDetailTabs'
|
|
40
|
+
import { AddressesSection } from '../../../../components/detail/AddressesSection'
|
|
40
41
|
import { PersonCompaniesSection } from '../../../../components/detail/PersonCompaniesSection'
|
|
41
42
|
import { MobilePersonDetail } from '../../../../components/detail/MobilePersonDetail'
|
|
42
43
|
import type { TagsSectionController } from '@open-mercato/ui/backend/detail'
|
|
@@ -541,6 +542,7 @@ export default function PersonDetailV2Page({ params }: { params?: { id?: string
|
|
|
541
542
|
activitiesCount={interactionCount}
|
|
542
543
|
dealsCount={dealCount}
|
|
543
544
|
companiesCount={companyCount}
|
|
545
|
+
addressesCount={data?.counts?.addresses ?? 0}
|
|
544
546
|
tasksCount={todoCount}
|
|
545
547
|
sectionAction={sectionAction}
|
|
546
548
|
>
|
|
@@ -619,6 +621,22 @@ export default function PersonDetailV2Page({ params }: { params?: { id?: string
|
|
|
619
621
|
)
|
|
620
622
|
}
|
|
621
623
|
|
|
624
|
+
if (activeTab === 'addresses') {
|
|
625
|
+
return (
|
|
626
|
+
<AddressesSection
|
|
627
|
+
entityId={personId}
|
|
628
|
+
emptyLabel={t('customers.people.detail.empty.addresses', 'No addresses linked to this person.')}
|
|
629
|
+
addActionLabel={t('customers.people.detail.addresses.add', 'Add address')}
|
|
630
|
+
emptyState={{
|
|
631
|
+
title: t('customers.people.detail.emptyState.addresses.title', 'No addresses yet'),
|
|
632
|
+
actionLabel: t('customers.people.detail.emptyState.addresses.action', 'Add address'),
|
|
633
|
+
}}
|
|
634
|
+
onActionChange={handleSectionActionChange}
|
|
635
|
+
translator={detailTranslator}
|
|
636
|
+
/>
|
|
637
|
+
)
|
|
638
|
+
}
|
|
639
|
+
|
|
622
640
|
if (activeTab === 'tasks') {
|
|
623
641
|
return (
|
|
624
642
|
<TasksSection
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
History,
|
|
14
14
|
Paperclip,
|
|
15
15
|
Plus,
|
|
16
|
+
MapPin,
|
|
16
17
|
} from 'lucide-react'
|
|
17
18
|
import type { SectionAction } from '@open-mercato/ui/backend/detail'
|
|
18
19
|
|
|
@@ -21,6 +22,7 @@ export type PersonTabId =
|
|
|
21
22
|
| 'emails'
|
|
22
23
|
| 'deals'
|
|
23
24
|
| 'companies'
|
|
25
|
+
| 'addresses'
|
|
24
26
|
| 'tasks'
|
|
25
27
|
| 'changelog'
|
|
26
28
|
| 'files'
|
|
@@ -40,13 +42,14 @@ type PersonDetailTabsProps = {
|
|
|
40
42
|
activitiesCount?: number
|
|
41
43
|
dealsCount?: number
|
|
42
44
|
companiesCount?: number
|
|
45
|
+
addressesCount?: number
|
|
43
46
|
tasksCount?: number
|
|
44
47
|
filesCount?: number
|
|
45
48
|
sectionAction?: SectionAction | null
|
|
46
49
|
children: React.ReactNode
|
|
47
50
|
}
|
|
48
51
|
|
|
49
|
-
const SUPPORTED_TAB_IDS = new Set<PersonTabId>(['activities', 'emails', 'deals', 'companies', 'tasks', 'changelog', 'files'])
|
|
52
|
+
const SUPPORTED_TAB_IDS = new Set<PersonTabId>(['activities', 'emails', 'deals', 'companies', 'addresses', 'tasks', 'changelog', 'files'])
|
|
50
53
|
|
|
51
54
|
export function resolveLegacyTab(tab: string | null | undefined): PersonTabId {
|
|
52
55
|
if (!tab) return 'activities'
|
|
@@ -77,6 +80,7 @@ export function PersonDetailTabs({
|
|
|
77
80
|
activitiesCount = 0,
|
|
78
81
|
dealsCount = 0,
|
|
79
82
|
companiesCount = 0,
|
|
83
|
+
addressesCount = 0,
|
|
80
84
|
tasksCount = 0,
|
|
81
85
|
filesCount = 0,
|
|
82
86
|
sectionAction = null,
|
|
@@ -109,6 +113,12 @@ export function PersonDetailTabs({
|
|
|
109
113
|
icon: <Building2 className="size-4" />,
|
|
110
114
|
badge: <CountBadge count={companiesCount} />,
|
|
111
115
|
},
|
|
116
|
+
{
|
|
117
|
+
id: 'addresses',
|
|
118
|
+
label: t('customers.people.detail.tabs.addresses', 'Addresses'),
|
|
119
|
+
icon: <MapPin className="size-4" />,
|
|
120
|
+
badge: <CountBadge count={addressesCount} />,
|
|
121
|
+
},
|
|
112
122
|
{
|
|
113
123
|
id: 'tasks',
|
|
114
124
|
label: t('customers.people.detail.tabs.tasks', 'Tasks'),
|
|
@@ -128,7 +138,7 @@ export function PersonDetailTabs({
|
|
|
128
138
|
badge: <CountBadge count={filesCount} />,
|
|
129
139
|
},
|
|
130
140
|
],
|
|
131
|
-
[t, activitiesCount, dealsCount, companiesCount, tasksCount, filesCount],
|
|
141
|
+
[t, activitiesCount, dealsCount, companiesCount, addressesCount, tasksCount, filesCount],
|
|
132
142
|
)
|
|
133
143
|
|
|
134
144
|
const allTabs: TabDef[] = React.useMemo(
|
|
@@ -719,11 +719,13 @@ async function resolveAddressSnapshot(
|
|
|
719
719
|
addressId?: string | null,
|
|
720
720
|
): Promise<Record<string, unknown> | null> {
|
|
721
721
|
if (!addressId) return null;
|
|
722
|
-
const address = await
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
tenantId,
|
|
726
|
-
|
|
722
|
+
const address = await findOneWithDecryption(
|
|
723
|
+
em,
|
|
724
|
+
CustomerAddress,
|
|
725
|
+
{ id: addressId, organizationId, tenantId },
|
|
726
|
+
undefined,
|
|
727
|
+
{ tenantId, organizationId },
|
|
728
|
+
);
|
|
727
729
|
if (!address) return null;
|
|
728
730
|
|
|
729
731
|
return {
|