From 592b47b5d4b3335c246bb15404eea1b10f2096a1 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Mon, 21 Mar 2022 11:47:25 -0600 Subject: [PATCH 1/8] IO-1789 Incoming hours cap --- bodyshop_translations.babel | 26 ++++++ .../shop-info.scheduling.component.jsx | 6 ++ client/src/graphql/bodyshop.queries.js | 3 +- client/src/translations/en_us/common.json | 3 + client/src/translations/es/common.json | 3 + client/src/translations/fr/common.json | 3 + hasura/metadata/tables.yaml | 2 + .../down.sql | 4 + .../up.sql | 2 + server/graphql-client/queries.js | 1 + server/scheduling/scheduling-job.js | 89 +++++++++++++++---- 11 files changed, 124 insertions(+), 18 deletions(-) create mode 100644 hasura/migrations/1647876980174_alter_table_public_bodyshops_add_column_ss_configuration/down.sql create mode 100644 hasura/migrations/1647876980174_alter_table_public_bodyshops_add_column_ss_configuration/up.sql diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index d11e1ed2d..28764f991 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -7280,6 +7280,32 @@ + + ss_configuration + + + dailyhrslimit + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + ssbuckets diff --git a/client/src/components/shop-info/shop-info.scheduling.component.jsx b/client/src/components/shop-info/shop-info.scheduling.component.jsx index d071cc9de..85e64c555 100644 --- a/client/src/components/shop-info/shop-info.scheduling.component.jsx +++ b/client/src/components/shop-info/shop-info.scheduling.component.jsx @@ -70,6 +70,12 @@ export default function ShopInfoSchedulingComponent({ form }) { > + + {currentUser.email} + + {bodyshop.email} + {bodyshop.md_from_emails && + bodyshop.md_from_emails.map((e) => ( + {e} + ))} + + diff --git a/client/src/components/email-overlay/email-overlay.container.jsx b/client/src/components/email-overlay/email-overlay.container.jsx index c2dc7d261..9276f35ee 100644 --- a/client/src/components/email-overlay/email-overlay.container.jsx +++ b/client/src/components/email-overlay/email-overlay.container.jsx @@ -56,13 +56,9 @@ export function EmailOverlayContainer({ : bodyshop.shopname, address: EmailSettings.fromAddress, }, - ReplyTo: { - Email: currentUser.validemail ? currentUser.email : bodyshop.email, - Name: currentUser.displayName, - }, }; - const handleFinish = async (values) => { + const handleFinish = async (allValues) => { logImEXEvent("email_send_from_modal"); //const attachments = []; @@ -77,10 +73,15 @@ export function EmailOverlayContainer({ // attachments.push(t); // }); + const { from, ...values } = allValues; setSending(true); try { await axios.post("/sendemail", { ...defaultEmailFrom, + ReplyTo: { + Email: from, + Name: currentUser.displayName, + }, ...values, html: rawHtml, attachments: [ @@ -138,6 +139,7 @@ export function EmailOverlayContainer({ } form.setFieldsValue({ + from: currentUser.validemail ? currentUser.email : bodyshop.email, ...emailConfig.messageOptions, cc: emailConfig.messageOptions.cc && 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 29288b9ee..186234adf 100644 --- a/client/src/components/shop-info/shop-info.general.component.jsx +++ b/client/src/components/shop-info/shop-info.general.component.jsx @@ -507,6 +507,19 @@ export default function ShopInfoGeneral({ form }) { > + +