Skip to content

Commit

Permalink
Trunk route fix (#804)
Browse files Browse the repository at this point in the history
* Dev (#803)

* Production (#720)

* Fix e2e test.

* Staging (#681)

* location search

* clean up svg

* workflow update

* upload only if failure

* workflow update

* search location tooltip

* text ids fixed

* more test-id changes

* testing timestamps

* testing timestamps

* testing dev.yml

* testing dev.yml

* update dev.yml

* increased pageloadtimeout

* mapillary version update and new logic for mapillary layer

* error messages

* envs updated

* fixed env and small css fix

* yarn.lock

* Staging (#686)

* location search

* clean up svg

* workflow update

* upload only if failure

* workflow update

* search location tooltip

* text ids fixed

* more test-id changes

* testing timestamps

* testing timestamps

* testing dev.yml

* testing dev.yml

* update dev.yml

* increased pageloadtimeout

* mapillary version update and new logic for mapillary layer

* error messages

* envs updated

* fixed env and small css fix

* yarn.lock

* Dev (#685)

* cypress node version tag

* error handling for cypress (#632)

* error handling for cypress

* node tag

* Cypress fix (#683)

* error handling for cypress

* node tag

* record set true

* added github action trigger

* node setup

* mapillary test disabled for now

* mapillary test removed

* Staging (#694)

* location search

* clean up svg

* workflow update

* upload only if failure

* workflow update

* search location tooltip

* text ids fixed

* more test-id changes

* testing timestamps

* testing timestamps

* testing dev.yml

* testing dev.yml

* update dev.yml

* increased pageloadtimeout

* mapillary version update and new logic for mapillary layer

* error messages

* envs updated

* fixed env and small css fix

* yarn.lock

* Dev (#685)

* cypress node version tag

* error handling for cypress (#632)

* error handling for cypress

* node tag

* Cypress fix (#683)

* error handling for cypress

* node tag

* record set true

* added github action trigger

* node setup

* mapillary test disabled for now

* mapillary test removed

* Dev (#691)

* cypress node version tag

* error handling for cypress (#632)

* error handling for cypress

* node tag

* Cypress fix (#683)

* error handling for cypress

* node tag

* record set true

* added github action trigger

* node setup

* mapillary test disabled for now

* mapillary test removed

* Update tests (#687)

* testing tests

* removed node-version

* debug

* ref fix

* Dev (#693)

* cypress node version tag

* error handling for cypress (#632)

* error handling for cypress

* node tag

* Cypress fix (#683)

* error handling for cypress

* node tag

* record set true

* added github action trigger

* node setup

* mapillary test disabled for now

* mapillary test removed

* Update tests (#687)

* testing tests

* removed node-version

* debug

* ref fix

* updated stage.yml and production.ymlD

* Staging (#696)

* location search

* clean up svg

* workflow update

* upload only if failure

* workflow update

* search location tooltip

* text ids fixed

* more test-id changes

* testing timestamps

* testing timestamps

* testing dev.yml

* testing dev.yml

* update dev.yml

* increased pageloadtimeout

* mapillary version update and new logic for mapillary layer

* error messages

* envs updated

* fixed env and small css fix

* yarn.lock

* Dev (#685)

* cypress node version tag

* error handling for cypress (#632)

* error handling for cypress

* node tag

* Cypress fix (#683)

* error handling for cypress

* node tag

* record set true

* added github action trigger

* node setup

* mapillary test disabled for now

* mapillary test removed

* Dev (#691)

* cypress node version tag

* error handling for cypress (#632)

* error handling for cypress

* node tag

* Cypress fix (#683)

* error handling for cypress

* node tag

* record set true

* added github action trigger

* node setup

* mapillary test disabled for now

* mapillary test removed

* Update tests (#687)

* testing tests

* removed node-version

* debug

* ref fix

* Dev (#693)

* cypress node version tag

* error handling for cypress (#632)

* error handling for cypress

* node tag

* Cypress fix (#683)

* error handling for cypress

* node tag

* record set true

* added github action trigger

* node setup

* mapillary test disabled for now

* mapillary test removed

* Update tests (#687)

* testing tests

* removed node-version

* debug

* ref fix

* updated stage.yml and production.ymlD

* Dev (#695)

* cypress node version tag

* error handling for cypress (#632)

* error handling for cypress

* node tag

* Cypress fix (#683)

* error handling for cypress

* node tag

* record set true

* added github action trigger

* node setup

* mapillary test disabled for now

* mapillary test removed

* Update tests (#687)

* testing tests

* removed node-version

* debug

* ref fix

* updated stage.yml and production.ymlD

* node version for daily runs

* Staging (#697)

* location search

* clean up svg

* workflow update

* upload only if failure

* workflow update

* search location tooltip

* text ids fixed

* more test-id changes

* testing timestamps

* testing timestamps

* testing dev.yml

* testing dev.yml

* update dev.yml

* increased pageloadtimeout

* mapillary version update and new logic for mapillary layer

* error messages

* envs updated

* fixed env and small css fix

* yarn.lock

* Dev (#685)

* cypress node version tag

* error handling for cypress (#632)

* error handling for cypress

* node tag

* Cypress fix (#683)

* error handling for cypress

* node tag

* record set true

* added github action trigger

* node setup

* mapillary test disabled for now

* mapillary test removed

* Dev (#691)

* cypress node version tag

* error handling for cypress (#632)

* error handling for cypress

* node tag

* Cypress fix (#683)

* error handling for cypress

* node tag

* record set true

* added github action trigger

* node setup

* mapillary test disabled for now

* mapillary test removed

* Update tests (#687)

* testing tests

* removed node-version

* debug

* ref fix

* Dev (#693)

* cypress node version tag

* error handling for cypress (#632)

* error handling for cypress

* node tag

* Cypress fix (#683)

* error handling for cypress

* node tag

* record set true

* added github action trigger

* node setup

* mapillary test disabled for now

* mapillary test removed

* Update tests (#687)

* testing tests

* removed node-version

* debug

* ref fix

* updated stage.yml and production.ymlD

* Dev (#695)

* cypress node version tag

* error handling for cypress (#632)

* error handling for cypress

* node tag

* Cypress fix (#683)

* error handling for cypress

* node tag

* record set true

* added github action trigger

* node setup

* mapillary test disabled for now

* mapillary test removed

* Update tests (#687)

* testing tests

* removed node-version

* debug

* ref fix

* updated stage.yml and production.ymlD

* node version for daily runs

* Dev (#716)

* location search

* clean up svg

* workflow update

* upload only if failure

* workflow update

* search location tooltip

* text ids fixed

* more test-id changes

* testing timestamps

* testing timestamps

* testing dev.yml

* testing dev.yml

* update dev.yml

* increased pageloadtimeout

* mapillary version update and new logic for mapillary layer

* error messages

* envs updated

* fixed env and small css fix

* yarn.lock

* cypress node version tag

* error handling for cypress (#632)

* error handling for cypress

* node tag

* Cypress fix (#683)

* error handling for cypress

* node tag

* record set true

* added github action trigger

* node setup

* mapillary test disabled for now

* mapillary test removed

* Dev (#685)

* cypress node version tag

* error handling for cypress (#632)

* error handling for cypress

* node tag

* Cypress fix (#683)

* error handling for cypress

* node tag

* record set true

* added github action trigger

* node setup

* mapillary test disabled for now

* mapillary test removed

* Update tests (#687)

* testing tests

* removed node-version

* debug

* ref fix

* Dev (#691)

* cypress node version tag

* error handling for cypress (#632)

* error handling for cypress

* node tag

* Cypress fix (#683)

* error handling for cypress

* node tag

* record set true

* added github action trigger

* node setup

* mapillary test disabled for now

* mapillary test removed

* Update tests (#687)

* testing tests

* removed node-version

* debug

* ref fix

* updated stage.yml and production.ymlD

* Dev (#693)

* cypress node version tag

* error handling for cypress (#632)

* error handling for cypress

* node tag

* Cypress fix (#683)

* error handling for cypress

* node tag

* record set true

* added github action trigger

* node setup

* mapillary test disabled for now

* mapillary test removed

* Update tests (#687)

* testing tests

* removed node-version

* debug

* ref fix

* updated stage.yml and production.ymlD

* node version for daily runs

* basemap switched to new version (#704)

Co-authored-by: Daniel Dunderfelt <[email protected]>

* filter duplicate vehicles

* map env update

* L rail updates (#797)

* L-rail updates

* L-rail updates

* codegen

* L-rail temp fixes (#800)

* vehicle filtering update (#802)

---------

Co-authored-by: Daniel Dunderfelt <[email protected]>

* fixed trunk route colors

---------

Co-authored-by: Daniel Dunderfelt <[email protected]>
  • Loading branch information
ahjyrkia and danieldunderfelt authored Nov 21, 2023
1 parent 7bf6db7 commit f845acd
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 12 deletions.
6 changes: 4 additions & 2 deletions src/components/journeypanel/JourneyPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,13 @@ const JourneyPanel = decorate(
}
}, [selectedJourney, loading]);

const journeyMode = get(route, "mode", "BUS");
let journeyMode = get(route, "mode", "BUS");
if (route.trunkRoute) {
journeyMode = "TRUNK";
}
const journeyColor = get(transportColor, journeyMode, "var(--light-grey)");
const originDeparture = get(journey, "departure", null);
const journeyEvents = get(journey, "events", []);

const journeyHealth = useJourneyHealth(journey);
const dataDelay = useDataDelay(journey);

Expand Down
10 changes: 8 additions & 2 deletions src/components/map/MapContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,20 @@ const MapContent = decorate(
<TerminalLayer />
{hasRoute && (
<>
<RouteLayer canCenterOnRoute={centerOnRoute} />
<RouteLayer
canCenterOnRoute={centerOnRoute}
isTrunkRoute={route.trunkRoute}
/>

{mapOverlays.includes("Route segment length") && <RouteSegmentLengthLayer />}

{(!selectedJourneyId ||
journeys.length === 0 ||
!journeys.find((journey) => selectedJourneyId === journey.id)) && (
<RouteStopsLayer showRadius={showStopRadius} />
<RouteStopsLayer
showRadius={showStopRadius}
isTrunkRoute={route.trunkRoute}
/>
)}

{journeys.length !== 0 &&
Expand Down
9 changes: 5 additions & 4 deletions src/components/map/RouteLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const routeGeometryQuery = gql`

const decorate = flow(observer, inject("UI"));

const RouteLayer = decorate(({canCenterOnRoute, UI, state}) => {
const RouteLayer = decorate(({canCenterOnRoute, isTrunkRoute, UI, state}) => {
const {route, date} = state;

const {data: routeGeometry} = useQueryData(
Expand All @@ -39,10 +39,11 @@ const RouteLayer = decorate(({canCenterOnRoute, UI, state}) => {
},
"route geometry query"
);

const coordinates = get(routeGeometry, "coordinates", []);
const mode = get(routeGeometry, "mode", []);

let mode = get(routeGeometry, "mode", []);
if (isTrunkRoute) {
mode = "TRUNK";
}
useEffect(() => {
if (!route || !route.routeId || !canCenterOnRoute || coordinates.length === 0) {
return;
Expand Down
7 changes: 5 additions & 2 deletions src/components/map/RouteStop.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ const RouteStop = decorate(
selectedJourney,
journey,
showRadius,
isTrunkRoute,
state,
Filters,
Time,
Expand All @@ -74,7 +75,6 @@ const RouteStop = decorate(
},
[]
);

const onShowStreetView = useCallback(() => {
UI.setMapillaryViewerLocation(latLng({lat: stop.lat, lng: stop.lng}));
}, [stop]);
Expand Down Expand Up @@ -102,7 +102,10 @@ const RouteStop = decorate(

let markerChildren = [stopTooltip, stopStreetViewPopup];

const mode = getPriorityMode(get(stop, "modes", []));
let mode = getPriorityMode(get(stop, "modes", []));
if (isTrunkRoute) {
mode = "TRUNK";
}
let color = getModeColor(mode);

if (!selectedJourney || (!departure && !arrival)) {
Expand Down
4 changes: 2 additions & 2 deletions src/components/map/RouteStopsLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import get from "lodash/get";
const decorate = flow(observer, inject("state"));

const RouteStopsLayer = decorate(
({state: {date, route, selectedJourney}, showRadius}) => {
({state: {date, route, selectedJourney}, showRadius, isTrunkRoute}) => {
let {data: routeStopsData} = useQueryData(stopsByRouteQuery, {
skip: !route,
variables: {
Expand All @@ -21,7 +21,6 @@ const RouteStopsLayer = decorate(
});

let routeStops = routeStopsData || [];

return routeStops.map((stop, index, arr) => {
const isFirst = index === 0;
const isLast = index === arr.length - 1;
Expand All @@ -37,6 +36,7 @@ const RouteStopsLayer = decorate(
stop={stop}
date={date}
showRadius={showRadius}
isTrunkRoute={isTrunkRoute}
/>
);
});
Expand Down

0 comments on commit f845acd

Please sign in to comment.