Commit graph

81 commits

Author SHA1 Message Date
bba2ad5523 fix(fires): el mapa de /fires ya no se queda en gris
All checks were successful
build-image / test (push) Successful in 2m22s
build-image / build (push) Successful in 11m25s
Causa raíz, encontrada reproduciéndolo con el bundle de producción en local
—con el servidor de desarrollo NO se ve, y por eso llevaba semanas dándose por
un artefacto del navegador sin pantalla:

    if ((centerStored !== [0, 0] || geolocation.get()) && geoInit) {
      center.set(centerStored || geolocation.get());
      geoInit = false;
    }

`centerStored !== [0, 0]` compara contra un array recién creado: es SIEMPRE
cierto. En un navegador nuevo —sin centro en localStorage y con la
geolocalización todavía sin resolver— eso hacía `center.set(undefined)` y dejaba
`geoInit` en false, o sea para siempre. Un `<MapContainer>` sin `center` no
recibe `setView`, y un mapa de Leaflet sin vista no carga capa base ni teselas
ni dispara `whenReady`, con lo que tampoco se creaba la suscripción por
viewport. En desarrollo no pasaba porque la geolocalización llegaba a tiempo.

Y de paso el "Actualizando…" que no se quitaba nunca: las suscripciones se
creaban dentro de un `Tracker.autorun` ANIDADO en el withTracker. La computación
de fuera no dependía de `mapSize`, así que `loading` se calculaba con
`subscription` a undefined y no volvía a recalcularse; además cada pasada del
withTracker dejaba otro autorun sin parar. Ahora las suscripciones se crean en
la propia computación reactiva, que es donde Meteor sabe pararlas al invalidarse.

MapReady, además, vigila el contenedor con un ResizeObserver: su comprobación de
tamaño solo podía reintentar con el evento `resize` de Leaflet, que no se emite
si nadie llama a invalidateSize(). No era la causa de esto, pero hacía que la
comprobación no sirviera de nada.

La suite e2e deja de usar selectores por id: TestUtils.testId() los devuelve solo
en desarrollo, así que contra el bundle de producción —lo que levanta el job
nocturno— no existían y la suite entera habría fallado esta noche.

Verificado contra bundle de producción: /fires pasa de 0 teselas y 0 capas a 12
teselas, capa base y las dos suscripciones por viewport, sin "Actualizando…".
90 tests de servidor, 16 e2e y smoke REST byte-idéntico.
2026-08-03 19:59:30 +02:00
a24c7a567c fix(fires): "En rojo, 0 fuegos activos" con el mapa lleno de fuegos
La leyenda de /fires decidia por `activefires` pero contaba `activefiresunion`:

  (activefires.length + firealerts.length) === 0 ? "No hay fuegos..." :
     "En rojo, {activefiresunion.length + firealerts.length} fuegos activos"

`activefiresunion` no la escribe nadie. La union de fuegos es un WIP de
fires-csv-mongo-import que nunca llego a produccion (usa thelpers/tsimplify/tbuffer
sin require), y de hecho el <FireListUnion> que la dibujaria solo se renderiza bajo
`Meteor.isDevelopment`. Verificado en la base de datos de PRODUCCION: activefiresunion = 0
documentos, con 3608 en activefires. O sea que el contador lleva anos diciendo 0.

Ahora cuenta `activefires`, que es justo lo que pinta en rojo el FireList `nasa`.

No es una regresion de la modernizacion: produccion tiene el mismo fallo. Si algun dia se
reimplementa la union de fuegos habra que revisar este contador (y sacar FireListUnion de
isDevelopment).
2026-07-28 09:01:05 +02:00
bc778bfd97 deps: react-leaflet 1.8 -> 4.2 (+ leaflet 1.9) — the last legacy react-* lib
Ground-up hooks rewrite of the app's core map. Removes the final batch of
React-19-blocking warnings (legacy context on Map/LayersControl/TileLayer/
Marker/CircleMarker/Circle/Tooltip + ReactDOM.render from the old controls).

Core: <Map> -> <MapContainer>; .leafletElement refs (6 files) -> the map/
layer instances directly, via a <MapReady> child (useMap) + plain refs on
Marker/Circle/GeoJSON; controlled viewport (onViewportChanged + state.center/
zoom) -> <MapEvents> (useMapEvents moveend/zoomend) + imperative setView;
onClick -> eventHandlers={{click}}; Path styling -> pathOptions/style;
subsUnion takes the L.Map directly.

