Backport de mejoras genéricas de frontend (desde cliente/tagumedica)

- Nuevo Icon.tsx (reemplaza emojis en toda la app), FieldTooltip, ConfirmModal, PageLoader, SecondaryButton, hook useSapCatalog, utils/errors (getErrorMessage).
- App.tsx: code-splitting con lazy()+Suspense+PageLoader para todas las rutas.
- MainLayout.tsx: menú usa Icon.tsx en vez de emojis.
- FormattedField/SelectField: soporte de dbField+tooltip, multiline.
- DenseTable/FilterBar/ListViewTemplate: onClear, mejoras varias.
- PrimaryButton: variante de tamaño sm/md.
- Renombres *View.tsx para uniformar el naming de vistas de detalle/mantenimiento (Dashboard, Items, BatchNumberDetails, Customers, Suppliers, Invoices, Orders, PurchaseOrders, PurchaseInvoices) y SapLogin -> SapLoginForm.
- BatchNumberDetailsList: filtros y columna de descripción de artículo.
- Configs de reportes e iconos de módulos actualizados a Icon.tsx.
- Ajustes de paleta en los 4 temas CSS.
- Docs actualizadas.

Se excluyó explícitamente del backport (queda solo en cliente/tagumedica, no es reusable sin adaptar a los UDFs propios de cada cliente):
- Vistas InmovilizarLotesView, LiberarLotesView, ConfirmarLiberacionLoteView y sus rutas/ítems de menú.
- types/sapInventoryLock.ts (contrato con los UDFs U_SIS_MOVINV/U_EXX_TIPOOPER/U_SIS_TIPDESP/U_SIS_MOTALM de Tagumedica).
- En BatchForm.tsx: los 3 campos U_SIS_MOTEST/U_SIS_COMEST/U_SIS_ACCTOM (Motivo/Comentario/Acción), manteniendo el resto de mejoras genéricas del archivo y reactivando el campo estándar "Detalles/Observaciones" que en tagumedica había quedado comentado sin justificación genérica.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
GeorgeandClaude Sonnet 5 committed 2026-09-28 14:28:29 -05:00
1 parent fef21898f9
commit f58f4292c3
55 files changed
+1014 -356

No files matched your search

+8
View File
@@ -0,0 +1,8 @@
/**
* `catch` recibe `unknown` en TypeScript estricto porque JavaScript permite
* lanzar cualquier valor (no solo instancias de Error). Este helper evita
* repetir la verificación `instanceof Error` en cada bloque catch de la app.
*/
export function getErrorMessage(err: unknown, fallback: string): string {
return err instanceof Error && err.message ? err.message : fallback;
}
+7 -7
View File
@@ -1,17 +1,17 @@
const STATUS_COLORS_MAP: Record<string, Record<string, { bg: string; text: string; icon?: string }>> = {
BATCH_STATUS_APROBACION: {
"101": { bg: "#fff8e1", text: "#f57f17", icon: "⏳" },
"102": { bg: "#e8f5e9", text: "#2e7d32", icon: "✅" },
"103": { bg: "#fce4ec", text: "#c62828", icon: "❌" },
"104": { bg: "#f5f5f5", text: "#616161", icon: "🔒" },
"101": { bg: "#fff8e1", text: "#f57f17", icon: "clock" },
"102": { bg: "#e8f5e9", text: "#2e7d32", icon: "check-circle" },
"103": { bg: "#fce4ec", text: "#c62828", icon: "x-circle" },
"104": { bg: "#f5f5f5", text: "#616161", icon: "lock" },
},
BATCH_STATUS_LIBERACION: {
"101": { bg: "#e8f5e9", text: "#2e7d32", icon: "✅" },
"101": { bg: "#e8f5e9", text: "#2e7d32", icon: "check-circle" },
"102": { bg: "#fff8e1", text: "#f57f17" },
},
DOCUMENT_STATUS: {
"bost_Open": { bg: "#e8f5e9", text: "#2e7d32", icon: "✅" },
"bost_Close": { bg: "#fce4ec", text: "#c62828", icon: "🔒" },
"bost_Open": { bg: "#e8f5e9", text: "#2e7d32", icon: "check-circle" },
"bost_Close": { bg: "#fce4ec", text: "#c62828", icon: "lock" },
},
};