entur / tavla

🖥 A customizable departure board for all public transport in Norway
https://tavla.entur.no
100 stars 51 forks source link

fix(walking-distance): show distance if location is far away #1588

Closed emilielr closed 2 months ago

emilielr commented 3 months ago

The field walkDistance is deprecated, and updated to streetDistance. Hence, the graphQL schema and types is updated. Taxi was also added as a new transport mode.

Problem: the walking distance was not set when the location of the board was far away. E. g when fetching the distance from Trondheim to Oslo, it returned nothing. Since the distance was undefined, the walkingDistance-object was deleted.

Solution: instead of deleting the whole walkingDistance-object in the database, the distance-field is set to NaN indicating the distance is not found. The visible-field is still either true or false. If distance is not present, "-" will show in tavla.

image

lindtvedtsebastian commented 3 months ago

Har du glemt å pushe noe kode her? Klarer ikke å finne det du snakker om over 😓

purusott commented 3 months ago

Når man har en walkingdist som gir "-" og legger til en ny adresse som gir samme state, blir vis gåavstand switchen skrudd av. Det samme skjer om man går fra en adresse som gir en walkingdist til en som skal gi "-". Er dette meningen? 💭

F.eks. fra en slik adresse (der gåavstand er skrudd på) image

til å f.eks. si at det skal stå fra drammen image