From e56424c9b36470dec326d2f561ed6a2dc6e82d07 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Fri, 6 May 2022 09:30:29 -0700 Subject: [PATCH] IO-1858 Email Groupings --- bodyshop_translations.babel | 42 +++++++++++++++ .../email-overlay/email-overlay.component.jsx | 12 ++++- .../shop-info/shop-info.general.component.jsx | 54 +++++++++++++++++++ client/src/graphql/bodyshop.queries.js | 2 + client/src/translations/en_us/common.json | 2 + client/src/translations/es/common.json | 2 + client/src/translations/fr/common.json | 2 + hasura/metadata/tables.yaml | 2 + .../down.sql | 4 ++ .../up.sql | 2 + 10 files changed, 123 insertions(+), 1 deletion(-) create mode 100644 hasura/migrations/1651792938097_alter_table_public_bodyshops_add_column_md_to_emails/down.sql create mode 100644 hasura/migrations/1651792938097_alter_table_public_bodyshops_add_column_md_to_emails/up.sql diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index a7de63bcb..d03467a82 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -8927,6 +8927,48 @@ + + md_to_emails + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + md_to_emails_emails + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + messagingpresets false diff --git a/client/src/components/email-overlay/email-overlay.component.jsx b/client/src/components/email-overlay/email-overlay.component.jsx index baf52d376..0c7fefc78 100644 --- a/client/src/components/email-overlay/email-overlay.component.jsx +++ b/client/src/components/email-overlay/email-overlay.component.jsx @@ -42,7 +42,12 @@ export function EmailOverlayComponent({ const { t } = useTranslation(); const handleClick = ({ item, key, keyPath }) => { const email = item.props.value; - form.setFieldsValue({ to: _.uniq([...form.getFieldValue("to"), email]) }); + form.setFieldsValue({ + to: _.uniq([ + ...form.getFieldValue("to"), + ...(typeof email === "string" ? [email] : email), + ]), + }); }; const menu = ( @@ -55,6 +60,11 @@ export function EmailOverlayComponent({ {`${e.first_name} ${e.last_name}`} ))} + {bodyshop.md_to_emails.map((e, idx) => ( + + {e.label} + + ))} ); diff --git a/client/src/components/shop-info/shop-info.general.component.jsx b/client/src/components/shop-info/shop-info.general.component.jsx index 0eeb78d4a..92e99791b 100644 --- a/client/src/components/shop-info/shop-info.general.component.jsx +++ b/client/src/components/shop-info/shop-info.general.component.jsx @@ -1393,6 +1393,60 @@ export default function ShopInfoGeneral({ form }) { }} + + + {(fields, { add, remove, move }) => { + return ( +
+ {fields.map((field, index) => ( + + + + + + +