Itinerary{' '}
From b07e03122c395a5c583f9a2d00f37e6555aa622b Mon Sep 17 00:00:00 2001
From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com>
Date: Thu, 2 Sep 2021 18:22:34 -0400
Subject: [PATCH 29/36] refactor(FormattedTimeRange): Format time using default
format for ambient locale.
---
i18n/en-US.yml | 2 +-
i18n/fr-FR.yml | 2 +-
.../narrative/default/default-itinerary.js | 28 +++++--------------
.../narrative/line-itin/itin-summary.js | 11 +++-----
.../narrative/tabbed-itineraries.js | 15 ++++------
lib/components/util/format-time.js | 14 ----------
lib/components/util/formatted-time-range.js | 18 ++++++++++++
lib/util/i18n.js | 9 ++++++
8 files changed, 46 insertions(+), 53 deletions(-)
delete mode 100644 lib/components/util/format-time.js
create mode 100644 lib/components/util/formatted-time-range.js
diff --git a/i18n/en-US.yml b/i18n/en-US.yml
index 3461ad984..f01668ed7 100644
--- a/i18n/en-US.yml
+++ b/i18n/en-US.yml
@@ -143,7 +143,7 @@ common:
time:
# Use ordered placeholders for the departure-arrival string
# (this will accommodate right-to-left languages by swapping the order in this string).
- departureArrivalTimes: "{startTime}—{endTime}"
+ departureArrivalTimes: "{startTime, time, short}—{endTime, time, short}"
tripDurationFormat: "{hours, plural,
=0 {{minutes, number} min}
other {{hours, number} hr {minutes, number} min}}"
diff --git a/i18n/fr-FR.yml b/i18n/fr-FR.yml
index 67b2ad174..d5b555962 100644
--- a/i18n/fr-FR.yml
+++ b/i18n/fr-FR.yml
@@ -110,7 +110,7 @@ common:
funicular: Funiculaire
time:
- departureArrivalTimes: "{startTime}—{endTime}"
+ departureArrivalTimes: "{startTime, time, short}—{endTime, time, short}"
tripDurationFormat: "{hours, plural,
=0 {{minutes, number} mn}
other {{hours, number} h {minutes, number} mn}}"
diff --git a/lib/components/narrative/default/default-itinerary.js b/lib/components/narrative/default/default-itinerary.js
index cb75f1714..ffc7aaf3e 100644
--- a/lib/components/narrative/default/default-itinerary.js
+++ b/lib/components/narrative/default/default-itinerary.js
@@ -1,6 +1,6 @@
import coreUtils from '@opentripplanner/core-utils'
import React from 'react'
-import { FormattedMessage, FormattedNumber } from 'react-intl'
+import { FormattedMessage, FormattedNumber, FormattedTime } from 'react-intl'
import { connect } from 'react-redux'
import styled from 'styled-components'
@@ -9,7 +9,7 @@ import NarrativeItinerary from '../narrative-itinerary'
import ItineraryBody from '../line-itin/connected-itinerary-body'
import SimpleRealtimeAnnotation from '../simple-realtime-annotation'
import { FormattedDuration } from '../../util/format-duration'
-import { FormattedTime } from '../../util/format-time'
+import FormattedTimeRange from '../../util/formatted-time-range'
import ItinerarySummary from './itinerary-summary'
@@ -85,26 +85,15 @@ const ITINERARY_ATTRIBUTES = [
render: (itinerary, options) => {
if (options.isSelected) {
if (options.selection === 'ARRIVALTIME') {
- return (
-
- )
+ return
} else {
- return (
-
- )
+ return
}
}
return (
-
)
}
@@ -182,8 +171,7 @@ class DefaultItinerary extends NarrativeItinerary {
LegIcon,
setActiveLeg,
showRealtimeAnnotation,
- timeFormat,
- use24HourFormat
+ timeFormat
} = this.props
const timeOptions = {
format: timeFormat,
@@ -222,7 +210,6 @@ class DefaultItinerary extends NarrativeItinerary {
options.selection = this.props.sort.type
}
options.LegIcon = LegIcon
- options.timeFormat = use24HourFormat ? 'H:mm' : 'h:mm a'
options.currency = currency
return (
@@ -256,8 +243,7 @@ const mapStateToProps = (state, ownProps) => {
// The configured (ambient) currency is needed for rendering the cost
// of itineraries whether they include a fare or not, in which case
// we show $0.00 or its equivalent in the configured currency and selected locale.
- currency: state.otp.config.localization?.currency || 'USD',
- use24HourFormat: state.user.loggedInUser?.use24HourFormat ?? false
+ currency: state.otp.config.localization?.currency || 'USD'
}
}
diff --git a/lib/components/narrative/line-itin/itin-summary.js b/lib/components/narrative/line-itin/itin-summary.js
index 677d6251a..bf61653d2 100644
--- a/lib/components/narrative/line-itin/itin-summary.js
+++ b/lib/components/narrative/line-itin/itin-summary.js
@@ -7,7 +7,7 @@ import { FormattedNumber, FormattedMessage } from 'react-intl'
import { ComponentContext } from '../../../util/contexts'
import { FormattedDuration } from '../../util/format-duration'
-import { FormattedTime } from '../../util/format-time'
+import FormattedTimeRange from '../../util/formatted-time-range'
// TODO: make this a prop
const defaultRouteColor = '#008'
@@ -87,9 +87,8 @@ export class ItinerarySummary extends Component {
}
render () {
- const { currency, itinerary, use24HourFormat } = this.props
+ const { currency, itinerary } = this.props
const { LegIcon } = this.context
- const timeFormat = use24HourFormat ? 'H:mm' : 'h:mm a'
const {
maxTNCFare,
@@ -111,10 +110,9 @@ export class ItinerarySummary extends Component {
{/* Duration as time range */}
-
@@ -212,8 +210,7 @@ function getRouteColorForBadge (leg) {
const mapStateToProps = (state, ownProps) => {
return {
- currency: state.otp.config.localization?.currency || 'USD',
- use24HourFormat: state.user.loggedInUser?.use24HourFormat ?? false
+ currency: state.otp.config.localization?.currency || 'USD'
}
}
export default connect(mapStateToProps)(ItinerarySummary)
diff --git a/lib/components/narrative/tabbed-itineraries.js b/lib/components/narrative/tabbed-itineraries.js
index 217d12a61..5368a0bca 100644
--- a/lib/components/narrative/tabbed-itineraries.js
+++ b/lib/components/narrative/tabbed-itineraries.js
@@ -8,9 +8,10 @@ import styled from 'styled-components'
import * as narrativeActions from '../../actions/narrative'
import { ComponentContext } from '../../util/contexts'
+import { getTimeFormat } from '../../util/i18n'
import { getActiveSearch, getRealtimeEffects } from '../../util/state'
import { FormattedDuration } from '../util/format-duration'
-import { FormattedTime } from '../util/format-time'
+import FormattedTimeRange from '../util/formatted-time-range'
const { calculateFares, calculatePhysicalActivity } = coreUtils.itinerary
@@ -47,12 +48,11 @@ class TabbedItineraries extends Component {
itineraries,
realtimeEffects,
setActiveItinerary,
- use24HourFormat,
+ timeFormat,
useRealtime,
...itineraryBodyProps
} = this.props
const { ItineraryBody, LegIcon } = this.context
- const timeFormat = use24HourFormat ? 'H:mm' : 'h:mm a'
if (!itineraries) return null
@@ -75,7 +75,6 @@ class TabbedItineraries extends Component {
itinerary={itinerary}
key={index}
onClick={setActiveItinerary}
- timeFormat={timeFormat}
/>
)
})}
@@ -119,7 +118,7 @@ class TabButton extends Component {
}
render () {
- const {currency, index, isActive, itinerary, timeFormat} = this.props
+ const {currency, index, isActive, itinerary} = this.props
const classNames = ['tab-button', 'clear-button-formatting']
const { caloriesBurned } = calculatePhysicalActivity(itinerary)
const {
@@ -148,10 +147,9 @@ class TabButton extends Component {
{/* The duration as a time range */}
-
{/* the fare / calories summary line */}
@@ -198,7 +196,6 @@ const mapStateToProps = (state, ownProps) => {
const pending = activeSearch ? Boolean(activeSearch.pending) : false
const realtimeEffects = getRealtimeEffects(state)
const useRealtime = state.otp.useRealtime
- const use24HourFormat = state.user.loggedInUser?.use24HourFormat ?? false
return {
activeItinerary: activeSearch && activeSearch.activeItinerary,
@@ -209,8 +206,8 @@ const mapStateToProps = (state, ownProps) => {
pending,
// swap out realtime itineraries with non-realtime depending on boolean
realtimeEffects,
+ timeFormat: getTimeFormat(state),
tnc: state.otp.tnc,
- use24HourFormat,
useRealtime
}
}
diff --git a/lib/components/util/format-time.js b/lib/components/util/format-time.js
deleted file mode 100644
index 0c02dd81c..000000000
--- a/lib/components/util/format-time.js
+++ /dev/null
@@ -1,14 +0,0 @@
-import moment from 'moment-timezone'
-import { FormattedMessage } from 'react-intl'
-
-export function FormattedTime ({ endTime, startTime, timeFormat }) {
- return (
-
- )
-}
diff --git a/lib/components/util/formatted-time-range.js b/lib/components/util/formatted-time-range.js
new file mode 100644
index 000000000..f1e9a2c8b
--- /dev/null
+++ b/lib/components/util/formatted-time-range.js
@@ -0,0 +1,18 @@
+import moment from 'moment-timezone'
+import { FormattedMessage } from 'react-intl'
+
+/**
+ * Renders a time range e.g. 3:45pm-4:15pm according to the
+ * react-intl default time format for the ambient locale.
+ */
+export default function FormattedTimeRange ({ endTime, startTime }) {
+ return (
+
+ )
+}
diff --git a/lib/util/i18n.js b/lib/util/i18n.js
index b0e91f165..c6f69d57d 100644
--- a/lib/util/i18n.js
+++ b/lib/util/i18n.js
@@ -64,3 +64,12 @@ export function getDefaultLocale (config) {
const { localization = {} } = config
return localization.defaultLocale || 'en-US'
}
+
+/**
+ * Obtains the time format (12 or 24 hr) based on the redux user state.
+ * FIXME: Remove after OTP-UI components can determine the time format on their own.
+ */
+export function getTimeFormat (state) {
+ const use24HourFormat = state.user.loggedInUser?.use24HourFormat ?? false
+ return use24HourFormat ? 'H:mm' : 'h:mm a'
+}
From 0f4a3c938e7dfa534ac84180bf07caf15ec1eb28 Mon Sep 17 00:00:00 2001
From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com>
Date: Thu, 2 Sep 2021 18:30:52 -0400
Subject: [PATCH 30/36] refactor(FormattedDuration): Make default export,
rename file.
---
lib/components/narrative/default/default-itinerary.js | 2 +-
lib/components/narrative/line-itin/itin-summary.js | 2 +-
lib/components/narrative/realtime-annotation.js | 2 +-
lib/components/narrative/tabbed-itineraries.js | 2 +-
.../util/{format-duration.js => formatted-duration.js} | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
rename lib/components/util/{format-duration.js => formatted-duration.js} (87%)
diff --git a/lib/components/narrative/default/default-itinerary.js b/lib/components/narrative/default/default-itinerary.js
index ffc7aaf3e..23405e904 100644
--- a/lib/components/narrative/default/default-itinerary.js
+++ b/lib/components/narrative/default/default-itinerary.js
@@ -8,7 +8,7 @@ import FieldTripGroupSize from '../../admin/field-trip-itinerary-group-size'
import NarrativeItinerary from '../narrative-itinerary'
import ItineraryBody from '../line-itin/connected-itinerary-body'
import SimpleRealtimeAnnotation from '../simple-realtime-annotation'
-import { FormattedDuration } from '../../util/format-duration'
+import FormattedDuration from '../../util/formatted-duration'
import FormattedTimeRange from '../../util/formatted-time-range'
import ItinerarySummary from './itinerary-summary'
diff --git a/lib/components/narrative/line-itin/itin-summary.js b/lib/components/narrative/line-itin/itin-summary.js
index bf61653d2..96f130dab 100644
--- a/lib/components/narrative/line-itin/itin-summary.js
+++ b/lib/components/narrative/line-itin/itin-summary.js
@@ -6,7 +6,7 @@ import { connect } from 'react-redux'
import { FormattedNumber, FormattedMessage } from 'react-intl'
import { ComponentContext } from '../../../util/contexts'
-import { FormattedDuration } from '../../util/format-duration'
+import FormattedDuration from '../../util/formatted-duration'
import FormattedTimeRange from '../../util/formatted-time-range'
// TODO: make this a prop
diff --git a/lib/components/narrative/realtime-annotation.js b/lib/components/narrative/realtime-annotation.js
index a6bafc0a4..30affa028 100644
--- a/lib/components/narrative/realtime-annotation.js
+++ b/lib/components/narrative/realtime-annotation.js
@@ -3,7 +3,7 @@ import React, { Component } from 'react'
import { Button, OverlayTrigger, Popover } from 'react-bootstrap'
import { FormattedList, FormattedMessage } from 'react-intl'
-import { FormattedDuration } from '../util/format-duration'
+import FormattedDuration from '../util/formatted-duration'
import Icon from '../util/icon'
export default class RealtimeAnnotation extends Component {
diff --git a/lib/components/narrative/tabbed-itineraries.js b/lib/components/narrative/tabbed-itineraries.js
index 5368a0bca..b41f587ed 100644
--- a/lib/components/narrative/tabbed-itineraries.js
+++ b/lib/components/narrative/tabbed-itineraries.js
@@ -10,7 +10,7 @@ import * as narrativeActions from '../../actions/narrative'
import { ComponentContext } from '../../util/contexts'
import { getTimeFormat } from '../../util/i18n'
import { getActiveSearch, getRealtimeEffects } from '../../util/state'
-import { FormattedDuration } from '../util/format-duration'
+import FormattedDuration from '../util/formatted-duration'
import FormattedTimeRange from '../util/formatted-time-range'
const { calculateFares, calculatePhysicalActivity } = coreUtils.itinerary
diff --git a/lib/components/util/format-duration.js b/lib/components/util/formatted-duration.js
similarity index 87%
rename from lib/components/util/format-duration.js
rename to lib/components/util/formatted-duration.js
index 897e20c62..3ca1a80c4 100644
--- a/lib/components/util/format-duration.js
+++ b/lib/components/util/formatted-duration.js
@@ -4,7 +4,7 @@ import { FormattedMessage } from 'react-intl'
/**
* Formats the given duration according to the selected locale.
*/
-export function FormattedDuration ({duration}) {
+export default function FormattedDuration ({duration}) {
const dur = moment.duration(duration, 'seconds')
const hours = dur.hours()
const minutes = dur.minutes()
From a0c2b521c1cf0f931f030220ebb15c18b11724e9 Mon Sep 17 00:00:00 2001
From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com>
Date: Thu, 2 Sep 2021 18:39:42 -0400
Subject: [PATCH 31/36] refactor(util/icon): Make tests pass.
---
lib/components/util/icon.js | 38 +++++++++++++++++++------------------
1 file changed, 20 insertions(+), 18 deletions(-)
diff --git a/lib/components/util/icon.js b/lib/components/util/icon.js
index 765ae8b0e..0662b2c94 100644
--- a/lib/components/util/icon.js
+++ b/lib/components/util/icon.js
@@ -4,34 +4,36 @@ import FontAwesome from 'react-fontawesome'
import styled from 'styled-components'
/**
- * A Font Awesome icon followed by a with a pseudo-element equivalent to a single space,
- * if so specified in the withSpace prop.
+ * A Font Awesome icon followed by a with a pseudo-element equivalent to a single space.
*/
-const StyledFontAwesome = styled(FontAwesome)`
- ${props => props.withSpace ? `
- &::after {
- content: "";
- margin: 0 0.125em;
- }
- ` : ''}
+const FontAwesomeWithSpace = styled(FontAwesome)`
+ &::after {
+ content: "";
+ margin: 0 0.125em;
+ }
`
/**
* Wrapper for the FontAwesome component that, if specified in the withSpace prop,
- * supports CSS spacing after the icon to replace the {' '} workaround,
+ * supports CSS spacing after the specified icon type, to replace the {' '} workaround,
* and that should work for both left-to-right and right-to-left layouts.
* Other props from FontAwesome are passed to that component.
*/
-const Icon = ({ fixedWidth = true, type, withSpace, ...props }) => (
-
-)
+const Icon = ({ fixedWidth = true, type, withSpace, ...props }) => {
+ const FontComponent = withSpace
+ ? FontAwesomeWithSpace
+ : FontAwesome
+ return (
+
+ )
+}
Icon.propTypes = {
+ fixedWidth: PropTypes.bool,
type: PropTypes.string.isRequired,
withSpace: PropTypes.bool
}
From ea5305f8cda795b6c064df88890b55bb09fcb9db Mon Sep 17 00:00:00 2001
From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com>
Date: Thu, 2 Sep 2021 20:51:30 -0400
Subject: [PATCH 32/36] test(StopViewer): Update snapshots, still.
---
.../viewers/__snapshots__/stop-viewer.js.snap | 74 ++-----------------
1 file changed, 5 insertions(+), 69 deletions(-)
diff --git a/__tests__/components/viewers/__snapshots__/stop-viewer.js.snap b/__tests__/components/viewers/__snapshots__/stop-viewer.js.snap
index 81e21e621..e83ba8e43 100644
--- a/__tests__/components/viewers/__snapshots__/stop-viewer.js.snap
+++ b/__tests__/components/viewers/__snapshots__/stop-viewer.js.snap
@@ -235,12 +235,10 @@ exports[`components > viewers > stop viewer should render countdown times after
@@ -294,12 +292,10 @@ exports[`components > viewers > stop viewer should render countdown times after
@@ -494,7 +490,7 @@ exports[`components > viewers > stop viewer should render countdown times after
viewers > stop viewer should render countdown times after
"marginRight": 2,
}
}
- type="clock-o"
>
viewers > stop viewer should render countdown times after
"marginRight": 2,
}
}
- type="clock-o"
/>
@@ -944,12 +938,10 @@ exports[`components > viewers > stop viewer should render countdown times after
@@ -1030,12 +1022,10 @@ exports[`components > viewers > stop viewer should render countdown times after
className=""
fixedWidth={true}
name="refresh"
- type="refresh"
>
@@ -1189,12 +1179,10 @@ exports[`components > viewers > stop viewer should render countdown times for st
@@ -1248,12 +1236,10 @@ exports[`components > viewers > stop viewer should render countdown times for st
@@ -1448,7 +1434,7 @@ exports[`components > viewers > stop viewer should render countdown times for st
viewers > stop viewer should render countdown times for st
"marginRight": 2,
}
}
- type="clock-o"
>
viewers > stop viewer should render countdown times for st
"marginRight": 2,
}
}
- type="clock-o"
/>
@@ -1709,12 +1693,10 @@ exports[`components > viewers > stop viewer should render countdown times for st
@@ -1795,12 +1777,10 @@ exports[`components > viewers > stop viewer should render countdown times for st
className=""
fixedWidth={true}
name="refresh"
- type="refresh"
>
@@ -2053,12 +2033,10 @@ exports[`components > viewers > stop viewer should render times after midnight w
@@ -2112,12 +2090,10 @@ exports[`components > viewers > stop viewer should render times after midnight w
@@ -2312,7 +2288,7 @@ exports[`components > viewers > stop viewer should render times after midnight w
viewers > stop viewer should render times after midnight w
"marginRight": 2,
}
}
- type="clock-o"
>
viewers > stop viewer should render times after midnight w
"marginRight": 2,
}
}
- type="clock-o"
/>
@@ -2771,12 +2745,10 @@ exports[`components > viewers > stop viewer should render times after midnight w
@@ -2857,12 +2829,10 @@ exports[`components > viewers > stop viewer should render times after midnight w
className=""
fixedWidth={true}
name="refresh"
- type="refresh"
>
@@ -3373,12 +3343,10 @@ exports[`components > viewers > stop viewer should render with OTP transit index
@@ -3432,12 +3400,10 @@ exports[`components > viewers > stop viewer should render with OTP transit index
@@ -3632,7 +3598,7 @@ exports[`components > viewers > stop viewer should render with OTP transit index
viewers > stop viewer should render with OTP transit index
"marginRight": 2,
}
}
- type="clock-o"
>
viewers > stop viewer should render with OTP transit index
"marginRight": 2,
}
}
- type="clock-o"
/>
@@ -4347,12 +4311,10 @@ exports[`components > viewers > stop viewer should render with OTP transit index
@@ -4549,7 +4511,6 @@ exports[`components > viewers > stop viewer should render with OTP transit index
"marginRight": 2,
}
}
- type="clock-o"
>
viewers > stop viewer should render with OTP transit index
"marginRight": 2,
}
}
- type="clock-o"
/>
@@ -4606,12 +4566,10 @@ exports[`components > viewers > stop viewer should render with OTP transit index
@@ -4808,7 +4766,6 @@ exports[`components > viewers > stop viewer should render with OTP transit index
"marginRight": 2,
}
}
- type="clock-o"
>
viewers > stop viewer should render with OTP transit index
"marginRight": 2,
}
}
- type="clock-o"
/>
@@ -4865,12 +4821,10 @@ exports[`components > viewers > stop viewer should render with OTP transit index
@@ -5121,7 +5075,6 @@ exports[`components > viewers > stop viewer should render with OTP transit index
"marginRight": 2,
}
}
- type="clock-o"
>
viewers > stop viewer should render with OTP transit index
"marginRight": 2,
}
}
- type="clock-o"
/>
@@ -5178,12 +5130,10 @@ exports[`components > viewers > stop viewer should render with OTP transit index
@@ -5264,12 +5214,10 @@ exports[`components > viewers > stop viewer should render with OTP transit index
className=""
fixedWidth={true}
name="refresh"
- type="refresh"
>
@@ -5775,12 +5723,10 @@ exports[`components > viewers > stop viewer should render with TriMet transit in
@@ -5834,12 +5780,10 @@ exports[`components > viewers > stop viewer should render with TriMet transit in
@@ -6034,7 +5978,7 @@ exports[`components > viewers > stop viewer should render with TriMet transit in
viewers > stop viewer should render with TriMet transit in
"marginRight": 2,
}
}
- type="clock-o"
>
viewers > stop viewer should render with TriMet transit in
"marginRight": 2,
}
}
- type="clock-o"
/>
@@ -6746,12 +6688,10 @@ exports[`components > viewers > stop viewer should render with TriMet transit in
@@ -6832,12 +6772,10 @@ exports[`components > viewers > stop viewer should render with TriMet transit in
className=""
fixedWidth={true}
name="refresh"
- type="refresh"
>
@@ -6925,12 +6863,10 @@ exports[`components > viewers > stop viewer should render with initial stop id a
From e399f4d30bb3f3d402b0a7cc7d7b7158657622da Mon Sep 17 00:00:00 2001
From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com>
Date: Fri, 3 Sep 2021 09:04:59 -0400
Subject: [PATCH 33/36] refactor(admin/trip-status): Remove unused import.
---
lib/components/admin/trip-status.js | 1 -
1 file changed, 1 deletion(-)
diff --git a/lib/components/admin/trip-status.js b/lib/components/admin/trip-status.js
index dbde8df5c..79d8e8ba8 100644
--- a/lib/components/admin/trip-status.js
+++ b/lib/components/admin/trip-status.js
@@ -6,7 +6,6 @@ import { connect } from 'react-redux'
import * as fieldTripActions from '../../actions/field-trip'
import * as formActions from '../../actions/form'
import { getTripFromRequest } from '../../util/call-taker'
-import Icon from '../util/icon'
import FieldTripStatusIcon from './field-trip-status-icon'
import {
From 7ef85a4209cfb70c6cf4a8233ad0b1036cf00583 Mon Sep 17 00:00:00 2001
From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com>
Date: Fri, 3 Sep 2021 09:09:20 -0400
Subject: [PATCH 34/36] refactor(FieldTripStatusIcon): Fix import
---
lib/components/admin/field-trip-status-icon.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/components/admin/field-trip-status-icon.js b/lib/components/admin/field-trip-status-icon.js
index e7ed9b0eb..901a73939 100644
--- a/lib/components/admin/field-trip-status-icon.js
+++ b/lib/components/admin/field-trip-status-icon.js
@@ -1,6 +1,6 @@
import React from 'react'
-import Icon from '../narrative/icon'
+import Icon from '../util/icon'
const FieldTripStatusIcon = ({ ok }) => (
ok
From 149b464407865904a3278d729715d350ad5ff43b Mon Sep 17 00:00:00 2001
From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com>
Date: Fri, 3 Sep 2021 09:23:50 -0400
Subject: [PATCH 35/36] refactor(RealtimeAnnotation): Improve rich text
rendering.
---
i18n/en-US.yml | 2 +-
i18n/fr-FR.yml | 3 +--
lib/components/narrative/realtime-annotation.js | 9 ++++-----
3 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/i18n/en-US.yml b/i18n/en-US.yml
index f01668ed7..7e5711a5e 100644
--- a/i18n/en-US.yml
+++ b/i18n/en-US.yml
@@ -78,7 +78,7 @@ components:
delaysNotShownInResults: "Your trip results are currently being affected by service delays.
These delays do not factor into travel times shown below."
delaysShownInResults: "Your trip results have been adjusted based on real-time
- information. Under normal conditions, this trip would take {normalDuration}
+ information. Under normal conditions, this trip would take {normalDuration}
using the following routes: {routes}."
ignoreServiceDelays: Ignore service delays
serviceUpdate: Service update
diff --git a/i18n/fr-FR.yml b/i18n/fr-FR.yml
index d5b555962..ad0874e2e 100644
--- a/i18n/fr-FR.yml
+++ b/i18n/fr-FR.yml
@@ -52,8 +52,7 @@ components:
delaysNotShownInResults: "Vos trajets recherchés sont perturbés par des retards.
Ces retards ne sont pas pris en compte dans les temps de trajet ci-dessous."
delaysShownInResults: "Vos trajets recherchés ont été mis à jour avec les conditions en temps réel.
- En temps normal, ce trajet prendrait {normalDuration}
- en empruntant les lignes: {routes}."
+ En temps normal, ce trajet prendrait {normalDuration} en empruntant les lignes: {routes}."
ignoreServiceDelays: Ignorer les retards
serviceUpdate: Information sur le service
SaveTripButton:
diff --git a/lib/components/narrative/realtime-annotation.js b/lib/components/narrative/realtime-annotation.js
index 30affa028..a8662cc33 100644
--- a/lib/components/narrative/realtime-annotation.js
+++ b/lib/components/narrative/realtime-annotation.js
@@ -37,16 +37,15 @@ export default class RealtimeAnnotation extends Component {
{chunks},
normalDuration: (
-
+
+
+
),
routes: (
{route})}
+ value={filteredRoutes.map(route => {route})}
/>
)
}}
From 42fec94d3a3d24bdc6add17cf2aa96b7193a0c18 Mon Sep 17 00:00:00 2001
From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com>
Date: Fri, 3 Sep 2021 11:22:03 -0400
Subject: [PATCH 36/36] refactor(TabbedItineraries): Replace
s with block
s.
---
lib/components/narrative/narrative.css | 4 +
.../narrative/tabbed-itineraries.js | 80 ++++++++++---------
2 files changed, 46 insertions(+), 38 deletions(-)
diff --git a/lib/components/narrative/narrative.css b/lib/components/narrative/narrative.css
index fd0d6534d..db5f6e664 100644
--- a/lib/components/narrative/narrative.css
+++ b/lib/components/narrative/narrative.css
@@ -198,6 +198,10 @@
color: #685c5c;
}
+.otp .tabbed-itineraries .tab-button .details > span {
+ display: block;
+}
+
.otp .tabbed-itineraries .tab-button:hover .title {
border-bottom: 3px solid #ddd;
}
diff --git a/lib/components/narrative/tabbed-itineraries.js b/lib/components/narrative/tabbed-itineraries.js
index b41f587ed..1352e542e 100644
--- a/lib/components/narrative/tabbed-itineraries.js
+++ b/lib/components/narrative/tabbed-itineraries.js
@@ -135,54 +135,58 @@ class TabButton extends Component {
key={`tab-button-${index}`}
onClick={this._onClick}
>
-
+
-
-
- {/* The itinerary duration in hrs/mins */}
-
+
+
+
+ {/* The itinerary duration in hrs/mins */}
+
+
{/* The duration as a time range */}
-
-
+
+
+
{/* the fare / calories summary line */}
-
- {minTotalFare > 0 && (
- <>
- minTNCFare,
- minTotalFare: (
-
- )
- }}
- />
-
- >
- )}
-
+
+ {minTotalFare > 0 && (
+ <>
+ minTNCFare,
+ minTotalFare: (
+
+ )
+ }}
+ />
+
+ >
+ )}
+
+
{/* The 'X tranfers' line, if applicable */}
-
-
-
-
+
+
+
+
)
}