@hed-hog/contact 0.0.286 → 0.0.292
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.
|
@@ -100,11 +100,25 @@ function usePersonFieldWithCreateTranslations() {
|
|
|
100
100
|
values?: Record<string, string | number | boolean | null | undefined>
|
|
101
101
|
) => {
|
|
102
102
|
const contactKey = `contact.PersonFieldWithCreate.${key}`;
|
|
103
|
+
// Filter values to only include types compatible with next-intl
|
|
104
|
+
const filteredValues = values
|
|
105
|
+
? Object.fromEntries(
|
|
106
|
+
Object.entries(values).filter(
|
|
107
|
+
([_, v]) => typeof v === 'string' || typeof v === 'number'
|
|
108
|
+
)
|
|
109
|
+
)
|
|
110
|
+
: undefined;
|
|
103
111
|
if (tRoot.has(contactKey)) {
|
|
104
|
-
return tRoot(
|
|
112
|
+
return tRoot(
|
|
113
|
+
contactKey,
|
|
114
|
+
filteredValues as Record<string, string | number> | undefined
|
|
115
|
+
);
|
|
105
116
|
}
|
|
106
117
|
|
|
107
|
-
return tRoot(
|
|
118
|
+
return tRoot(
|
|
119
|
+
`finance.PersonFieldWithCreate.${key}`,
|
|
120
|
+
filteredValues as Record<string, string | number> | undefined
|
|
121
|
+
);
|
|
108
122
|
};
|
|
109
123
|
}
|
|
110
124
|
|
|
@@ -643,20 +657,22 @@ export function PersonFieldWithCreate<TFieldValues extends FieldValues>({
|
|
|
643
657
|
params.set('search', debouncedPersonSearch.trim());
|
|
644
658
|
}
|
|
645
659
|
|
|
646
|
-
const response = await request<
|
|
660
|
+
const response = await request<
|
|
661
|
+
PaginatedResponse<PersonOption> | PersonOption[]
|
|
662
|
+
>({
|
|
647
663
|
url: `/person?${params.toString()}`,
|
|
648
664
|
method: 'GET',
|
|
649
665
|
});
|
|
650
666
|
|
|
651
667
|
const payload = response?.data;
|
|
652
|
-
if (Array.isArray(payload?.data)) {
|
|
653
|
-
return payload.data as PersonOption[];
|
|
654
|
-
}
|
|
655
|
-
|
|
656
668
|
if (Array.isArray(payload)) {
|
|
657
669
|
return payload as PersonOption[];
|
|
658
670
|
}
|
|
659
671
|
|
|
672
|
+
if (payload && 'data' in payload && Array.isArray(payload.data)) {
|
|
673
|
+
return payload.data as PersonOption[];
|
|
674
|
+
}
|
|
675
|
+
|
|
660
676
|
return [];
|
|
661
677
|
},
|
|
662
678
|
placeholderData: (old) => old ?? [],
|
|
@@ -670,7 +686,10 @@ export function PersonFieldWithCreate<TFieldValues extends FieldValues>({
|
|
|
670
686
|
return (
|
|
671
687
|
<>
|
|
672
688
|
<div className="grid gap-2">
|
|
673
|
-
<Label
|
|
689
|
+
<Label
|
|
690
|
+
data-error={!!fieldState.error}
|
|
691
|
+
className="data-[error=true]:text-destructive"
|
|
692
|
+
>
|
|
674
693
|
{label}
|
|
675
694
|
</Label>
|
|
676
695
|
<Controller
|
|
@@ -798,9 +817,7 @@ export function PersonFieldWithCreate<TFieldValues extends FieldValues>({
|
|
|
798
817
|
}}
|
|
799
818
|
/>
|
|
800
819
|
{fieldState.error?.message ? (
|
|
801
|
-
<p className="text-destructive text-sm">
|
|
802
|
-
{fieldState.error.message}
|
|
803
|
-
</p>
|
|
820
|
+
<p className="text-destructive text-sm">{fieldState.error.message}</p>
|
|
804
821
|
) : null}
|
|
805
822
|
</div>
|
|
806
823
|
|
|
@@ -14,12 +14,12 @@ import {
|
|
|
14
14
|
CardHeader,
|
|
15
15
|
CardTitle,
|
|
16
16
|
} from '@/components/ui/card';
|
|
17
|
-
import { KpiCardsGrid } from '@/components/ui/kpi-cards-grid';
|
|
18
17
|
import {
|
|
19
18
|
Collapsible,
|
|
20
19
|
CollapsibleContent,
|
|
21
20
|
CollapsibleTrigger,
|
|
22
21
|
} from '@/components/ui/collapsible';
|
|
22
|
+
import { KpiCardsGrid } from '@/components/ui/kpi-cards-grid';
|
|
23
23
|
import { ScrollArea } from '@/components/ui/scroll-area';
|
|
24
24
|
import {
|
|
25
25
|
Tooltip,
|
|
@@ -154,8 +154,6 @@ function DraggableLeadCard({
|
|
|
154
154
|
'touch-none',
|
|
155
155
|
isDragging && 'z-30 opacity-60 shadow-lg ring-1 ring-primary/30'
|
|
156
156
|
)}
|
|
157
|
-
role="button"
|
|
158
|
-
tabIndex={0}
|
|
159
157
|
onClick={onClick}
|
|
160
158
|
onKeyDown={onKeyDown}
|
|
161
159
|
{...listeners}
|
|
@@ -566,7 +564,8 @@ export default function CrmPipelinePage() {
|
|
|
566
564
|
const sourceLead = visibleLeadsById.get(sourceLeadId);
|
|
567
565
|
if (!sourceLead || sourceLead.lifecycle_stage === targetStage) return;
|
|
568
566
|
|
|
569
|
-
const previousStage =
|
|
567
|
+
const previousStage: PersonLifecycleStage =
|
|
568
|
+
sourceLead.lifecycle_stage ?? 'new';
|
|
570
569
|
|
|
571
570
|
setStageOverrides((prev) => ({ ...prev, [sourceLeadId]: targetStage }));
|
|
572
571
|
setSelectedLead((prev) =>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hed-hog/contact",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.292",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"dependencies": {
|
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
"@nestjs/core": "^11",
|
|
10
10
|
"@nestjs/jwt": "^11",
|
|
11
11
|
"@nestjs/mapped-types": "*",
|
|
12
|
+
"@hed-hog/core": "0.0.292",
|
|
12
13
|
"@hed-hog/api-mail": "0.0.8",
|
|
13
|
-
"@hed-hog/core": "0.0.286",
|
|
14
14
|
"@hed-hog/api-prisma": "0.0.5",
|
|
15
|
-
"@hed-hog/address": "0.0.286",
|
|
16
15
|
"@hed-hog/api-locale": "0.0.13",
|
|
17
|
-
"@hed-hog/api
|
|
18
|
-
"@hed-hog/
|
|
16
|
+
"@hed-hog/api": "0.0.4",
|
|
17
|
+
"@hed-hog/address": "0.0.292",
|
|
18
|
+
"@hed-hog/api-pagination": "0.0.6"
|
|
19
19
|
},
|
|
20
20
|
"exports": {
|
|
21
21
|
".": {
|