Fix: Filtro Fecha Tiradas
All checks were successful
Optimized Build and Deploy / remote-build-and-deploy (push) Successful in 5m10s
All checks were successful
Optimized Build and Deploy / remote-build-and-deploy (push) Successful in 5m10s
This commit is contained in:
@@ -14,7 +14,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Configura SSH
|
# Configura SSH (sin cambios)
|
||||||
apt-get update -qq && apt-get install -y openssh-client git
|
apt-get update -qq && apt-get install -y openssh-client git
|
||||||
mkdir -p ~/.ssh
|
mkdir -p ~/.ssh
|
||||||
echo "${{ secrets.PROD_SERVER_SSH_KEY }}" > ~/.ssh/id_rsa
|
echo "${{ secrets.PROD_SERVER_SSH_KEY }}" > ~/.ssh/id_rsa
|
||||||
@@ -26,6 +26,12 @@ jobs:
|
|||||||
set -e
|
set -e
|
||||||
echo "--- INICIO DEL DESPLIEGUE OPTIMIZADO ---"
|
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
|
# 1. Preparar entorno
|
||||||
TEMP_DIR=$(mktemp -d)
|
TEMP_DIR=$(mktemp -d)
|
||||||
REPO_OWNER="dmolinari"
|
REPO_OWNER="dmolinari"
|
||||||
@@ -37,7 +43,7 @@ jobs:
|
|||||||
cd "$TEMP_DIR"
|
cd "$TEMP_DIR"
|
||||||
git checkout "${{ gitea.sha }}"
|
git checkout "${{ gitea.sha }}"
|
||||||
|
|
||||||
# 2. Construcción paralela con Docker nativo (más rápido y fiable)
|
# 2. Construcción paralela
|
||||||
build_image() {
|
build_image() {
|
||||||
local dockerfile=$1
|
local dockerfile=$1
|
||||||
local image_name=$2
|
local image_name=$2
|
||||||
@@ -59,7 +65,7 @@ jobs:
|
|||||||
cd /opt/gestion-integral
|
cd /opt/gestion-integral
|
||||||
export DB_SA_PASSWORD='${{ secrets.DB_SA_PASSWORD_SECRET }}'
|
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
|
docker compose up -d --force-recreate
|
||||||
|
|
||||||
# 4. Limpieza
|
# 4. Limpieza
|
||||||
@@ -68,5 +74,4 @@ jobs:
|
|||||||
docker image prune -f --filter "dangling=true"
|
docker image prune -f --filter "dangling=true"
|
||||||
|
|
||||||
echo "--- DESPLIEGUE COMPLETADO CON ÉXITO ---"
|
echo "--- DESPLIEGUE COMPLETADO CON ÉXITO ---"
|
||||||
echo "Tiempo total: $(($SECONDS / 60)) minutos y $(($SECONDS % 60)) segundos"
|
|
||||||
EOSSH
|
EOSSH
|
||||||
@@ -25,6 +25,13 @@ import TiradaFormModal from '../../components/Modals/Impresion/TiradaFormModal';
|
|||||||
import { usePermissions } from '../../hooks/usePermissions';
|
import { usePermissions } from '../../hooks/usePermissions';
|
||||||
import axios from 'axios';
|
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 GestionarTiradasPage: React.FC = () => {
|
||||||
const [tiradas, setTiradas] = useState<TiradaDto[]>([]);
|
const [tiradas, setTiradas] = useState<TiradaDto[]>([]);
|
||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(true);
|
||||||
@@ -32,7 +39,7 @@ const GestionarTiradasPage: React.FC = () => {
|
|||||||
const [apiErrorMessage, setApiErrorMessage] = useState<string | null>(null);
|
const [apiErrorMessage, setApiErrorMessage] = useState<string | null>(null);
|
||||||
|
|
||||||
// Filtros
|
// 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 [filtroIdPublicacion, setFiltroIdPublicacion] = useState<number | string>('');
|
||||||
const [filtroIdPlanta, setFiltroIdPlanta] = 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>;
|
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 }}>
|
<Paper sx={{ p: 2, mb: 2 }}>
|
||||||
<Typography variant="h6" gutterBottom>Filtros <FilterListIcon fontSize="small" /></Typography>
|
<Typography variant="h6" gutterBottom>Filtros <FilterListIcon fontSize="small" /></Typography>
|
||||||
<Box sx={{ display: 'flex', flexWrap: 'wrap', gap: 2, alignItems: 'center', mb: 2 }}>
|
<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}>
|
<FormControl size="small" sx={{ minWidth: 200, flexGrow: 1 }} disabled={loadingFiltersDropdown}>
|
||||||
<InputLabel>Publicación</InputLabel>
|
<InputLabel>Publicación</InputLabel>
|
||||||
<Select value={filtroIdPublicacion} label="Publicación" onChange={(e) => setFiltroIdPublicacion(e.target.value as number | string)}>
|
<Select value={filtroIdPublicacion} label="Publicación" onChange={(e) => setFiltroIdPublicacion(e.target.value as number | string)}>
|
||||||
|
|||||||
Reference in New Issue
Block a user