Fix frontend

This commit is contained in:
2026-03-19 17:12:39 +01:00
parent be5ef212e9
commit 106ed50361
3 changed files with 19 additions and 19 deletions
+10 -10
View File
@@ -10,13 +10,13 @@ Non effettuare test da Browser, ci penso io
Questi i container: Questi i container:
pecflow-worker-1 pechub-worker-1
pecflow-frontend-1 pechub-frontend-1
pecflow-backend-1 pechub-backend-1
pecflow-nginx-1 pechub-nginx-1
pecflow-db-1 pechub-db-1
pecflow-redis-1 pechub-redis-1
pecflow-minio-1 pechub-minio-1
Queste le caselle PEC e i loro parametri IMAP/SMTP che puoi usare per test, non effettuare invii per adesso Queste le caselle PEC e i loro parametri IMAP/SMTP che puoi usare per test, non effettuare invii per adesso
@@ -36,7 +36,7 @@ Tutto il frontend deve essere in italiano
Credenziali admin Credenziali admin
Ruolo Email Password Ruolo Email Password
Super Admin superadmin@pecflow.it SuperAdmin@PecFlow2026! Super Admin superadmin@pechub.it SuperAdmin@PEChub2026!
Admin (tenant demo) admin@demo.pecflow.it Demo@PecFlow2026! Admin (tenant demo) admin@demo.pechub.it Demo@PEChub2026!
Operator (tenant demo) operator@demo.pecflow.it Oper@PecFlow2026! Operator (tenant demo) operator@demo.pechub.it Oper@PEChub2026!
Per accedere all'applicazione usa le credenziali Admin del tenant demo. Per accedere all'applicazione usa le credenziali Admin del tenant demo.
+2 -2
View File
@@ -94,7 +94,7 @@ async def send_message(
async def send_test_message( async def send_test_message(
bot_token: str, bot_token: str,
chat_id: str, chat_id: str,
channel_name: str = "PecFlow", channel_name: str = "PEChub",
) -> dict: ) -> dict:
""" """
Invia un messaggio di test formattato al canale configurato. Invia un messaggio di test formattato al canale configurato.
@@ -106,7 +106,7 @@ async def send_test_message(
ts = datetime.now().strftime("%Y-%m-%d %H:%M:%S") ts = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
text = ( text = (
f"✅ <b>PecFlow Test canale Telegram</b>\n\n" f"✅ <b>PEChub Test canale Telegram</b>\n\n"
f"Il canale <b>{channel_name}</b> è configurato correttamente.\n\n" f"Il canale <b>{channel_name}</b> è configurato correttamente.\n\n"
f"🕐 <i>{ts}</i>" f"🕐 <i>{ts}</i>"
) )
@@ -10,12 +10,12 @@ Testa:
4. Test via NotificationService.test_channel (flusso completo) 4. Test via NotificationService.test_channel (flusso completo)
Eseguire DENTRO il container backend: Eseguire DENTRO il container backend:
docker exec pecflow-backend-1 python \ docker exec pechub-backend-1 python \
/app/tests/integration/test_telegram_real.py /app/tests/integration/test_telegram_real.py
Oppure specificando credenziali manuali via env: Oppure specificando credenziali manuali via env:
docker exec -e TELEGRAM_BOT_TOKEN=xxx -e TELEGRAM_CHAT_ID=-100yyy \ docker exec -e TELEGRAM_BOT_TOKEN=xxx -e TELEGRAM_CHAT_ID=-100yyy \
pecflow-backend-1 python /app/tests/integration/test_telegram_real.py pechub-backend-1 python /app/tests/integration/test_telegram_real.py
""" """
import asyncio import asyncio
@@ -28,7 +28,7 @@ from datetime import datetime
# ─── Variabili d'ambiente ───────────────────────────────────────────────────── # ─── Variabili d'ambiente ─────────────────────────────────────────────────────
os.environ.setdefault("ENCRYPTION_KEY", "6465762d656e6372797074696f6e2d6b65792d6e6f742d666f722d70726f6400") os.environ.setdefault("ENCRYPTION_KEY", "6465762d656e6372797074696f6e2d6b65792d6e6f742d666f722d70726f6400")
os.environ.setdefault("SECRET_KEY", "dev-secret-key-not-for-production-use-only-for-local-0000000000000") os.environ.setdefault("SECRET_KEY", "dev-secret-key-not-for-production-use-only-for-local-0000000000000")
os.environ.setdefault("DATABASE_URL", "postgresql+asyncpg://pecflow:pecflow_dev_password@db:5432/pecflow") os.environ.setdefault("DATABASE_URL", "postgresql+asyncpg://pechub:pechub_dev_password@db:5432/pechub")
os.environ.setdefault("REDIS_URL", "redis://redis:6379/0") os.environ.setdefault("REDIS_URL", "redis://redis:6379/0")
os.environ.setdefault("MINIO_ENDPOINT", "minio:9000") os.environ.setdefault("MINIO_ENDPOINT", "minio:9000")
@@ -41,7 +41,7 @@ def _sep(char: str = "─", width: int = 60) -> None:
def _banner(bot_token_masked: str, chat_id: str) -> None: def _banner(bot_token_masked: str, chat_id: str) -> None:
_sep("") _sep("")
print(" PecFlow Test Telegram Reale") print(" PEChub Test Telegram Reale")
_sep("") _sep("")
print(f" Timestamp : {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}") print(f" Timestamp : {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}")
print(f" Bot Token : {bot_token_masked}") print(f" Bot Token : {bot_token_masked}")
@@ -145,7 +145,7 @@ async def test_direct_send(bot_token: str, chat_id: str) -> bool:
ts = datetime.now().strftime("%Y-%m-%d %H:%M:%S") ts = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
text = ( text = (
f"🧪 <b>PecFlow Test integrazione</b>\n\n" f"🧪 <b>PEChub Test integrazione</b>\n\n"
f"Test invio diretto via <code>send_message()</code>\n\n" f"Test invio diretto via <code>send_message()</code>\n\n"
f"🕐 <i>{ts}</i>" f"🕐 <i>{ts}</i>"
) )
@@ -201,14 +201,14 @@ async def test_send_test_message(bot_token: str, chat_id: str) -> bool:
from app.notifications.telegram import TelegramError, send_test_message from app.notifications.telegram import TelegramError, send_test_message
print(" Chiamata: send_test_message(channel_name='Test PecFlow')") print(" Chiamata: send_test_message(channel_name='Test PEChub')")
print() print()
try: try:
result = await send_test_message( result = await send_test_message(
bot_token=bot_token, bot_token=bot_token,
chat_id=chat_id, chat_id=chat_id,
channel_name="Test PecFlow", channel_name="Test PEChub",
) )
msg_id = result.get("message_id") msg_id = result.get("message_id")
print(f" ✅ INVIO OK message_id={msg_id}") print(f" ✅ INVIO OK message_id={msg_id}")