Fix: Filtro Fecha Tiradas
All checks were successful
Optimized Build and Deploy / remote-build-and-deploy (push) Successful in 5m10s

This commit is contained in:
2025-07-18 17:04:12 -03:00
parent c96d259892
commit a35a3a66ea
2 changed files with 114 additions and 91 deletions

View File

@@ -14,7 +14,7 @@ jobs:
run: |
set -e
# Configura SSH
# Configura SSH (sin cambios)
apt-get update -qq && apt-get install -y openssh-client git
mkdir -p ~/.ssh
echo "${{ secrets.PROD_SERVER_SSH_KEY }}" > ~/.ssh/id_rsa
@@ -26,6 +26,12 @@ jobs:
set -e
echo "--- INICIO DEL DESPLIEGUE OPTIMIZADO ---"
# --- Asegurar que el Stack de la Base de Datos esté corriendo ---
echo "Asegurando que el stack de la base de datos esté activo..."
cd /opt/shared-services/database
# El comando 'up -d' es idempotente. Si ya está corriendo, no hace nada.
docker compose up -d
# 1. Preparar entorno
TEMP_DIR=$(mktemp -d)
REPO_OWNER="dmolinari"
@@ -37,7 +43,7 @@ jobs:
cd "$TEMP_DIR"
git checkout "${{ gitea.sha }}"
# 2. Construcción paralela con Docker nativo (más rápido y fiable)
# 2. Construcción paralela
build_image() {
local dockerfile=$1
local image_name=$2
@@ -59,7 +65,7 @@ jobs:
cd /opt/gestion-integral
export DB_SA_PASSWORD='${{ secrets.DB_SA_PASSWORD_SECRET }}'
echo "Recreando servicios..."
echo "Recreando servicios de la aplicación..."
docker compose up -d --force-recreate
# 4. Limpieza
@@ -68,5 +74,4 @@ jobs:
docker image prune -f --filter "dangling=true"
echo "--- DESPLIEGUE COMPLETADO CON ÉXITO ---"
echo "Tiempo total: $(($SECONDS / 60)) minutos y $(($SECONDS % 60)) segundos"
EOSSH

View File

@@ -25,6 +25,13 @@ import TiradaFormModal from '../../components/Modals/Impresion/TiradaFormModal';
import { usePermissions } from '../../hooks/usePermissions';
import axios from 'axios';
const toLocalDateString = (date: Date): string => {
const year = date.getFullYear();
const month = (date.getMonth() + 1).toString().padStart(2, '0');
const day = date.getDate().toString().padStart(2, '0');
return `${year}-${month}-${day}`;
};
const GestionarTiradasPage: React.FC = () => {
const [tiradas, setTiradas] = useState<TiradaDto[]>([]);
const [loading, setLoading] = useState(true);
@@ -32,7 +39,7 @@ const GestionarTiradasPage: React.FC = () => {
const [apiErrorMessage, setApiErrorMessage] = useState<string | null>(null);
// Filtros
const [filtroFecha, setFiltroFecha] = useState<string>(new Date().toISOString().split('T')[0]);
const [filtroFecha, setFiltroFecha] = useState<string>(toLocalDateString(new Date()));
const [filtroIdPublicacion, setFiltroIdPublicacion] = useState<number | string>('');
const [filtroIdPlanta, setFiltroIdPlanta] = useState<number | string>('');
@@ -118,7 +125,10 @@ const GestionarTiradasPage: React.FC = () => {
}
};
const formatDate = (dateString?: string | null) => dateString ? new Date(dateString + 'T00:00:00Z').toLocaleDateString('es-AR') : '-';
const formatDate = (dateString?: string | null) => {
if (!dateString) return '-';
return new Date(dateString).toLocaleDateString('es-AR', { timeZone: 'UTC' });
};
if (!loading && !puedeVer && !loadingFiltersDropdown) return <Box sx={{ p: 2 }}><Alert severity="error">{error || "Acceso denegado."}</Alert></Box>;
@@ -129,7 +139,15 @@ const GestionarTiradasPage: React.FC = () => {
<Paper sx={{ p: 2, mb: 2 }}>
<Typography variant="h6" gutterBottom>Filtros <FilterListIcon fontSize="small" /></Typography>
<Box sx={{ display: 'flex', flexWrap: 'wrap', gap: 2, alignItems: 'center', mb: 2 }}>
<TextField label="Fecha" type="date" size="small" value={filtroFecha} onChange={(e) => setFiltroFecha(e.target.value)} InputLabelProps={{ shrink: true }} sx={{minWidth: 170}}/>
<TextField
label="Fecha"
type="date"
size="small"
value={filtroFecha}
onChange={(e) => setFiltroFecha(e.target.value)}
InputLabelProps={{ shrink: true }}
sx={{ minWidth: 170 }}
/>
<FormControl size="small" sx={{ minWidth: 200, flexGrow: 1 }} disabled={loadingFiltersDropdown}>
<InputLabel>Publicación</InputLabel>
<Select value={filtroIdPublicacion} label="Publicación" onChange={(e) => setFiltroIdPublicacion(e.target.value as number | string)}>