diff --git a/Elecciones-Web/frontend/src/features/legislativas/nacionales/components/MapaNacional.tsx b/Elecciones-Web/frontend/src/features/legislativas/nacionales/components/MapaNacional.tsx index 4d75adb..7246a54 100644 --- a/Elecciones-Web/frontend/src/features/legislativas/nacionales/components/MapaNacional.tsx +++ b/Elecciones-Web/frontend/src/features/legislativas/nacionales/components/MapaNacional.tsx @@ -30,7 +30,7 @@ interface ViewConfig { const PROVINCE_VIEW_CONFIG: Record = { "BUENOS AIRES": { desktop: { center: [-60.5, -37.3], zoom: 5 }, mobile: { center: [-60, -38], zoom: 5.5 } }, "SANTA CRUZ": { desktop: { center: [-69.5, -49.3], zoom: 5 }, mobile: { center: [-69.5, -50], zoom: 4 } }, - "CIUDAD AUTONOMA DE BUENOS AIRES": { desktop: { center: [-58.44, -34.65], zoom: 150 } }, + "CAPITAL FEDERAL": { desktop: { center: [-58.44, -34.65], zoom: 150 } }, "CHUBUT": { desktop: { center: [-68.5, -44.5], zoom: 5.5 }, mobile: { center: [-68, -44.5], zoom: 4.5 } }, "SANTA FE": { desktop: { center: [-61, -31.2], zoom: 6 }, mobile: { center: [-61, -31.5], zoom: 7.5 } }, "CORRIENTES": { desktop: { center: [-58, -29], zoom: 7 }, mobile: { center: [-57.5, -28.8], zoom: 9 } }, diff --git a/Elecciones-Web/frontend/src/features/legislativas/nacionales/components/MapaProvincial.tsx b/Elecciones-Web/frontend/src/features/legislativas/nacionales/components/MapaProvincial.tsx index dc73627..cef49b9 100644 --- a/Elecciones-Web/frontend/src/features/legislativas/nacionales/components/MapaProvincial.tsx +++ b/Elecciones-Web/frontend/src/features/legislativas/nacionales/components/MapaProvincial.tsx @@ -7,9 +7,6 @@ import { geoCentroid } from 'd3-geo'; import { feature } from 'topojson-client'; import { API_BASE_URL, assetBaseUrl } from '../../../../apiService'; import type { ResultadoMapaDto, AmbitoGeography } from '../../../../types/types'; -// 1. A diferencia de otros componentes, este no necesita importar el CSS -// porque no tiene un contenedor propio ni clases únicas. -// Heredará y usará las clases globales (:global) definidas en PanelNacional.module.css const DEFAULT_MAP_COLOR = '#E0E0E0'; const normalizarTexto = (texto: string = ''): string => texto.trim().toUpperCase().normalize("NFD").replace(/[\u0300-\u036f]/g, ""); @@ -65,10 +62,7 @@ export const MapaProvincial = ({ eleccionId, categoriaId, distritoId, nombreProv {({ geographies }: { geographies: AmbitoGeography[] }) => geographies.map((geo) => { const resultado = resultadosPorNombre.get(normalizarTexto(geo.properties.departamento)); const esSeleccionado = nombreMunicipioSeleccionado ? normalizarTexto(geo.properties.departamento) === normalizarTexto(nombreMunicipioSeleccionado) : false; - - // 2. Las clases aquí NO usan el objeto 'styles' porque son clases - // que react-simple-maps necesita globalmente. El archivo CSS - // ya se encarga de estilizarlas usando :global(.rsm-geography), etc. + const classNames = [ 'rsm-geography', 'mapa-provincial-geography', diff --git a/Elecciones-Web/src/Elecciones.Worker/LowPriorityDataWorker.cs b/Elecciones-Web/src/Elecciones.Worker/LowPriorityDataWorker.cs index be660bc..adba84d 100644 --- a/Elecciones-Web/src/Elecciones.Worker/LowPriorityDataWorker.cs +++ b/Elecciones-Web/src/Elecciones.Worker/LowPriorityDataWorker.cs @@ -495,9 +495,24 @@ public class LowPriorityDataWorker : BackgroundService if (!ambitosEnDb.ContainsKey(claveUnica)) { + string nombreCorregido = ambitoDto.Nombre; + + // VERIFICAMOS SI ES UNA COMUNA DE CABA + // Condición: El DistritoId es "01" (CABA) Y el NivelId corresponde a Departamento/Comuna (30) + // Y el nombre es simplemente un número. + if (ambitoDto.CodigoAmbitos.DistritoId == "01" && + ambitoDto.NivelId == 30 && + int.TryParse(ambitoDto.Nombre, out int numeroComuna)) + { + // Si cumple las condiciones, le damos el formato correcto. + nombreCorregido = $"COMUNA {numeroComuna}"; + _logger.LogInformation("Nombre de comuna de CABA corregido: de '{Original}' a '{Corregido}'", ambitoDto.Nombre, nombreCorregido); + } + var nuevoAmbito = new AmbitoGeografico { - Nombre = ambitoDto.Nombre, + // Usamos el nombre corregido en lugar del original. + Nombre = nombreCorregido, NivelId = ambitoDto.NivelId, DistritoId = ambitoDto.CodigoAmbitos.DistritoId, SeccionProvincialId = ambitoDto.CodigoAmbitos.SeccionProvincialId,