@bigbinary/neeto-email-delivery-frontend 1.0.17 → 1.0.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -223,6 +223,7 @@ for step-by-step instructions to develop the frontend package.
223
223
  | `ownerId` | uuid/string | ID of the owner record. |
224
224
  | `indexRoute` | string | Index route for the email delivery page. |
225
225
  | `ownDomainSetupRoute` | string | Nested route for the SparkPost "Own Domain" setup component. |
226
+ | `ownDomainVerifyRoute` | string | Nested route for the SparkPost "Verify Domain" component. |
226
227
 
227
228
  ###### SparkpostDomainSetup
228
229
 
@@ -53,12 +53,15 @@
53
53
  "emailLabel": "Email address",
54
54
  "emailPlaceholder": "notifications@example.com",
55
55
  "emailHelp": "This email will be used as the sender address for outgoing emails. We'll automatically verify the domain ({{domain}}).",
56
+ "displayNameHelp": "This will be used as the display name for outgoing emails.",
56
57
  "setupEmail": "Setup email",
58
+ "displayNameLabel": "Display name",
57
59
  "note": "Note: You'll need access to your domain's DNS settings to complete the verification process.",
58
60
  "validation": {
59
61
  "emailRequired": "Please enter an email address",
60
62
  "emailInvalid": "Please enter a valid email address",
61
- "setupFailed": "Failed to setup domain. Please try again."
63
+ "setupFailed": "Failed to setup domain. Please try again.",
64
+ "requiredField": "{{field}} is required"
62
65
  }
63
66
  },
64
67
  "verify": {
@@ -94,7 +97,9 @@
94
97
  "connectedEmail": "Connected email: {{email}}",
95
98
  "connected": "Connected",
96
99
  "disconnect": "Disconnect",
97
- "setupDomain": "Setup domain"
100
+ "setupDomain": "Setup domain",
101
+ "continueVerification": "Continue verification",
102
+ "verificationPending": "The verification for {{domain}} is pending. Please continue to the verification page to complete the verification process."
98
103
  },
99
104
  "toasts": {
100
105
  "domainVerifiedConnected": "Domain verified and connected successfully!",
@@ -24,7 +24,7 @@ import { t } from 'i18next';
24
24
  import * as yup from 'yup';
25
25
  import { jsxs, jsx } from 'react/jsx-runtime';
26
26
  import { useQueryClient } from '@tanstack/react-query';
27
- import { u as useSparkpostDomain } from './useSparkpostDomain-CuX-Gl5a.js';
27
+ import { u as useSparkpostDomain } from './useSparkpostDomain-De-Fz3ek.js';
28
28
  import Button from '@bigbinary/neetoui/Button';
29
29
  import Tag from '@bigbinary/neetoui/Tag';
30
30
  import '@babel/runtime/helpers/defineProperty';
@@ -311,7 +311,11 @@ var IntegrationCard = function IntegrationCard(_ref) {
311
311
  _ref$connectedTagText = _ref.connectedTagText,
312
312
  connectedTagText = _ref$connectedTagText === void 0 ? "neetoEmailDelivery.sparkpost.emailDelivery.connected" : _ref$connectedTagText,
313
313
  _ref$showDisconnect = _ref.showDisconnect,
314
- showDisconnect = _ref$showDisconnect === void 0 ? false : _ref$showDisconnect;
314
+ showDisconnect = _ref$showDisconnect === void 0 ? false : _ref$showDisconnect,
315
+ _ref$showManageButton = _ref.showManageButton,
316
+ showManageButton = _ref$showManageButton === void 0 ? false : _ref$showManageButton,
317
+ manageButtonText = _ref.manageButtonText,
318
+ onManage = _ref.onManage;
315
319
  var _useTranslation = useTranslation(),
316
320
  t = _useTranslation.t;
317
321
  var shouldShowDisconnect = isConnected || showDisconnect;
@@ -340,9 +344,15 @@ var IntegrationCard = function IntegrationCard(_ref) {
340
344
  }), /*#__PURE__*/jsx(Typography, {
341
345
  style: "body2",
342
346
  children: description
343
- }), connectButtonText && /*#__PURE__*/jsx("div", {
347
+ }), connectButtonText && /*#__PURE__*/jsxs("div", {
344
348
  className: "flex gap-2",
345
- children: shouldShowDisconnect ? /*#__PURE__*/jsx(Button, {
349
+ children: [showManageButton && /*#__PURE__*/jsx(Button, {
350
+ "data-cy": "manage-button",
351
+ label: t(manageButtonText),
352
+ size: "small",
353
+ style: "secondary",
354
+ onClick: onManage
355
+ }), shouldShowDisconnect ? /*#__PURE__*/jsx(Button, {
346
356
  "data-cy": "disconnect-button",
347
357
  label: t(disconnectButtonText),
348
358
  loading: isDisconnecting,
@@ -355,7 +365,7 @@ var IntegrationCard = function IntegrationCard(_ref) {
355
365
  size: "small",
356
366
  style: "primary",
357
367
  onClick: onConnect
358
- })
368
+ })]
359
369
  })]
360
370
  })
361
371
  });
