Skip to content

Commit fa4c1cb

Browse files
feat: support middleware CDP changes
1 parent 85f28da commit fa4c1cb

File tree

3 files changed

+20
-7
lines changed

3 files changed

+20
-7
lines changed

i18n/en-US.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ components:
233233
stopsTo: "Towards"
234234
selectADirection: "Select a direction..."
235235
RouteRow:
236-
operatorLogoAltText: '{operatorName} logo'
236+
operatorLogoAltText: "{operatorName} logo"
237237
RouteViewer:
238238
agencyFilter: Agency Filter
239239
allAgencies: All Agencies
@@ -295,6 +295,10 @@ components:
295295
termsOfStorageStatement: >
296296
Optional: I consent to the Trip Planner storing my historical planned trips in order to
297297
improve transit services in my area. <termsOfStorageLink>More info...</termsOfStorageLink>
298+
confirmDeletionPrompt: >
299+
Removing your consent to storage of historical trips will cause all data tied to you to be deleted.
300+
All your other saved locations, trips, and notifications will also be deleted permanently.
301+
Are you sure you want to continue?
298302
TransitVehicleOverlay:
299303
# keys designed to match API output
300304
incoming_at: "approaching {stop}"
@@ -404,7 +408,6 @@ components:
404408
to verify your email address before finishing your account setup.
405409
instructions2: Once you're verified, click the button below to continue.
406410
resendVerification: Resend verification email
407-
408411

409412
# Common messages that appear in multiple components and modules
410413
# are grouped below by topic.
@@ -491,4 +494,3 @@ common:
491494
other {{hours, number} hr {minutes, number} min}}
492495
# If trip is less than one hour only display the minutes.
493496
tripDurationFormatZeroHours: "{minutes, number} min"
494-

lib/actions/api.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export function routingQuery (searchId = null, updateSearchInReducer = false) {
125125
return Promise.all(iterations.map((injectedParams, i) => {
126126
const requestId = randId()
127127
// fetch a realtime route
128-
const url = constructRoutingQuery(state, false, injectedParams)
128+
const url = constructRoutingQuery(state, false, { batchId: searchId, ...injectedParams })
129129
const realTimeFetch = fetch(url, getOtpFetchOptions(state))
130130
.then(getJsonAndCheckResponse)
131131
.then(json => {
@@ -185,7 +185,7 @@ export function routingQuery (searchId = null, updateSearchInReducer = false) {
185185
user.loggedInUser.storeTripHistory
186186

187187
const nonRealtimeFetch = fetch(
188-
constructRoutingQuery(state, true),
188+
constructRoutingQuery(state, true, { batchId: searchId }),
189189
getOtpFetchOptions(state, storeTripHistory)
190190
)
191191
.then(getJsonAndCheckResponse)

lib/components/user/terms-of-use-pane.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react'
22
import { connect } from 'react-redux'
33
import { Checkbox, ControlLabel, FormGroup } from 'react-bootstrap'
4-
import { FormattedMessage } from 'react-intl'
4+
import { FormattedMessage, useIntl } from 'react-intl'
55

66
import { TERMS_OF_SERVICE_PATH, TERMS_OF_STORAGE_PATH } from '../../util/constants'
77

@@ -15,6 +15,7 @@ const TermsOfUsePane = ({
1515
termsOfStorageSet,
1616
values: userData
1717
}) => {
18+
const intl = useIntl()
1819
const {
1920
hasConsentedToTerms,
2021
storeTripHistory
@@ -48,7 +49,17 @@ const TermsOfUsePane = ({
4849
checked={storeTripHistory}
4950
name='storeTripHistory'
5051
onBlur={handleBlur}
51-
onChange={handleChange}
52+
onChange={(e) => {
53+
// Show alert when user is unchecking the checkbox
54+
if (storeTripHistory) {
55+
// Do nothing if the user hits cancel
56+
if (!confirm(intl.formatMessage({id: 'components.TermsOfUsePane.confirmDeletionPrompt'}))) {
57+
return
58+
}
59+
}
60+
61+
handleChange(e)
62+
}}
5263
>
5364
<FormattedMessage
5465
id='components.TermsOfUsePane.termsOfStorageStatement'

0 commit comments

Comments
 (0)