From 569fa7478d816b46610f5304201828a4968801bf Mon Sep 17 00:00:00 2001 From: amy-corson-ibigroup <115499534+amy-corson-ibigroup@users.noreply.github.com> Date: Wed, 6 Dec 2023 14:24:10 -0600 Subject: [PATCH] update config types --- lib/components/user/terms-of-use-pane.tsx | 5 +++-- lib/util/config-types.ts | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/components/user/terms-of-use-pane.tsx b/lib/components/user/terms-of-use-pane.tsx index 469c7bf2e..7054f4a84 100644 --- a/lib/components/user/terms-of-use-pane.tsx +++ b/lib/components/user/terms-of-use-pane.tsx @@ -3,6 +3,7 @@ import { connect } from 'react-redux' import { FormattedMessage, useIntl } from 'react-intl' import React, { FormEventHandler } from 'react' +import { AppReduxState } from '../../util/state-types' import { LinkOpensNewWindow } from '../util/externalLink' import { TERMS_OF_SERVICE_PATH, @@ -24,7 +25,7 @@ const TermsOfUsePane = ({ handleBlur: () => void handleChange: FormEventHandler locale: string - termsOfServiceLink: string + termsOfServiceLink?: string values: { hasConsentedToTerms: boolean storeTripHistory: boolean @@ -101,7 +102,7 @@ const TermsOfUsePane = ({ ) } -const mapStateToProps = (state: any) => { +const mapStateToProps = (state: AppReduxState) => { return { locale: state.otp.ui?.locale, termsOfServiceLink: state.otp.config.termsOfServiceLink, diff --git a/lib/util/config-types.ts b/lib/util/config-types.ts index a0d46c3d1..6b980bbf0 100644 --- a/lib/util/config-types.ts +++ b/lib/util/config-types.ts @@ -103,7 +103,9 @@ export type PersistenceConfig = ( | LocalPersistenceConfig | MiddlewarePersistenceConfig ) & { - enabled?: boolean + enabled?: boolean | undefined + // eslint-disable-next-line camelcase + terms_of_storage?: boolean | undefined } /** Popup target settings */ @@ -370,6 +372,8 @@ export interface AppConfig { /** Whether to show the x minutes late/early in the itinerary body */ showScheduleDeviation?: boolean stopViewer?: StopViewerConfig + /** Externally hosted terms of service URL */ + termsOfServiceLink?: string /** App title shown in the browser title bar. */ title?: string transitOperators?: TransitOperatorConfig[]