diff --git a/CHANGELOG.md b/CHANGELOG.md index 519a19f..de0f83d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## [1.14.4] - 2026-10-09 + +### Fixed +- **UI/UX (Componentes Genéricos)**: Solucionado un error en los componentes de añadir equipos a una subred (`add-clients-to-subnet`) y configuración de ficheros de arranque PXE (`pxe-boot-files`) introducido en versiones previas. Estos componentes enviaban un identificador URI (ej. `/organizational-units/uuid`) o el propio UUID en sus peticiones de búsqueda (GET) en lugar del ID numérico esperado por la base de datos (Doctrine), lo que impedía listar los equipos de las aulas seleccionadas. Ahora resuelven correctamente el ID numérico de la unidad seleccionada antes de realizar la petición al backend. + ## [1.14.3] - 2026-10-09 ### Fixed diff --git a/ogWebconsole/src/app/components/ogboot/pxe-boot-files/pxe-boot-files.component.ts b/ogWebconsole/src/app/components/ogboot/pxe-boot-files/pxe-boot-files.component.ts index 88d7271..23fffbc 100644 --- a/ogWebconsole/src/app/components/ogboot/pxe-boot-files/pxe-boot-files.component.ts +++ b/ogWebconsole/src/app/components/ogboot/pxe-boot-files/pxe-boot-files.component.ts @@ -134,9 +134,15 @@ export class PxeBootFilesComponent implements OnInit { loadChildUnits(event: any) { let unitId = event.value; - if (typeof event.value === 'object' && event.value !== null) { + + // Buscar la unidad organizativa seleccionada para obtener su ID numérico + const selectedUnit = this.units.find(u => (u['@id'] || u.id) === event.value); + if (selectedUnit && selectedUnit.id) { + unitId = selectedUnit.id; + } else if (typeof event.value === 'object' && event.value !== null) { unitId = event.value.id; } else if (typeof event.value === 'string' && event.value.includes('/')) { + // Fallback por si acaso no se encuentra unitId = event.value.split('/').pop(); } diff --git a/ogWebconsole/src/app/components/ogdhcp/add-clients-to-subnet/add-clients-to-subnet.component.ts b/ogWebconsole/src/app/components/ogdhcp/add-clients-to-subnet/add-clients-to-subnet.component.ts index b59278a..ba4773d 100644 --- a/ogWebconsole/src/app/components/ogdhcp/add-clients-to-subnet/add-clients-to-subnet.component.ts +++ b/ogWebconsole/src/app/components/ogdhcp/add-clients-to-subnet/add-clients-to-subnet.component.ts @@ -66,9 +66,15 @@ export class AddClientsToSubnetComponent implements OnInit { loadChildUnits(event: any) { let unitId = event.value; - if (typeof event.value === 'object' && event.value !== null) { + + // Buscar la unidad organizativa seleccionada para obtener su ID numérico + const selectedUnit = this.units.find(u => (u['@id'] || u.id) === event.value); + if (selectedUnit && selectedUnit.id) { + unitId = selectedUnit.id; + } else if (typeof event.value === 'object' && event.value !== null) { unitId = event.value.id; } else if (typeof event.value === 'string' && event.value.includes('/')) { + // Fallback por si acaso no se encuentra (aunque debería) unitId = event.value.split('/').pop(); }