The 4 v1-only plugins reimplemented (new in-repo helpers under Maps/):
- react-leaflet-control -> MapControl (L.Control + createPortal)
- react-leaflet-google  -> GoogleMutantLayer (createLayerComponent +
  leaflet.gridlayer.googlemutant; Google Maps API already loaded by Gkeys)
- react-leaflet-fullscreen -> createControlComponent + leaflet.fullscreen
- leaflet-sleep / leaflet-graphicscale kept as vanilla (work on leaflet 1.9)

Browser-verified: /fires (tiles, OSM+Google layer switch, custom control,
fullscreen, graphic scale, pan/zoom -> re-fetch, no NaN), fire detail
(GeoJSON rect + fitBounds), home (3 maps coexist; SelectionMap draggable
marker -> updatePosition + distance circle). Console now shows 0 React
warnings on home/fires. REST smoke byte-identical.
2026-07-21 18:45:15 +02:00
5661e129fb fix: NaN in /fires 'active fires in map' count (react-i18next 14 <Trans>)
react-i18next 14 reserves `count` as the pluralization variable and no
longer interpolates it from a <Trans> object child, so <strong>{{count:N}}</strong>
left {{count,number}} unresolved -> the number formatter ran on undefined ->
"NaN". (t() and the countTotal var were unaffected; regression from the
i18next 10->23 / react-i18next 7->14 bump.)

Renamed the variable count -> inMap in FiresMap.js and in the
activeFireInMapCount value of the es/en/gl locales (the string has no plural
forms, so count was only an unlucky name). Browser-verified: /fires now shows
the real count; home/zones/fire-detail render with no real errors. REST smoke
byte-identical.
2026-07-21 13:45:59 +02:00
a1a1b9a801 deps: react-bootstrap 0.31 -> 2 (Bootstrap 5 CSS deferred as debt)
Removes the largest batch of React-19-blocking warnings: the 0.31
components (Grid, FormGroup, ControlLabel, Navbar.Header/Brand, Checkbox,
SafeAnchor) all leaned on legacy context / defaultProps.

29 files converted: Grid->Container, FormGroup/ControlLabel/FormControl/
HelpBlock -> Form.Group/Label/Control/Text, Checkbox -> Form.Check (label
as prop), bsStyle->variant (default->secondary), bsSize->size,
pull-right->float-end. Custom Col.js now re-exports v2's Col; custom
NavItem.js rewritten self-contained (no SafeAnchor/createChainedFunction);
Navigation.js drops react-bootstrap Navbar (raw markup anyway).

CSS stays on Bootstrap 4 (alexwine:bootstrap-4) for now: the BS4->5 jump
is entangled with the jQuery carousel/swipe + navbar-collapse and is
tracked as separate debt in UPGRADE.md. Only .form-label needed a shim
(forms.scss). Browser-verified home carousel+navbar, signup form + terms
checkbox, login form; REST smoke byte-identical.
2026-07-21 12:44:46 +02:00
12bdbe8fed deps: i18next 10 -> 23, react-i18next 7 -> 14
Modernizes the whole i18n stack:
- 48 translate([], {wait:true}) / translate() HOCs -> withTranslation()
- react.wait:true -> react.useSuspense:false
- whitelist -> supportedLngs; added compatibilityJSON: 'v3' so our
  natural-language keys + v3 _plural layout keep working (custom
  separators ss/eth/dj preserved)
- backends: xhr -> i18next-http-backend (client), sync-fs ->
  i18next-fs-backend (server); dropped i18next-localstorage-cache
  (was enabled:false); languagedetector 2 -> 8
- ReSendEmail: <Interpolate> (removed in v10) -> <Trans values={{email}}/>,
  dropped the removed bare t export
- saveMissing handler signature (lngs, ns, key, fallbackValue)

Silences the per-component Translate/I18n legacy-context warnings.
Browser-verified es/en switch and <Trans> interpolation on /fires;
REST smoke byte-identical.
2026-07-18 06:28:41 +02:00
f1eae84e25 deps: react-helmet -> react-helmet-async 2
react-helmet 5 is unmaintained and breaks under React 18 StrictMode.
Same <Helmet> API in the 15 pages; HelmetProvider wraps <App/> in the
client entry. Browser-verified: per-page titles, meta description and
hreflang alternates all inject. REST smoke byte-identical.
2026-07-18 06:14:14 +02:00
eb3aec82ae meteor3: purge dead client packages — web UI renders on 3.1
alanning:roles removed (client crashed the whole bundle; plain user.roles
checks instead), selaias:cookie-consent replaced by in-repo React banner,
publish-performant-counts vendored with countAsync, Meteor.autorun dropped
(App)/Tracker.autorun (FiresMap), and the map publications not covered by
the REST smoke (activefiresmyloc, activefiresunionmyloc, fireAlerts,
oauth.verifyConfiguration) converted to async APIs.

