diff options
| author | Ariel Costas Guerrero <ariel@costas.dev> | 2025-11-03 10:57:14 +0100 |
|---|---|---|
| committer | Ariel Costas Guerrero <ariel@costas.dev> | 2025-11-03 10:57:14 +0100 |
| commit | 809941dcc8f37967a22516b1c4f7af1f3b8a82bc (patch) | |
| tree | f328d3694aaa335c005a53d2589a05203bf37b23 | |
| parent | 60f8d79d9e8ccedcd95610a88dd7dc8ec5521aca (diff) | |
Show distances only whne supported
| -rw-r--r-- | Costasdev.Busurbano.sln.DotSettings.user | 2 | ||||
| -rw-r--r-- | src/Costasdev.Busurbano.Backend/SantiagoController.cs | 2 | ||||
| -rw-r--r-- | src/Costasdev.Busurbano.Backend/VigoController.cs | 4 | ||||
| -rw-r--r-- | src/frontend/app/components/StopSheet.tsx | 10 | ||||
| -rw-r--r-- | src/frontend/package-lock.json | 21 |
5 files changed, 30 insertions, 9 deletions
diff --git a/Costasdev.Busurbano.sln.DotSettings.user b/Costasdev.Busurbano.sln.DotSettings.user index e2eea46..5e721e3 100644 --- a/Costasdev.Busurbano.sln.DotSettings.user +++ b/Costasdev.Busurbano.sln.DotSettings.user @@ -6,4 +6,4 @@ <s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ATimeOnly_002Ecs_002Fl_003AC_0021_003FUsers_003Fariel_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E2_003Fresharper_002Dhost_003FSourcesCache_003F9ef1339c59fbf37dc6e64e8aed649711d2db7354d1141113de1c43ac6325b32_003FTimeOnly_002Ecs/@EntryIndexedValue">ForceIncluded</s:String> <s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AVigoTransitApiClient_002Ecs_002Fl_003AC_0021_003FUsers_003Fariel_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E2_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F124c78a45c0043088c5af452a969bf098400_003F02_003Fe7a1a74c_003FVigoTransitApiClient_002Ecs/@EntryIndexedValue">ForceIncluded</s:String> - <s:Boolean x:Key="/Default/UnloadedProject/UnloadedProjects/=64ba8700_002D5e35_002D433e_002D68fe_002D2c1b3d215569_0023frontend/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
\ No newline at end of file + </wpf:ResourceDictionary>
\ No newline at end of file diff --git a/src/Costasdev.Busurbano.Backend/SantiagoController.cs b/src/Costasdev.Busurbano.Backend/SantiagoController.cs index 41bc62b..c86c74b 100644 --- a/src/Costasdev.Busurbano.Backend/SantiagoController.cs +++ b/src/Costasdev.Busurbano.Backend/SantiagoController.cs @@ -60,7 +60,7 @@ public class SantiagoController : ControllerBase } catch (InvalidOperationException) { - return new BadRequestObjectResult("Stop not found"); + return BadRequest("Stop not found"); } } diff --git a/src/Costasdev.Busurbano.Backend/VigoController.cs b/src/Costasdev.Busurbano.Backend/VigoController.cs index be0e7c6..147c22a 100644 --- a/src/Costasdev.Busurbano.Backend/VigoController.cs +++ b/src/Costasdev.Busurbano.Backend/VigoController.cs @@ -43,7 +43,7 @@ public class VigoController : ControllerBase } catch (InvalidOperationException) { - return new BadRequestObjectResult("Stop not found"); + return BadRequest("Stop not found"); } } @@ -56,7 +56,7 @@ public class VigoController : ControllerBase : DateTime.Today.ToString("yyyy-MM-dd"); // Validate date format - if (!DateTime.TryParseExact(dateString, "yyyy-MM-dd", null, System.Globalization.DateTimeStyles.None, out var parsedDate)) + if (!DateTime.TryParseExact(dateString, "yyyy-MM-dd", null, System.Globalization.DateTimeStyles.None, out _)) { return BadRequest("Invalid date format. Please use yyyy-MM-dd format."); } diff --git a/src/frontend/app/components/StopSheet.tsx b/src/frontend/app/components/StopSheet.tsx index 4bd75a8..8080220 100644 --- a/src/frontend/app/components/StopSheet.tsx +++ b/src/frontend/app/components/StopSheet.tsx @@ -7,7 +7,7 @@ import LineIcon from "./LineIcon"; import { StopSheetSkeleton } from "./StopSheetSkeleton"; import { ErrorDisplay } from "./ErrorDisplay"; import { type Estimate } from "../routes/estimates-$id"; -import { type RegionId, getRegionConfig } from "../data/RegionConfig"; +import { REGIONS, type RegionId, getRegionConfig } from "../data/RegionConfig"; import { useApp } from "../AppContext"; import "./StopSheet.css"; @@ -174,9 +174,11 @@ export const StopSheet: React.FC<StopSheetProps> = ({ <Clock /> {formatTime(estimate.minutes)} </div> - <div className="stop-sheet-estimate-distance"> - {formatDistance(estimate.meters)} - </div> + {REGIONS[region].showMeters && ( + <div className="stop-sheet-estimate-distance"> + {formatDistance(estimate.meters)} + </div> + )} </div> </div> ))} diff --git a/src/frontend/package-lock.json b/src/frontend/package-lock.json index b6da948..4e8eec9 100644 --- a/src/frontend/package-lock.json +++ b/src/frontend/package-lock.json @@ -83,6 +83,7 @@ "integrity": "sha512-2BCOP7TN8M+gVDj7/ht3hsaO/B/n5oDbiAyyvnRlNOs+u1o+JWNYTQrmpuNp1/Wq2gcFrI01JAW+paEKDMx/CA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/code-frame": "^7.27.1", "@babel/generator": "^7.28.3", @@ -1599,6 +1600,7 @@ "integrity": "sha512-zXub2L4qwtGd8+pdXi1QheI8PHPxSwi5EF0D1924fji8yN1R8csP/2cr055/xFOEtbkbJSZyVRrJ44fFnBxKCw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@mjackson/node-fetch-server": "^0.2.0", "@react-router/express": "7.9.4", @@ -1980,6 +1982,7 @@ "integrity": "sha512-/NbVmcGTP+lj5oa4yiYxxeBjRivKQ5Ns1eSZeB99ExsEQ6rX5XYU1Zy/gGxY/ilqtD4Etx9mKyrPxZRetiahhA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "undici-types": "~7.14.0" } @@ -1990,6 +1993,7 @@ "integrity": "sha512-6mDvHUFSjyT2B2yeNx2nUgMxh9LtOWvkhIU3uePn2I2oyNymUAX1NIsdgviM4CH+JSrp2D2hsMvJOkxY+0wNRA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "csstype": "^3.0.2" } @@ -2060,6 +2064,7 @@ "integrity": "sha512-n1H6IcDhmmUEG7TNVSspGmiHHutt7iVKtZwRppD7e04wha5MrkV1h3pti9xQLcCMt6YWsncpoT0HMjkH1FNwWQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "8.46.0", "@typescript-eslint/types": "8.46.0", @@ -2366,6 +2371,7 @@ "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "dev": true, "license": "MIT", + "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -2606,6 +2612,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "baseline-browser-mapping": "^2.8.9", "caniuse-lite": "^1.0.30001746", @@ -3170,6 +3177,7 @@ "integrity": "sha512-XyLmROnACWqSxiGYArdef1fItQd47weqB7iwtfr9JHwRrqIXZdcFMvvEcL9xHCmL0SNsOvF0c42lWyM1U5dgig==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.1", @@ -3378,6 +3386,7 @@ "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", @@ -4272,6 +4281,7 @@ "integrity": "sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ==", "dev": true, "license": "MIT", + "peer": true, "bin": { "jiti": "lib/jiti-cli.mjs" } @@ -4381,7 +4391,8 @@ "version": "1.9.4", "resolved": "https://registry.npmjs.org/leaflet/-/leaflet-1.9.4.tgz", "integrity": "sha512-nxS1ynzJOmOlHp+iL3FyWqK89GtNL8U8rvlMOsQdTTssxZwCXh8N2NB3GDQOL+YR3XnWyZAxwQixURb+FA74PA==", - "license": "BSD-2-Clause" + "license": "BSD-2-Clause", + "peer": true }, "node_modules/leaflet.markercluster": { "version": "1.5.3", @@ -4461,6 +4472,7 @@ "integrity": "sha512-YxW9glb/YrDXGDhqy1u+aG113+L86ttAUpTd6sCkGHyUKMXOX8qbGHJQVqxOczy+4CtRKnqcCfSura2MzB0nQA==", "dev": true, "license": "BSD-3-Clause", + "peer": true, "dependencies": { "@mapbox/geojson-rewind": "^0.5.2", "@mapbox/jsonlint-lines-primitives": "^2.0.2", @@ -5072,6 +5084,7 @@ "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=12" }, @@ -5288,6 +5301,7 @@ "resolved": "https://registry.npmjs.org/react/-/react-19.2.0.tgz", "integrity": "sha512-tmbWg6W31tQLeB5cdIBOicJDJRR2KzXsV7uSK9iNfLWQ5bIZfxuPEHp7M8wiHyHnn0DD1i7w3Zmin0FtkrwoCQ==", "license": "MIT", + "peer": true, "engines": { "node": ">=0.10.0" } @@ -5297,6 +5311,7 @@ "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.0.tgz", "integrity": "sha512-UlbRu4cAiGaIewkPyiRGJk0imDN2T3JjieT6spoL2UeSf5od4n5LB/mQ4ejmxhCFT1tYe8IvaFulzynWovsEFQ==", "license": "MIT", + "peer": true, "dependencies": { "scheduler": "^0.27.0" }, @@ -5427,6 +5442,7 @@ "resolved": "https://registry.npmjs.org/react-router/-/react-router-7.9.4.tgz", "integrity": "sha512-SD3G8HKviFHg9xj7dNODUKDFgpG4xqD5nhyd0mYoB5iISepuZAvzSr8ywxgxKJ52yRzf/HWtVHc9AWwoTbljvA==", "license": "MIT", + "peer": true, "dependencies": { "cookie": "^1.0.1", "set-cookie-parser": "^2.6.0" @@ -6267,6 +6283,7 @@ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "devOptional": true, "license": "Apache-2.0", + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -6452,6 +6469,7 @@ "integrity": "sha512-uzcxnSDVjAopEUjljkWh8EIrg6tlzrjFUfMcR1EVsRDGwf/ccef0qQPRyOrROwhrTDaApueq+ja+KLPlzR/zdg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.5.0", @@ -6727,6 +6745,7 @@ "integrity": "sha512-JInaHOamG8pt5+Ey8kGmdcAcg3OL9reK8ltczgHTAwNhMys/6ThXHityHxVV2p3fkw/c+MAvBHFVYHFZDmjMCQ==", "dev": true, "license": "MIT", + "peer": true, "funding": { "url": "https://github.com/sponsors/colinhacks" } |
