From c289fbc30671ffcd5a998b11d52ca5064a32cb47 Mon Sep 17 00:00:00 2001 From: tekoiv Date: Tue, 11 Jul 2023 15:21:39 +0300 Subject: [PATCH 1/7] feat: support for new speedtram mode DT-5987 --- app/component/ItineraryLegs.js | 10 ++++ app/component/SpeedTramLeg.js | 28 ++++++++++ app/component/itinerary.scss | 3 + app/component/map/VehicleMarkerContainer.js | 11 +++- app/component/map/popups/marker-popup.scss | 3 + app/component/map/tile-layer/SelectStopRow.js | 4 ++ app/configurations/config.hsl.js | 30 ++++++++++ app/constants.js | 1 + app/translations.js | 3 + app/util/modeUtils.js | 2 + .../package.json | 6 +- .../package.json | 6 +- .../package.json | 4 +- .../package.json | 4 +- .../package.json | 6 +- .../package.json | 4 +- .../package.json | 4 +- .../digitransit-component-icon/package.json | 2 +- .../search-speedtram-stop-digitransit.svg | 13 +++++ .../src/assets/speedtram.svg | 11 ++++ .../digitransit-component-icon/src/index.js | 6 ++ .../package.json | 4 +- .../src/index.js | 11 ++++ .../package.json | 4 +- .../digitransit-component/package.json | 18 +++--- sass/base/_helper-classes.scss | 3 + sass/themes/default/_theme.scss | 1 + sass/themes/hsl/_theme.scss | 1 + sass/themes/matka/_theme.scss | 1 + static/assets/svg-sprite.default.svg | 4 ++ static/assets/svg-sprite.hsl.svg | 24 ++++++++ yarn.lock | 56 +++++++++---------- 32 files changed, 227 insertions(+), 61 deletions(-) create mode 100644 app/component/SpeedTramLeg.js create mode 100644 digitransit-component/packages/digitransit-component-icon/src/assets/search-speedtram-stop-digitransit.svg create mode 100644 digitransit-component/packages/digitransit-component-icon/src/assets/speedtram.svg diff --git a/app/component/ItineraryLegs.js b/app/component/ItineraryLegs.js index 966e6d5527..6b16fb56ba 100644 --- a/app/component/ItineraryLegs.js +++ b/app/component/ItineraryLegs.js @@ -29,6 +29,7 @@ import { addAnalyticsEvent } from '../util/analyticsUtils'; import ItineraryProfile from './ItineraryProfile'; import BikeParkLeg from './BikeParkLeg'; import FunicularLeg from './FunicularLeg'; +import SpeedTramLeg from './SpeedTramLeg'; class ItineraryLegs extends React.Component { static childContextTypes = { @@ -241,6 +242,15 @@ class ItineraryLegs extends React.Component { focusAction={this.focus(leg.from)} />, ); + } else if (leg.mode === 'SPEEDTRAM' && !leg.interlineWithPreviousLeg) { + legs.push( + , + ); } else if (leg.mode === 'FERRY' && !leg.interlineWithPreviousLeg) { legs.push( ( + + + +); + +SpeedTramLeg.propTypes = { + leg: PropTypes.object.isRequired, + index: PropTypes.number.isRequired, + focusAction: PropTypes.func.isRequired, + interliningWait: PropTypes.number, + isNextLegInterlining: PropTypes.bool, +}; + +export default SpeedTramLeg; diff --git a/app/component/itinerary.scss b/app/component/itinerary.scss index 76cc36c4a2..64a813f1b4 100644 --- a/app/component/itinerary.scss +++ b/app/component/itinerary.scss @@ -18,6 +18,9 @@ $itinerary-tab-switch-height: 48px; &.bus-express { @include getCircleSvg($bus-express-color, $fill); } + &.speedtram { + @include getCircleSvg($speedtram-color, $fill); + } &.airplane { @include getCircleSvg($airplane-color, $fill); } diff --git a/app/component/map/VehicleMarkerContainer.js b/app/component/map/VehicleMarkerContainer.js index bb58ffb9c8..f888d79003 100644 --- a/app/component/map/VehicleMarkerContainer.js +++ b/app/component/map/VehicleMarkerContainer.js @@ -14,6 +14,7 @@ const MODES_WITH_ICONS = [ 'rail', 'subway', 'ferry', + 'speedtram', ]; function getVehicleIcon( @@ -80,8 +81,14 @@ function VehicleMarkerContainer(props) { return visibleVehicles.map(([id, message]) => { const type = props.topics?.find(t => t.shortName === message.shortName) ?.type; - const mode = - type === ExtendedRouteTypes.BusExpress ? 'bus-express' : message.mode; + let mode; + if (type === ExtendedRouteTypes.BusExpress) { + mode = 'bus-express'; + } else if (type === ExtendedRouteTypes.SpeedTram) { + mode = 'speedtram'; + } else { + mode = message.mode; + } return ( route.type === 902, + header: { + fi: 'Raide-Jokeri', + en: 'Jokeri Light Rail', + sv: 'Spårjokern', + }, + content: { + fi: [ + 'Sed nibh ante, sodales non tortor vel, ullamcorper auctor massa. Nulla facilisi. Sed pharetra malesuada mauris, et auctor diam luctus at.', + ], + en: [ + 'Sed nibh ante, sodales non tortor vel, ullamcorper auctor massa. Nulla facilisi. Sed pharetra malesuada mauris, et auctor diam luctus at.', + ], + sv: [ + 'Sed nibh ante, sodales non tortor vel, ullamcorper auctor massa. Nulla facilisi. Sed pharetra malesuada mauris, et auctor diam luctus at.', + ], + }, + closeButtonLabel: { + fi: 'Mitä lähibussi tarkoittaa?', + en: 'What does a neigbourhood route mean?', + sv: 'Vad betyder en närbuss?', + }, + link: { + fi: 'hsl.fi/matkustaminen/lahibussit', + en: 'hsl.fi/matkustaminen/lahibussit', + sv: 'hsl.fi/matkustaminen/lahibussit', + }, + }, ], embeddedSearch: { diff --git a/app/constants.js b/app/constants.js index 9528150721..8816ad55f4 100644 --- a/app/constants.js +++ b/app/constants.js @@ -95,6 +95,7 @@ export const AlertEntityType = Object.freeze({ export const ExtendedRouteTypes = Object.freeze({ BusExpress: 702, BusLocal: 704, + SpeedTram: 902, }); export const ParkTypes = { diff --git a/app/translations.js b/app/translations.js index 74a452ec4c..16fbc0730e 100644 --- a/app/translations.js +++ b/app/translations.js @@ -1485,6 +1485,7 @@ const translations = { 'skip-to-content': 'Skip to content', slow: 'Slow', 'specify-location': 'Specify location', + speedtram: 'Jokeri Light Rail', 'splash-locating': 'Detecting location', 'splash-or-choose': 'or select your origin', 'splash-use-positioning': 'Use location services', @@ -2615,6 +2616,7 @@ const translations = { 'skip-to-content': 'Siirry sisältöön', slow: 'Hidas', 'specify-location': 'Määritä sijainti', + speedtram: 'Raide-Jokeri', 'splash-locating': 'Paikannetaan', 'splash-or-choose': 'tai valitse lähtöpaikaksi', 'splash-use-positioning': 'Käytä paikannusta', @@ -4530,6 +4532,7 @@ const translations = { 'skip-to-content': 'Till innehållet', slow: 'Långsam', 'specify-location': 'Ange en plats', + speedtram: 'Spårjokern', 'splash-locating': 'Söker din plats...', 'splash-or-choose': 'eller välj en avfärdsplats', 'splash-please-allow-positioning': diff --git a/app/util/modeUtils.js b/app/util/modeUtils.js index cbfd39206e..f11121d21f 100644 --- a/app/util/modeUtils.js +++ b/app/util/modeUtils.js @@ -110,6 +110,8 @@ export const getRouteMode = route => { return 'bus-express'; case ExtendedRouteTypes.BusLocal: return 'bus-local'; + case ExtendedRouteTypes.SpeedTram: + return 'speedtram'; default: return route.mode?.toLowerCase(); } diff --git a/digitransit-component/packages/digitransit-component-autosuggest-panel/package.json b/digitransit-component/packages/digitransit-component-autosuggest-panel/package.json index 0c5b4d5afa..89c6026414 100644 --- a/digitransit-component/packages/digitransit-component-autosuggest-panel/package.json +++ b/digitransit-component/packages/digitransit-component-autosuggest-panel/package.json @@ -1,6 +1,6 @@ { "name": "@digitransit-component/digitransit-component-autosuggest-panel", - "version": "2.0.2", + "version": "2.0.3", "description": "digitransit-component autosuggest-panel module", "main": "index.js", "files": [ @@ -28,8 +28,8 @@ "author": "Digitransit Authors", "license": "(AGPL-3.0 OR EUPL-1.2)", "peerDependencies": { - "@digitransit-component/digitransit-component-autosuggest": "^1.9.6", - "@digitransit-component/digitransit-component-icon": "^0.2.0", + "@digitransit-component/digitransit-component-autosuggest": "^1.9.7", + "@digitransit-component/digitransit-component-icon": "^0.2.1", "@hsl-fi/sass": "^0.2.0", "classnames": "2.2.6", "i18next": "^19.3.3", diff --git a/digitransit-component/packages/digitransit-component-autosuggest/package.json b/digitransit-component/packages/digitransit-component-autosuggest/package.json index 35b8d2476b..f46bd00a2d 100644 --- a/digitransit-component/packages/digitransit-component-autosuggest/package.json +++ b/digitransit-component/packages/digitransit-component-autosuggest/package.json @@ -1,6 +1,6 @@ { "name": "@digitransit-component/digitransit-component-autosuggest", - "version": "1.9.6", + "version": "1.9.7", "description": "digitransit-component autosuggest module", "main": "index.js", "files": [ @@ -36,8 +36,8 @@ }, "peerDependencies": { "@digitransit-component/digitransit-component-dialog-modal": "^0.3.4", - "@digitransit-component/digitransit-component-icon": "^0.2.0", - "@digitransit-component/digitransit-component-suggestion-item": "^1.1.1", + "@digitransit-component/digitransit-component-icon": "^0.2.1", + "@digitransit-component/digitransit-component-suggestion-item": "^1.1.2", "@hsl-fi/sass": "^0.2.0", "classnames": "2.2.6", "i18next": "^19.3.3", diff --git a/digitransit-component/packages/digitransit-component-control-panel/package.json b/digitransit-component/packages/digitransit-component-control-panel/package.json index 940ef63a8d..335af701e2 100644 --- a/digitransit-component/packages/digitransit-component-control-panel/package.json +++ b/digitransit-component/packages/digitransit-component-control-panel/package.json @@ -1,6 +1,6 @@ { "name": "@digitransit-component/digitransit-component-control-panel", - "version": "1.1.1", + "version": "1.1.2", "description": "digitransit-component control-panel module", "main": "index.js", "files": [ @@ -29,7 +29,7 @@ "author": "Digitransit Authors", "license": "(AGPL-3.0 OR EUPL-1.2)", "peerDependencies": { - "@digitransit-component/digitransit-component-icon": "^0.2.0", + "@digitransit-component/digitransit-component-icon": "^0.2.1", "@hsl-fi/sass": "~0.2.0", "classnames": "2.2.6", "i18next": "^19.3.3", diff --git a/digitransit-component/packages/digitransit-component-datetimepicker/package.json b/digitransit-component/packages/digitransit-component-datetimepicker/package.json index dc2e890662..10859e9a1b 100644 --- a/digitransit-component/packages/digitransit-component-datetimepicker/package.json +++ b/digitransit-component/packages/digitransit-component-datetimepicker/package.json @@ -1,6 +1,6 @@ { "name": "@digitransit-component/digitransit-component-datetimepicker", - "version": "0.7.2", + "version": "0.7.3", "description": "digitransit-component datetimepicker module", "main": "index.js", "files": [ @@ -29,7 +29,7 @@ "author": "Digitransit Authors", "license": "(AGPL-3.0 OR EUPL-1.2)", "peerDependencies": { - "@digitransit-component/digitransit-component-icon": "^0.2.0", + "@digitransit-component/digitransit-component-icon": "^0.2.1", "i18next": "^19.3.3", "lodash": "4.17.21", "lodash-es": "4.17.21", diff --git a/digitransit-component/packages/digitransit-component-favourite-bar/package.json b/digitransit-component/packages/digitransit-component-favourite-bar/package.json index e53fb45c14..40079f90c5 100644 --- a/digitransit-component/packages/digitransit-component-favourite-bar/package.json +++ b/digitransit-component/packages/digitransit-component-favourite-bar/package.json @@ -1,6 +1,6 @@ { "name": "@digitransit-component/digitransit-component-favourite-bar", - "version": "1.1.1", + "version": "1.1.2", "description": "digitransit-component favourite-bar module", "main": "index.js", "files": [ @@ -32,8 +32,8 @@ "@digitransit-search-util/digitransit-search-util-uniq-by-label": "^1.1.0" }, "peerDependencies": { - "@digitransit-component/digitransit-component-icon": "^0.2.0", - "@digitransit-component/digitransit-component-suggestion-item": "^1.1.1", + "@digitransit-component/digitransit-component-icon": "^0.2.1", + "@digitransit-component/digitransit-component-suggestion-item": "^1.1.2", "@hsl-fi/sass": "^0.2.0", "@hsl-fi/shimmer": "0.1.2", "classnames": "2.2.6", diff --git a/digitransit-component/packages/digitransit-component-favourite-editing-modal/package.json b/digitransit-component/packages/digitransit-component-favourite-editing-modal/package.json index cf9a9235da..ddb8868f52 100644 --- a/digitransit-component/packages/digitransit-component-favourite-editing-modal/package.json +++ b/digitransit-component/packages/digitransit-component-favourite-editing-modal/package.json @@ -1,6 +1,6 @@ { "name": "@digitransit-component/digitransit-component-favourite-editing-modal", - "version": "1.1.2", + "version": "1.1.3", "description": "digitransit-component favourite-editing-modal module", "main": "index.js", "files": [ @@ -33,7 +33,7 @@ }, "peerDependencies": { "@digitransit-component/digitransit-component-dialog-modal": "^0.3.4", - "@digitransit-component/digitransit-component-icon": "^0.2.0", + "@digitransit-component/digitransit-component-icon": "^0.2.1", "@hsl-fi/container-spinner": "0.3.1", "@hsl-fi/modal": "^0.3.1", "@hsl-fi/sass": "^0.2.0", diff --git a/digitransit-component/packages/digitransit-component-favourite-modal/package.json b/digitransit-component/packages/digitransit-component-favourite-modal/package.json index 57ae35f679..7e37d50279 100644 --- a/digitransit-component/packages/digitransit-component-favourite-modal/package.json +++ b/digitransit-component/packages/digitransit-component-favourite-modal/package.json @@ -1,6 +1,6 @@ { "name": "@digitransit-component/digitransit-component-favourite-modal", - "version": "1.0.0", + "version": "1.0.1", "description": "digitransit-component favourite-modal module", "main": "index.js", "files": [ @@ -29,7 +29,7 @@ "author": "Digitransit Authors", "license": "(AGPL-3.0 OR EUPL-1.2)", "peerDependencies": { - "@digitransit-component/digitransit-component-icon": "^0.2.0", + "@digitransit-component/digitransit-component-icon": "^0.2.1", "@hsl-fi/modal": "^0.3.1", "@hsl-fi/sass": "^0.2.0", "classnames": "2.2.6", diff --git a/digitransit-component/packages/digitransit-component-icon/package.json b/digitransit-component/packages/digitransit-component-icon/package.json index ea78185e4f..9736ccb67e 100644 --- a/digitransit-component/packages/digitransit-component-icon/package.json +++ b/digitransit-component/packages/digitransit-component-icon/package.json @@ -1,6 +1,6 @@ { "name": "@digitransit-component/digitransit-component-icon", - "version": "0.2.0", + "version": "0.2.1", "description": "digitransit-component icon module", "main": "index.js", "files": [ diff --git a/digitransit-component/packages/digitransit-component-icon/src/assets/search-speedtram-stop-digitransit.svg b/digitransit-component/packages/digitransit-component-icon/src/assets/search-speedtram-stop-digitransit.svg new file mode 100644 index 0000000000..48c7dda514 --- /dev/null +++ b/digitransit-component/packages/digitransit-component-icon/src/assets/search-speedtram-stop-digitransit.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/digitransit-component/packages/digitransit-component-icon/src/assets/speedtram.svg b/digitransit-component/packages/digitransit-component-icon/src/assets/speedtram.svg new file mode 100644 index 0000000000..8d282f3f72 --- /dev/null +++ b/digitransit-component/packages/digitransit-component-icon/src/assets/speedtram.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/digitransit-component/packages/digitransit-component-icon/src/index.js b/digitransit-component/packages/digitransit-component-icon/src/index.js index 88c9f53050..3501932f26 100644 --- a/digitransit-component/packages/digitransit-component-icon/src/index.js +++ b/digitransit-component/packages/digitransit-component-icon/src/index.js @@ -39,6 +39,7 @@ import CautionWhite from './assets/caution_white_exclamation.svg'; import Trash from './assets/trash.svg'; import ModeBus from './assets/mode_bus.svg'; import ModeBusExpress from './assets/bus-express.svg'; +import Speedtram from './assets/speedtram.svg'; import ModeBusLocal from './assets/bus-local.svg'; import ModeRail from './assets/mode_rail.svg'; import ModeTram from './assets/mode_tram.svg'; @@ -76,6 +77,7 @@ import SearchFerryStopDigitransit from './assets/search-ferry-stop-digitransit.s import SearchRailStopDigitransit from './assets/search-rail-stop-digitransit.svg'; import SearchRailStationDigitransit from './assets/search-rail-station-digitransit.svg'; import SearchTramStopDigitransit from './assets/search-tram-stop-digitransit.svg'; +import SearchSpeedtramStopDigitransit from './assets/search-speedtram-stop-digitransit.svg'; import Funicular from './assets/funicular.svg'; const IconMap = style => { @@ -122,6 +124,7 @@ const IconMap = style => { 'mode-bus': , 'mode-bus-express': , 'mode-bus-local': , + 'mode-speedtram': , 'mode-rail': , 'mode-tram': , 'mode-subway': , @@ -179,6 +182,9 @@ const IconMap = style => { ), 'search-tram-stop-digitransit': , funicular: , + 'search-speedtram-stop-digitransit': ( + + ), }; }; diff --git a/digitransit-component/packages/digitransit-component-suggestion-item/package.json b/digitransit-component/packages/digitransit-component-suggestion-item/package.json index 7686823c2e..d846fbbb30 100644 --- a/digitransit-component/packages/digitransit-component-suggestion-item/package.json +++ b/digitransit-component/packages/digitransit-component-suggestion-item/package.json @@ -1,6 +1,6 @@ { "name": "@digitransit-component/digitransit-component-suggestion-item", - "version": "1.1.1", + "version": "1.1.2", "description": "digitransit-component suggestion-item module", "main": "index.js", "files": [ @@ -32,7 +32,7 @@ "recompose": "0.30.0" }, "peerDependencies": { - "@digitransit-component/digitransit-component-icon": "^0.2.0", + "@digitransit-component/digitransit-component-icon": "^0.2.1", "@hsl-fi/sass": " ^0.2.0", "classnames": "2.2.6", "i18next": "^19.3.3", diff --git a/digitransit-component/packages/digitransit-component-suggestion-item/src/index.js b/digitransit-component/packages/digitransit-component-suggestion-item/src/index.js index b53180fa8b..f88e53c1a4 100644 --- a/digitransit-component/packages/digitransit-component-suggestion-item/src/index.js +++ b/digitransit-component/packages/digitransit-component-suggestion-item/src/index.js @@ -8,6 +8,7 @@ import styles from './helpers/styles.scss'; const BUS_EXPRESS = 702; const BUS_LOCAL = 704; +const SPEEDTRAM = 902; const getRouteMode = props => { switch (props.type) { @@ -15,6 +16,8 @@ const getRouteMode = props => { return 'bus-local'; case BUS_EXPRESS: return 'bus-express'; + case SPEEDTRAM: + return 'speedtram'; default: return props?.mode?.toLowerCase() || 'bus'; } @@ -152,6 +155,14 @@ function getIconProperties( 'TRAM-digitransit', { icon: 'search-tram-stop-digitransit', color: 'mode-tram' }, ], + [ + 'SPEEDTRAM-default', + { icon: 'search-speedtram-stop-digitransit', color: 'mode-tram' }, + ], + [ + 'SPEEDTRAM-digitransit', + { icon: 'search-tram-stop-default', color: 'mode-tram' }, + ], ['SUBWAY-default', { icon: 'subway', color: 'mode-metro' }], ['SUBWAY-digitransit', { icon: 'subway', color: 'mode-metro' }], ['SUBWAY-STATION-default', { icon: 'subway', color: 'mode-metro' }], diff --git a/digitransit-component/packages/digitransit-component-traffic-now-link/package.json b/digitransit-component/packages/digitransit-component-traffic-now-link/package.json index 7da5f2a912..a287079c18 100644 --- a/digitransit-component/packages/digitransit-component-traffic-now-link/package.json +++ b/digitransit-component/packages/digitransit-component-traffic-now-link/package.json @@ -1,6 +1,6 @@ { "name": "@digitransit-component/digitransit-component-traffic-now-link", - "version": "0.2.0", + "version": "0.2.1", "description": "digitransit-component traffic-now-link module", "main": "index.js", "files": [ @@ -29,7 +29,7 @@ "author": "Digitransit Authors", "license": "(AGPL-3.0 OR EUPL-1.2)", "peerDependencies": { - "@digitransit-component/digitransit-component-icon": "^0.2.0", + "@digitransit-component/digitransit-component-icon": "^0.2.1", "@hsl-fi/sass": "^0.2.0", "i18next": "^19.3.3", "prop-types": "^15.7.2", diff --git a/digitransit-component/packages/digitransit-component/package.json b/digitransit-component/packages/digitransit-component/package.json index 1eb14ebdda..37d3fe23d9 100644 --- a/digitransit-component/packages/digitransit-component/package.json +++ b/digitransit-component/packages/digitransit-component/package.json @@ -1,6 +1,6 @@ { "name": "@digitransit-component/digitransit-component", - "version": "1.2.6", + "version": "1.2.7", "description": "a JavaScript library for Digitransit", "main": "digitransit-component", "module": "digitransit-component.mjs", @@ -14,14 +14,14 @@ "docs": "node -r esm ../../scripts/generate-readmes" }, "dependencies": { - "@digitransit-component/digitransit-component-autosuggest": "^1.9.6", - "@digitransit-component/digitransit-component-autosuggest-panel": "^2.0.2", - "@digitransit-component/digitransit-component-control-panel": "^1.1.1", - "@digitransit-component/digitransit-component-favourite-bar": "1.1.1", - "@digitransit-component/digitransit-component-favourite-editing-modal": "^1.1.2", - "@digitransit-component/digitransit-component-favourite-modal": "^1.0.0", - "@digitransit-component/digitransit-component-icon": "^0.2.0", - "@digitransit-component/digitransit-component-suggestion-item": "^1.1.1", + "@digitransit-component/digitransit-component-autosuggest": "^1.9.7", + "@digitransit-component/digitransit-component-autosuggest-panel": "^2.0.3", + "@digitransit-component/digitransit-component-control-panel": "^1.1.2", + "@digitransit-component/digitransit-component-favourite-bar": "1.1.2", + "@digitransit-component/digitransit-component-favourite-editing-modal": "^1.1.3", + "@digitransit-component/digitransit-component-favourite-modal": "^1.0.1", + "@digitransit-component/digitransit-component-icon": "^0.2.1", + "@digitransit-component/digitransit-component-suggestion-item": "^1.1.2", "@digitransit-component/digitransit-component-with-breakpoint": "^0.0.5" }, "peerDependencies": { diff --git a/sass/base/_helper-classes.scss b/sass/base/_helper-classes.scss index 9e555d0822..1db09baf50 100644 --- a/sass/base/_helper-classes.scss +++ b/sass/base/_helper-classes.scss @@ -16,6 +16,9 @@ .bus-express { color: $bus-express-color; } +.speedtram { + color: $speedtram-color; +} .map .call { color: $white; } diff --git a/sass/themes/default/_theme.scss b/sass/themes/default/_theme.scss index f2f06be16a..5f54ea5c39 100644 --- a/sass/themes/default/_theme.scss +++ b/sass/themes/default/_theme.scss @@ -64,6 +64,7 @@ $nav-content-color: false; $airplane-color: $livi-airplane-blue; $bus-color: $livi-bus-blue; $bus-express-color: $livi-bus-blue; +$speedtram-color: $livi-tram-green; $tram-color: $livi-tram-green; $metro-color: $livi-subway-orange; $rail-color: $livi-rail-purple; diff --git a/sass/themes/hsl/_theme.scss b/sass/themes/hsl/_theme.scss index 9465796986..5564fcee15 100644 --- a/sass/themes/hsl/_theme.scss +++ b/sass/themes/hsl/_theme.scss @@ -36,6 +36,7 @@ $top-bar-color: $primary-color; $airplane-color: #0046ad; $bus-color: $hsl-blue; $bus-express-color: $hsl-bus-express; +$speedtram-color: #007E79; $tram-color: $hsl-tram-green; $metro-color: $hsl-metro-orange; $rail-color: $hsl-rail-red; diff --git a/sass/themes/matka/_theme.scss b/sass/themes/matka/_theme.scss index b4a43fb3db..c1cc0ee0df 100644 --- a/sass/themes/matka/_theme.scss +++ b/sass/themes/matka/_theme.scss @@ -24,6 +24,7 @@ $button-font-family: 'Montserrat', Arial, Georgia, sans-serif; $bus-color: #007ac9; $airplane-color: #0046ad; $tram-color: #5E7921; +$speedtram-color: #5E7921; $metro-color: #CA4000; $rail-color: #8c4799; $ferry-color: #247C7B; diff --git a/static/assets/svg-sprite.default.svg b/static/assets/svg-sprite.default.svg index 5ae7236eaf..d426c79d2c 100644 --- a/static/assets/svg-sprite.default.svg +++ b/static/assets/svg-sprite.default.svg @@ -416,6 +416,10 @@ + + + + diff --git a/static/assets/svg-sprite.hsl.svg b/static/assets/svg-sprite.hsl.svg index f76807fe45..c0d3ece3b3 100644 --- a/static/assets/svg-sprite.hsl.svg +++ b/static/assets/svg-sprite.hsl.svg @@ -99,6 +99,17 @@ + + + + + + + + + + + @@ -159,6 +170,19 @@ + + + + + + + + + + + + + diff --git a/yarn.lock b/yarn.lock index 7c655dfac9..899018b119 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1819,12 +1819,12 @@ __metadata: languageName: unknown linkType: soft -"@digitransit-component/digitransit-component-autosuggest-panel@^2.0.2, @digitransit-component/digitransit-component-autosuggest-panel@workspace:digitransit-component/packages/digitransit-component-autosuggest-panel": +"@digitransit-component/digitransit-component-autosuggest-panel@^2.0.3, @digitransit-component/digitransit-component-autosuggest-panel@workspace:digitransit-component/packages/digitransit-component-autosuggest-panel": version: 0.0.0-use.local resolution: "@digitransit-component/digitransit-component-autosuggest-panel@workspace:digitransit-component/packages/digitransit-component-autosuggest-panel" peerDependencies: - "@digitransit-component/digitransit-component-autosuggest": ^1.9.6 - "@digitransit-component/digitransit-component-icon": ^0.2.0 + "@digitransit-component/digitransit-component-autosuggest": ^1.9.7 + "@digitransit-component/digitransit-component-icon": ^0.2.1 "@hsl-fi/sass": ^0.2.0 classnames: 2.2.6 i18next: ^19.3.3 @@ -1839,7 +1839,7 @@ __metadata: languageName: unknown linkType: soft -"@digitransit-component/digitransit-component-autosuggest@^1.9.6, @digitransit-component/digitransit-component-autosuggest@workspace:digitransit-component/packages/digitransit-component-autosuggest": +"@digitransit-component/digitransit-component-autosuggest@^1.9.7, @digitransit-component/digitransit-component-autosuggest@workspace:digitransit-component/packages/digitransit-component-autosuggest": version: 0.0.0-use.local resolution: "@digitransit-component/digitransit-component-autosuggest@workspace:digitransit-component/packages/digitransit-component-autosuggest" dependencies: @@ -1849,8 +1849,8 @@ __metadata: "@hsl-fi/hooks": ^1.2.0 peerDependencies: "@digitransit-component/digitransit-component-dialog-modal": ^0.3.4 - "@digitransit-component/digitransit-component-icon": ^0.2.0 - "@digitransit-component/digitransit-component-suggestion-item": ^1.1.1 + "@digitransit-component/digitransit-component-icon": ^0.2.1 + "@digitransit-component/digitransit-component-suggestion-item": ^1.1.2 "@hsl-fi/sass": ^0.2.0 classnames: 2.2.6 i18next: ^19.3.3 @@ -1864,11 +1864,11 @@ __metadata: languageName: unknown linkType: soft -"@digitransit-component/digitransit-component-control-panel@^1.1.1, @digitransit-component/digitransit-component-control-panel@workspace:digitransit-component/packages/digitransit-component-control-panel": +"@digitransit-component/digitransit-component-control-panel@^1.1.2, @digitransit-component/digitransit-component-control-panel@workspace:digitransit-component/packages/digitransit-component-control-panel": version: 0.0.0-use.local resolution: "@digitransit-component/digitransit-component-control-panel@workspace:digitransit-component/packages/digitransit-component-control-panel" peerDependencies: - "@digitransit-component/digitransit-component-icon": ^0.2.0 + "@digitransit-component/digitransit-component-icon": ^0.2.1 "@hsl-fi/sass": ~0.2.0 classnames: 2.2.6 i18next: ^19.3.3 @@ -1882,7 +1882,7 @@ __metadata: version: 0.0.0-use.local resolution: "@digitransit-component/digitransit-component-datetimepicker@workspace:digitransit-component/packages/digitransit-component-datetimepicker" peerDependencies: - "@digitransit-component/digitransit-component-icon": ^0.2.0 + "@digitransit-component/digitransit-component-icon": ^0.2.1 i18next: ^19.3.3 lodash: 4.17.21 lodash-es: 4.17.21 @@ -1910,14 +1910,14 @@ __metadata: languageName: unknown linkType: soft -"@digitransit-component/digitransit-component-favourite-bar@1.1.1, @digitransit-component/digitransit-component-favourite-bar@workspace:digitransit-component/packages/digitransit-component-favourite-bar": +"@digitransit-component/digitransit-component-favourite-bar@1.1.2, @digitransit-component/digitransit-component-favourite-bar@workspace:digitransit-component/packages/digitransit-component-favourite-bar": version: 0.0.0-use.local resolution: "@digitransit-component/digitransit-component-favourite-bar@workspace:digitransit-component/packages/digitransit-component-favourite-bar" dependencies: "@digitransit-search-util/digitransit-search-util-uniq-by-label": ^1.1.0 peerDependencies: - "@digitransit-component/digitransit-component-icon": ^0.2.0 - "@digitransit-component/digitransit-component-suggestion-item": ^1.1.1 + "@digitransit-component/digitransit-component-icon": ^0.2.1 + "@digitransit-component/digitransit-component-suggestion-item": ^1.1.2 "@hsl-fi/sass": ^0.2.0 "@hsl-fi/shimmer": 0.1.2 classnames: 2.2.6 @@ -1929,14 +1929,14 @@ __metadata: languageName: unknown linkType: soft -"@digitransit-component/digitransit-component-favourite-editing-modal@^1.1.2, @digitransit-component/digitransit-component-favourite-editing-modal@workspace:digitransit-component/packages/digitransit-component-favourite-editing-modal": +"@digitransit-component/digitransit-component-favourite-editing-modal@^1.1.3, @digitransit-component/digitransit-component-favourite-editing-modal@workspace:digitransit-component/packages/digitransit-component-favourite-editing-modal": version: 0.0.0-use.local resolution: "@digitransit-component/digitransit-component-favourite-editing-modal@workspace:digitransit-component/packages/digitransit-component-favourite-editing-modal" dependencies: "@digitransit-search-util/digitransit-search-util-uniq-by-label": ^1.1.0 peerDependencies: "@digitransit-component/digitransit-component-dialog-modal": ^0.3.4 - "@digitransit-component/digitransit-component-icon": ^0.2.0 + "@digitransit-component/digitransit-component-icon": ^0.2.1 "@hsl-fi/container-spinner": 0.3.1 "@hsl-fi/modal": ^0.3.1 "@hsl-fi/sass": ^0.2.0 @@ -1947,11 +1947,11 @@ __metadata: languageName: unknown linkType: soft -"@digitransit-component/digitransit-component-favourite-modal@^1.0.0, @digitransit-component/digitransit-component-favourite-modal@workspace:digitransit-component/packages/digitransit-component-favourite-modal": +"@digitransit-component/digitransit-component-favourite-modal@^1.0.1, @digitransit-component/digitransit-component-favourite-modal@workspace:digitransit-component/packages/digitransit-component-favourite-modal": version: 0.0.0-use.local resolution: "@digitransit-component/digitransit-component-favourite-modal@workspace:digitransit-component/packages/digitransit-component-favourite-modal" peerDependencies: - "@digitransit-component/digitransit-component-icon": ^0.2.0 + "@digitransit-component/digitransit-component-icon": ^0.2.1 "@hsl-fi/modal": ^0.3.1 "@hsl-fi/sass": ^0.2.0 classnames: 2.2.6 @@ -1963,7 +1963,7 @@ __metadata: languageName: unknown linkType: soft -"@digitransit-component/digitransit-component-icon@^0.2.0, @digitransit-component/digitransit-component-icon@workspace:digitransit-component/packages/digitransit-component-icon": +"@digitransit-component/digitransit-component-icon@^0.2.1, @digitransit-component/digitransit-component-icon@workspace:digitransit-component/packages/digitransit-component-icon": version: 0.0.0-use.local resolution: "@digitransit-component/digitransit-component-icon@workspace:digitransit-component/packages/digitransit-component-icon" peerDependencies: @@ -1973,13 +1973,13 @@ __metadata: languageName: unknown linkType: soft -"@digitransit-component/digitransit-component-suggestion-item@^1.1.1, @digitransit-component/digitransit-component-suggestion-item@workspace:digitransit-component/packages/digitransit-component-suggestion-item": +"@digitransit-component/digitransit-component-suggestion-item@^1.1.2, @digitransit-component/digitransit-component-suggestion-item@workspace:digitransit-component/packages/digitransit-component-suggestion-item": version: 0.0.0-use.local resolution: "@digitransit-component/digitransit-component-suggestion-item@workspace:digitransit-component/packages/digitransit-component-suggestion-item" dependencies: recompose: 0.30.0 peerDependencies: - "@digitransit-component/digitransit-component-icon": ^0.2.0 + "@digitransit-component/digitransit-component-icon": ^0.2.1 "@hsl-fi/sass": " ^0.2.0" classnames: 2.2.6 i18next: ^19.3.3 @@ -1992,7 +1992,7 @@ __metadata: version: 0.0.0-use.local resolution: "@digitransit-component/digitransit-component-traffic-now-link@workspace:digitransit-component/packages/digitransit-component-traffic-now-link" peerDependencies: - "@digitransit-component/digitransit-component-icon": ^0.2.0 + "@digitransit-component/digitransit-component-icon": ^0.2.1 "@hsl-fi/sass": ^0.2.0 i18next: ^19.3.3 prop-types: ^15.7.2 @@ -2016,14 +2016,14 @@ __metadata: version: 0.0.0-use.local resolution: "@digitransit-component/digitransit-component@workspace:digitransit-component/packages/digitransit-component" dependencies: - "@digitransit-component/digitransit-component-autosuggest": ^1.9.6 - "@digitransit-component/digitransit-component-autosuggest-panel": ^2.0.2 - "@digitransit-component/digitransit-component-control-panel": ^1.1.1 - "@digitransit-component/digitransit-component-favourite-bar": 1.1.1 - "@digitransit-component/digitransit-component-favourite-editing-modal": ^1.1.2 - "@digitransit-component/digitransit-component-favourite-modal": ^1.0.0 - "@digitransit-component/digitransit-component-icon": ^0.2.0 - "@digitransit-component/digitransit-component-suggestion-item": ^1.1.1 + "@digitransit-component/digitransit-component-autosuggest": ^1.9.7 + "@digitransit-component/digitransit-component-autosuggest-panel": ^2.0.3 + "@digitransit-component/digitransit-component-control-panel": ^1.1.2 + "@digitransit-component/digitransit-component-favourite-bar": 1.1.2 + "@digitransit-component/digitransit-component-favourite-editing-modal": ^1.1.3 + "@digitransit-component/digitransit-component-favourite-modal": ^1.0.1 + "@digitransit-component/digitransit-component-icon": ^0.2.1 + "@digitransit-component/digitransit-component-suggestion-item": ^1.1.2 "@digitransit-component/digitransit-component-with-breakpoint": ^0.0.5 peerDependencies: "@digitransit-component/digitransit-component-dialog-modal": ^0.3.4 From 1864c299d37d9906592f390fc4e5cde99d28a31e Mon Sep 17 00:00:00 2001 From: tekoiv Date: Wed, 16 Aug 2023 09:32:58 +0300 Subject: [PATCH 2/7] chore: change speedtram references to tram-local --- app/component/ItineraryLegs.js | 10 ------- app/component/SpeedTramLeg.js | 28 ------------------- app/component/TramLeg.js | 28 +++++++++++-------- app/component/itinerary.scss | 4 +-- app/component/map/VehicleMarkerContainer.js | 6 ++-- app/component/map/popups/marker-popup.scss | 4 +-- app/component/map/tile-layer/SelectStopRow.js | 11 ++++++-- app/component/map/tile-layer/Stops.js | 20 ++++++++++++- app/configurations/config.hsl.js | 6 ++-- app/constants.js | 2 +- app/translations.js | 6 ++-- app/util/modeUtils.js | 4 +-- ...=> search-tram-local-stop-digitransit.svg} | 0 .../assets/{speedtram.svg => tram-local.svg} | 0 .../digitransit-component-icon/src/index.js | 10 +++---- .../src/index.js | 16 ++++++----- sass/base/_helper-classes.scss | 4 +-- sass/themes/default/_theme.scss | 2 +- sass/themes/hsl/_theme.scss | 2 +- sass/themes/matka/_theme.scss | 2 +- static/assets/svg-sprite.default.svg | 28 ++++++++++++++++++- static/assets/svg-sprite.hsl.svg | 17 +++++++++-- 22 files changed, 120 insertions(+), 90 deletions(-) delete mode 100644 app/component/SpeedTramLeg.js rename digitransit-component/packages/digitransit-component-icon/src/assets/{search-speedtram-stop-digitransit.svg => search-tram-local-stop-digitransit.svg} (100%) rename digitransit-component/packages/digitransit-component-icon/src/assets/{speedtram.svg => tram-local.svg} (100%) diff --git a/app/component/ItineraryLegs.js b/app/component/ItineraryLegs.js index 6b16fb56ba..966e6d5527 100644 --- a/app/component/ItineraryLegs.js +++ b/app/component/ItineraryLegs.js @@ -29,7 +29,6 @@ import { addAnalyticsEvent } from '../util/analyticsUtils'; import ItineraryProfile from './ItineraryProfile'; import BikeParkLeg from './BikeParkLeg'; import FunicularLeg from './FunicularLeg'; -import SpeedTramLeg from './SpeedTramLeg'; class ItineraryLegs extends React.Component { static childContextTypes = { @@ -242,15 +241,6 @@ class ItineraryLegs extends React.Component { focusAction={this.focus(leg.from)} />, ); - } else if (leg.mode === 'SPEEDTRAM' && !leg.interlineWithPreviousLeg) { - legs.push( - , - ); } else if (leg.mode === 'FERRY' && !leg.interlineWithPreviousLeg) { legs.push( ( - - - -); - -SpeedTramLeg.propTypes = { - leg: PropTypes.object.isRequired, - index: PropTypes.number.isRequired, - focusAction: PropTypes.func.isRequired, - interliningWait: PropTypes.number, - isNextLegInterlining: PropTypes.bool, -}; - -export default SpeedTramLeg; diff --git a/app/component/TramLeg.js b/app/component/TramLeg.js index 26f088f60f..fff13fe971 100644 --- a/app/component/TramLeg.js +++ b/app/component/TramLeg.js @@ -1,21 +1,25 @@ import PropTypes from 'prop-types'; import React from 'react'; import { FormattedMessage } from 'react-intl'; +import { getRouteMode } from '../util/modeUtils'; import TransitLeg from './TransitLeg'; -const TramLeg = ({ leg, ...props }) => ( - - - -); +const TramLeg = ({ leg, ...props }) => { + const mode = getRouteMode({ mode: leg.mode, type: leg.route.type }); + return ( + + + + ); +}; TramLeg.propTypes = { leg: PropTypes.object.isRequired, diff --git a/app/component/itinerary.scss b/app/component/itinerary.scss index 64a813f1b4..2f9701b47f 100644 --- a/app/component/itinerary.scss +++ b/app/component/itinerary.scss @@ -18,8 +18,8 @@ $itinerary-tab-switch-height: 48px; &.bus-express { @include getCircleSvg($bus-express-color, $fill); } - &.speedtram { - @include getCircleSvg($speedtram-color, $fill); + &.tram-local { + @include getCircleSvg($tram-local-color, $fill); } &.airplane { @include getCircleSvg($airplane-color, $fill); diff --git a/app/component/map/VehicleMarkerContainer.js b/app/component/map/VehicleMarkerContainer.js index f888d79003..1cc251f01a 100644 --- a/app/component/map/VehicleMarkerContainer.js +++ b/app/component/map/VehicleMarkerContainer.js @@ -14,7 +14,7 @@ const MODES_WITH_ICONS = [ 'rail', 'subway', 'ferry', - 'speedtram', + 'tram-local', ]; function getVehicleIcon( @@ -84,8 +84,8 @@ function VehicleMarkerContainer(props) { let mode; if (type === ExtendedRouteTypes.BusExpress) { mode = 'bus-express'; - } else if (type === ExtendedRouteTypes.SpeedTram) { - mode = 'speedtram'; + } else if (type === ExtendedRouteTypes.TramLocal) { + mode = 'tram-local'; } else { mode = message.mode; } diff --git a/app/component/map/popups/marker-popup.scss b/app/component/map/popups/marker-popup.scss index 1df195d654..1610d58edb 100644 --- a/app/component/map/popups/marker-popup.scss +++ b/app/component/map/popups/marker-popup.scss @@ -74,8 +74,8 @@ .funicular-stop { color: $funicular-color; } - .speedtram-stop { - color: $speedtram-color; + .tram-local-stop { + color: $tram-local-color; } } diff --git a/app/component/map/tile-layer/SelectStopRow.js b/app/component/map/tile-layer/SelectStopRow.js index eb27c87599..ba53a9ad58 100644 --- a/app/component/map/tile-layer/SelectStopRow.js +++ b/app/component/map/tile-layer/SelectStopRow.js @@ -19,6 +19,11 @@ function SelectStopRow( if (patternArray.some(p => p.gtfsType === ExtendedRouteTypes.BusExpress)) { mode = 'bus-express'; } + } else if (patterns && type === 'TRAM' && config.useExtendedRouteTypes) { + const patternArray = JSON.parse(patterns); + if (patternArray.some(p => p.gtfsType === ExtendedRouteTypes.TramLocal)) { + mode = 'tram-local'; + } } const iconOptions = {}; switch (mode) { @@ -58,9 +63,9 @@ function SelectStopRow( iconOptions.iconId = 'icon-icon_funicular-stop-lollipop'; iconOptions.className = 'funicular-stop'; break; - case 'SPEEDTRAM': - iconOptions.iconId = 'icon-icon_speedtram-stop-lollipop'; - iconOptions.className = 'speedtram-stop'; + case 'tram-local': + iconOptions.iconId = 'icon-tram-local-stop-lollipop'; + iconOptions.className = 'tram-local-stop'; break; case 'FERRY': iconOptions.iconId = !isNull(code) diff --git a/app/component/map/tile-layer/Stops.js b/app/component/map/tile-layer/Stops.js index f5c2bdf6ac..f78bdefd82 100644 --- a/app/component/map/tile-layer/Stops.js +++ b/app/component/map/tile-layer/Stops.js @@ -35,6 +35,7 @@ class Stops { this.tile.hilightedStops && this.tile.hilightedStops.includes(feature.properties.gtfsId); let hasTrunkRoute = false; + let hasLocalTramRoute = false; if ( feature.properties.type === 'BUS' && this.config.useExtendedRouteTypes @@ -44,6 +45,15 @@ class Stops { hasTrunkRoute = true; } } + if ( + feature.properties.type === 'TRAM' && + this.config.useExtendedRouteTypes + ) { + const routes = JSON.parse(feature.properties.routes); + if (routes.some(p => p.gtfsType === ExtendedRouteTypes.TramLocal)) { + hasLocalTramRoute = true; + } + } const ignoreMinZoomLevel = feature.properties.type === 'FERRY' || feature.properties.type === 'RAIL' || @@ -60,10 +70,18 @@ class Stops { return; } + let mode = feature.properties.type; + if (hasTrunkRoute) { + mode = 'bus-express'; + } + if (hasLocalTramRoute) { + mode = 'tram-local'; + } + drawStopIcon( this.tile, feature.geom, - hasTrunkRoute ? 'bus-express' : feature.properties.type, + mode, !isNull(feature.properties.platform) ? feature.properties.platform : false, diff --git a/app/configurations/config.hsl.js b/app/configurations/config.hsl.js index f7ed10237c..077bca2cdb 100644 --- a/app/configurations/config.hsl.js +++ b/app/configurations/config.hsl.js @@ -22,8 +22,8 @@ export default { URL: { OTP: OTP_URL, STOP_MAP: { - default: `${POI_MAP_PREFIX}/fi/stops,stations/`, - sv: `${POI_MAP_PREFIX}/sv/stops,stations/`, + default: `${OTP_URL}vectorTiles/stops,stations/`, + sv: `${OTP_URL}vectorTiles/stops,stations/`, }, RENTAL_STATION_MAP: { default: `${POI_MAP_PREFIX}/fi/rentalStations/`, @@ -122,7 +122,7 @@ export default { 'mode-metro': '#CA4000', 'mode-citybike': '#f2b62d', 'mode-citybike-secondary': '#333333', - 'mode-speedtram': '#007E79', + 'mode-tram-local': '#007E79', }, }, getAutoSuggestIcons: { diff --git a/app/constants.js b/app/constants.js index 8816ad55f4..bb6314269c 100644 --- a/app/constants.js +++ b/app/constants.js @@ -95,7 +95,7 @@ export const AlertEntityType = Object.freeze({ export const ExtendedRouteTypes = Object.freeze({ BusExpress: 702, BusLocal: 704, - SpeedTram: 902, + TramLocal: 902, }); export const ParkTypes = { diff --git a/app/translations.js b/app/translations.js index 209ca31ef6..9c199f857b 100644 --- a/app/translations.js +++ b/app/translations.js @@ -1485,7 +1485,6 @@ const translations = { 'skip-to-content': 'Skip to content', slow: 'Slow', 'specify-location': 'Specify location', - speedtram: 'Jokeri Light Rail', 'splash-locating': 'Detecting location', 'splash-or-choose': 'or select your origin', 'splash-use-positioning': 'Use location services', @@ -1575,6 +1574,7 @@ const translations = { 'track-short-no-num': 'Track', traficom: 'Traficom', tram: 'Tram', + 'tram-local': 'Jokeri Light Rail', 'tram-with-route-number': 'Tram {routeNumber} {headSign}', transfer: 'Transfer', transfers: 'Number of transfers', @@ -2617,7 +2617,6 @@ const translations = { 'skip-to-content': 'Siirry sisältöön', slow: 'Hidas', 'specify-location': 'Määritä sijainti', - speedtram: 'Raide-Jokeri', 'splash-locating': 'Paikannetaan', 'splash-or-choose': 'tai valitse lähtöpaikaksi', 'splash-use-positioning': 'Käytä paikannusta', @@ -2710,6 +2709,7 @@ const translations = { 'track-short-no-num': 'Raide', traficom: 'Traficom', tram: 'Raitiovaunu', + 'tram-local': 'Raide-Jokeri', 'tram-with-route-number': 'Raitiovaunu {routeNumber} {headSign}', transfer: 'Vaihto', transfers: 'Vaihtojen määrä', @@ -4534,7 +4534,6 @@ const translations = { 'skip-to-content': 'Till innehållet', slow: 'Långsam', 'specify-location': 'Ange en plats', - speedtram: 'Spårjokern', 'splash-locating': 'Söker din plats...', 'splash-or-choose': 'eller välj en avfärdsplats', 'splash-please-allow-positioning': @@ -4627,6 +4626,7 @@ const translations = { 'track-short-no-num': 'Spår', traficom: 'Traficom', tram: 'Spårvagn', + 'tram-local': 'Spårjokern', 'tram-with-route-number': 'Spårvagn {routeNumber} {headSign}', transfer: 'Byte', transfers: 'Antal byten', diff --git a/app/util/modeUtils.js b/app/util/modeUtils.js index f11121d21f..1f8ca4ed75 100644 --- a/app/util/modeUtils.js +++ b/app/util/modeUtils.js @@ -110,8 +110,8 @@ export const getRouteMode = route => { return 'bus-express'; case ExtendedRouteTypes.BusLocal: return 'bus-local'; - case ExtendedRouteTypes.SpeedTram: - return 'speedtram'; + case ExtendedRouteTypes.TramLocal: + return 'tram-local'; default: return route.mode?.toLowerCase(); } diff --git a/digitransit-component/packages/digitransit-component-icon/src/assets/search-speedtram-stop-digitransit.svg b/digitransit-component/packages/digitransit-component-icon/src/assets/search-tram-local-stop-digitransit.svg similarity index 100% rename from digitransit-component/packages/digitransit-component-icon/src/assets/search-speedtram-stop-digitransit.svg rename to digitransit-component/packages/digitransit-component-icon/src/assets/search-tram-local-stop-digitransit.svg diff --git a/digitransit-component/packages/digitransit-component-icon/src/assets/speedtram.svg b/digitransit-component/packages/digitransit-component-icon/src/assets/tram-local.svg similarity index 100% rename from digitransit-component/packages/digitransit-component-icon/src/assets/speedtram.svg rename to digitransit-component/packages/digitransit-component-icon/src/assets/tram-local.svg diff --git a/digitransit-component/packages/digitransit-component-icon/src/index.js b/digitransit-component/packages/digitransit-component-icon/src/index.js index 3501932f26..31f189fa52 100644 --- a/digitransit-component/packages/digitransit-component-icon/src/index.js +++ b/digitransit-component/packages/digitransit-component-icon/src/index.js @@ -39,7 +39,7 @@ import CautionWhite from './assets/caution_white_exclamation.svg'; import Trash from './assets/trash.svg'; import ModeBus from './assets/mode_bus.svg'; import ModeBusExpress from './assets/bus-express.svg'; -import Speedtram from './assets/speedtram.svg'; +import TramLocal from './assets/tram-local.svg'; import ModeBusLocal from './assets/bus-local.svg'; import ModeRail from './assets/mode_rail.svg'; import ModeTram from './assets/mode_tram.svg'; @@ -77,7 +77,7 @@ import SearchFerryStopDigitransit from './assets/search-ferry-stop-digitransit.s import SearchRailStopDigitransit from './assets/search-rail-stop-digitransit.svg'; import SearchRailStationDigitransit from './assets/search-rail-station-digitransit.svg'; import SearchTramStopDigitransit from './assets/search-tram-stop-digitransit.svg'; -import SearchSpeedtramStopDigitransit from './assets/search-speedtram-stop-digitransit.svg'; +import SearchTramLocalStopDigitransit from './assets/search-tram-local-stop-digitransit.svg'; import Funicular from './assets/funicular.svg'; const IconMap = style => { @@ -124,7 +124,7 @@ const IconMap = style => { 'mode-bus': , 'mode-bus-express': , 'mode-bus-local': , - 'mode-speedtram': , + 'mode-tram-local': , 'mode-rail': , 'mode-tram': , 'mode-subway': , @@ -182,8 +182,8 @@ const IconMap = style => { ), 'search-tram-stop-digitransit': , funicular: , - 'search-speedtram-stop-digitransit': ( - + 'search-tram-local-stop-digitransit': ( + ), }; }; diff --git a/digitransit-component/packages/digitransit-component-suggestion-item/src/index.js b/digitransit-component/packages/digitransit-component-suggestion-item/src/index.js index f88e53c1a4..6b5f11dfd4 100644 --- a/digitransit-component/packages/digitransit-component-suggestion-item/src/index.js +++ b/digitransit-component/packages/digitransit-component-suggestion-item/src/index.js @@ -8,7 +8,7 @@ import styles from './helpers/styles.scss'; const BUS_EXPRESS = 702; const BUS_LOCAL = 704; -const SPEEDTRAM = 902; +const TRAM_LOCAL = 902; const getRouteMode = props => { switch (props.type) { @@ -16,8 +16,8 @@ const getRouteMode = props => { return 'bus-local'; case BUS_EXPRESS: return 'bus-express'; - case SPEEDTRAM: - return 'speedtram'; + case TRAM_LOCAL: + return 'tram-local'; default: return props?.mode?.toLowerCase() || 'bus'; } @@ -156,12 +156,12 @@ function getIconProperties( { icon: 'search-tram-stop-digitransit', color: 'mode-tram' }, ], [ - 'SPEEDTRAM-default', - { icon: 'search-speedtram-stop-digitransit', color: 'mode-tram' }, + 'TRAM-LOCAL-default', + { icon: 'search-tram-local-stop-digitransit', color: 'mode-tram-local' }, ], [ - 'SPEEDTRAM-digitransit', - { icon: 'search-tram-stop-default', color: 'mode-tram' }, + 'TRAM-LOCAL-digitransit', + { icon: 'search-tram-stop-default', color: 'mode-tram-local' }, ], ['SUBWAY-default', { icon: 'subway', color: 'mode-metro' }], ['SUBWAY-digitransit', { icon: 'subway', color: 'mode-metro' }], @@ -212,6 +212,8 @@ function getIconProperties( } } else if (modes.includes('BUS-EXPRESS') && modeSet === 'default') { iconStr = [layerIcon.get('BUS-EXPRESS'.concat('-').concat(modeSet))]; + } else if (modes.includes('TRAM-LOCAL') && modeSet === 'default') { + iconStr = [layerIcon.get('TRAM-LOCAL'.concat('-').concat(modeSet))]; } else { iconStr = [layerIcon.get(mode.concat('-').concat(modeSet))]; } diff --git a/sass/base/_helper-classes.scss b/sass/base/_helper-classes.scss index 1db09baf50..bc77890d61 100644 --- a/sass/base/_helper-classes.scss +++ b/sass/base/_helper-classes.scss @@ -16,8 +16,8 @@ .bus-express { color: $bus-express-color; } -.speedtram { - color: $speedtram-color; +.tram-local { + color: $tram-local-color; } .map .call { color: $white; diff --git a/sass/themes/default/_theme.scss b/sass/themes/default/_theme.scss index 5f54ea5c39..e8ae685138 100644 --- a/sass/themes/default/_theme.scss +++ b/sass/themes/default/_theme.scss @@ -64,7 +64,7 @@ $nav-content-color: false; $airplane-color: $livi-airplane-blue; $bus-color: $livi-bus-blue; $bus-express-color: $livi-bus-blue; -$speedtram-color: $livi-tram-green; +$tram-local-color: $livi-tram-green; $tram-color: $livi-tram-green; $metro-color: $livi-subway-orange; $rail-color: $livi-rail-purple; diff --git a/sass/themes/hsl/_theme.scss b/sass/themes/hsl/_theme.scss index 5564fcee15..cbca2ecc37 100644 --- a/sass/themes/hsl/_theme.scss +++ b/sass/themes/hsl/_theme.scss @@ -36,7 +36,7 @@ $top-bar-color: $primary-color; $airplane-color: #0046ad; $bus-color: $hsl-blue; $bus-express-color: $hsl-bus-express; -$speedtram-color: #007E79; +$tram-local-color: #007E79; $tram-color: $hsl-tram-green; $metro-color: $hsl-metro-orange; $rail-color: $hsl-rail-red; diff --git a/sass/themes/matka/_theme.scss b/sass/themes/matka/_theme.scss index c1cc0ee0df..9c7aafe38d 100644 --- a/sass/themes/matka/_theme.scss +++ b/sass/themes/matka/_theme.scss @@ -24,7 +24,7 @@ $button-font-family: 'Montserrat', Arial, Georgia, sans-serif; $bus-color: #007ac9; $airplane-color: #0046ad; $tram-color: #5E7921; -$speedtram-color: #5E7921; +$tram-local-color: #5E7921; $metro-color: #CA4000; $rail-color: #8c4799; $ferry-color: #247C7B; diff --git a/static/assets/svg-sprite.default.svg b/static/assets/svg-sprite.default.svg index 667d9b43b1..0223dc3d0c 100644 --- a/static/assets/svg-sprite.default.svg +++ b/static/assets/svg-sprite.default.svg @@ -201,6 +201,19 @@ + + + + + + + + + + + + + @@ -417,7 +430,7 @@ - + @@ -1151,6 +1164,19 @@ + + + + + + + + + + + + + icon-stop-hsl_ferry-small diff --git a/static/assets/svg-sprite.hsl.svg b/static/assets/svg-sprite.hsl.svg index c0d3ece3b3..e0d962f1bf 100644 --- a/static/assets/svg-sprite.hsl.svg +++ b/static/assets/svg-sprite.hsl.svg @@ -99,7 +99,7 @@ - + @@ -170,7 +170,7 @@ - + @@ -1170,6 +1170,19 @@ + + + + + + + + + + + + + From 307bee155083f7a4ebb5873c354360b3e36be5e5 Mon Sep 17 00:00:00 2001 From: tekoiv Date: Mon, 21 Aug 2023 12:15:08 +0300 Subject: [PATCH 3/7] fix: remove debug from conf --- app/configurations/config.hsl.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/configurations/config.hsl.js b/app/configurations/config.hsl.js index 077bca2cdb..5fb7105ece 100644 --- a/app/configurations/config.hsl.js +++ b/app/configurations/config.hsl.js @@ -22,8 +22,8 @@ export default { URL: { OTP: OTP_URL, STOP_MAP: { - default: `${OTP_URL}vectorTiles/stops,stations/`, - sv: `${OTP_URL}vectorTiles/stops,stations/`, + default: `${POI_MAP_PREFIX}/fi/stops,stations/`, + sv: `${POI_MAP_PREFIX}/sv/stops,stations/`, }, RENTAL_STATION_MAP: { default: `${POI_MAP_PREFIX}/fi/rentalStations/`, From 18ce14d80c42bff2f99f5fd5ea0450ac49972d0d Mon Sep 17 00:00:00 2001 From: tekoiv Date: Tue, 22 Aug 2023 09:26:09 +0300 Subject: [PATCH 4/7] chore: refactor icons --- ...ransit.svg => search-tram-local-stop-default.svg} | 2 +- .../packages/digitransit-component-icon/src/index.js | 12 ++++++------ .../src/index.js | 12 ++++-------- 3 files changed, 11 insertions(+), 15 deletions(-) rename digitransit-component/packages/digitransit-component-icon/src/assets/{search-tram-local-stop-digitransit.svg => search-tram-local-stop-default.svg} (96%) diff --git a/digitransit-component/packages/digitransit-component-icon/src/assets/search-tram-local-stop-digitransit.svg b/digitransit-component/packages/digitransit-component-icon/src/assets/search-tram-local-stop-default.svg similarity index 96% rename from digitransit-component/packages/digitransit-component-icon/src/assets/search-tram-local-stop-digitransit.svg rename to digitransit-component/packages/digitransit-component-icon/src/assets/search-tram-local-stop-default.svg index 48c7dda514..96823470bb 100644 --- a/digitransit-component/packages/digitransit-component-icon/src/assets/search-tram-local-stop-digitransit.svg +++ b/digitransit-component/packages/digitransit-component-icon/src/assets/search-tram-local-stop-default.svg @@ -1,4 +1,4 @@ - + diff --git a/digitransit-component/packages/digitransit-component-icon/src/index.js b/digitransit-component/packages/digitransit-component-icon/src/index.js index 31f189fa52..9221daed88 100644 --- a/digitransit-component/packages/digitransit-component-icon/src/index.js +++ b/digitransit-component/packages/digitransit-component-icon/src/index.js @@ -39,7 +39,7 @@ import CautionWhite from './assets/caution_white_exclamation.svg'; import Trash from './assets/trash.svg'; import ModeBus from './assets/mode_bus.svg'; import ModeBusExpress from './assets/bus-express.svg'; -import TramLocal from './assets/tram-local.svg'; +import ModeTramLocal from './assets/tram-local.svg'; import ModeBusLocal from './assets/bus-local.svg'; import ModeRail from './assets/mode_rail.svg'; import ModeTram from './assets/mode_tram.svg'; @@ -60,6 +60,7 @@ import TramWaltti from './assets/tram-waltti.svg'; import Check from './assets/check.svg'; import SearchBusStopDefault from './assets/search-bus-stop-default.svg'; import SearchBusStopExpressDefault from './assets/search-bus-stop-express-default.svg'; +import SearchTramLocalStopDefault from './assets/search-tram-local-stop-default.svg'; import SearchRailStopDefault from './assets/search-rail-stop-default.svg'; import SearchFerryDefault from './assets/search-ferry-default.svg'; import SearchFerryStopDefault from './assets/search-ferry-stop-default.svg'; @@ -77,7 +78,6 @@ import SearchFerryStopDigitransit from './assets/search-ferry-stop-digitransit.s import SearchRailStopDigitransit from './assets/search-rail-stop-digitransit.svg'; import SearchRailStationDigitransit from './assets/search-rail-station-digitransit.svg'; import SearchTramStopDigitransit from './assets/search-tram-stop-digitransit.svg'; -import SearchTramLocalStopDigitransit from './assets/search-tram-local-stop-digitransit.svg'; import Funicular from './assets/funicular.svg'; const IconMap = style => { @@ -124,7 +124,7 @@ const IconMap = style => { 'mode-bus': , 'mode-bus-express': , 'mode-bus-local': , - 'mode-tram-local': , + 'mode-tram-local': , 'mode-rail': , 'mode-tram': , 'mode-subway': , @@ -151,6 +151,9 @@ const IconMap = style => { 'search-bus-stop-express-default': ( ), + 'search-tram-local-stop-default': ( + + ), 'search-rail-stop-default': , 'search-ferry-default': , 'search-ferry-stop-default': , @@ -182,9 +185,6 @@ const IconMap = style => { ), 'search-tram-stop-digitransit': , funicular: , - 'search-tram-local-stop-digitransit': ( - - ), }; }; diff --git a/digitransit-component/packages/digitransit-component-suggestion-item/src/index.js b/digitransit-component/packages/digitransit-component-suggestion-item/src/index.js index 6b5f11dfd4..e62fac3acb 100644 --- a/digitransit-component/packages/digitransit-component-suggestion-item/src/index.js +++ b/digitransit-component/packages/digitransit-component-suggestion-item/src/index.js @@ -127,6 +127,10 @@ function getIconProperties( 'BUS-EXPRESS-default', { icon: 'search-bus-stop-express-default', color: 'mode-bus-express' }, ], + [ + 'TRAM-LOCAL-default', + { icon: 'search-tram-local-stop-default', color: 'mode-tram-local' }, + ], [ 'BUS-digitransit', { icon: 'search-bus-stop-digitransit', color: 'mode-bus' }, @@ -155,14 +159,6 @@ function getIconProperties( 'TRAM-digitransit', { icon: 'search-tram-stop-digitransit', color: 'mode-tram' }, ], - [ - 'TRAM-LOCAL-default', - { icon: 'search-tram-local-stop-digitransit', color: 'mode-tram-local' }, - ], - [ - 'TRAM-LOCAL-digitransit', - { icon: 'search-tram-stop-default', color: 'mode-tram-local' }, - ], ['SUBWAY-default', { icon: 'subway', color: 'mode-metro' }], ['SUBWAY-digitransit', { icon: 'subway', color: 'mode-metro' }], ['SUBWAY-STATION-default', { icon: 'subway', color: 'mode-metro' }], From 411d541548c9d8d222fd4030aa9d4fdd423569b3 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Wed, 23 Aug 2023 08:16:33 +0300 Subject: [PATCH 5/7] fix: remove strange svg elements which confuse rendering --- .../digitransit-component-icon/src/assets/tram-local.svg | 7 ------- 1 file changed, 7 deletions(-) diff --git a/digitransit-component/packages/digitransit-component-icon/src/assets/tram-local.svg b/digitransit-component/packages/digitransit-component-icon/src/assets/tram-local.svg index 8d282f3f72..26016acd11 100644 --- a/digitransit-component/packages/digitransit-component-icon/src/assets/tram-local.svg +++ b/digitransit-component/packages/digitransit-component-icon/src/assets/tram-local.svg @@ -1,11 +1,4 @@ - - - - - - - \ No newline at end of file From c0d5ab5f1334f346d487f68c51814f53981bff2b Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Wed, 23 Aug 2023 08:52:23 +0300 Subject: [PATCH 6/7] chore: remove unecessary clipPath definitions from svg symbols --- .../src/assets/bus-local.svg | 7 ----- .../assets/search-tram-local-stop-default.svg | 7 ----- static/assets/svg-sprite.hsl.svg | 28 ------------------- 3 files changed, 42 deletions(-) diff --git a/digitransit-component/packages/digitransit-component-icon/src/assets/bus-local.svg b/digitransit-component/packages/digitransit-component-icon/src/assets/bus-local.svg index 8ea23c23ff..b204cee924 100644 --- a/digitransit-component/packages/digitransit-component-icon/src/assets/bus-local.svg +++ b/digitransit-component/packages/digitransit-component-icon/src/assets/bus-local.svg @@ -1,11 +1,4 @@ - - - - - - - diff --git a/digitransit-component/packages/digitransit-component-icon/src/assets/search-tram-local-stop-default.svg b/digitransit-component/packages/digitransit-component-icon/src/assets/search-tram-local-stop-default.svg index 96823470bb..9b05561f12 100644 --- a/digitransit-component/packages/digitransit-component-icon/src/assets/search-tram-local-stop-default.svg +++ b/digitransit-component/packages/digitransit-component-icon/src/assets/search-tram-local-stop-default.svg @@ -1,13 +1,6 @@ - - - - - - - \ No newline at end of file diff --git a/static/assets/svg-sprite.hsl.svg b/static/assets/svg-sprite.hsl.svg index e0d962f1bf..3a2d6c993d 100644 --- a/static/assets/svg-sprite.hsl.svg +++ b/static/assets/svg-sprite.hsl.svg @@ -89,26 +89,12 @@ - - - - - - - - - - - - - - @@ -173,15 +159,8 @@ - - - - - - - @@ -1173,15 +1152,8 @@ - - - - - - - From 8573dffc4460f92423af4d7545044847e43ef8df Mon Sep 17 00:00:00 2001 From: tekoiv Date: Wed, 23 Aug 2023 13:57:52 +0300 Subject: [PATCH 7/7] fix: express bus and local tram render correctly in popup --- .../map/tile-layer/MarkerSelectPopup.js | 1 + app/component/map/tile-layer/SelectStopRow.js | 18 +++++++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/app/component/map/tile-layer/MarkerSelectPopup.js b/app/component/map/tile-layer/MarkerSelectPopup.js index 394d1ff345..c82b2afba9 100644 --- a/app/component/map/tile-layer/MarkerSelectPopup.js +++ b/app/component/map/tile-layer/MarkerSelectPopup.js @@ -41,6 +41,7 @@ function MarkerSelectPopup(props) { {...option.feature.properties} key={option.feature.properties.gtfsId} colors={props.colors} + routes={option.feature.properties.routes} /> ); } diff --git a/app/component/map/tile-layer/SelectStopRow.js b/app/component/map/tile-layer/SelectStopRow.js index ba53a9ad58..7e24899b81 100644 --- a/app/component/map/tile-layer/SelectStopRow.js +++ b/app/component/map/tile-layer/SelectStopRow.js @@ -10,18 +10,18 @@ function isNull(val) { } function SelectStopRow( - { code, type, desc, gtfsId, name, patterns, terminal, colors }, + { code, type, desc, gtfsId, name, terminal, colors, routes }, { config }, ) { let mode = type; - if (patterns && type === 'BUS' && config.useExtendedRouteTypes) { - const patternArray = JSON.parse(patterns); - if (patternArray.some(p => p.gtfsType === ExtendedRouteTypes.BusExpress)) { + if (routes && type === 'BUS' && config.useExtendedRouteTypes) { + const routesArray = JSON.parse(routes); + if (routesArray.some(p => p.gtfsType === ExtendedRouteTypes.BusExpress)) { mode = 'bus-express'; } - } else if (patterns && type === 'TRAM' && config.useExtendedRouteTypes) { - const patternArray = JSON.parse(patterns); - if (patternArray.some(p => p.gtfsType === ExtendedRouteTypes.TramLocal)) { + } else if (routes && type === 'TRAM' && config.useExtendedRouteTypes) { + const routesArray = JSON.parse(routes); + if (routesArray.some(p => p.gtfsType === ExtendedRouteTypes.TramLocal)) { mode = 'tram-local'; } } @@ -64,7 +64,7 @@ function SelectStopRow( iconOptions.className = 'funicular-stop'; break; case 'tram-local': - iconOptions.iconId = 'icon-tram-local-stop-lollipop'; + iconOptions.iconId = 'icon-icon_tram-local-stop-lollipop'; iconOptions.className = 'tram-local-stop'; break; case 'FERRY': @@ -122,7 +122,7 @@ SelectStopRow.propTypes = { gtfsId: PropTypes.string.isRequired, type: PropTypes.string.isRequired, name: PropTypes.string.isRequired, - patterns: PropTypes.string, + routes: PropTypes.string, code: PropTypes.string, desc: PropTypes.string, terminal: PropTypes.bool,