diff --git a/apps/db/migrations/44_telefono_v2.up.sql b/apps/db/migrations/44_telefono_v2.up.sql
new file mode 100644
index 0000000..db7ee9f
--- /dev/null
+++ b/apps/db/migrations/44_telefono_v2.up.sql
@@ -0,0 +1,5 @@
+ALTER TABLE IF EXISTS public.users
+ ADD COLUMN IF NOT EXISTS extra_telefono_titolo text;
+
+ALTER TABLE IF EXISTS public.users
+ ADD COLUMN IF NOT EXISTS extra_telefono_numero text;
\ No newline at end of file
diff --git a/apps/infoalloggi/src/components/area-riservata/userViewHeader.tsx b/apps/infoalloggi/src/components/area-riservata/userViewHeader.tsx
index 2234674..74f8c36 100644
--- a/apps/infoalloggi/src/components/area-riservata/userViewHeader.tsx
+++ b/apps/infoalloggi/src/components/area-riservata/userViewHeader.tsx
@@ -144,9 +144,20 @@ export const UserViewHeader = () => {
+ {data.extra_telefono_numero && (
+
+
+
+ )}
{data.codice_fiscale ? (
) : (
diff --git a/apps/infoalloggi/src/components/tables/richieste-table.tsx b/apps/infoalloggi/src/components/tables/richieste-table.tsx
index ca169a4..85d9035 100644
--- a/apps/infoalloggi/src/components/tables/richieste-table.tsx
+++ b/apps/infoalloggi/src/components/tables/richieste-table.tsx
@@ -31,6 +31,9 @@ import {
ContextMenuContent,
ContextMenuItem,
ContextMenuLabel,
+ ContextMenuSub,
+ ContextMenuSubContent,
+ ContextMenuSubTrigger,
ContextMenuTrigger,
} from "~/components/ui/context-menu";
import { DataTable } from "~/components/ui/data-table";
@@ -161,17 +164,47 @@ export const RichiesteTable = ({ data }: RichiesteTableProps) => {
Profilo
-
-
-
-
- WhatsApp
-
-
+ {data.extra_telefono_numero ? (
+
+
+
+ WhatsApp
+
+
+
+
+
+ WhatsApp ({data.nome})
+
+
+
+
+
+ WhatsApp ({data.extra_telefono_titolo})
+
+
+
+
+ ) : (
+
+
+
+ WhatsApp
+
+
+ )}
);
diff --git a/apps/infoalloggi/src/components/tables/users-table.tsx b/apps/infoalloggi/src/components/tables/users-table.tsx
index a3f4c97..2a6fd69 100644
--- a/apps/infoalloggi/src/components/tables/users-table.tsx
+++ b/apps/infoalloggi/src/components/tables/users-table.tsx
@@ -38,6 +38,9 @@ import {
ContextMenuItem,
ContextMenuLabel,
ContextMenuSeparator,
+ ContextMenuSub,
+ ContextMenuSubContent,
+ ContextMenuSubTrigger,
} from "../ui/context-menu";
import {
Dialog,
@@ -66,10 +69,13 @@ export const UsersTable = (props: { data: UserWChatInfo[] }) => {
const tabledata = data.map((user) => {
return {
+ nome: user.nome,
chatid: user.chatid,
created_at: user.created_at,
email: user.email,
telefono: user.telefono,
+ extra_telefono_numero: user.extra_telefono_numero,
+ extra_telefono_titolo: user.extra_telefono_titolo,
note: user.note,
id: user.id,
isAdmin: user.isAdmin ? "Admin" : "Utente",
@@ -190,6 +196,22 @@ export const UsersTable = (props: { data: UserWChatInfo[] }) => {
title={columns_titles.telefono}
/>
),
+ cell: ({ row }) => {
+ const { nome, telefono, extra_telefono_numero, extra_telefono_titolo } =
+ row.original;
+ return (
+
+ {telefono}
+ {extra_telefono_numero && (
+ <>
+ {nome}
+ {extra_telefono_numero}
+ {extra_telefono_titolo}
+ >
+ )}
+
+ );
+ },
},
{
accessorKey: "email",
@@ -361,16 +383,48 @@ export const UsersTable = (props: { data: UserWChatInfo[] }) => {
Chat
-
-
-
- WhatsApp
-
-
+ {data.extra_telefono_numero ? (
+
+
+
+ WhatsApp
+
+
+
+
+
+ WhatsApp ({data.nome})
+
+
+
+
+
+ WhatsApp ({data.extra_telefono_titolo})
+
+
+
+
+ ) : (
+
+
+
+ WhatsApp
+
+
+ )}
+