Skip to content

Commit c93a0f5

Browse files
authored
Merge pull request #67 from krystxf/fix/missing-departures
fix: missing departures
2 parents 2445d07 + cb5854d commit c93a0f5

File tree

7 files changed

+179
-5
lines changed

7 files changed

+179
-5
lines changed

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
FROM node:20-slim AS base
22
ENV PNPM_HOME="/pnpm"
33
ENV PATH="$PNPM_HOME:$PATH"
4+
RUN npm install -g corepack
45
RUN corepack enable
56

67
RUN apt-get update \
Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
{
2+
"info": {
3+
"_postman_id": "ffce154e-3270-4344-a193-42344fcc19ae",
4+
"name": "metro-now",
5+
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
6+
"_exporter_id": "16893880"
7+
},
8+
"item": [
9+
{
10+
"name": "departure",
11+
"item": [
12+
{
13+
"name": "stop",
14+
"request": {
15+
"method": "GET",
16+
"header": [],
17+
"url": {
18+
"raw": "{{endpoint}}/v2/departure?stop[]=U1072",
19+
"host": ["{{endpoint}}"],
20+
"path": ["v2", "departure"],
21+
"query": [
22+
{
23+
"key": "stop[]",
24+
"value": "U1072",
25+
"description": "Můstek"
26+
}
27+
]
28+
}
29+
},
30+
"response": []
31+
},
32+
{
33+
"name": "platform",
34+
"request": {
35+
"method": "GET",
36+
"header": [],
37+
"url": {
38+
"raw": "{{endpoint}}/v2/departure?platform[]=U1072Z101P&platform[]=U1072Z102P",
39+
"host": ["{{endpoint}}"],
40+
"path": ["v2", "departure"],
41+
"query": [
42+
{
43+
"key": "platform[]",
44+
"value": "U1072Z101P"
45+
},
46+
{
47+
"key": "platform[]",
48+
"value": "U1072Z102P"
49+
}
50+
]
51+
}
52+
},
53+
"response": []
54+
}
55+
]
56+
},
57+
{
58+
"name": "stop",
59+
"item": [
60+
{
61+
"name": "all",
62+
"request": {
63+
"method": "GET",
64+
"header": [],
65+
"url": {
66+
"raw": "{{endpoint}}/v1/stop/all",
67+
"host": ["{{endpoint}}"],
68+
"path": ["v1", "stop", "all"]
69+
}
70+
},
71+
"response": []
72+
},
73+
{
74+
"name": "{id}",
75+
"request": {
76+
"method": "GET",
77+
"header": [],
78+
"url": {
79+
"raw": "{{endpoint}}/v1/stop/U1072",
80+
"host": ["{{endpoint}}"],
81+
"path": ["v1", "stop", "U1072"]
82+
}
83+
},
84+
"response": []
85+
}
86+
]
87+
},
88+
{
89+
"name": "platform",
90+
"item": [
91+
{
92+
"name": "all",
93+
"event": [
94+
{
95+
"listen": "test",
96+
"script": {
97+
"exec": [
98+
"var template = `",
99+
"<style type=\"text/css\">",
100+
" .tftable {font-size:14px;color:#333333;width:100%;border-width: 1px;border-color: #87ceeb;border-collapse: collapse;}",
101+
" .tftable th {font-size:18px;background-color:#87ceeb;border-width: 1px;padding: 8px;border-style: solid;border-color: #87ceeb;text-align:left;}",
102+
" .tftable tr {background-color:#ffffff;}",
103+
" .tftable td {font-size:14px;border-width: 1px;padding: 8px;border-style: solid;border-color: #87ceeb;}",
104+
" .tftable tr:hover {background-color:#e0ffff;}",
105+
"</style>",
106+
"",
107+
"<table class=\"tftable\" border=\"1\">",
108+
" <tr>",
109+
" <th>ID</th>",
110+
" <th>Latitude</th>",
111+
" <th>Longitude</th>",
112+
" <th>Name</th>",
113+
" <th>Routes</th>",
114+
" </tr>",
115+
" ",
116+
" {{#each response}}",
117+
" <tr>",
118+
" <td>{{id}}</td>",
119+
" <td>{{latitude}}</td>",
120+
" <td>{{longitude}}</td>",
121+
" <td>{{name}}</td>",
122+
" <td>",
123+
" <table>",
124+
" <tr>",
125+
" <th>ID</th>",
126+
" <th>Name</th>",
127+
" </tr>",
128+
" {{#each routes}}",
129+
" <tr>",
130+
" <td>{{id}}</td>",
131+
" <td>{{name}}</td>",
132+
" </tr>",
133+
" {{/each}}",
134+
" </table>",
135+
" </td>",
136+
" </tr>",
137+
" {{/each}}",
138+
"</table>",
139+
"`;",
140+
"",
141+
"function constructVisualizerPayload() {",
142+
" return { response: pm.response.json() }",
143+
"}",
144+
"",
145+
"pm.visualizer.set(template, constructVisualizerPayload());"
146+
],
147+
"type": "text/javascript",
148+
"packages": {}
149+
}
150+
}
151+
],
152+
"request": {
153+
"method": "GET",
154+
"header": [],
155+
"url": {
156+
"raw": "{{endpoint}}/v1/platform/all",
157+
"host": ["{{endpoint}}"],
158+
"path": ["v1", "platform", "all"]
159+
}
160+
},
161+
"response": []
162+
}
163+
]
164+
}
165+
],
166+
"variable": [
167+
{
168+
"key": "endpoint",
169+
"value": "http://localhost:3001",
170+
"type": "default"
171+
}
172+
]
173+
}

