diff --git a/i18n/en-US.yml b/i18n/en-US.yml index 07f154ff1..2f6f028e0 100644 --- a/i18n/en-US.yml +++ b/i18n/en-US.yml @@ -142,7 +142,6 @@ common: walk: Walk notifications: email: email - push: push notifications sms: SMS places: custom: custom @@ -413,8 +412,6 @@ components: description: The content you requested is not available. header: Content not found NotificationPrefsPane: - devicesRegistered: "{count, plural, one {# device} other {# devices}} registered" - noDeviceForPush: Register your device using the mobile app to access push notifications. notificationChannelPrompt: "Receive notifications about your saved trips via:" OTP2ErrorRenderer: LOCATION_NOT_FOUND: diff --git a/i18n/es.yml b/i18n/es.yml index c80631ae4..2f31042d6 100644 --- a/i18n/es.yml +++ b/i18n/es.yml @@ -144,7 +144,6 @@ common: walk: Caminar notifications: email: correo electrónico - push: notificaciones push sms: Mensaje de texto places: custom: personalizado @@ -412,8 +411,6 @@ components: description: El contenido que ha solicitado no está disponible. header: No se encontró el contenido NotificationPrefsPane: - devicesRegistered: "{count, plural, one {# device} other {# devices}} registrado" - noDeviceForPush: Regístrese con la aplicación móvil para acceder a esta configuración. notificationChannelPrompt: "Recibir notificaciones para sus viajes guardados por:" OTP2ErrorRenderer: LOCATION_NOT_FOUND: diff --git a/i18n/fr.yml b/i18n/fr.yml index baee7ff29..6323e1e0e 100644 --- a/i18n/fr.yml +++ b/i18n/fr.yml @@ -151,7 +151,6 @@ common: walk: À pied notifications: email: e-mail - push: notifications push sms: SMS places: custom: divers @@ -424,10 +423,6 @@ components: description: Le contenu que vous avez demandé n'est pas disponible. header: Contenu introuvable NotificationPrefsPane: - devicesRegistered: >- - {count, plural, one {# appareil enregistré} other {# appareils - enregistrés}} - noDeviceForPush: Inscrivez-vous avec l'application mobile pour accéder à ce paramètre. notificationChannelPrompt: "Recevoir des notifications sur vos trajets par :" OTP2ErrorRenderer: LOCATION_NOT_FOUND: diff --git a/i18n/i18n-exceptions.json b/i18n/i18n-exceptions.json index ea5575e0a..42fc70cb9 100644 --- a/i18n/i18n-exceptions.json +++ b/i18n/i18n-exceptions.json @@ -2,8 +2,7 @@ "groups": { "common.notifications.*": [ "email", - "sms", - "push" + "sms" ], "components.UserAccountScreen.fields.*": [ "add-companion-form", diff --git a/i18n/ko.yml b/i18n/ko.yml index 094db9350..b793e15f1 100644 --- a/i18n/ko.yml +++ b/i18n/ko.yml @@ -130,7 +130,6 @@ common: walk: 걷기 notifications: email: 이메일 - push: 푸시 알림 sms: SMS places: custom: 사용자 정의 @@ -370,8 +369,6 @@ components: description: 요청한 콘텐츠를 사용할 수 없습니다. header: 콘텐츠를 찾을 수 없음 NotificationPrefsPane: - devicesRegistered: "{count, plural, one {# device} other {# devices}} 등록됨" - noDeviceForPush: 푸시 알림을 이용하려면 모바일 앱을 사용해 기기를 등록하십시오. notificationChannelPrompt: "저장된 여행의 알림을 받는 방법:" OTP2ErrorRenderer: LOCATION_NOT_FOUND: @@ -392,8 +389,8 @@ components: header: 탐색 창 내 대중교통 연결편 없음 OUTSIDE_BOUNDS: body: >- - {inputFields} {inputFieldsCount, plural, =0 {} one {위치는} other {위치들은}} 트립 - 플래너 범위가 아닙니다. + {inputFields} {inputFieldsCount, plural, =0 {} one {위치는} other {위치들은}} + 트립 플래너 범위가 아닙니다. header: 범위 밖 위치 OUTSIDE_SERVICE_PERIOD: body: 지정된 날짜가 현재 트립 플래너에 로드된 데이터 범위를 벗어납니다. diff --git a/i18n/ru.yml b/i18n/ru.yml index ccfc03f6e..15ff91e59 100644 --- a/i18n/ru.yml +++ b/i18n/ru.yml @@ -143,7 +143,6 @@ common: walk: Пешком notifications: email: электронная почта - push: всплывающие уведомления sms: SMS places: custom: пользовательское @@ -409,10 +408,6 @@ components: description: Запрашиваемое содержимое недоступно. header: Содержимое не обнаружено NotificationPrefsPane: - devicesRegistered: "{count, plural, one {# устройство} other {# устройства}} зарегистрированы" - noDeviceForPush: >- - Зарегистрируйте свое устройство с помощью мобильного приложения, чтобы - получать всплывающие уведомления. notificationChannelPrompt: "Получайте уведомления о сохраненных поездках через:" OTP2ErrorRenderer: LOCATION_NOT_FOUND: @@ -741,8 +736,7 @@ components: TripSummaryPane: happensOnDays: "Проходит в такие дни: {days}" monitoredTripDays: Дни наблюдения за поездками - notifications: за {leadTimeInMinutes} мин до запланированного времени - отправления + notifications: за {leadTimeInMinutes} мин до запланированного времени отправления notificationsDisabled: "Уведомления: отключены" timeAndDuration: Время и продолжительность поездки TripTools: diff --git a/i18n/ta.yml b/i18n/ta.yml index 3328aed42..1c90938fc 100644 --- a/i18n/ta.yml +++ b/i18n/ta.yml @@ -145,7 +145,6 @@ common: walk: நடை notifications: email: மின்னஞ்சல் - push: அறிவிப்புகளை அழுத்தவும் sms: எச்.எம்.எச் places: custom: தனிப்பயன் @@ -414,12 +413,6 @@ components: description: நீங்கள் கோரிய உள்ளடக்கம் கிடைக்கவில்லை. header: உள்ளடக்கம் கிடைக்கவில்லை NotificationPrefsPane: - devicesRegistered: >- - {எண்ணிக்கை, பன்மை, ஒன்று {# சாதனம்} பிற {# சாதனங்கள்}} பதிவு - செய்யப்பட்டுள்ளன - noDeviceForPush: >- - புச் அறிவிப்புகளை அணுக மொபைல் பயன்பாட்டைப் பயன்படுத்தி உங்கள் சாதனத்தை - பதிவு செய்யுங்கள். notificationChannelPrompt: "நீங்கள் சேமித்த பயணங்களைப் பற்றிய அறிவிப்புகளைப் பெறுங்கள்:" OTP2ErrorRenderer: LOCATION_NOT_FOUND: diff --git a/i18n/tl.yml b/i18n/tl.yml index e3540747f..3c8a35e20 100644 --- a/i18n/tl.yml +++ b/i18n/tl.yml @@ -150,7 +150,6 @@ common: walk: Naglalakad notifications: email: email - push: mga push notification sms: SMS places: custom: custom @@ -419,10 +418,6 @@ components: description: Hindi available ang hiniling mong content. header: Hindi nakita ang content NotificationPrefsPane: - devicesRegistered: "{count, plural, one {# device} other {# mga device}} rehistrado" - noDeviceForPush: >- - Irehistro ang iyong device gamit ang mobile app para i-access ang mga push - notification. notificationChannelPrompt: >- Makatanggap ng mga notification tungkol sa iyong mga naka-save na biyahe sa pamamagitan ng: diff --git a/i18n/tr.yml b/i18n/tr.yml index ffaf8046c..6d50176a2 100644 --- a/i18n/tr.yml +++ b/i18n/tr.yml @@ -114,7 +114,6 @@ common: walk: Yürümek notifications: email: eposta - push: bildirimler sms: SMS places: dining: yemek diff --git a/i18n/vi.yml b/i18n/vi.yml index 6b97b407c..4dc5ba880 100644 --- a/i18n/vi.yml +++ b/i18n/vi.yml @@ -143,7 +143,6 @@ common: walk: Đi bộ notifications: email: e-mail - push: thông báo đẩy sms: tin nhắn places: custom: phong tục @@ -397,8 +396,6 @@ components: description: Nội dung bạn yêu cầu không có sẵn. header: Không tìm thấy nội dung NotificationPrefsPane: - devicesRegistered: "{count, plural, one {# device} other {# devices}} đã đăng ký" - noDeviceForPush: Đăng ký thiết bị của quý vị bằng ứng dụng di động để nhận thông báo đẩy. notificationChannelPrompt: "Nhận thông báo về các chuyến đi đã lưu bằng:" OTP2ErrorRenderer: LOCATION_NOT_FOUND: @@ -427,8 +424,9 @@ components: kiếm OUTSIDE_BOUNDS: body: >- - {inputFields} {inputFieldsCount, plural, =0 {} one {Vị trí là} other {Các - vị trí là}} không nằm trong ranh giới của trình lên kế hoạch chuyến đi. + {inputFields} {inputFieldsCount, plural, =0 {} one {Vị trí là} other + {Các vị trí là}} không nằm trong ranh giới của trình lên kế hoạch chuyến + đi. header: Địa điểm nằm ngoài ranh giới OUTSIDE_SERVICE_PERIOD: body: >- diff --git a/i18n/zh_Hans.yml b/i18n/zh_Hans.yml index 1f488fd01..68a42df97 100644 --- a/i18n/zh_Hans.yml +++ b/i18n/zh_Hans.yml @@ -130,7 +130,6 @@ common: walk: 步行 notifications: email: 电子邮件 - push: 推送通知 sms: 短信 places: custom: 习俗 @@ -365,8 +364,6 @@ components: description: 您要求的内容不存在. header: 未找到内容 NotificationPrefsPane: - devicesRegistered: "{count, plural, one {# device} other {# devices}}已注册" - noDeviceForPush: 使用移动应用程序注册您的设备以访问推送通知。 notificationChannelPrompt: "如何接收已保存行程的通知:" OTP2ErrorRenderer: LOCATION_NOT_FOUND: @@ -387,8 +384,8 @@ components: header: 搜索窗口中没有公交连接 OUTSIDE_BOUNDS: body: >- - {inputFields} {inputFieldsCount, plural, =0 {} one {位置是} other {位置是}}不在Trip - Planner的范围内。 + {inputFields} {inputFieldsCount, plural, =0 {} one {位置是} other + {位置是}}不在Trip Planner的范围内。 header: 位置超出边界 OUTSIDE_SERVICE_PERIOD: body: 指定的日期不在当前加载到Trip Planner中的数据范围内。 diff --git a/i18n/zh_Hant.yml b/i18n/zh_Hant.yml index e65b179ff..d1ca191cc 100644 --- a/i18n/zh_Hant.yml +++ b/i18n/zh_Hant.yml @@ -128,7 +128,6 @@ common: walk: 步行 notifications: email: 電子郵件 - push: 推播通知 sms: 簡訊 places: custom: 自訂 @@ -313,8 +312,6 @@ components: description: 您要求的內容無法使用。 header: 找不到內容 NotificationPrefsPane: - devicesRegistered: "{count}個裝置 已註冊" - noDeviceForPush: 使用行動應用程式註冊您的裝置以存取推播通知。 notificationChannelPrompt: 透過以下方式接收有關您已儲存之行程的通知: OTP2ErrorRenderer: LOCATION_NOT_FOUND: diff --git a/lib/components/user/notification-prefs-pane.tsx b/lib/components/user/notification-prefs-pane.tsx index d011e3bce..55ee0e0c8 100644 --- a/lib/components/user/notification-prefs-pane.tsx +++ b/lib/components/user/notification-prefs-pane.tsx @@ -1,11 +1,9 @@ -import { connect } from 'react-redux' import { Field, FormikProps } from 'formik' import { FormattedMessage } from 'react-intl' import { ListGroup, ListGroupItem } from 'react-bootstrap' import React from 'react' import styled from 'styled-components' -import { AppReduxState } from '../../util/state-types' import { GREY_ON_WHITE } from '../util/colors' import { FieldSet } from './styled' @@ -13,11 +11,9 @@ import { User } from './types' import PhoneNumberEditor from './phone-number-editor' interface Props extends FormikProps { - allowedNotificationChannels: string[] loggedInUser: User } -const allNotificationChannels = ['email', 'sms', 'push'] const emailAndSms = ['email', 'sms'] // Styles @@ -48,11 +44,10 @@ const NotificationOption = styled(ListGroupItem)` * User notification preferences pane. */ const NotificationPrefsPane = ({ - allowedNotificationChannels, handleChange, // Formik or custom handler values: userData // Formik prop }: Props): JSX.Element => { - const { email, isPhoneNumberVerified, phoneNumber, pushDevices } = userData + const { email, isPhoneNumberVerified, phoneNumber } = userData return (
@@ -60,7 +55,7 @@ const NotificationPrefsPane = ({ - {allowedNotificationChannels.map((type) => { + {emailAndSms.map((type) => { const inputId = `notification-channel-${type}` const inputDescriptionId = `${inputId}-description` return ( @@ -68,7 +63,6 @@ const NotificationPrefsPane = ({ {type === 'email' ? ( {email} - ) : type === 'sms' ? ( + ) : ( - ) : ( - - {pushDevices ? ( - - ) : ( - - )} - )} @@ -113,17 +94,4 @@ const NotificationPrefsPane = ({ ) } -const mapStateToProps = (state: AppReduxState) => { - const { persistence } = state.otp.config - const supportsPushNotifications = - persistence && 'otp_middleware' in persistence - ? persistence.otp_middleware?.supportsPushNotifications - : false - return { - allowedNotificationChannels: supportsPushNotifications - ? allNotificationChannels - : emailAndSms - } -} - -export default connect(mapStateToProps)(NotificationPrefsPane) +export default NotificationPrefsPane diff --git a/lib/components/user/types.ts b/lib/components/user/types.ts index 84da09e60..dfa2fd385 100644 --- a/lib/components/user/types.ts +++ b/lib/components/user/types.ts @@ -59,7 +59,6 @@ export interface User { notificationChannel?: string phoneNumber?: string preferredLocale?: string - pushDevices?: number relatedUsers?: CompanionInfo[] savedLocations?: UserSavedLocation[] storeTripHistory?: boolean