Skip to content

Commit

Permalink
ARREJS-20: Added 0 to stations
Browse files Browse the repository at this point in the history
  • Loading branch information
tuj committed Oct 12, 2023
1 parent c1115f7 commit 853ef6b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

- [#145](https://github.com/os2display/display-templates/pull/145)
- Added 0 to stations.
- [#142](https://github.com/os2display/display-templates/pull/142)
Update poster template to display url domain.

Expand Down
4 changes: 2 additions & 2 deletions build/travel-config-develop.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"id": "01FZD7K807VAKZ99BGSSCHRJM6",
"description": "Skabelon til rejseplanen.",
"resources": {
"component": "https://raw.githubusercontent.com/os2display/display-templates/develop/build/travel.js?ts=1693473782862",
"admin": "https://raw.githubusercontent.com/os2display/display-templates/develop/build/travel-admin.json?ts=1693473782862",
"component": "https://raw.githubusercontent.com/os2display/display-templates/develop/build/travel.js?ts=1697047769089",
"admin": "https://raw.githubusercontent.com/os2display/display-templates/develop/build/travel-admin.json?ts=1697047769089",
"schema": "",
"assets": [],
"options": {},
Expand Down
4 changes: 2 additions & 2 deletions build/travel-config-main.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"id": "01FZD7K807VAKZ99BGSSCHRJM6",
"description": "Skabelon til rejseplanen.",
"resources": {
"component": "https://raw.githubusercontent.com/os2display/display-templates/main/build/travel.js?ts=1693473782862",
"admin": "https://raw.githubusercontent.com/os2display/display-templates/main/build/travel-admin.json?ts=1693473782862",
"component": "https://raw.githubusercontent.com/os2display/display-templates/main/build/travel.js?ts=1697047769089",
"admin": "https://raw.githubusercontent.com/os2display/display-templates/main/build/travel-admin.json?ts=1697047769089",
"schema": "",
"assets": [],
"options": {},
Expand Down
2 changes: 1 addition & 1 deletion build/travel.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/travel/travel.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ function Travel({ slide, content, run, slideDone, executionId }) {
// This is a shameful hack, hopefully temporarily, to combat the fact that the station-api
// only returns a station in _one direction_, instead of both
// After meeting*s* about this, we have concluded that the ids follow a pattern, where the last character
// in the string is defining which direction, and can be anything from 1-9.
// So, here we replace the last character of the id with 1-9, and then the rejseplan-api disregards ids that
// in the string is defining which direction, and can be anything from 0-9.
// So, here we replace the last character of the id with 0-9, and then the rejseplan-api disregards ids that
// are not connected to a station (we hope).
const getStationIds = () => {
let ids = "";
Expand All @@ -56,8 +56,8 @@ function Travel({ slide, content, run, slideDone, executionId }) {
station[0].id.length - 1
);

[...Array(9).keys()].forEach((i) => {
ids += `${idWithMissingLastCharacter}${i + 1}@`;
[...Array(10).keys()].forEach((i) => {
ids += `${idWithMissingLastCharacter}${i}@`;
});
return ids;
};
Expand Down

0 comments on commit 853ef6b

Please sign in to comment.