From 1b87c0f995400d6545207be3ddc54a2fd2d8811e Mon Sep 17 00:00:00 2001 From: wjames111 Date: Wed, 31 Jul 2024 11:15:16 -0400 Subject: [PATCH 1/6] Add confirm individual mutation. --- .../Tool/FixPhoneNumbers/Contact.tsx | 12 +++++- .../Tool/FixPhoneNumbers/FixPhoneNumbers.tsx | 38 ++++++++++++++++++- .../UpdateInvalidPhoneNumbers.graphql | 15 ++++++++ 3 files changed, 61 insertions(+), 4 deletions(-) create mode 100644 src/components/Tool/FixPhoneNumbers/UpdateInvalidPhoneNumbers.graphql diff --git a/src/components/Tool/FixPhoneNumbers/Contact.tsx b/src/components/Tool/FixPhoneNumbers/Contact.tsx index 425f0ba55..39f801135 100644 --- a/src/components/Tool/FixPhoneNumbers/Contact.tsx +++ b/src/components/Tool/FixPhoneNumbers/Contact.tsx @@ -23,7 +23,7 @@ import { PersonPhoneNumberInput } from 'src/graphql/types.generated'; import { useLocale } from 'src/hooks/useLocale'; import { dateFormatShort } from 'src/lib/intlFormat'; import theme from '../../../theme'; -import { PhoneNumberData } from './FixPhoneNumbers'; +import { PersonPhoneNumbers, PhoneNumberData } from './FixPhoneNumbers'; const useStyles = makeStyles()((theme: Theme) => ({ left: { @@ -105,6 +105,7 @@ interface Props { numbers: PhoneNumberData[]; toDelete: PersonPhoneNumberInput[]; personId: string; + contact: PersonPhoneNumbers; handleChange: ( personId: string, numberIndex: number, @@ -114,12 +115,14 @@ interface Props { handleAdd: (personId: string, number: string) => void; handleChangePrimary: (personId: string, numberIndex: number) => void; setContactFocus: SetContactFocus; + handleUpdate: (personId: string, contact: PersonPhoneNumbers) => void; } const Contact: React.FC = ({ name, numbers, personId, + contact, handleChange, handleDelete, handleAdd, @@ -127,6 +130,7 @@ const Contact: React.FC = ({ // Remove below line when function is being used. // eslint-disable-next-line @typescript-eslint/no-unused-vars setContactFocus, + handleUpdate, }) => { const { t } = useTranslation(); const locale = useLocale(); @@ -349,7 +353,11 @@ const Contact: React.FC = ({ style={{ paddingLeft: theme.spacing(1) }} > -