Fix CI
All checks were successful
Build and publish Docker image / build-and-push (push) Successful in 4m15s
CI / Check (push) Successful in 5m49s

This commit is contained in:
Andras Schmelczer 2026-06-06 20:37:54 +01:00
parent 719dd27600
commit b4d66a28c1
5 changed files with 14 additions and 15 deletions

View file

@ -169,7 +169,7 @@ describe('LocationSearch', () => {
}); });
}); });
it('waits for nearest postcode selection before flying to a place result', async () => { it('flies to a place result immediately and resolves its nearest postcode for the side panel', async () => {
window.localStorage.setItem( window.localStorage.setItem(
RECENT_SEARCHES_STORAGE_KEY, RECENT_SEARCHES_STORAGE_KEY,
JSON.stringify([ JSON.stringify([
@ -201,7 +201,11 @@ describe('LocationSearch', () => {
fireEvent.focus(input); fireEvent.focus(input);
fireEvent.mouseDown(await screen.findByRole('button', { name: 'E14' })); fireEvent.mouseDown(await screen.findByRole('button', { name: 'E14' }));
expect(onFlyTo).not.toHaveBeenCalled(); // The camera moves straight away from the result's own coordinates, without
// waiting on the nearest-postcode lookup (which only feeds the side panel).
expect(onFlyTo).toHaveBeenCalledWith(51.505, -0.01, 16);
expect(onLocationSearched).not.toHaveBeenCalled();
nearestLookup.resolve( nearestLookup.resolve(
jsonResponse({ jsonResponse({
postcode: 'E14 2DG', postcode: 'E14 2DG',
@ -223,9 +227,9 @@ describe('LocationSearch', () => {
markerLatitude: 51.505, markerLatitude: 51.505,
markerLongitude: -0.01, markerLongitude: -0.01,
}); });
expect(onFlyTo).toHaveBeenCalledWith(51.505, -0.01, 16); expect(onFlyTo).toHaveBeenCalledTimes(1);
expect(onLocationSearched.mock.invocationCallOrder[0]).toBeLessThan( expect(onFlyTo.mock.invocationCallOrder[0]).toBeLessThan(
onFlyTo.mock.invocationCallOrder[0] onLocationSearched.mock.invocationCallOrder[0]
); );
}); });

View file

@ -1,2 +0,0 @@
*
!.gitignore

View file

@ -539,8 +539,7 @@ async fn main() -> anyhow::Result<()> {
let tile_reader = Arc::new(routes::init_tile_reader(tiles_path).await?); let tile_reader = Arc::new(routes::init_tile_reader(tiles_path).await?);
info!("PMTiles loaded successfully"); info!("PMTiles loaded successfully");
let noise_overlay_reader = let noise_overlay_reader = init_required_tile_reader("Noise", &cli.noise_overlay_tiles).await?;
init_required_tile_reader("Noise", &cli.noise_overlay_tiles).await?;
let satellite_reader = init_required_tile_reader("Satellite", &cli.satellite_tiles).await?; let satellite_reader = init_required_tile_reader("Satellite", &cli.satellite_tiles).await?;
let satellite_highres_reader = let satellite_highres_reader =
init_required_tile_reader("Satellite high-res", &cli.satellite_highres_tiles).await?; init_required_tile_reader("Satellite high-res", &cli.satellite_highres_tiles).await?;

View file

@ -796,12 +796,10 @@ pub async fn get_export(
group.summary.merge_from(agg); group.summary.merge_from(agg);
} }
for group in by_outcode.values_mut() { for group in by_outcode.values_mut() {
group group.members.sort_by(|&a, &b| {
.members postcode_data.postcodes[postcode_aggs[a].0]
.sort_by(|&a, &b| { .cmp(&postcode_data.postcodes[postcode_aggs[b].0])
postcode_data.postcodes[postcode_aggs[a].0] });
.cmp(&postcode_data.postcodes[postcode_aggs[b].0])
});
} }
order order
.into_iter() .into_iter()