From 762af428eb8b6b4dafdf7fee8ac3590a4203f1f9 Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Sat, 29 Apr 2023 11:51:44 +0300 Subject: [PATCH] Revert "Merge pull request #4788 from HSLdevcom/DT-5859" This reverts commit d603090b621ba31e2deca821fb9b0915f69e460b, reversing changes made to 83b3102b07d9abe540c4df176d82c42a5620053e. Kela customizations break standard UI. Reverted to allow a new release. --- app/component/ItineraryTab.js | 1 - app/component/LegInfo.js | 3 -- app/component/QuickSettingsPanel.js | 12 ++--- app/component/StreetModeSelector.js | 59 ++++++++++------------- app/component/StreetModeSelectorButton.js | 13 +---- app/component/SummaryPage.js | 4 +- app/component/SummaryRow.js | 8 --- app/component/summary-row.scss | 15 +++--- app/util/geo-utils.js | 7 --- sass/themes/kela/_theme.scss | 18 ------- sass/themes/kela/main.scss | 2 - 11 files changed, 41 insertions(+), 101 deletions(-) delete mode 100644 sass/themes/kela/_theme.scss delete mode 100644 sass/themes/kela/main.scss diff --git a/app/component/ItineraryTab.js b/app/component/ItineraryTab.js index 909cf0e2d7..2774ef263c 100644 --- a/app/component/ItineraryTab.js +++ b/app/component/ItineraryTab.js @@ -368,7 +368,6 @@ const withRelay = createFragmentContainer( mode nextLegs(numberOfLegs: 2 originModesWithParentStation: [RAIL] destinationModesWithParentStation: [RAIL]) { mode - distance route { alerts { alertSeverityLevel diff --git a/app/component/LegInfo.js b/app/component/LegInfo.js index 6ebf537555..0dd189186a 100644 --- a/app/component/LegInfo.js +++ b/app/component/LegInfo.js @@ -58,9 +58,6 @@ const LegInfo = (
{headsign}
- {config.showTransitLegDistance && ( -
{(leg.distance / 1000).toFixed(1)} km
- )} {displayTime && ( {moment(leg.startTime).format('HH:mm')} diff --git a/app/component/QuickSettingsPanel.js b/app/component/QuickSettingsPanel.js index cfd9100f8b..89f277b0b9 100644 --- a/app/component/QuickSettingsPanel.js +++ b/app/component/QuickSettingsPanel.js @@ -36,18 +36,14 @@ class QuickSettingsPanel extends React.Component { - - - ) +
+ +
} embedWhenOpen={
- {!this.context.config.hideItinerarySettings && ( - - )} +
} diff --git a/app/component/StreetModeSelector.js b/app/component/StreetModeSelector.js index 85fafceedd..a74bf3658f 100644 --- a/app/component/StreetModeSelector.js +++ b/app/component/StreetModeSelector.js @@ -5,26 +5,23 @@ import { StreetModeSelectorButton } from './StreetModeSelectorButton'; import { StreetModeSelectorWeatherLabel } from './StreetModeSelectorWeatherLabel'; import { StreetModeSelectorShimmer } from './StreetModeSelectorShimmer'; -export const StreetModeSelector = ( - { - showWalkOptionButton, - showBikeOptionButton, - showBikeAndPublicOptionButton, - showCarOptionButton, - showParkRideOptionButton, - toggleStreetMode, - setStreetModeAndSelect, - weatherData, - walkPlan, - bikePlan, - bikeAndPublicPlan, - bikeParkPlan, - carPlan, - parkRidePlan, - loading, - }, - { config }, -) => { +export const StreetModeSelector = ({ + showWalkOptionButton, + showBikeOptionButton, + showBikeAndPublicOptionButton, + showCarOptionButton, + showParkRideOptionButton, + toggleStreetMode, + setStreetModeAndSelect, + weatherData, + walkPlan, + bikePlan, + bikeAndPublicPlan, + bikeParkPlan, + carPlan, + parkRidePlan, + loading, +}) => { const bikeAndVehicle = !loading ? { itineraries: [ @@ -38,16 +35,14 @@ export const StreetModeSelector = ( {!loading && (
- {config.showWeatherLabel && ( - - )} + {showWalkOptionButton && ( - {config.showDistanceBeforeDuration ? ( - <> -
{distance}
-
{duration}
- - ) : ( - <> -
{duration}
-
{distance}
- - )} +
{duration}
+
{distance}
diff --git a/app/component/SummaryPage.js b/app/component/SummaryPage.js index ddd8d929fe..7084333c8d 100644 --- a/app/component/SummaryPage.js +++ b/app/component/SummaryPage.js @@ -2235,8 +2235,7 @@ class SummaryPage extends React.Component { } const showWalkOptionButton = Boolean( - this.context.config.showWalkOption && - walkPlan && + walkPlan && walkPlan.itineraries && walkPlan.itineraries.length > 0 && !currentSettings.accessibilityOption && @@ -2249,6 +2248,7 @@ class SummaryPage extends React.Component { bikePlan.itineraries.every(itinerary => itinerary.legs.every(leg => leg.mode === 'WALK'), ); + const showBikeOptionButton = Boolean( bikePlan && bikePlan.itineraries && diff --git a/app/component/SummaryRow.js b/app/component/SummaryRow.js index 7efecffa42..e7571ccdc5 100644 --- a/app/component/SummaryRow.js +++ b/app/component/SummaryRow.js @@ -16,7 +16,6 @@ import { getLegBadgeProps, isCallAgencyPickupType, getInterliningLegs, - getTotalDistance, } from '../util/legUtils'; import { dateOrEmpty, isTomorrow } from '../util/timeUtils'; import withBreakpoint from '../util/withBreakpoint'; @@ -773,13 +772,6 @@ const SummaryRow = (
{itineraryStartAndEndTime}
- -
- {config.showDistanceInItinerarySummary && ( -
- {(getTotalDistance(data) / 1000).toFixed(1)} km -
- )}
diff --git a/app/component/summary-row.scss b/app/component/summary-row.scss index 00aa67e46b..7bc0f239e2 100644 --- a/app/component/summary-row.scss +++ b/app/component/summary-row.scss @@ -95,9 +95,16 @@ line-height: normal; font-style: normal; padding-top: 17px; - display: flex; + .itinerary-start-time-and-end-time { + float: left; + } + .itinerary-duration { + float: right; + } .itinerary-start-date { + padding-right: 5px; + float: left; text-transform: capitalize; .tomorrow { text-transform: capitalize; @@ -106,12 +113,6 @@ text-transform: lowercase; } } - .itinerary-total-distance { - //float: right; - //padding-left: 20px; - flex-grow: 1; - margin-right: 20px; - } } .itinerary-end-time-and-distance { diff --git a/app/util/geo-utils.js b/app/util/geo-utils.js index b8640bf6eb..f152e59a9f 100644 --- a/app/util/geo-utils.js +++ b/app/util/geo-utils.js @@ -98,9 +98,6 @@ function displayDistanceWithLocale(meters, formatNumber) { } export function displayDistance(meters, config, formatNumber) { - if (config.alwaysShowDistanceInKm) { - return `${(meters / 1000).toFixed(1)} km`; - } if (isImperial(config)) { return displayImperialDistance(meters); } @@ -122,10 +119,6 @@ export function displayDistance(meters, config, formatNumber) { return `${Math.round(meters / 10000) * 10} km`; // tens of kilometers } -/* export function displayDistance2(meters) { - return `${(meters / 1000).toFixed(1)} km`; -} - */ /* eslint-enable yoda */ // Return the bounding box of a latlon array of length > 0 diff --git a/sass/themes/kela/_theme.scss b/sass/themes/kela/_theme.scss deleted file mode 100644 index 04cb69cb22..0000000000 --- a/sass/themes/kela/_theme.scss +++ /dev/null @@ -1,18 +0,0 @@ -@import '../../base/waltti'; - -/* main theme colors */ -$primary-color: #003580; -$secondary-color: darken($primary-color, 20%); -$hilight-color: rgb(253, 185, 19); -$action-color: $primary-color; -$bus-color: $primary-color; -$viewpoint-marker-color: $primary-color; -$current-location-color: $primary-color; - -$standalone-btn-color: $primary-color; -$link-color: $primary-color; - -/*Component palette*/ -$desktop-title-color: $primary-color; -$desktop-title-arrow-icon-color: $secondary-color; -$top-bar-color: #003580; diff --git a/sass/themes/kela/main.scss b/sass/themes/kela/main.scss deleted file mode 100644 index c8dfef40b9..0000000000 --- a/sass/themes/kela/main.scss +++ /dev/null @@ -1,2 +0,0 @@ -@import 'theme'; -@import '../../main';