@@ -365,6 +375,7 @@ var EmailDeliveryScreen = function EmailDeliveryScreen(_ref) {
365
375
  var indexRoute = _ref.indexRoute,
366
376
  ownerId = _ref.ownerId,
367
377
  ownDomainSetupRoute = _ref.ownDomainSetupRoute,
378
+ ownDomainVerifyRoute = _ref.ownDomainVerifyRoute,
368
379
  canManageIntegrations = _ref.canManageIntegrations;
369
380
  var _useTranslation = useTranslation(),
370
381
  t = _useTranslation.t;
@@ -439,6 +450,7 @@ var EmailDeliveryScreen = function EmailDeliveryScreen(_ref) {
439
450
  var showOutlook = noneExists || isOutlookExists;
440
451
  var showSparkpost = noneExists || isSparkpostExists;
441
452
  var showSmtp = noneExists || isSmtpExists;
453
+ var sparkpostVerificationPending = isSparkpostExists && !isSparkpostConnected;
442
454
  var handleGmailConnect = function handleGmailConnect() {
443
455
  window.location.href = buildUrl(GMAIL_OAUTH_CONNECT_URL, {
444
456
  ownerId: ownerId
@@ -461,7 +473,14 @@ var EmailDeliveryScreen = function EmailDeliveryScreen(_ref) {
461
473
  var gmailEmail = prop("email", gmailData);
462
474
  var outlookEmail = prop("email", outlookData);
463
475
  var sparkpostEmail = prop("email", sparkpostData);
476
+ var sparkpostDomain = prop("domain", sparkpostData);
464
477
  var smtpEmail = prop("email", smtpData);
478
+ var showVerificationPage = function showVerificationPage() {
479
+ history.push(buildUrl(ownDomainVerifyRoute, {
480
+ domain: sparkpostDomain,
481
+ email: sparkpostEmail
482
+ }));
483
+ };
465
484
  var gmailTitle = t("neetoEmailDelivery.gmail.title");
466
485
  var gmailDescription = isGmailConnected ? t("neetoEmailDelivery.sparkpost.emailDelivery.connectedEmail", {
467
486
  email: gmailEmail
@@ -516,9 +535,13 @@ var EmailDeliveryScreen = function EmailDeliveryScreen(_ref) {
516
535
  icon: MailSend,
517
536
  isConnected: isSparkpostConnected,
518
537
  isDisconnecting: isSparkpostDisconnecting,
538
+ manageButtonText: "neetoEmailDelivery.sparkpost.emailDelivery.continueVerification",
539
+ showManageButton: sparkpostVerificationPending,
519
540
  title: ownDomainTitle,
541
+ showDisconnect: sparkpostVerificationPending || isSparkpostConnected,
520
542
  onConnect: handleOwnDomainConnect,
521
- onDisconnect: onSparkpostDisconnect
543
+ onDisconnect: onSparkpostDisconnect,
544
+ onManage: showVerificationPage
522
545
  }), showSmtp && /*#__PURE__*/jsx(IntegrationCard, {
523
546
  connectButtonText: "neetoEmailDelivery.smtp.connectSmtp",
524
547
  description: smtpDescription,
@@ -537,6 +560,11 @@ var EmailDeliveryScreen = function EmailDeliveryScreen(_ref) {
537
560
  children: t("neetoEmailDelivery.outlook.waitingForTestEmail", {
538
561
  email: outlookEmail
539
562
  })
563
+ }), sparkpostVerificationPending && /*#__PURE__*/jsx(Callout, {
564
+ style: "warning",
565
+ children: t("neetoEmailDelivery.sparkpost.emailDelivery.verificationPending", {
566
+ domain: sparkpostDomain
567
+ })
540
568
  }), isOutlookShadowAccount && /*#__PURE__*/jsx(Callout, {
541
569
  style: "warning",
542
570
  children: t("neetoEmailDelivery.outlook.shadowAccountMessage", {
@@ -1 +1 @@
1
- {"version":3,"file":"EmailDeliveryScreen.js","sources":["../app/javascript/src/components/Smtp/constants.js","../app/javascript/src/components/Smtp/Setup.jsx","../app/javascript/src/hooks/integrations/useGmail.js","../app/javascript/src/hooks/integrations/useOutlook.js","../app/javascript/src/hooks/integrations/useSmtp.js","../app/javascript/src/components/EmailDeliveryScreen/constants.js","../app/javascript/src/components/EmailDeliveryScreen/IntegrationCard.jsx","../app/javascript/src/components/EmailDeliveryScreen/index.jsx"],"sourcesContent":["import { t } from \"i18next\";\nimport * as yup from \"yup\";\n\nexport const ENCRYPTION_OPTIONS = [\n { label: \"None\", value: \"none\" },\n { label: \"StartTLS\", value: \"starttls\" },\n { label: \"SSL\", value: \"ssl\" },\n];\n\nexport const SMTP_ACCOUNT_INITIAL_VALUES = {\n host: \"\",\n port: 587,\n username: \"\",\n password: \"\",\n email: \"\",\n encryption: \"starttls\",\n displayName: \"\",\n};\n\nexport const SMTP_ACCOUNT_VALIDATION_SCHEMA = yup.object().shape({\n host: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.hostLabel\"),\n })\n ),\n port: yup.number().required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.portLabel\"),\n })\n ),\n username: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.usernameLabel\"),\n })\n ),\n password: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.passwordLabel\"),\n })\n ),\n email: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.emailLabel\"),\n })\n )\n .email(t(\"neetoEmailDelivery.smtp.setup.emailInvalid\")),\n displayName: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.displayNameLabel\"),\n })\n ),\n encryption: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.encryptionLabel\"),\n })\n ),\n});\n","import { Callout, Pane, Typography } from \"neetoui\";\nimport { Form, Input, Radio, ActionBlock } from \"neetoui/formik\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { useCreateSmtp } from \"hooks/reactQuery/integrations/useSmtpIntegrationApi\";\n\nimport {\n SMTP_ACCOUNT_INITIAL_VALUES,\n SMTP_ACCOUNT_VALIDATION_SCHEMA,\n ENCRYPTION_OPTIONS,\n} from \"./constants\";\n\nconst SmtpSetup = ({ ownerId, onDone, onCancel, isOpen }) => {\n const { t } = useTranslation();\n\n const { isPending: isCreating, mutate: createSmtp } = useCreateSmtp({\n ownerId,\n });\n\n const handleSubmit = values => {\n createSmtp({ smtp_account: values }, { onSuccess: onDone });\n };\n\n return (\n <Pane {...{ isOpen }} size=\"lg\" onClose={onCancel}>\n <Pane.Header>\n <Typography style=\"h2\" weight=\"semibold\">\n {t(\"neetoEmailDelivery.smtp.setup.title\")}\n </Typography>\n </Pane.Header>\n <Form\n className=\"w-full\"\n formikProps={{\n initialValues: SMTP_ACCOUNT_INITIAL_VALUES,\n validationSchema: SMTP_ACCOUNT_VALIDATION_SCHEMA,\n onSubmit: handleSubmit,\n }}\n >\n <Pane.Body className=\"space-y-4\">\n <div className=\"flex flex-col gap-6\">\n <Callout style=\"warning\">\n {t(\"neetoEmailDelivery.smtp.setup.note\")}\n </Callout>\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.hostLabel\")}\n name=\"host\"\n />\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.portLabel\")}\n name=\"port\"\n type=\"number\"\n />\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.usernameLabel\")}\n name=\"username\"\n />\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.passwordLabel\")}\n name=\"password\"\n type=\"password\"\n />\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.emailLabel\")}\n name=\"email\"\n type=\"email\"\n />\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.displayNameLabel\")}\n name=\"displayName\"\n />\n <Radio\n label={t(\"neetoEmailDelivery.smtp.setup.encryptionLabel\")}\n name=\"encryption\"\n >\n {ENCRYPTION_OPTIONS.map(option => (\n <Radio.Item\n key={option.value}\n label={option.label}\n value={option.value}\n />\n ))}\n </Radio>\n </div>\n </Pane.Body>\n <Pane.Footer>\n <ActionBlock\n cancelButtonProps={{ onClick: onCancel }}\n isSubmitting={isCreating}\n submitButtonProps={{\n label: t(\"neetoEmailDelivery.smtp.setup.saveAndActivate\"),\n }}\n />\n </Pane.Footer>\n </Form>\n </Pane>\n );\n};\n\nexport default SmtpSetup;\n","import { useState } from \"react\";\n\nimport { useQueryClient } from \"@tanstack/react-query\";\nimport { useHistory } from \"react-router-dom\";\n\nimport {\n useFetchGmail,\n useDestroyGmail,\n} from \"hooks/reactQuery/integrations/useGmailIntegrationApi\";\nimport { invalidateAllIntegrationQueries } from \"src/utils\";\n\nconst useGmail = ({ ownerId, indexRoute, canManageIntegrations }) => {\n const [isDisconnectAlertOpen, setIsDisconnectAlertOpen] = useState(false);\n\n const history = useHistory();\n\n const queryClient = useQueryClient();\n\n const { isLoading, data = {} } = useFetchGmail(ownerId, {\n enabled: canManageIntegrations,\n });\n\n const { isPending: isDestroying, mutate: destroyIntegration } =\n useDestroyGmail({ ownerId });\n\n const onClose = () => history.replace(indexRoute);\n\n const onDisconnect = () => {\n destroyIntegration(false, {\n onSuccess: () => {\n setIsDisconnectAlertOpen(false);\n invalidateAllIntegrationQueries(queryClient, ownerId);\n history.replace(indexRoute);\n },\n });\n };\n\n return {\n data,\n isLoading,\n isDestroying,\n exists: data?.exists,\n isConnected: data?.connected,\n isDisconnectAlertOpen,\n setIsDisconnectAlertOpen,\n onDisconnect,\n onClose,\n errorMessage: data?.error,\n };\n};\n\nexport default useGmail;\n","import { useState } from \"react\";\n\nimport { useQueryClient } from \"@tanstack/react-query\";\nimport { useHistory } from \"react-router-dom\";\n\nimport {\n useFetchOutlook,\n useDestroyOutlook,\n} from \"hooks/reactQuery/integrations/useOutlookIntegrationApi\";\nimport { invalidateAllIntegrationQueries } from \"src/utils\";\n\nconst useOutlook = ({ ownerId, indexRoute, canManageIntegrations }) => {\n const [isDisconnectAlertOpen, setIsDisconnectAlertOpen] = useState(false);\n\n const history = useHistory();\n\n const queryClient = useQueryClient();\n\n const { isLoading, data = {} } = useFetchOutlook(ownerId, {\n enabled: canManageIntegrations,\n });\n\n const { isPending: isDestroying, mutate: destroyIntegration } =\n useDestroyOutlook({ ownerId });\n\n const onClose = () => history.replace(indexRoute);\n\n const onDisconnect = () => {\n destroyIntegration(false, {\n onSuccess: () => {\n setIsDisconnectAlertOpen(false);\n invalidateAllIntegrationQueries(queryClient, ownerId);\n history.replace(indexRoute);\n },\n });\n };\n\n return {\n data,\n isLoading,\n exists: data?.exists,\n status: data?.status,\n shadowAccount: data?.shadowAccount,\n isWaitingForTestEmail: data?.status === \"inactive\" && !data?.connected,\n isDestroying,\n isConnected: data?.connected,\n isDisconnectAlertOpen,\n setIsDisconnectAlertOpen,\n onDisconnect,\n onClose,\n errorMessage: data?.error,\n };\n};\n\nexport default useOutlook;\n","import {\n useFetchSmtp,\n useDestroySmtp,\n} from \"hooks/reactQuery/integrations/useSmtpIntegrationApi\";\n\nconst useSmtp = ({ ownerId, canManageIntegrations }) => {\n const { isLoading, data = {} } = useFetchSmtp(ownerId, {\n enabled: canManageIntegrations,\n });\n\n const { isPending: isDestroying, mutate: onDisconnect } = useDestroySmtp({\n ownerId,\n });\n\n return {\n data,\n isConnected: data?.connected,\n isLoading,\n isDestroying,\n onDisconnect,\n exists: data?.exists,\n };\n};\n\nexport default useSmtp;\n","import { t } from \"i18next\";\n\nexport const ERROR_MESSAGES = {\n gmail_permission_not_given: t(\"neetoEmailDelivery.gmail.permissionNotGiven\"),\n outlook_permission_not_given: t(\n \"neetoEmailDelivery.outlook.permissionNotGiven\"\n ),\n outlook_invalid_client: t(\"neetoEmailDelivery.outlook.invalidClient\"),\n outlook_nil_json_web_token: t(\"neetoEmailDelivery.outlook.nilJsonWebToken\"),\n};\n","import { Button, Tag, Typography } from \"neetoui\";\nimport { useTranslation } from \"react-i18next\";\n\nconst IntegrationCard = ({\n icon: Icon,\n title,\n description,\n isConnected,\n isDisconnecting,\n onConnect,\n onDisconnect,\n connectButtonText,\n disconnectButtonText = \"neetoEmailDelivery.sparkpost.emailDelivery.disconnect\",\n connectedTagText = \"neetoEmailDelivery.sparkpost.emailDelivery.connected\",\n showDisconnect = false,\n}) => {\n const { t } = useTranslation();\n\n const shouldShowDisconnect = isConnected || showDisconnect;\n\n return (\n <div className=\"neeto-ui-rounded-lg neeto-ui-shadow-xs neeto-ui-border-gray-300 translate flex flex-col gap-y-4 border p-6 no-underline transition-transform duration-300 ease-in-out outline-none hover:-translate-y-1\">\n <div className=\"flex flex-col gap-4\">\n <div className=\"flex items-center gap-3\">\n <Icon className=\"shrink-0\" size={32} />\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex items-center gap-2\">\n <Typography style=\"h4\" weight=\"semibold\">\n {title}\n </Typography>\n {isConnected && <Tag label={t(connectedTagText)} />}\n </div>\n </div>\n </div>\n <Typography style=\"body2\">{description}</Typography>\n {connectButtonText && (\n <div className=\"flex gap-2\">\n {shouldShowDisconnect ? (\n <Button\n data-cy=\"disconnect-button\"\n label={t(disconnectButtonText)}\n loading={isDisconnecting}\n size=\"small\"\n style=\"danger\"\n onClick={onDisconnect}\n />\n ) : (\n <Button\n data-cy=\"connect-button\"\n label={t(connectButtonText)}\n size=\"small\"\n style=\"primary\"\n onClick={onConnect}\n />\n )}\n </div>\n )}\n </div>\n </div>\n );\n};\n\nexport default IntegrationCard;\n","import { useState } from \"react\";\n\nimport { humanize, isPresent } from \"neetocist\";\nimport { useQueryParams } from \"neetocommons/react-utils\";\nimport { buildUrl } from \"neetocommons/utils\";\nimport { MailSend } from \"neetoicons\";\nimport { Gmail as GmailIcon, Outlook as OutlookIcon } from \"neetoicons/misc\";\nimport { Spinner, Callout, Toastr } from \"neetoui\";\nimport { prop } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\nimport { useHistory } from \"react-router-dom\";\n\nimport {\n GMAIL_OAUTH_CONNECT_URL,\n OUTLOOK_OAUTH_CONNECT_URL,\n} from \"apis/integrations/constants\";\nimport SmtpSetup from \"components/Smtp/Setup\";\nimport useGmail from \"hooks/integrations/useGmail\";\nimport useOutlook from \"hooks/integrations/useOutlook\";\nimport useSmtp from \"hooks/integrations/useSmtp\";\nimport useSparkpostDomain from \"hooks/integrations/useSparkpostDomain\";\n\nimport { ERROR_MESSAGES } from \"./constants\";\nimport IntegrationCard from \"./IntegrationCard\";\n\nconst EmailDeliveryScreen = ({\n indexRoute,\n ownerId,\n ownDomainSetupRoute,\n canManageIntegrations,\n}) => {\n const { t } = useTranslation();\n const history = useHistory();\n const [isSmtpPaneOpen, setIsSmtpPaneOpen] = useState(false);\n const { error, errorDescription } = useQueryParams();\n\n if (isPresent(error)) {\n let errorMessage = ERROR_MESSAGES[error];\n if (errorDescription) {\n errorMessage = `${errorMessage} ${errorDescription}`;\n }\n Toastr.error(errorMessage ?? humanize(error));\n\n history.replace(indexRoute);\n }\n\n const gmailIntegration = useGmail({\n ownerId,\n indexRoute,\n canManageIntegrations,\n });\n\n const outlookIntegration = useOutlook({\n ownerId,\n indexRoute,\n canManageIntegrations,\n });\n\n const sparkpostIntegration = useSparkpostDomain({\n ownerId,\n canManageIntegrations,\n });\n\n const smtpIntegration = useSmtp({ ownerId, canManageIntegrations });\n\n const {\n data: gmailData = {},\n isConnected: isGmailConnected,\n isLoading: isGmailLoading,\n isDestroying: isGmailDisconnecting,\n onDisconnect: onGmailDisconnect,\n exists: isGmailExists,\n } = gmailIntegration;\n\n const {\n data: outlookData = {},\n isConnected: isOutlookConnected,\n isLoading: isOutlookLoading,\n isDestroying: isOutlookDisconnecting,\n isWaitingForTestEmail: isOutlookWaitingForTestEmail,\n shadowAccount: isOutlookShadowAccount,\n onDisconnect: onOutlookDisconnect,\n exists: isOutlookExists,\n } = outlookIntegration;\n\n const {\n data: sparkpostData = {},\n isConnected: isSparkpostConnected,\n isLoading: isSparkpostLoading,\n onDisconnect: onSparkpostDisconnect,\n isDestroying: isSparkpostDisconnecting,\n exists: isSparkpostExists,\n } = sparkpostIntegration;\n\n const {\n data: smtpData = {},\n isConnected: isSmtpConnected,\n isLoading: isSmtpLoading,\n isDestroying: isSmtpDisconnecting,\n onDisconnect: onSmtpDisconnect,\n exists: isSmtpExists,\n } = smtpIntegration;\n\n const isLoading =\n isGmailLoading || isOutlookLoading || isSparkpostLoading || isSmtpLoading;\n\n const noneExists =\n !isGmailExists && !isOutlookExists && !isSparkpostExists && !isSmtpExists;\n const showGmail = noneExists || isGmailExists;\n const showOutlook = noneExists || isOutlookExists;\n const showSparkpost = noneExists || isSparkpostExists;\n const showSmtp = noneExists || isSmtpExists;\n\n const handleGmailConnect = () => {\n window.location.href = buildUrl(GMAIL_OAUTH_CONNECT_URL, { ownerId });\n };\n\n const handleOutlookConnect = () => {\n window.location.href = buildUrl(OUTLOOK_OAUTH_CONNECT_URL, { ownerId });\n };\n\n const handleOwnDomainConnect = () => {\n history.push(ownDomainSetupRoute);\n };\n\n const handleSmtpConnect = () => {\n setIsSmtpPaneOpen(true);\n };\n\n const handleSmtpPaneClose = () => {\n setIsSmtpPaneOpen(false);\n };\n\n const gmailEmail = prop(\"email\", gmailData);\n const outlookEmail = prop(\"email\", outlookData);\n const sparkpostEmail = prop(\"email\", sparkpostData);\n const smtpEmail = prop(\"email\", smtpData);\n\n const gmailTitle = t(\"neetoEmailDelivery.gmail.title\");\n const gmailDescription = isGmailConnected\n ? t(\"neetoEmailDelivery.sparkpost.emailDelivery.connectedEmail\", {\n email: gmailEmail,\n })\n : t(\"neetoEmailDelivery.gmail.description\");\n\n const outlookTitle = t(\"neetoEmailDelivery.outlook.title\");\n const outlookDescription = isOutlookConnected\n ? t(\"neetoEmailDelivery.sparkpost.emailDelivery.connectedEmail\", {\n email: outlookEmail,\n })\n : t(\"neetoEmailDelivery.outlook.description\");\n\n const ownDomainTitle = t(\n \"neetoEmailDelivery.sparkpost.emailDelivery.ownDomainTitle\"\n );\n\n const ownDomainDescription = isSparkpostConnected\n ? t(\"neetoEmailDelivery.sparkpost.emailDelivery.connectedEmail\", {\n email: sparkpostEmail,\n })\n : t(\"neetoEmailDelivery.sparkpost.emailDelivery.ownDomainDescription\");\n\n const smtpTitle = t(\"neetoEmailDelivery.smtp.title\");\n const smtpDescription = isSmtpConnected\n ? t(\"neetoEmailDelivery.sparkpost.emailDelivery.connectedEmail\", {\n email: smtpEmail,\n })\n : t(\"neetoEmailDelivery.smtp.description\");\n\n if (isLoading) {\n return (\n <div className=\"flex grow items-center justify-center w-full\">\n <Spinner />\n </div>\n );\n }\n\n const activeMessage =\n (isGmailConnected && t(\"neetoEmailDelivery.gmail.gmailConfigured\")) ||\n (isOutlookConnected && t(\"neetoEmailDelivery.outlook.outlookConfigured\")) ||\n (isSparkpostConnected &&\n t(\"neetoEmailDelivery.sparkpost.ownDomainConfigured\")) ||\n (isSmtpConnected && t(\"neetoEmailDelivery.smtp.smtpConfigured\"));\n\n return (\n <div className=\"min-h-0 w-full grow\">\n <div className=\"@container mx-auto space-y-6\">\n <div className=\"grid grid-cols-1 gap-3 py-1 @lg:grid-cols-2 @lg:gap-6 @3xl:grid-cols-3 @7xl:grid-cols-4\">\n {/* Gmail Option */}\n {showGmail && (\n <IntegrationCard\n connectButtonText=\"neetoEmailDelivery.gmail.connectGmail\"\n description={gmailDescription}\n icon={GmailIcon}\n isConnected={isGmailConnected}\n isDisconnecting={isGmailDisconnecting}\n title={gmailTitle}\n onConnect={handleGmailConnect}\n onDisconnect={onGmailDisconnect}\n />\n )}\n {/* Outlook Option */}\n {showOutlook && (\n <IntegrationCard\n connectButtonText=\"neetoEmailDelivery.outlook.connectOutlook\"\n description={outlookDescription}\n icon={OutlookIcon}\n isConnected={isOutlookConnected}\n isDisconnecting={isOutlookDisconnecting}\n title={outlookTitle}\n showDisconnect={\n isOutlookWaitingForTestEmail || isOutlookShadowAccount\n }\n onConnect={handleOutlookConnect}\n onDisconnect={onOutlookDisconnect}\n />\n )}\n {/* Own Domain (Sparkpost) Option */}\n {showSparkpost && (\n <IntegrationCard\n connectButtonText=\"neetoEmailDelivery.sparkpost.emailDelivery.setupDomain\"\n description={ownDomainDescription}\n icon={MailSend}\n isConnected={isSparkpostConnected}\n isDisconnecting={isSparkpostDisconnecting}\n title={ownDomainTitle}\n onConnect={handleOwnDomainConnect}\n onDisconnect={onSparkpostDisconnect}\n />\n )}\n {/* SMTP Option */}\n {showSmtp && (\n <IntegrationCard\n connectButtonText=\"neetoEmailDelivery.smtp.connectSmtp\"\n description={smtpDescription}\n icon={MailSend}\n isConnected={isSmtpConnected}\n isDisconnecting={isSmtpDisconnecting}\n title={smtpTitle}\n onConnect={handleSmtpConnect}\n onDisconnect={onSmtpDisconnect}\n />\n )}\n </div>\n {activeMessage && <Callout style=\"success\">{activeMessage}</Callout>}\n {isOutlookWaitingForTestEmail && (\n <Callout style=\"warning\">\n {t(\"neetoEmailDelivery.outlook.waitingForTestEmail\", {\n email: outlookEmail,\n })}\n </Callout>\n )}\n {isOutlookShadowAccount && (\n <Callout style=\"warning\">\n {t(\"neetoEmailDelivery.outlook.shadowAccountMessage\", {\n email: outlookEmail,\n })}\n </Callout>\n )}\n </div>\n <SmtpSetup\n {...{ ownerId }}\n isOpen={isSmtpPaneOpen}\n onCancel={handleSmtpPaneClose}\n onDone={handleSmtpPaneClose}\n />\n </div>\n );\n};\n\nexport default EmailDeliveryScreen;\n"],"names":["ENCRYPTION_OPTIONS","label","value","SMTP_ACCOUNT_INITIAL_VALUES","host","port","username","password","email","encryption","displayName","SMTP_ACCOUNT_VALIDATION_SCHEMA","yup","object","shape","string","trim","required","t","field","number","SmtpSetup","_ref","ownerId","onDone","onCancel","isOpen","_useTranslation","useTranslation","_useCreateSmtp","useCreateSmtp","isCreating","isPending","createSmtp","mutate","handleSubmit","values","smtp_account","onSuccess","_jsxs","Pane","size","onClose","children","_jsx","Header","Typography","style","weight","Form","className","formikProps","initialValues","validationSchema","onSubmit","Body","Callout","Input","name","type","Radio","map","option","Item","Footer","ActionBlock","cancelButtonProps","onClick","isSubmitting","submitButtonProps","useGmail","indexRoute","canManageIntegrations","_useState","useState","_useState2","_slicedToArray","isDisconnectAlertOpen","setIsDisconnectAlertOpen","history","useHistory","queryClient","useQueryClient","_useFetchGmail","useFetchGmail","enabled","isLoading","_useFetchGmail$data","data","_useDestroyGmail","useDestroyGmail","isDestroying","destroyIntegration","replace","onDisconnect","invalidateAllIntegrationQueries","exists","isConnected","connected","errorMessage","error","useOutlook","_useFetchOutlook","useFetchOutlook","_useFetchOutlook$data","_useDestroyOutlook","useDestroyOutlook","status","shadowAccount","isWaitingForTestEmail","useSmtp","_useFetchSmtp","useFetchSmtp","_useFetchSmtp$data","_useDestroySmtp","useDestroySmtp","ERROR_MESSAGES","gmail_permission_not_given","outlook_permission_not_given","outlook_invalid_client","outlook_nil_json_web_token","IntegrationCard","Icon","icon","title","description","isDisconnecting","onConnect","connectButtonText","_ref$disconnectButton","disconnectButtonText","_ref$connectedTagText","connectedTagText","_ref$showDisconnect","showDisconnect","shouldShowDisconnect","Tag","Button","loading","EmailDeliveryScreen","ownDomainSetupRoute","isSmtpPaneOpen","setIsSmtpPaneOpen","_useQueryParams","useQueryParams","errorDescription","isPresent","_errorMessage","concat","Toastr","humanize","gmailIntegration","outlookIntegration","sparkpostIntegration","useSparkpostDomain","smtpIntegration","_gmailIntegration$dat","gmailData","isGmailConnected","isGmailLoading","isGmailDisconnecting","onGmailDisconnect","isGmailExists","_outlookIntegration$d","outlookData","isOutlookConnected","isOutlookLoading","isOutlookDisconnecting","isOutlookWaitingForTestEmail","isOutlookShadowAccount","onOutlookDisconnect","isOutlookExists","_sparkpostIntegration","sparkpostData","isSparkpostConnected","isSparkpostLoading","onSparkpostDisconnect","isSparkpostDisconnecting","isSparkpostExists","_smtpIntegration$data","smtpData","isSmtpConnected","isSmtpLoading","isSmtpDisconnecting","onSmtpDisconnect","isSmtpExists","noneExists","showGmail","showOutlook","showSparkpost","showSmtp","handleGmailConnect","window","location","href","buildUrl","GMAIL_OAUTH_CONNECT_URL","handleOutlookConnect","OUTLOOK_OAUTH_CONNECT_URL","handleOwnDomainConnect","push","handleSmtpConnect","handleSmtpPaneClose","gmailEmail","prop","outlookEmail","sparkpostEmail","smtpEmail","gmailTitle","gmailDescription","outlookTitle","outlookDescription","ownDomainTitle","ownDomainDescription","smtpTitle","smtpDescription","Spinner","activeMessage","GmailIcon","OutlookIcon","MailSend"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGO,IAAMA,kBAAkB,GAAG,CAChC;AAAEC,EAAAA,KAAK,EAAE,MAAM;AAAEC,EAAAA,KAAK,EAAE;AAAO,CAAC,EAChC;AAAED,EAAAA,KAAK,EAAE,UAAU;AAAEC,EAAAA,KAAK,EAAE;AAAW,CAAC,EACxC;AAAED,EAAAA,KAAK,EAAE,KAAK;AAAEC,EAAAA,KAAK,EAAE;AAAM,CAAC,CAC/B;AAEM,IAAMC,2BAA2B,GAAG;AACzCC,EAAAA,IAAI,EAAE,EAAE;AACRC,EAAAA,IAAI,EAAE,GAAG;AACTC,EAAAA,QAAQ,EAAE,EAAE;AACZC,EAAAA,QAAQ,EAAE,EAAE;AACZC,EAAAA,KAAK,EAAE,EAAE;AACTC,EAAAA,UAAU,EAAE,UAAU;AACtBC,EAAAA,WAAW,EAAE;AACf,CAAC;AAEM,IAAMC,8BAA8B,GAAGC,GAAG,CAACC,MAAM,EAAE,CAACC,KAAK,CAAC;AAC/DV,EAAAA,IAAI,EAAEQ,GAAG,CACNG,MAAM,EAAE,CACRC,IAAI,EAAE,CACNC,QAAQ,CACPC,CAAC,CAAC,6CAA6C,EAAE;IAC/CC,KAAK,EAAED,CAAC,CAAC,yCAAyC;AACpD,GAAC,CACH,CAAC;AACHb,EAAAA,IAAI,EAAEO,GAAG,CAACQ,MAAM,EAAE,CAACH,QAAQ,CACzBC,CAAC,CAAC,6CAA6C,EAAE;IAC/CC,KAAK,EAAED,CAAC,CAAC,yCAAyC;AACpD,GAAC,CACH,CAAC;AACDZ,EAAAA,QAAQ,EAAEM,GAAG,CACVG,MAAM,EAAE,CACRC,IAAI,EAAE,CACNC,QAAQ,CACPC,CAAC,CAAC,6CAA6C,EAAE;IAC/CC,KAAK,EAAED,CAAC,CAAC,6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,QAAAA,QAAA,EACrBzB,CAAC,CAAC,iDAAiD,EAAE;AACpDV,UAAAA,KAAK,EAAEqM;SACR;AAAC,OACK,CACV;AAAA,KACE,CAAC,eACNjK,GAAA,CAACvB,SAAS,EAAA;AACFE,MAAAA,OAAO,EAAPA,OAAO;AACbG,MAAAA,MAAM,EAAEmH,cAAe;AACvBpH,MAAAA,QAAQ,EAAEiL,mBAAoB;AAC9BlL,MAAAA,MAAM,EAAEkL;AAAoB,KAC7B,CAAC;AAAA,GACC,CAAC;AAEV;;;;"}
1
+ {"version":3,"file":"EmailDeliveryScreen.js","sources":["../app/javascript/src/components/Smtp/constants.js","../app/javascript/src/components/Smtp/Setup.jsx","../app/javascript/src/hooks/integrations/useGmail.js","../app/javascript/src/hooks/integrations/useOutlook.js","../app/javascript/src/hooks/integrations/useSmtp.js","../app/javascript/src/components/EmailDeliveryScreen/constants.js","../app/javascript/src/components/EmailDeliveryScreen/IntegrationCard.jsx","../app/javascript/src/components/EmailDeliveryScreen/index.jsx"],"sourcesContent":["import { t } from \"i18next\";\nimport * as yup from \"yup\";\n\nexport const ENCRYPTION_OPTIONS = [\n { label: \"None\", value: \"none\" },\n { label: \"StartTLS\", value: \"starttls\" },\n { label: \"SSL\", value: \"ssl\" },\n];\n\nexport const SMTP_ACCOUNT_INITIAL_VALUES = {\n host: \"\",\n port: 587,\n username: \"\",\n password: \"\",\n email: \"\",\n encryption: \"starttls\",\n displayName: \"\",\n};\n\nexport const SMTP_ACCOUNT_VALIDATION_SCHEMA = yup.object().shape({\n host: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.hostLabel\"),\n })\n ),\n port: yup.number().required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.portLabel\"),\n })\n ),\n username: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.usernameLabel\"),\n })\n ),\n password: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.passwordLabel\"),\n })\n ),\n email: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.emailLabel\"),\n })\n )\n .email(t(\"neetoEmailDelivery.smtp.setup.emailInvalid\")),\n displayName: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.displayNameLabel\"),\n })\n ),\n encryption: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.encryptionLabel\"),\n })\n ),\n});\n","import { Callout, Pane, Typography } from \"neetoui\";\nimport { Form, Input, Radio, ActionBlock } from \"neetoui/formik\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { useCreateSmtp } from \"hooks/reactQuery/integrations/useSmtpIntegrationApi\";\n\nimport {\n SMTP_ACCOUNT_INITIAL_VALUES,\n SMTP_ACCOUNT_VALIDATION_SCHEMA,\n ENCRYPTION_OPTIONS,\n} from \"./constants\";\n\nconst SmtpSetup = ({ ownerId, onDone, onCancel, isOpen }) => {\n const { t } = useTranslation();\n\n const { isPending: isCreating, mutate: createSmtp } = useCreateSmtp({\n ownerId,\n });\n\n const handleSubmit = values => {\n createSmtp({ smtp_account: values }, { onSuccess: onDone });\n };\n\n return (\n <Pane {...{ isOpen }} size=\"lg\" onClose={onCancel}>\n <Pane.Header>\n <Typography style=\"h2\" weight=\"semibold\">\n {t(\"neetoEmailDelivery.smtp.setup.title\")}\n </Typography>\n </Pane.Header>\n <Form\n className=\"w-full\"\n formikProps={{\n initialValues: SMTP_ACCOUNT_INITIAL_VALUES,\n validationSchema: SMTP_ACCOUNT_VALIDATION_SCHEMA,\n onSubmit: handleSubmit,\n }}\n >\n <Pane.Body className=\"space-y-4\">\n <div className=\"flex flex-col gap-6\">\n <Callout style=\"warning\">\n {t(\"neetoEmailDelivery.smtp.setup.note\")}\n </Callout>\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.hostLabel\")}\n name=\"host\"\n />\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.portLabel\")}\n name=\"port\"\n type=\"number\"\n />\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.usernameLabel\")}\n name=\"username\"\n />\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.passwordLabel\")}\n name=\"password\"\n type=\"password\"\n />\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.emailLabel\")}\n name=\"email\"\n type=\"email\"\n />\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.displayNameLabel\")}\n name=\"displayName\"\n />\n <Radio\n label={t(\"neetoEmailDelivery.smtp.setup.encryptionLabel\")}\n name=\"encryption\"\n >\n {ENCRYPTION_OPTIONS.map(option => (\n <Radio.Item\n key={option.value}\n label={option.label}\n value={option.value}\n />\n ))}\n </Radio>\n </div>\n </Pane.Body>\n <Pane.Footer>\n <ActionBlock\n cancelButtonProps={{ onClick: onCancel }}\n isSubmitting={isCreating}\n submitButtonProps={{\n label: t(\"neetoEmailDelivery.smtp.setup.saveAndActivate\"),\n }}\n />\n </Pane.Footer>\n </Form>\n </Pane>\n );\n};\n\nexport default SmtpSetup;\n","import { useState } from \"react\";\n\nimport { useQueryClient } from \"@tanstack/react-query\";\nimport { useHistory } from \"react-router-dom\";\n\nimport {\n useFetchGmail,\n useDestroyGmail,\n} from \"hooks/reactQuery/integrations/useGmailIntegrationApi\";\nimport { invalidateAllIntegrationQueries } from \"src/utils\";\n\nconst useGmail = ({ ownerId, indexRoute, canManageIntegrations }) => {\n const [isDisconnectAlertOpen, setIsDisconnectAlertOpen] = useState(false);\n\n const history = useHistory();\n\n const queryClient = useQueryClient();\n\n const { isLoading, data = {} } = useFetchGmail(ownerId, {\n enabled: canManageIntegrations,\n });\n\n const { isPending: isDestroying, mutate: destroyIntegration } =\n useDestroyGmail({ ownerId });\n\n const onClose = () => history.replace(indexRoute);\n\n const onDisconnect = () => {\n destroyIntegration(false, {\n onSuccess: () => {\n setIsDisconnectAlertOpen(false);\n invalidateAllIntegrationQueries(queryClient, ownerId);\n history.replace(indexRoute);\n },\n });\n };\n\n return {\n data,\n isLoading,\n isDestroying,\n exists: data?.exists,\n isConnected: data?.connected,\n isDisconnectAlertOpen,\n setIsDisconnectAlertOpen,\n onDisconnect,\n onClose,\n errorMessage: data?.error,\n };\n};\n\nexport default useGmail;\n","import { useState } from \"react\";\n\nimport { useQueryClient } from \"@tanstack/react-query\";\nimport { useHistory } from \"react-router-dom\";\n\nimport {\n useFetchOutlook,\n useDestroyOutlook,\n} from \"hooks/reactQuery/integrations/useOutlookIntegrationApi\";\nimport { invalidateAllIntegrationQueries } from \"src/utils\";\n\nconst useOutlook = ({ ownerId, indexRoute, canManageIntegrations }) => {\n const [isDisconnectAlertOpen, setIsDisconnectAlertOpen] = useState(false);\n\n const history = useHistory();\n\n const queryClient = useQueryClient();\n\n const { isLoading, data = {} } = useFetchOutlook(ownerId, {\n enabled: canManageIntegrations,\n });\n\n const { isPending: isDestroying, mutate: destroyIntegration } =\n useDestroyOutlook({ ownerId });\n\n const onClose = () => history.replace(indexRoute);\n\n const onDisconnect = () => {\n destroyIntegration(false, {\n onSuccess: () => {\n setIsDisconnectAlertOpen(false);\n invalidateAllIntegrationQueries(queryClient, ownerId);\n history.replace(indexRoute);\n },\n });\n };\n\n return {\n data,\n isLoading,\n exists: data?.exists,\n status: data?.status,\n shadowAccount: data?.shadowAccount,\n isWaitingForTestEmail: data?.status === \"inactive\" && !data?.connected,\n isDestroying,\n isConnected: data?.connected,\n isDisconnectAlertOpen,\n setIsDisconnectAlertOpen,\n onDisconnect,\n onClose,\n errorMessage: data?.error,\n };\n};\n\nexport default useOutlook;\n","import {\n useFetchSmtp,\n useDestroySmtp,\n} from \"hooks/reactQuery/integrations/useSmtpIntegrationApi\";\n\nconst useSmtp = ({ ownerId, canManageIntegrations }) => {\n const { isLoading, data = {} } = useFetchSmtp(ownerId, {\n enabled: canManageIntegrations,\n });\n\n const { isPending: isDestroying, mutate: onDisconnect } = useDestroySmtp({\n ownerId,\n });\n\n return {\n data,\n isConnected: data?.connected,\n isLoading,\n isDestroying,\n onDisconnect,\n exists: data?.exists,\n };\n};\n\nexport default useSmtp;\n","import { t } from \"i18next\";\n\nexport const ERROR_MESSAGES = {\n gmail_permission_not_given: t(\"neetoEmailDelivery.gmail.permissionNotGiven\"),\n outlook_permission_not_given: t(\n \"neetoEmailDelivery.outlook.permissionNotGiven\"\n ),\n outlook_invalid_client: t(\"neetoEmailDelivery.outlook.invalidClient\"),\n outlook_nil_json_web_token: t(\"neetoEmailDelivery.outlook.nilJsonWebToken\"),\n};\n","import { Button, Tag, Typography } from \"neetoui\";\nimport { useTranslation } from \"react-i18next\";\n\nconst IntegrationCard = ({\n icon: Icon,\n title,\n description,\n isConnected,\n isDisconnecting,\n onConnect,\n onDisconnect,\n connectButtonText,\n disconnectButtonText = \"neetoEmailDelivery.sparkpost.emailDelivery.disconnect\",\n connectedTagText = \"neetoEmailDelivery.sparkpost.emailDelivery.connected\",\n showDisconnect = false,\n showManageButton = false,\n manageButtonText,\n onManage,\n}) => {\n const { t } = useTranslation();\n\n const shouldShowDisconnect = isConnected || showDisconnect;\n\n return (\n <div className=\"neeto-ui-rounded-lg neeto-ui-shadow-xs neeto-ui-border-gray-300 translate flex flex-col gap-y-4 border p-6 no-underline transition-transform duration-300 ease-in-out outline-none hover:-translate-y-1\">\n <div className=\"flex flex-col gap-4\">\n <div className=\"flex items-center gap-3\">\n <Icon className=\"shrink-0\" size={32} />\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex items-center gap-2\">\n <Typography style=\"h4\" weight=\"semibold\">\n {title}\n </Typography>\n {isConnected && <Tag label={t(connectedTagText)} />}\n </div>\n </div>\n </div>\n <Typography style=\"body2\">{description}</Typography>\n {connectButtonText && (\n <div className=\"flex gap-2\">\n {showManageButton && (\n <Button\n data-cy=\"manage-button\"\n label={t(manageButtonText)}\n size=\"small\"\n style=\"secondary\"\n onClick={onManage}\n />\n )}\n {shouldShowDisconnect ? (\n <Button\n data-cy=\"disconnect-button\"\n label={t(disconnectButtonText)}\n loading={isDisconnecting}\n size=\"small\"\n style=\"danger\"\n onClick={onDisconnect}\n />\n ) : (\n <Button\n data-cy=\"connect-button\"\n label={t(connectButtonText)}\n size=\"small\"\n style=\"primary\"\n onClick={onConnect}\n />\n )}\n </div>\n )}\n </div>\n </div>\n );\n};\n\nexport default IntegrationCard;\n","import { useState } from \"react\";\n\nimport { humanize, isPresent } from \"neetocist\";\nimport { useQueryParams } from \"neetocommons/react-utils\";\nimport { buildUrl } from \"neetocommons/utils\";\nimport { MailSend } from \"neetoicons\";\nimport { Gmail as GmailIcon, Outlook as OutlookIcon } from \"neetoicons/misc\";\nimport { Spinner, Callout, Toastr } from \"neetoui\";\nimport { prop } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\nimport { useHistory } from \"react-router-dom\";\n\nimport {\n GMAIL_OAUTH_CONNECT_URL,\n OUTLOOK_OAUTH_CONNECT_URL,\n} from \"apis/integrations/constants\";\nimport SmtpSetup from \"components/Smtp/Setup\";\nimport useGmail from \"hooks/integrations/useGmail\";\nimport useOutlook from \"hooks/integrations/useOutlook\";\nimport useSmtp from \"hooks/integrations/useSmtp\";\nimport useSparkpostDomain from \"hooks/integrations/useSparkpostDomain\";\n\nimport { ERROR_MESSAGES } from \"./constants\";\nimport IntegrationCard from \"./IntegrationCard\";\n\nconst EmailDeliveryScreen = ({\n indexRoute,\n ownerId,\n ownDomainSetupRoute,\n ownDomainVerifyRoute,\n canManageIntegrations,\n}) => {\n const { t } = useTranslation();\n const history = useHistory();\n const [isSmtpPaneOpen, setIsSmtpPaneOpen] = useState(false);\n const { error, errorDescription } = useQueryParams();\n\n if (isPresent(error)) {\n let errorMessage = ERROR_MESSAGES[error];\n if (errorDescription) {\n errorMessage = `${errorMessage} ${errorDescription}`;\n }\n Toastr.error(errorMessage ?? humanize(error));\n\n history.replace(indexRoute);\n }\n\n const gmailIntegration = useGmail({\n ownerId,\n indexRoute,\n canManageIntegrations,\n });\n\n const outlookIntegration = useOutlook({\n ownerId,\n indexRoute,\n canManageIntegrations,\n });\n\n const sparkpostIntegration = useSparkpostDomain({\n ownerId,\n canManageIntegrations,\n });\n\n const smtpIntegration = useSmtp({ ownerId, canManageIntegrations });\n\n const {\n data: gmailData = {},\n isConnected: isGmailConnected,\n isLoading: isGmailLoading,\n isDestroying: isGmailDisconnecting,\n onDisconnect: onGmailDisconnect,\n exists: isGmailExists,\n } = gmailIntegration;\n\n const {\n data: outlookData = {},\n isConnected: isOutlookConnected,\n isLoading: isOutlookLoading,\n isDestroying: isOutlookDisconnecting,\n isWaitingForTestEmail: isOutlookWaitingForTestEmail,\n shadowAccount: isOutlookShadowAccount,\n onDisconnect: onOutlookDisconnect,\n exists: isOutlookExists,\n } = outlookIntegration;\n\n const {\n data: sparkpostData = {},\n isConnected: isSparkpostConnected,\n isLoading: isSparkpostLoading,\n onDisconnect: onSparkpostDisconnect,\n isDestroying: isSparkpostDisconnecting,\n exists: isSparkpostExists,\n } = sparkpostIntegration;\n\n const {\n data: smtpData = {},\n isConnected: isSmtpConnected,\n isLoading: isSmtpLoading,\n isDestroying: isSmtpDisconnecting,\n onDisconnect: onSmtpDisconnect,\n exists: isSmtpExists,\n } = smtpIntegration;\n\n const isLoading =\n isGmailLoading || isOutlookLoading || isSparkpostLoading || isSmtpLoading;\n\n const noneExists =\n !isGmailExists && !isOutlookExists && !isSparkpostExists && !isSmtpExists;\n const showGmail = noneExists || isGmailExists;\n const showOutlook = noneExists || isOutlookExists;\n const showSparkpost = noneExists || isSparkpostExists;\n const showSmtp = noneExists || isSmtpExists;\n const sparkpostVerificationPending =\n isSparkpostExists && !isSparkpostConnected;\n\n const handleGmailConnect = () => {\n window.location.href = buildUrl(GMAIL_OAUTH_CONNECT_URL, { ownerId });\n };\n\n const handleOutlookConnect = () => {\n window.location.href = buildUrl(OUTLOOK_OAUTH_CONNECT_URL, { ownerId });\n };\n\n const handleOwnDomainConnect = () => {\n history.push(ownDomainSetupRoute);\n };\n\n const handleSmtpConnect = () => {\n setIsSmtpPaneOpen(true);\n };\n\n const handleSmtpPaneClose = () => {\n setIsSmtpPaneOpen(false);\n };\n\n const gmailEmail = prop(\"email\", gmailData);\n const outlookEmail = prop(\"email\", outlookData);\n const sparkpostEmail = prop(\"email\", sparkpostData);\n const sparkpostDomain = prop(\"domain\", sparkpostData);\n const smtpEmail = prop(\"email\", smtpData);\n\n const showVerificationPage = () => {\n history.push(\n buildUrl(ownDomainVerifyRoute, {\n domain: sparkpostDomain,\n email: sparkpostEmail,\n })\n );\n };\n\n const gmailTitle = t(\"neetoEmailDelivery.gmail.title\");\n const gmailDescription = isGmailConnected\n ? t(\"neetoEmailDelivery.sparkpost.emailDelivery.connectedEmail\", {\n email: gmailEmail,\n })\n : t(\"neetoEmailDelivery.gmail.description\");\n\n const outlookTitle = t(\"neetoEmailDelivery.outlook.title\");\n const outlookDescription = isOutlookConnected\n ? t(\"neetoEmailDelivery.sparkpost.emailDelivery.connectedEmail\", {\n email: outlookEmail,\n })\n : t(\"neetoEmailDelivery.outlook.description\");\n\n const ownDomainTitle = t(\n \"neetoEmailDelivery.sparkpost.emailDelivery.ownDomainTitle\"\n );\n\n const ownDomainDescription = isSparkpostConnected\n ? t(\"neetoEmailDelivery.sparkpost.emailDelivery.connectedEmail\", {\n email: sparkpostEmail,\n })\n : t(\"neetoEmailDelivery.sparkpost.emailDelivery.ownDomainDescription\");\n\n const smtpTitle = t(\"neetoEmailDelivery.smtp.title\");\n const smtpDescription = isSmtpConnected\n ? t(\"neetoEmailDelivery.sparkpost.emailDelivery.connectedEmail\", {\n email: smtpEmail,\n })\n : t(\"neetoEmailDelivery.smtp.description\");\n\n if (isLoading) {\n return (\n <div className=\"flex grow items-center justify-center w-full\">\n <Spinner />\n </div>\n );\n }\n\n const activeMessage =\n (isGmailConnected && t(\"neetoEmailDelivery.gmail.gmailConfigured\")) ||\n (isOutlookConnected && t(\"neetoEmailDelivery.outlook.outlookConfigured\")) ||\n (isSparkpostConnected &&\n t(\"neetoEmailDelivery.sparkpost.ownDomainConfigured\")) ||\n (isSmtpConnected && t(\"neetoEmailDelivery.smtp.smtpConfigured\"));\n\n return (\n <div className=\"min-h-0 w-full grow\">\n <div className=\"@container mx-auto space-y-6\">\n <div className=\"grid grid-cols-1 gap-3 py-1 @lg:grid-cols-2 @lg:gap-6 @3xl:grid-cols-3 @7xl:grid-cols-4\">\n {/* Gmail Option */}\n {showGmail && (\n <IntegrationCard\n connectButtonText=\"neetoEmailDelivery.gmail.connectGmail\"\n description={gmailDescription}\n icon={GmailIcon}\n isConnected={isGmailConnected}\n isDisconnecting={isGmailDisconnecting}\n title={gmailTitle}\n onConnect={handleGmailConnect}\n onDisconnect={onGmailDisconnect}\n />\n )}\n {/* Outlook Option */}\n {showOutlook && (\n <IntegrationCard\n connectButtonText=\"neetoEmailDelivery.outlook.connectOutlook\"\n description={outlookDescription}\n icon={OutlookIcon}\n isConnected={isOutlookConnected}\n isDisconnecting={isOutlookDisconnecting}\n title={outlookTitle}\n showDisconnect={\n isOutlookWaitingForTestEmail || isOutlookShadowAccount\n }\n onConnect={handleOutlookConnect}\n onDisconnect={onOutlookDisconnect}\n />\n )}\n {/* Own Domain (Sparkpost) Option */}\n {showSparkpost && (\n <IntegrationCard\n connectButtonText=\"neetoEmailDelivery.sparkpost.emailDelivery.setupDomain\"\n description={ownDomainDescription}\n icon={MailSend}\n isConnected={isSparkpostConnected}\n isDisconnecting={isSparkpostDisconnecting}\n manageButtonText=\"neetoEmailDelivery.sparkpost.emailDelivery.continueVerification\"\n showManageButton={sparkpostVerificationPending}\n title={ownDomainTitle}\n showDisconnect={\n sparkpostVerificationPending || isSparkpostConnected\n }\n onConnect={handleOwnDomainConnect}\n onDisconnect={onSparkpostDisconnect}\n onManage={showVerificationPage}\n />\n )}\n {/* SMTP Option */}\n {showSmtp && (\n <IntegrationCard\n connectButtonText=\"neetoEmailDelivery.smtp.connectSmtp\"\n description={smtpDescription}\n icon={MailSend}\n isConnected={isSmtpConnected}\n isDisconnecting={isSmtpDisconnecting}\n title={smtpTitle}\n onConnect={handleSmtpConnect}\n onDisconnect={onSmtpDisconnect}\n />\n )}\n </div>\n {activeMessage && <Callout style=\"success\">{activeMessage}</Callout>}\n {isOutlookWaitingForTestEmail && (\n <Callout style=\"warning\">\n {t(\"neetoEmailDelivery.outlook.waitingForTestEmail\", {\n email: outlookEmail,\n })}\n </Callout>\n )}\n {sparkpostVerificationPending && (\n <Callout style=\"warning\">\n {t(\n \"neetoEmailDelivery.sparkpost.emailDelivery.verificationPending\",\n { domain: sparkpostDomain }\n )}\n </Callout>\n )}\n {isOutlookShadowAccount && (\n <Callout style=\"warning\">\n {t(\"neetoEmailDelivery.outlook.shadowAccountMessage\", {\n email: outlookEmail,\n })}\n </Callout>\n )}\n </div>\n <SmtpSetup\n {...{ ownerId }}\n isOpen={isSmtpPaneOpen}\n onCancel={handleSmtpPaneClose}\n onDone={handleSmtpPaneClose}\n />\n </div>\n );\n};\n\nexport default EmailDeliveryScreen;\n"],"names":["ENCRYPTION_OPTIONS","label","value","SMTP_ACCOUNT_INITIAL_VALUES","host","port","username","password","email","encryption","displayName","SMTP_ACCOUNT_VALIDATION_SCHEMA","yup","object","shape","string","trim","required","t","field","number","SmtpSetup","_ref","ownerId","onDone","onCancel","isOpen","_useTranslation","useTranslation","_useCreateSmtp","useCreateSmtp","isCreating","isPending","createSmtp","mutate","handleSubmit","values","smtp_account","onSuccess","_jsxs","Pane","size","onClose","children","_jsx","Header","Typography","style","weight","Form","className","formikProps","initialValues","validationSchema","onSubmit","Body","Callout","Input","name","type","Radio","map","option","Item","Footer","ActionBlock","cancelButtonProps","onClick","isSubmitting","submitButtonProps","useGmail","indexRoute","canManageIntegrations","_useState","useState","_useState2","_slicedToArray","isDisconnectAlertOpen","setIsDisconnectAlertOpen","history","useHistory","queryClient","useQueryClient","_useFetchGmail","useFetchGmail","enabled","isLoading","_useFetchGmail$data","data","_useDestroyGmail","useDestroyGmail","isDestroying","destroyIntegration","replace","onDisconnect","invalidateAllIntegrationQueries","exists","isConnected","connected","errorMessage","error","useOutlook","_useFetchOutlook","useFetchOutlook","_useFetchOutlook$data","_useDestroyOutlook","useDestroyOutlook","status","shadowAccount","isWaitingForTestEmail","useSmtp","_useFetchSmtp","useFetchSmtp","_useFetchSmtp$data","_useDestroySmtp","useDestroySmtp","ERROR_MESSAGES","gmail_permission_not_given","outlook_permission_not_given","outlook_invalid_client","outlook_nil_json_web_token","IntegrationCard","Icon","icon","title","description","isDisconnecting","onConnect","connectButtonText","_ref$disconnectButton","disconnectButtonText","_ref$connectedTagText","connectedTagText","_ref$showDisconnect","showDisconnect","_ref$showManageButton","showManageButton","manageButtonText","onManage","shouldShowDisconnect","Tag","Button","loading","EmailDeliveryScreen","ownDomainSetupRoute","ownDomainVerifyRoute","isSmtpPaneOpen","setIsSmtpPaneOpen","_useQueryParams","useQueryParams","errorDescription","isPresent","_errorMessage","concat","Toastr","humanize","gmailIntegration","outlookIntegration","sparkpostIntegration","useSparkpostDomain","smtpIntegration","_gmailIntegration$dat","gmailData","isGmailConnected","isGmailLoading","isGmailDisconnecting","onGmailDisconnect","isGmailExists","_outlookIntegration$d","outlookData","isOutlookConnected","isOutlookLoading","isOutlookDisconnecting","isOutlookWaitingForTestEmail","isOutlookShadowAccount","onOutlookDisconnect","isOutlookExists","_sparkpostIntegration","sparkpostData","isSparkpostConnected","isSparkpostLoading","onSparkpostDisconnect","isSparkpostDisconnecting","isSparkpostExists","_smtpIntegration$data","smtpData","isSmtpConnected","isSmtpLoading","isSmtpDisconnecting","onSmtpDisconnect","isSmtpExists","noneExists","showGmail","showOutlook","showSparkpost","showSmtp","sparkpostVerificationPending","handleGmailConnect","window","location","href","buildUrl","GMAIL_OAUTH_CONNECT_URL","handleOutlookConnect","OUTLOOK_OAUTH_CONNECT_URL","handleOwnDomainConnect","push","handleSmtpConnect","handleSmtpPaneClose","gmailEmail","prop","outlookEmail","sparkpostEmail","sparkpostDomain","smtpEmail","showVerificationPage","domain","gmailTitle","gmailDescription","outlookTitle","outlookDescription","ownDomainTitle","ownDomainDescription","smtpTitle","smtpDescription","Spinner","activeMessage","GmailIcon","OutlookIcon","MailSend"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGO,IAAMA,kBAAkB,GAAG,CAChC;AAAEC,EAAAA,KAAK,EAAE,MAAM;AAAEC,EAAAA,KAAK,EAAE;AAAO,CAAC,EAChC;AAAED,EAAAA,KAAK,EAAE,UAAU;AAAEC,EAAAA,KAAK,EAAE;AAAW,CAAC,EACxC;AAAED,EAAAA,KAAK,EAAE,KAAK;AAAEC,EAAAA,KAAK,EAAE;AAAM,CAAC,CAC/B;AAEM,IAAMC,2BAA2B,GAAG;AACzCC,EAAAA,IAAI,EAAE,EAAE;AACRC,EAAAA,IAAI,EAAE,GAAG;AACTC,EAAAA,QAAQ,EAAE,EAAE;AACZC,EAAAA,QAAQ,EAAE,EAAE;AACZC,EAAAA,KAAK,EAAE,EAAE;AACTC,EAAAA,UAAU,EAAE,UAAU;AACtBC,EAAAA,WAAW,EAAE;AACf,CAAC;AAEM,IAAMC,8BAA8B,GAAGC,GAAG,CAACC,MAAM,EAAE,CAACC,KAAK,CAAC;AAC/DV,EAAAA,IAAI,EAAEQ,GAAG,CACNG,MAAM,EAAE,CACRC,IAAI,EAAE,CACNC,QAAQ,CACPC,CAAC,CAAC,6CAA6C,EAAE;IAC/CC,KAAK,EAAED,CAAC,CAAC,yCAAyC;AACpD,GAAC,CACH,CAAC;AACHb,EAAAA,IAAI,EAAEO,GAAG,CAACQ,MAAM,EAAE,CAACH,QAA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4B,iBAC3BxJ,GAAA,CAACY,OAAO,EAAA;AAACT,QAAAA,KAAK,EAAC,SAAS;AAAAJ,QAAAA,QAAA,EACrBzB,CAAC,CACA,gEAAgE,EAChE;AAAEsM,UAAAA,MAAM,EAAEH;SACZ;AAAC,OACM,CACV,EACAvC,sBAAsB,iBACrBlI,GAAA,CAACY,OAAO,EAAA;AAACT,QAAAA,KAAK,EAAC,SAAS;AAAAJ,QAAAA,QAAA,EACrBzB,CAAC,CAAC,iDAAiD,EAAE;AACpDV,UAAAA,KAAK,EAAE2M;SACR;AAAC,OACK,CACV;AAAA,KACE,CAAC,eACNvK,GAAA,CAACvB,SAAS,EAAA;AACFE,MAAAA,OAAO,EAAPA,OAAO;AACbG,MAAAA,MAAM,EAAEwH,cAAe;AACvBzH,MAAAA,QAAQ,EAAEuL,mBAAoB;AAC9BxL,MAAAA,MAAM,EAAEwL;AAAoB,KAC7B,CAAC;AAAA,GACC,CAAC;AAEV;;;;"}
@@ -6,8 +6,8 @@ import ActionBlock from '@bigbinary/neetoui/formik/ActionBlock';
6
6
  import Form from '@bigbinary/neetoui/formik/Form';
7
7
  import { useTranslation } from 'react-i18next';
8
8
  import { useHistory } from 'react-router-dom';
9
- import { P as PageWrapper, a as PageContent, V as VALIDATION_SCHEMA } from './constants-Cvxv8ly7.js';
10
- import { u as useSparkpostDomain } from './useSparkpostDomain-CuX-Gl5a.js';
9
+ import { P as PageWrapper, a as PageContent, I as INITIAL_VALUES, V as VALIDATION_SCHEMA } from './constants-DbB8UFcr.js';
10
+ import { u as useSparkpostDomain } from './useSparkpostDomain-De-Fz3ek.js';
11
11
  import { jsx, jsxs } from 'react/jsx-runtime';
12
12
  import '@babel/runtime/helpers/defineProperty';
13
13
  import '@babel/runtime/helpers/objectWithoutProperties';
@@ -45,7 +45,7 @@ var SparkpostDomainSetup = function SparkpostDomainSetup(_ref) {
45
45
  isCreating = _useSparkpostDomain.isCreating;
46
46
  var handleSubmit = function handleSubmit(values, _ref2) {
47
47
  var setFieldError = _ref2.setFieldError;
48
- onCreateDomain(values.email.trim(), function (response) {
48
+ onCreateDomain(values.email.trim(), values.displayName.trim(), function (response) {
49
49
  if (response !== null && response !== void 0 && response.alreadyVerified) {
50
50
  // Domain is already verified, go back to email delivery settings
51
51
  history.push(alreadyVerifiedRoute);
@@ -71,9 +71,7 @@ var SparkpostDomainSetup = function SparkpostDomainSetup(_ref) {
71
71
  children: /*#__PURE__*/jsx(Form, {
72
72
  className: "w-full",
73
73
  formikProps: {
74
- initialValues: {
75
- email: ""
76
- },
74
+ initialValues: INITIAL_VALUES,
77
75
  validationSchema: VALIDATION_SCHEMA,
78
76
  onSubmit: handleSubmit
79
77
  },
@@ -107,6 +105,11 @@ var SparkpostDomainSetup = function SparkpostDomainSetup(_ref) {
107
105
  domain: domain
108
106
  }),
109
107
  placeholder: t("neetoEmailDelivery.sparkpost.setup.emailPlaceholder")
108
+ }), /*#__PURE__*/jsx(Input, {
109
+ required: true,
110
+ name: "displayName",
111
+ helpText: t("neetoEmailDelivery.sparkpost.setup.displayNameHelp"),
112
+ label: t("neetoEmailDelivery.sparkpost.setup.displayNameLabel")
110
113
  })]
111
114
  })
112
115
  });
@@ -1 +1 @@
1
- {"version":3,"file":"SparkpostDomainSetup.js","sources":["../app/javascript/src/components/SparkpostDomain/utils.js","../app/javascript/src/components/SparkpostDomain/Setup.jsx"],"sourcesContent":["const getDomainFromEmail = email => email.trim().split(\"@\")[1];\n\nexport { getDomainFromEmail };\n","import { buildUrl } from \"neetocommons/utils\";\nimport CardLayout from \"neetomolecules/CardLayout\";\nimport { Callout } from \"neetoui\";\nimport { Input, ActionBlock, Form } from \"neetoui/formik\";\nimport { useTranslation } from \"react-i18next\";\nimport { useHistory } from \"react-router-dom\";\n\nimport { PageContent, PageWrapper } from \"components/PageLayout\";\nimport useSparkpostDomain from \"hooks/integrations/useSparkpostDomain\";\n\nimport { VALIDATION_SCHEMA } from \"./constants\";\nimport { getDomainFromEmail } from \"./utils\";\n\nconst SparkpostDomainSetup = ({\n ownerId,\n alreadyVerifiedRoute,\n verifyRoute,\n onCancelRoute,\n canManageIntegrations,\n}) => {\n const { t } = useTranslation();\n\n const history = useHistory();\n\n const { onCreateDomain, isCreating } = useSparkpostDomain({\n ownerId,\n canManageIntegrations,\n });\n\n const handleSubmit = (values, { setFieldError }) => {\n onCreateDomain(\n values.email.trim(),\n response => {\n if (response?.alreadyVerified) {\n // Domain is already verified, go back to email delivery settings\n history.push(alreadyVerifiedRoute);\n } else {\n // Navigate to verification page with domain query parameter\n const domain = getDomainFromEmail(values.email);\n history.push(\n buildUrl(verifyRoute, { domain, email: values.email.trim() })\n );\n }\n },\n error => {\n const errorMessage =\n error?.response?.data?.error ||\n t(\"neetoEmailDelivery.sparkpost.setup.validation.setupFailed\");\n setFieldError(\"email\", errorMessage);\n }\n );\n };\n\n const handleCancel = () => {\n history.push(onCancelRoute);\n };\n\n return (\n <PageWrapper>\n <PageContent>\n <Form\n className=\"w-full\"\n formikProps={{\n initialValues: { email: \"\" },\n validationSchema: VALIDATION_SCHEMA,\n onSubmit: handleSubmit,\n }}\n >\n {({ values }) => {\n const domain = values.email\n ? getDomainFromEmail(values.email)\n : t(\"neetoEmailDelivery.sparkpost.customDomain\");\n\n return (\n <CardLayout\n title={String(t(\"neetoEmailDelivery.sparkpost.setup.title\"))}\n actionBlock={\n <ActionBlock\n cancelButtonProps={{ onClick: handleCancel }}\n isSubmitting={isCreating}\n submitButtonProps={{\n label: t(\"neetoEmailDelivery.sparkpost.setup.setupEmail\"),\n }}\n />\n }\n description={String(\n t(\"neetoEmailDelivery.sparkpost.setup.description\")\n )}\n >\n <div className=\"flex flex-col gap-6\">\n <Callout style=\"warning\">\n {t(\"neetoEmailDelivery.sparkpost.setup.note\")}\n </Callout>\n <Input\n required\n unlimitedChars\n label={t(\"neetoEmailDelivery.sparkpost.setup.emailLabel\")}\n name=\"email\"\n type=\"email\"\n helpText={t(\n \"neetoEmailDelivery.sparkpost.setup.emailHelp\",\n { domain }\n )}\n placeholder={t(\n \"neetoEmailDelivery.sparkpost.setup.emailPlaceholder\"\n )}\n />\n </div>\n </CardLayout>\n );\n }}\n </Form>\n </PageContent>\n </PageWrapper>\n );\n};\n\nexport default SparkpostDomainSetup;\n"],"names":["getDomainFromEmail","email","trim","split","SparkpostDomainSetup","_ref","ownerId","alreadyVerifiedRoute","verifyRoute","onCancelRoute","canManageIntegrations","_useTranslation","useTranslation","t","history","useHistory","_useSparkpostDomain","useSparkpostDomain","onCreateDomain","isCreating","handleSubmit","values","_ref2","setFieldError","response","alreadyVerified","push","domain","buildUrl","error","_error$response","errorMessage","data","handleCancel","_jsx","PageWrapper","children","PageContent","Form","className","formikProps","initialValues","validationSchema","VALIDATION_SCHEMA","onSubmit","_ref3","CardLayout","title","String","actionBlock","ActionBlock","cancelButtonProps","onClick","isSubmitting","submitButtonProps","label","description","_jsxs","Callout","style","Input","required","unlimitedChars","name","type","helpText","placeholder"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAMA,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAGC,KAAK,EAAA;AAAA,EAAA,OAAIA,KAAK,CAACC,IAAI,EAAE,CAACC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAAA,CAAA;;ACa9D,IAAMC,oBAAoB,GAAG,SAAvBA,oBAAoBA,CAAAC,IAAA,EAMpB;AAAA,EAAA,IALJC,OAAO,GAAAD,IAAA,CAAPC,OAAO;IACPC,oBAAoB,GAAAF,IAAA,CAApBE,oBAAoB;IACpBC,WAAW,GAAAH,IAAA,CAAXG,WAAW;IACXC,aAAa,GAAAJ,IAAA,CAAbI,aAAa;IACbC,qBAAqB,GAAAL,IAAA,CAArBK,qBAAqB;AAErB,EAAA,IAAAC,eAAA,GAAcC,cAAc,EAAE;IAAtBC,CAAC,GAAAF,eAAA,CAADE,CAAC;AAET,EAAA,IAAMC,OAAO,GAAGC,UAAU,EAAE;EAE5B,IAAAC,mBAAA,GAAuCC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A,SAAS,EAAC,qBAAqB;cAAAH,QAAA,EAAA,cAClCF,GAAA,CAACwB,OAAO,EAAA;AAACC,gBAAAA,KAAK,EAAC,SAAS;gBAAAvB,QAAA,EACrBvB,CAAC,CAAC,yCAAyC;AAAC,eACtC,CAAC,eACVqB,GAAA,CAAC0B,KAAK,EAAA;gBACJC,QAAQ,EAAA,IAAA;gBACRC,cAAc,EAAA,IAAA;AACdP,gBAAAA,KAAK,EAAE1C,CAAC,CAAC,+CAA+C,CAAE;AAC1DkD,gBAAAA,IAAI,EAAC,OAAO;AACZC,gBAAAA,IAAI,EAAC,OAAO;AACZC,gBAAAA,QAAQ,EAAEpD,CAAC,CACT,8CAA8C,EAC9C;AAAEc,kBAAAA,MAAM,EAANA;AAAO,iBACX,CAAE;gBACFuC,WAAW,EAAErD,CAAC,CACZ,qDACF;AAAE,eACH,CAAC;aACC;AAAC,WACI,CAAC;AAEjB;OACI;KACK;AAAC,GACH,CAAC;AAElB;;;;"}
1
+ {"version":3,"file":"SparkpostDomainSetup.js","sources":["../app/javascript/src/components/SparkpostDomain/utils.js","../app/javascript/src/components/SparkpostDomain/Setup.jsx"],"sourcesContent":["const getDomainFromEmail = email => email.trim().split(\"@\")[1];\n\nexport { getDomainFromEmail };\n","import { buildUrl } from \"neetocommons/utils\";\nimport CardLayout from \"neetomolecules/CardLayout\";\nimport { Callout } from \"neetoui\";\nimport { Input, ActionBlock, Form } from \"neetoui/formik\";\nimport { useTranslation } from \"react-i18next\";\nimport { useHistory } from \"react-router-dom\";\n\nimport { PageContent, PageWrapper } from \"components/PageLayout\";\nimport useSparkpostDomain from \"hooks/integrations/useSparkpostDomain\";\n\nimport { VALIDATION_SCHEMA, INITIAL_VALUES } from \"./constants\";\nimport { getDomainFromEmail } from \"./utils\";\n\nconst SparkpostDomainSetup = ({\n ownerId,\n alreadyVerifiedRoute,\n verifyRoute,\n onCancelRoute,\n canManageIntegrations,\n}) => {\n const { t } = useTranslation();\n\n const history = useHistory();\n\n const { onCreateDomain, isCreating } = useSparkpostDomain({\n ownerId,\n canManageIntegrations,\n });\n\n const handleSubmit = (values, { setFieldError }) => {\n onCreateDomain(\n values.email.trim(),\n values.displayName.trim(),\n response => {\n if (response?.alreadyVerified) {\n // Domain is already verified, go back to email delivery settings\n history.push(alreadyVerifiedRoute);\n } else {\n // Navigate to verification page with domain query parameter\n const domain = getDomainFromEmail(values.email);\n history.push(\n buildUrl(verifyRoute, { domain, email: values.email.trim() })\n );\n }\n },\n error => {\n const errorMessage =\n error?.response?.data?.error ||\n t(\"neetoEmailDelivery.sparkpost.setup.validation.setupFailed\");\n setFieldError(\"email\", errorMessage);\n }\n );\n };\n\n const handleCancel = () => {\n history.push(onCancelRoute);\n };\n\n return (\n <PageWrapper>\n <PageContent>\n <Form\n className=\"w-full\"\n formikProps={{\n initialValues: INITIAL_VALUES,\n validationSchema: VALIDATION_SCHEMA,\n onSubmit: handleSubmit,\n }}\n >\n {({ values }) => {\n const domain = values.email\n ? getDomainFromEmail(values.email)\n : t(\"neetoEmailDelivery.sparkpost.customDomain\");\n\n return (\n <CardLayout\n title={String(t(\"neetoEmailDelivery.sparkpost.setup.title\"))}\n actionBlock={\n <ActionBlock\n cancelButtonProps={{ onClick: handleCancel }}\n isSubmitting={isCreating}\n submitButtonProps={{\n label: t(\"neetoEmailDelivery.sparkpost.setup.setupEmail\"),\n }}\n />\n }\n description={String(\n t(\"neetoEmailDelivery.sparkpost.setup.description\")\n )}\n >\n <div className=\"flex flex-col gap-6\">\n <Callout style=\"warning\">\n {t(\"neetoEmailDelivery.sparkpost.setup.note\")}\n </Callout>\n <Input\n required\n unlimitedChars\n label={t(\"neetoEmailDelivery.sparkpost.setup.emailLabel\")}\n name=\"email\"\n type=\"email\"\n helpText={t(\n \"neetoEmailDelivery.sparkpost.setup.emailHelp\",\n { domain }\n )}\n placeholder={t(\n \"neetoEmailDelivery.sparkpost.setup.emailPlaceholder\"\n )}\n />\n <Input\n required\n name=\"displayName\"\n helpText={t(\n \"neetoEmailDelivery.sparkpost.setup.displayNameHelp\"\n )}\n label={t(\n \"neetoEmailDelivery.sparkpost.setup.displayNameLabel\"\n )}\n />\n </div>\n </CardLayout>\n );\n }}\n </Form>\n </PageContent>\n </PageWrapper>\n );\n};\n\nexport default SparkpostDomainSetup;\n"],"names":["getDomainFromEmail","email","trim","split","SparkpostDomainSetup","_ref","ownerId","alreadyVerifiedRoute","verifyRoute","onCancelRoute","canManageIntegrations","_useTranslation","useTranslation","t","history","useHistory","_useSparkpostDomain","useSparkpostDomain","onCreateDomain","isCreating","handleSubmit","values","_ref2","setFieldError","displayName","response","alreadyVerified","push","domain","buildUrl","error","_error$response","errorMessage","data","handleCancel","_jsx","PageWrapper","children","PageContent","Form","className","formikProps","initialValues","INITIAL_VALUES","validationSchema","VALIDATION_SCHEMA","onSubmit","_ref3","CardLayout","title","String","actionBlock","ActionBlock","cancelButtonProps","onClick","isSubmitting","submitButtonProps","label","description","_jsxs","Callout","style","Input","required","unlimitedChars","name","type","helpText","placeholder"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAMA,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAGC,KAAK,EAAA;AAAA,EAAA,OAAIA,KAAK,CAACC,IAAI,EAAE,CAACC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAAA,CAAA;;ACa9D,IAAMC,oBAAoB,GAAG,SAAvBA,oBAAoBA,CAAAC,IAAA,EAMpB;AAAA,EAAA,IALJC,OAAO,GAAAD,IAAA,CAAPC,OAAO;IACPC,oBAAoB,GAAAF,IAAA,CAApBE,oBAAoB;IACpBC,WAAW,GAAAH,IAAA,CAAXG,WAAW;IACXC,aAAa,GAAAJ,IAAA,CAAbI,aAAa;IACbC,qBAAqB,GAAAL,IAAA,CAArBK,qBAAqB;AAErB,EAAA,IAAAC,eAAA,GAAcC,cAAc,EAAE;IAAtBC,CAAC,GAAAF,eAAA,CAADE,CAAC;AAET,EAAA,IAAMC,OAAO,GAAG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AAE;AAAAwB,YAAAA,QAAA,eAEFsB,IAAA,CAAA,KAAA,EAAA;AAAKnB,cAAAA,SAAS,EAAC,qBAAqB;cAAAH,QAAA,EAAA,cAClCF,GAAA,CAACyB,OAAO,EAAA;AAACC,gBAAAA,KAAK,EAAC,SAAS;gBAAAxB,QAAA,EACrBxB,CAAC,CAAC,yCAAyC;AAAC,eACtC,CAAC,eACVsB,GAAA,CAAC2B,KAAK,EAAA;gBACJC,QAAQ,EAAA,IAAA;gBACRC,cAAc,EAAA,IAAA;AACdP,gBAAAA,KAAK,EAAE5C,CAAC,CAAC,+CAA+C,CAAE;AAC1DoD,gBAAAA,IAAI,EAAC,OAAO;AACZC,gBAAAA,IAAI,EAAC,OAAO;AACZC,gBAAAA,QAAQ,EAAEtD,CAAC,CACT,8CAA8C,EAC9C;AAAEe,kBAAAA,MAAM,EAANA;AAAO,iBACX,CAAE;gBACFwC,WAAW,EAAEvD,CAAC,CACZ,qDACF;AAAE,eACH,CAAC,eACFsB,GAAA,CAAC2B,KAAK,EAAA;gBACJC,QAAQ,EAAA,IAAA;AACRE,gBAAAA,IAAI,EAAC,aAAa;AAClBE,gBAAAA,QAAQ,EAAEtD,CAAC,CACT,oDACF,CAAE;gBACF4C,KAAK,EAAE5C,CAAC,CACN,qDACF;AAAE,eACH,CAAC;aACC;AAAC,WACI,CAAC;AAEjB;OACI;KACK;AAAC,GACH,CAAC;AAElB;;;;"}
@@ -6,8 +6,8 @@ import Spinner from '@bigbinary/neetoui/Spinner';
6
6
  import { isEmpty, pathOr } from 'ramda';
7
7
  import { useTranslation } from 'react-i18next';
8
8
  import { useHistory } from 'react-router-dom';
9
- import { b as PURPOSE_COLORS, D as DEFAULT_COLOR, c as VERIFICATION_STATUS_CONFIG, d as VERIFICATION_STATUSES, P as PageWrapper, a as PageContent } from './constants-Cvxv8ly7.js';
10
- import { u as useSparkpostDomain } from './useSparkpostDomain-CuX-Gl5a.js';
9
+ import { b as PURPOSE_COLORS, D as DEFAULT_COLOR, c as VERIFICATION_STATUS_CONFIG, d as VERIFICATION_STATUSES, P as PageWrapper, a as PageContent } from './constants-DbB8UFcr.js';
10
+ import { u as useSparkpostDomain } from './useSparkpostDomain-De-Fz3ek.js';
11
11
  import { u as useFetchSparkpostDomain } from './useSparkpostApi-qpRhsK7H.js';
12
12
  import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
13
13
  import Typography from '@bigbinary/neetoui/Typography';
@@ -26,7 +26,7 @@ var i18next = require('i18next');
26
26
  var yup = require('yup');
27
27
  var jsxRuntime = require('react/jsx-runtime');
28
28
  var reactQuery = require('@tanstack/react-query');
29
- var useSparkpostDomain = require('../useSparkpostDomain-Brk7SmL4.js');
29
+ var useSparkpostDomain = require('../useSparkpostDomain-DtEcunpG.js');
30
30
  var Button = require('@bigbinary/neetoui/Button');
31
31
  var Tag = require('@bigbinary/neetoui/Tag');
32
32
  require('@babel/runtime/helpers/defineProperty');
@@ -332,7 +332,11 @@ var IntegrationCard = function IntegrationCard(_ref) {
332
332
  _ref$connectedTagText = _ref.connectedTagText,
333
333
  connectedTagText = _ref$connectedTagText === void 0 ? "neetoEmailDelivery.sparkpost.emailDelivery.connected" : _ref$connectedTagText,
334
334
  _ref$showDisconnect = _ref.showDisconnect,
335
- showDisconnect = _ref$showDisconnect === void 0 ? false : _ref$showDisconnect;
335
+ showDisconnect = _ref$showDisconnect === void 0 ? false : _ref$showDisconnect,
336
+ _ref$showManageButton = _ref.showManageButton,
337
+ showManageButton = _ref$showManageButton === void 0 ? false : _ref$showManageButton,
338
+ manageButtonText = _ref.manageButtonText,
339
+ onManage = _ref.onManage;
336
340
  var _useTranslation = reactI18next.useTranslation(),
337
341
  t = _useTranslation.t;
338
342
  var shouldShowDisconnect = isConnected || showDisconnect;
@@ -361,9 +365,15 @@ var IntegrationCard = function IntegrationCard(_ref) {
361
365
  }), /*#__PURE__*/jsxRuntime.jsx(Typography, {
362
366
  style: "body2",
363
367
  children: description
364
- }), connectButtonText && /*#__PURE__*/jsxRuntime.jsx("div", {
368
+ }), connectButtonText && /*#__PURE__*/jsxRuntime.jsxs("div", {
365
369
  className: "flex gap-2",
366
- children: shouldShowDisconnect ? /*#__PURE__*/jsxRuntime.jsx(Button, {
370
+ children: [showManageButton && /*#__PURE__*/jsxRuntime.jsx(Button, {
371
+ "data-cy": "manage-button",
372
+ label: t(manageButtonText),
373
+ size: "small",
374
+ style: "secondary",
375
+ onClick: onManage
376
+ }), shouldShowDisconnect ? /*#__PURE__*/jsxRuntime.jsx(Button, {
367
377
  "data-cy": "disconnect-button",
368
378
  label: t(disconnectButtonText),
369
379
  loading: isDisconnecting,
@@ -376,7 +386,7 @@ var IntegrationCard = function IntegrationCard(_ref) {
376
386
  size: "small",
377
387
  style: "primary",
378
388
  onClick: onConnect
379
- })
389
+ })]
380
390
  })]
381
391
  })
382
392
  });
@@ -386,6 +396,7 @@ var EmailDeliveryScreen = function EmailDeliveryScreen(_ref) {
386
396
  var indexRoute = _ref.indexRoute,
387
397
  ownerId = _ref.ownerId,
388
398
  ownDomainSetupRoute = _ref.ownDomainSetupRoute,
399
+ ownDomainVerifyRoute = _ref.ownDomainVerifyRoute,
389
400
  canManageIntegrations = _ref.canManageIntegrations;
390
401
  var _useTranslation = reactI18next.useTranslation(),
391
402
  t = _useTranslation.t;
@@ -460,6 +471,7 @@ var EmailDeliveryScreen = function EmailDeliveryScreen(_ref) {
460
471
  var showOutlook = noneExists || isOutlookExists;
461
472
  var showSparkpost = noneExists || isSparkpostExists;
462
473
  var showSmtp = noneExists || isSmtpExists;
474
+ var sparkpostVerificationPending = isSparkpostExists && !isSparkpostConnected;
463
475
  var handleGmailConnect = function handleGmailConnect() {
464
476
  window.location.href = utils.buildUrl(useSparkpostApi.GMAIL_OAUTH_CONNECT_URL, {
465
477
  ownerId: ownerId
@@ -482,7 +494,14 @@ var EmailDeliveryScreen = function EmailDeliveryScreen(_ref) {
482
494
  var gmailEmail = ramda.prop("email", gmailData);
483
495
  var outlookEmail = ramda.prop("email", outlookData);
484
496
  var sparkpostEmail = ramda.prop("email", sparkpostData);
497
+ var sparkpostDomain = ramda.prop("domain", sparkpostData);
485
498
  var smtpEmail = ramda.prop("email", smtpData);
499
+ var showVerificationPage = function showVerificationPage() {
500
+ history.push(utils.buildUrl(ownDomainVerifyRoute, {
501
+ domain: sparkpostDomain,
502
+ email: sparkpostEmail
503
+ }));
504
+ };
486
505
  var gmailTitle = t("neetoEmailDelivery.gmail.title");
487
506
  var gmailDescription = isGmailConnected ? t("neetoEmailDelivery.sparkpost.emailDelivery.connectedEmail", {
488
507
  email: gmailEmail
@@ -537,9 +556,13 @@ var EmailDeliveryScreen = function EmailDeliveryScreen(_ref) {
537
556
  icon: MailSend,
538
557
  isConnected: isSparkpostConnected,
539
558
  isDisconnecting: isSparkpostDisconnecting,
559
+ manageButtonText: "neetoEmailDelivery.sparkpost.emailDelivery.continueVerification",
560
+ showManageButton: sparkpostVerificationPending,
540
561
  title: ownDomainTitle,
562
+ showDisconnect: sparkpostVerificationPending || isSparkpostConnected,
541
563
  onConnect: handleOwnDomainConnect,
542
- onDisconnect: onSparkpostDisconnect
564
+ onDisconnect: onSparkpostDisconnect,
565
+ onManage: showVerificationPage
543
566
  }), showSmtp && /*#__PURE__*/jsxRuntime.jsx(IntegrationCard, {
544
567
  connectButtonText: "neetoEmailDelivery.smtp.connectSmtp",
545
568
  description: smtpDescription,
@@ -558,6 +581,11 @@ var EmailDeliveryScreen = function EmailDeliveryScreen(_ref) {
558
581
  children: t("neetoEmailDelivery.outlook.waitingForTestEmail", {
559
582
  email: outlookEmail
560
583
  })
584
+ }), sparkpostVerificationPending && /*#__PURE__*/jsxRuntime.jsx(Callout, {
585
+ style: "warning",
586
+ children: t("neetoEmailDelivery.sparkpost.emailDelivery.verificationPending", {
587
+ domain: sparkpostDomain
588
+ })
561
589
  }), isOutlookShadowAccount && /*#__PURE__*/jsxRuntime.jsx(Callout, {
562
590
  style: "warning",
563
591
  children: t("neetoEmailDelivery.outlook.shadowAccountMessage", {