mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-28 23:50:08 +00:00
fix(atlas): name the globe hook dependencies, cover the mesh routes
The second run of the globe Atlas was red on: - Client lint: the engine getter is a stable callback now, so the hooks that call it name it (and the refs and setters they read); an unused navigate and a seven parameter label helper are gone. - Atlas coverage: the mesh controller and the people and flights routes get unit tests, an unused region name helper is removed. - The French "Atlas" is marked as the same word, index.css is back at its length, the server people service is formatted, and the baselines drop the deleted AtlasPage and follow the lower counts.
This commit is contained in:
@@ -593,12 +593,6 @@ function parseRegionFeatures(cc: string): RegionFeature[] {
|
||||
return out;
|
||||
}
|
||||
|
||||
/** A bundled admin-1 region's name by its ISO code (`DE-BY`), or null when the bundle has none. */
|
||||
export function regionNameByCode(countryCode: string, regionCode: string): string | null {
|
||||
const code = regionCode.toUpperCase();
|
||||
return getRegionFeatures(countryCode).find((f) => f.code.toUpperCase() === code)?.name ?? null;
|
||||
}
|
||||
|
||||
// Resolve (lat,lng) to a bundled admin1 region within the given country, smallest
|
||||
// matching-part-first (mirroring getCountryFromCoords' candidate ranking) so a point near
|
||||
// a shared border prefers the tighter-fitting candidate. Returns null when the country has
|
||||
|
||||
@@ -70,7 +70,9 @@ export class AtlasPeopleService {
|
||||
if (!(await this.compareEnabled())) return [];
|
||||
const asked = [...new Set(ids)].slice(0, ATLAS_PEOPLE_MAX);
|
||||
// Each traveller is read on their own; the order of the answer is the order asked.
|
||||
const answers = await Promise.all(asked.map(async (id) => ((await this.isHidden(id)) ? null : await this.person(id))));
|
||||
const answers = await Promise.all(
|
||||
asked.map(async (id) => ((await this.isHidden(id)) ? null : await this.person(id))),
|
||||
);
|
||||
return answers.filter((p): p is AtlasPerson => p !== null);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user