diff --git a/app/component/itinerary/NaviCardContainer.js b/app/component/itinerary/NaviCardContainer.js index 9d65cf630b..0caff26569 100644 --- a/app/component/itinerary/NaviCardContainer.js +++ b/app/component/itinerary/NaviCardContainer.js @@ -53,8 +53,8 @@ function NaviCardContainer( incomingMessages.set(alert.id, alert); }); - const legChanged = newLeg?.id - ? newLeg.id !== currentLeg?.id + const legChanged = newLeg?.legId + ? newLeg.legId !== currentLeg?.legId : currentLeg?.mode !== newLeg?.mode; const l = currentLeg || newLeg; diff --git a/app/component/itinerary/NaviContainer.js b/app/component/itinerary/NaviContainer.js index b56d6d6ad6..4ba123b60a 100644 --- a/app/component/itinerary/NaviContainer.js +++ b/app/component/itinerary/NaviContainer.js @@ -31,7 +31,7 @@ function NaviContainer( if (lastTransitLeg) { const rtLeg = realTimeLegs.find(leg => { - return leg.id === lastTransitLeg.id; + return leg.legId === lastTransitLeg.legId; }); arrivalChange = legTime(rtLeg.end) - legTime(lastTransitLeg.end); } diff --git a/app/component/itinerary/NaviUtils.js b/app/component/itinerary/NaviUtils.js index 43ef196d8a..5e519517e5 100644 --- a/app/component/itinerary/NaviUtils.js +++ b/app/component/itinerary/NaviUtils.js @@ -58,12 +58,12 @@ export const getAdditionalMessages = (leg, time, intl, config, messages) => { }; export const getTransitLegState = (leg, intl, messages) => { - const { start, realtimeState, from, mode, id } = leg; + const { start, realtimeState, from, mode, legId } = leg; const { scheduledTime, estimated } = start; if (mode === 'WALK') { return null; } - const previousMessage = messages.get(id); + const previousMessage = messages.get(legId); const prevSeverity = previousMessage ? previousMessage.severity : null; const late = estimated?.delay > 0; @@ -117,7 +117,7 @@ export const getTransitLegState = (leg, intl, messages) => { severity = 'INFO'; } const state = severity - ? { severity, content, id, expiresOn: 'legChange' } + ? { severity, content, id: legId, expiresOn: 'legChange' } : null; return state; }; @@ -142,7 +142,7 @@ export const getItineraryAlerts = (realTimeLegs, intl, messages) => { }); } if (transferProblem !== null) { - const transferId = `transfer-${transferProblem[0].id}-${transferProblem[1].id}}`; + const transferId = `transfer-${transferProblem[0].legId}-${transferProblem[1].legId}}`; if (!messages.get(transferId)) { // todo no current design content = ( diff --git a/app/component/itinerary/PlanConnection.js b/app/component/itinerary/PlanConnection.js index 37ffb1559a..fe8cc6080d 100644 --- a/app/component/itinerary/PlanConnection.js +++ b/app/component/itinerary/PlanConnection.js @@ -69,7 +69,7 @@ const planConnection = graphql` mode distance transitLeg - id + legId: id interlineWithPreviousLeg duration headsign diff --git a/app/component/itinerary/hooks/useRealtimeLegs.js b/app/component/itinerary/hooks/useRealtimeLegs.js index d0618bab80..3b2a0099a4 100644 --- a/app/component/itinerary/hooks/useRealtimeLegs.js +++ b/app/component/itinerary/hooks/useRealtimeLegs.js @@ -29,13 +29,13 @@ const useRealtimeLegs = (initialLegs, mapRef, relayEnvironment) => { fetchQuery( relayEnvironment, legQuery, - { id: leg.id }, + { id: leg.legId }, { force: true }, ).toPromise(), ); const responses = await Promise.all(legQueries); return responses.reduce( - (map, response) => ({ ...map, [response.leg.id]: response.leg }), + (map, response) => ({ ...map, [response.leg.legId]: response.leg }), {}, ); }, @@ -49,7 +49,7 @@ const useRealtimeLegs = (initialLegs, mapRef, relayEnvironment) => { ); const rtLegs = initialLegs.map(l => { - const rtLeg = l.id ? rtLegMap[l.id] : null; + const rtLeg = l.legId ? rtLegMap[l.legId] : null; if (rtLeg) { return { ...l, diff --git a/app/component/itinerary/queries/LegQuery.js b/app/component/itinerary/queries/LegQuery.js index ba552eafba..94dbc7f4d5 100644 --- a/app/component/itinerary/queries/LegQuery.js +++ b/app/component/itinerary/queries/LegQuery.js @@ -3,7 +3,7 @@ import { graphql } from 'react-relay'; const legQuery = graphql` query LegQuery($id: String!) { leg(id: $id) { - id + legId: id start { scheduledTime estimated { diff --git a/digitransit-search-util/packages/digitransit-search-util-get-json/package.json b/digitransit-search-util/packages/digitransit-search-util-get-json/package.json index a007c1ae88..b2ce27d1d6 100644 --- a/digitransit-search-util/packages/digitransit-search-util-get-json/package.json +++ b/digitransit-search-util/packages/digitransit-search-util-get-json/package.json @@ -22,6 +22,6 @@ "license": "(AGPL-3.0 OR EUPL-1.2)", "dependencies": { "@digitransit-search-util/digitransit-search-util-serialize": "0.0.2", - "axios": "1.6.7" + "axios": "1.7.7" } } diff --git a/package.json b/package.json index a78068e860..e9a383c981 100644 --- a/package.json +++ b/package.json @@ -143,7 +143,7 @@ "@hsl-fi/site-header": "4.5.0", "@mapbox/sphericalmercator": "1.1.0", "@mapbox/vector-tile": "1.3.1", - "axios": "1.6.7", + "axios": "1.7.7", "babel-plugin-dynamic-import-node": "2.3.3", "babel-plugin-relay": "16.2.0", "body-parser": "1.20.3", diff --git a/yarn.lock b/yarn.lock index 4b4008db46..4fc5d65977 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2236,7 +2236,7 @@ __metadata: resolution: "@digitransit-search-util/digitransit-search-util-get-json@workspace:digitransit-search-util/packages/digitransit-search-util-get-json" dependencies: "@digitransit-search-util/digitransit-search-util-serialize": 0.0.2 - axios: 1.6.7 + axios: 1.7.7 languageName: unknown linkType: soft @@ -7573,7 +7573,18 @@ __metadata: languageName: node linkType: hard -"axios@npm:1.6.7, axios@npm:^1.6.1": +"axios@npm:1.7.7": + version: 1.7.7 + resolution: "axios@npm:1.7.7" + dependencies: + follow-redirects: ^1.15.6 + form-data: ^4.0.0 + proxy-from-env: ^1.1.0 + checksum: 882d4fe0ec694a07c7f5c1f68205eb6dc5a62aecdb632cc7a4a3d0985188ce3030e0b277e1a8260ac3f194d314ae342117660a151fabffdc5081ca0b5a8b47fe + languageName: node + linkType: hard + +"axios@npm:^1.6.1": version: 1.6.7 resolution: "axios@npm:1.6.7" dependencies: @@ -11197,7 +11208,7 @@ __metadata: async: ^3.2.2 autoprefixer: 9.8.6 axe-core: ^4.7.2 - axios: 1.6.7 + axios: 1.7.7 babel-loader: 8.2.5 babel-plugin-dynamic-import-node: 2.3.3 babel-plugin-inline-react-svg: 2.0.2 @@ -13623,6 +13634,16 @@ __metadata: languageName: node linkType: hard +"follow-redirects@npm:^1.15.6": + version: 1.15.9 + resolution: "follow-redirects@npm:1.15.9" + peerDependenciesMeta: + debug: + optional: true + checksum: 859e2bacc7a54506f2bf9aacb10d165df78c8c1b0ceb8023f966621b233717dab56e8d08baadc3ad3b9db58af290413d585c999694b7c146aaf2616340c3d2a6 + languageName: node + linkType: hard + "for-each@npm:^0.3.3": version: 0.3.3 resolution: "for-each@npm:0.3.3"