apps/mobile/metro-now/metro-now Watch App/pages/closest-stop-list/ClosestStopListViewModel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ class ClosestStopListViewModel: NSObject, ObservableObject, CLLocationManagerDel
110110
"stop": stopsIds,
111111
"limit": 20,
112112
"minutesBefore": 1,
113-
"minutesAfter": String(5 * 60),
113+
"minutesAfter": String(1 * 60),
114114
]
115115
)
116116

apps/mobile/metro-now/metro-now/pages/closest-stop/ClosestStopPageViewModel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ class ClosestStopPageViewModel: NSObject, ObservableObject, CLLocationManagerDel
155155
"platform": platformsIds,
156156
"limit": 4,
157157
"minutesBefore": 1,
158-
"minutesAfter": String(3 * 60),
158+
"minutesAfter": String(1 * 60),
159159
]
160160
)
161161

apps/mobile/metro-now/metro-now/pages/search/stop-detail/SearchPageDetailViewModel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class SearchPageDetailViewModel: NSObject, ObservableObject {
7474
"platform": platformsIds,
7575
"limit": 6,
7676
"minutesBefore": 1,
77-
"minutesAfter": String(12 * 60),
77+
"minutesAfter": String(1 * 60),
7878
]
7979
)
8080

apps/mobile/metro-now/metro-now/pages/stop-detail/StopMetroDeparturesViewModel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class StopMetroDeparturesViewModel: NSObject, ObservableObject {
7474
"platform": platformsIds,
7575
"limit": 20,
7676
"minutesBefore": 1,
77-
"minutesAfter": String(8 * 60),
77+
"minutesAfter": String(1 * 60),
7878
]
7979
)
8080

apps/mobile/metro-now/widgets/departures/DeparturesWidgetManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class DeparturesWidgetManager: NSObject, ObservableObject, CLLocationManagerDele
6666
let stopQuery = stopIds.map { "stop[]=\($0)" }.joined(separator: "&")
6767
let platformQuery = platformIds.map { "platform[]=\($0)" }.joined(separator: "&")
6868

69-
let url = "\(API_URL)/v2/departure?\(stopQuery)&\(platformQuery)&limit=4&minutesBefore=1&minutesAfter=\(3 * 60)"
69+
let url = "\(API_URL)/v2/departure?\(stopQuery)&\(platformQuery)&limit=4&minutesBefore=1&minutesAfter=\(1 * 60)"
7070

7171
// Print the full API request URL for debugging
7272
print("API Request URL for Departures: \(url)")

0 commit comments

Comments
 (0)