Verified in browser: / and /fires render with map + cookie banner, zero
uncaught exceptions. REST smoke byte-identical (12/12).
2026-07-14 11:32:19 +02:00
vjrj
b9457fe141 Minor changes in fires union 2018-12-23 13:31:41 +01:00
vjrj
6abe668740 Added fires union (wip) 2018-11-18 11:48:03 +01:00
vjrj
5e5ecb69b8 Wait for settings 2018-06-12 06:10:19 +02:00
vjrj
bea2703f2f Better stats in FiresMap 2018-05-21 15:43:43 +02:00
vjrj
0f0983bcf5 Removed unused dep 2018-05-10 22:32:30 +02:00
vjrj
b7ebb9a28c Better loading in FiresMap 2018-05-10 11:47:45 +02:00
vjrj
03acf8ba65 Fix for firestats increased by one 2018-05-05 09:01:34 +02:00
vjrj
1d0ad9c41b FireStats class 2018-05-01 17:42:13 +02:00
vjrj
452f6baf45 Last fire detected 2018-03-22 16:38:27 +01:00
vjrj
b794538ed2 New def values for FiresMap 2018-03-22 16:01:02 +01:00
vjrj
d2d9b2cf05 Fire neighbour icon 2018-03-10 17:05:16 +01:00
vjrj
6e0282d679 FiresMap refactor 2018-03-06 15:55:27 +01:00
vjrj
23ee271d64 Fires maps simplified. Better mobile style 2018-03-04 13:31:41 +01:00
vjrj
7d5fe8f0ee isHomeAndMobile reactive 2018-02-28 01:52:10 +01:00
vjrj
5d216d81d4 Location search in Fire Map 2018-02-27 17:46:00 +01:00
vjrj
dc92574bc3 Full screen on maps 2018-02-27 11:37:54 +01:00
vjrj
b5620cea46 Added progress bar to fires map 2018-02-27 11:08:55 +01:00
vjrj
ccbfe642a8 Added industries collection 2018-02-26 12:11:23 +01:00
vjrj
a8dc8a6b58 More accurate firemap legend 2018-02-23 17:11:45 +01:00
vjrj
7ce9317876 Maps colors improved 2018-02-20 13:39:05 +01:00
vjrj
f0bf995584 Fire page now shows also false positives 2018-02-20 07:55:26 +01:00
vjrj
79222eb978 Removed loading in FireMap. Improve data retrieving 2018-02-17 09:30:44 +01:00
vjrj
53ab69555e Don't query again if zoom in 2018-02-17 08:48:04 +01:00
vjrj
237269f761 Fix some FireMaps data retrieving 2018-02-17 08:43:01 +01:00
vjrj
824f66df03 import L 2018-02-17 08:26:46 +01:00
vjrj
2a6d8bea78 False positives only for active fires 2018-02-16 20:40:41 +01:00
vjrj
79eed373d4 Make subs union no clickable (interactive) and wait for fire alerts 2018-02-16 16:46:06 +01:00
vjrj
ac4331edbd Subs union to server side 2018-02-14 18:21:50 +01:00
vjrj
981e8e798e FiresMap store checkbox and improved performance 2018-02-13 01:44:15 +01:00
vjrj
fde04bb77f FiresMap issue with init 2018-02-12 13:07:09 +01:00
vjrj
cd80d72e32 Added share it 2018-02-12 12:18:50 +01:00
vjrj
c3bc4e604a Minor fix in firesmap for race condition 2018-02-08 20:41:24 +01:00
vjrj
35ba215834 Store center/zoom in fire map 2018-02-08 17:44:42 +01:00
vjrj
735dd55531 Fire industries marks 2018-02-08 15:54:47 +01:00
vjrj
eca58df6c2 Fire popupsand active/archive urls 2018-02-08 11:15:23 +01:00
vjrj
464af6b9d1 More work with titles & descriptions 2018-02-07 15:27:12 +01:00
vjrj
a1138c8c43 More work with titles & descriptions 2018-02-07 10:00:31 +01:00
vjrj
a02cccb400 Removed comment 2018-02-01 06:11:16 +01:00
vjrj
656cc283fe Trying to catch firemap exception 2018-01-31 11:53:07 +01:00
vjrj
57ea015c03 FiresMap refactor 2018-01-31 11:26:12 +01:00
vjrj
eafebf9d2a FiresMap refactor 2018-01-31 10:57:12 +01:00
vjrj
2fec833aef Better publication and count of active fires in current map 2018-01-30 18:05:11 +01:00