From 72798eeeb935380abdb29c774325fb7cfb0a2789 Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Fri, 20 Dec 2024 13:49:53 -0500 Subject: [PATCH 1/5] fix(AddEmailForm): Set form name to its id and add field name for toast. --- i18n/en-US.yml | 1 + i18n/fr.yml | 1 + lib/components/user/common/add-email-form.tsx | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/i18n/en-US.yml b/i18n/en-US.yml index 197c0baad..e54eed7eb 100644 --- a/i18n/en-US.yml +++ b/i18n/en-US.yml @@ -763,6 +763,7 @@ components: errorUpdatingProfile: Error updating profile. fieldUpdated: This setting has been updated. fields: + add-companion-form: Companions storeTripHistory: Store trip history updating: Updating UserSettings: diff --git a/i18n/fr.yml b/i18n/fr.yml index 041b2e578..7e9f21228 100644 --- a/i18n/fr.yml +++ b/i18n/fr.yml @@ -795,6 +795,7 @@ components: errorUpdatingProfile: Erreur dans la mise à jour de votre profil. fieldUpdated: Ce paramètre a été mis à jour. fields: + add-companion-form: Accompagnateurs storeTripHistory: Enregistrement des recherches updating: Mise à jour UserSettings: diff --git a/lib/components/user/common/add-email-form.tsx b/lib/components/user/common/add-email-form.tsx index 88e368402..00595b60b 100644 --- a/lib/components/user/common/add-email-form.tsx +++ b/lib/components/user/common/add-email-form.tsx @@ -10,7 +10,7 @@ import { Field, Form, Formik } from 'formik' import React, { ReactNode } from 'react' import styled from 'styled-components' -import { ControlStrip, phoneFieldStyle } from '../styled' +import { phoneFieldStyle } from '../styled' import SubmitButton from '../../util/submit-button' interface Props { @@ -64,7 +64,7 @@ const AddEmailForm = ({ {label} -
+ Date: Fri, 20 Dec 2024 14:03:53 -0500 Subject: [PATCH 2/5] chore(i18n): Add exception for companion field name --- i18n/i18n-exceptions.json | 1 + 1 file changed, 1 insertion(+) diff --git a/i18n/i18n-exceptions.json b/i18n/i18n-exceptions.json index 9cb9f516a..f1d52aae7 100644 --- a/i18n/i18n-exceptions.json +++ b/i18n/i18n-exceptions.json @@ -6,6 +6,7 @@ "push" ], "components.UserAccountScreen.fields.*": [ + "add-companion-form", "storeTripHistory" ], "components.OTP2ErrorRenderer.*.body": [ From bca731f1d67ebbc9620cdd89593c7a4eb1eee327 Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Mon, 6 Jan 2025 13:51:04 -0500 Subject: [PATCH 3/5] chore(i18n): Use "Trusted Companions" in toast header. --- i18n/en-US.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/en-US.yml b/i18n/en-US.yml index 32857cb1f..e13ff3a8e 100644 --- a/i18n/en-US.yml +++ b/i18n/en-US.yml @@ -770,7 +770,7 @@ components: errorUpdatingProfile: Error updating profile. fieldUpdated: This setting has been updated. fields: - add-companion-form: Companions + add-companion-form: Trusted Companions storeTripHistory: Store trip history updating: Updating UserSettings: From e1eba1f81386ea95968f6104b4f78b684ad6fe15 Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Mon, 6 Jan 2025 13:54:28 -0500 Subject: [PATCH 4/5] chore(i18n): Use "Travel Companions" in toast header --- i18n/en-US.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/en-US.yml b/i18n/en-US.yml index e13ff3a8e..ad9c088dd 100644 --- a/i18n/en-US.yml +++ b/i18n/en-US.yml @@ -770,7 +770,7 @@ components: errorUpdatingProfile: Error updating profile. fieldUpdated: This setting has been updated. fields: - add-companion-form: Trusted Companions + add-companion-form: Travel Companions storeTripHistory: Store trip history updating: Updating UserSettings: From d9a00f41109b478db00fb58df676fd4625754824 Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Thu, 9 Jan 2025 16:21:16 -0500 Subject: [PATCH 5/5] improvement: Add title to toasts on mobility wiz, saved trip. --- lib/actions/user.js | 10 +++++++++- .../user/mobility-profile/mobility-wizard.tsx | 2 +- lib/components/user/wizard.tsx | 10 +++++++--- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/lib/actions/user.js b/lib/actions/user.js index a65f93665..7cef5fcc7 100644 --- a/lib/actions/user.js +++ b/lib/actions/user.js @@ -17,6 +17,7 @@ import { } from '../util/user' import { isBlank } from '../util/ui' import { secureFetch } from '../util/middleware' +import { toastSuccess } from '../components/util/toasts' import { TRIPS_PATH } from '../util/constants' import { routeTo, setLocale } from './ui' @@ -500,7 +501,14 @@ export function createOrUpdateUserMonitoredTrip( if (status === 'success' && data) { if (!silentOnSuccess && intl) { - toast.success( + toastSuccess( + isNew + ? intl.formatMessage({ + id: 'components.SavedTripEditor.saveNewTrip' + }) + : intl.formatMessage({ + id: 'components.SavedTripEditor.editSavedTrip' + }), intl.formatMessage({ id: 'actions.user.preferencesSaved' }) ) } diff --git a/lib/components/user/mobility-profile/mobility-wizard.tsx b/lib/components/user/mobility-profile/mobility-wizard.tsx index ad8b87705..fd11016b3 100644 --- a/lib/components/user/mobility-profile/mobility-wizard.tsx +++ b/lib/components/user/mobility-profile/mobility-wizard.tsx @@ -10,7 +10,7 @@ const MobilityWizard = ({ formikProps }: WizardProps): JSX.Element => { const intl = useIntl() const title = intl.formatMessage({ - id: 'components.MobilityProfile.title' + id: 'components.MobilityProfile.MobilityPane.header' }) return ( diff --git a/lib/components/user/wizard.tsx b/lib/components/user/wizard.tsx index e41805d75..824d0558b 100644 --- a/lib/components/user/wizard.tsx +++ b/lib/components/user/wizard.tsx @@ -5,11 +5,11 @@ import { FormattedMessage, injectIntl, IntlShape } from 'react-intl' import { push, replace } from 'connected-react-router' import React, { Component, MouseEvent } from 'react' import styled from 'styled-components' -import toast from 'react-hot-toast' import * as uiActions from '../../actions/ui' import { AppReduxState } from '../../util/state-types' import { GREY_ON_WHITE } from '../util/colors' +import { toastSuccess } from '../util/toasts' import PageTitle from '../util/page-title' import { EditedUser } from './types' @@ -69,7 +69,8 @@ class Wizard extends Component { onNext, pages, returnTo = '/', - routeTo + routeTo, + title } = this.props if (activePaneIndex < pages.length - 1) { @@ -94,7 +95,10 @@ class Wizard extends Component { } else { // Display a toast to acknowledge saved changes // (although in reality, changes quietly took effect in previous screens). - toast.success(intl.formatMessage({ id: 'actions.user.preferencesSaved' })) + toastSuccess( + title, + intl.formatMessage({ id: 'actions.user.preferencesSaved' }) + ) routeTo(returnTo) } }