Skip to content

Commit

Permalink
Revert "Merge pull request #4788 from HSLdevcom/DT-5859"
Browse files Browse the repository at this point in the history
This reverts commit d603090, reversing
changes made to 83b3102.

Kela customizations break standard UI. Reverted to allow a new release.
  • Loading branch information
vesameskanen committed Apr 29, 2023
1 parent a3ecfee commit 762af42
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 101 deletions.
1 change: 0 additions & 1 deletion app/component/ItineraryTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,6 @@ const withRelay = createFragmentContainer(
mode
nextLegs(numberOfLegs: 2 originModesWithParentStation: [RAIL] destinationModesWithParentStation: [RAIL]) {
mode
distance
route {
alerts {
alertSeverityLevel
Expand Down
3 changes: 0 additions & 3 deletions app/component/LegInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ const LegInfo = (
</span>
</Link>
<div className="headsign">{headsign}</div>
{config.showTransitLegDistance && (
<div>{(leg.distance / 1000).toFixed(1)} km</div>
)}
{displayTime && (
<span className={cx('leg-departure-time', { realtime: leg.realTime })}>
{moment(leg.startTime).format('HH:mm')}
Expand Down
12 changes: 4 additions & 8 deletions app/component/QuickSettingsPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,14 @@ class QuickSettingsPanel extends React.Component {
<DatetimepickerContainer
realtime={false}
embedWhenClosed={
!this.context.config.hideItinerarySettings && (
<div className="open-advanced-settings">
<RightOffcanvasToggle onToggleClick={toggleSettings} />
</div>
)
<div className="open-advanced-settings">
<RightOffcanvasToggle onToggleClick={toggleSettings} />
</div>
}
embedWhenOpen={
<div className="open-embed-container">
<div className="open-advanced-settings open-embed">
{!this.context.config.hideItinerarySettings && (
<RightOffcanvasToggle onToggleClick={toggleSettings} />
)}
<RightOffcanvasToggle onToggleClick={toggleSettings} />
</div>
</div>
}
Expand Down
59 changes: 25 additions & 34 deletions app/component/StreetModeSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand All @@ -38,16 +35,14 @@ export const StreetModeSelector = (
<StreetModeSelectorShimmer loading={loading} />
{!loading && (
<div className="street-mode-button-row">
{config.showWeatherLabel && (
<StreetModeSelectorWeatherLabel
active={
showWalkOptionButton ||
showBikeOptionButton ||
showBikeAndPublicOptionButton
}
weatherData={weatherData}
/>
)}
<StreetModeSelectorWeatherLabel
active={
showWalkOptionButton ||
showBikeOptionButton ||
showBikeAndPublicOptionButton
}
weatherData={weatherData}
/>
{showWalkOptionButton && (
<StreetModeSelectorButton
icon="icon-icon_walk"
Expand Down Expand Up @@ -125,8 +120,4 @@ StreetModeSelector.defaultProps = {
loading: undefined,
};

StreetModeSelector.contextTypes = {
config: PropTypes.object,
};

export default StreetModeSelector;
13 changes: 2 additions & 11 deletions app/component/StreetModeSelectorButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,17 +124,8 @@ export const StreetModeSelectorButton = (
''
)}
<div className="street-mode-button-info">
{config.showDistanceBeforeDuration ? (
<>
<div className="street-mode-button-time">{distance}</div>
<div className="street-mode-button-length">{duration}</div>
</>
) : (
<>
<div className="street-mode-button-time">{duration}</div>
<div className="street-mode-button-length">{distance}</div>
</>
)}
<div className="street-mode-button-time">{duration}</div>
<div className="street-mode-button-length">{distance}</div>
</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions app/component/SummaryPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand All @@ -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 &&
Expand Down
8 changes: 0 additions & 8 deletions app/component/SummaryRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
getLegBadgeProps,
isCallAgencyPickupType,
getInterliningLegs,
getTotalDistance,
} from '../util/legUtils';
import { dateOrEmpty, isTomorrow } from '../util/timeUtils';
import withBreakpoint from '../util/withBreakpoint';
Expand Down Expand Up @@ -773,13 +772,6 @@ const SummaryRow = (
<div className="itinerary-start-time-and-end-time">
{itineraryStartAndEndTime}
</div>

<div style={{ flexGrow: 1 }} />
{config.showDistanceInItinerarySummary && (
<div className="itinerary-total-distance">
{(getTotalDistance(data) / 1000).toFixed(1)} km
</div>
)}
<div className="itinerary-duration">
<RelativeDuration duration={duration} />
</div>
Expand Down
15 changes: 8 additions & 7 deletions app/component/summary-row.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 {
Expand Down
7 changes: 0 additions & 7 deletions app/util/geo-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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
Expand Down
18 changes: 0 additions & 18 deletions sass/themes/kela/_theme.scss

This file was deleted.

2 changes: 0 additions & 2 deletions sass/themes/kela/main.scss

This file was deleted.

0 comments on commit 762af42

Please sign in to comment.