@bigbinary/neeto-email-delivery-frontend 1.0.30 → 1.0.33

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Verify-Cbn8WE7T.js","sources":["../app/javascript/src/components/SparkpostDomain/RecordField.jsx","../app/javascript/src/components/SparkpostDomain/DnsRecordsSection.jsx","../app/javascript/src/components/SparkpostDomain/VerificationActions.jsx","../app/javascript/src/components/SparkpostDomain/VerificationInstructions.jsx","../app/javascript/src/components/SparkpostDomain/VerificationStatusCallout.jsx","../app/javascript/src/components/SparkpostDomain/Verify.jsx"],"sourcesContent":["import CopyToClipboardButton from \"neetomolecules/CopyToClipboardButton\";\nimport { Typography } from \"neetoui\";\n\nconst RecordField = ({ label, value, dataTestid }) => (\n <div className=\"flex w-full flex-col gap-1\">\n <div className=\"flex items-center justify-between\">\n <Typography style=\"h6\">{label}</Typography>\n </div>\n <code\n className=\"neeto-ui-text-gray-800 neeto-ui-bg-gray-100 neeto-ui-rounded-md relative block p-2 pe-10 font-mono text-xs break-all\"\n data-testid={dataTestid}\n >\n {value}\n <CopyToClipboardButton\n {...{ value }}\n className=\"absolute top-1 end-1 shrink-0\"\n style=\"tertiary\"\n />\n </code>\n </div>\n);\n\nexport default RecordField;\n","import { Typography, Tag } from \"neetoui\";\nimport { isEmpty } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { PURPOSE_COLORS, DEFAULT_COLOR } from \"./constants\";\nimport RecordField from \"./RecordField\";\n\nconst DnsRecordsSection = ({\n dnsRecords,\n domain,\n sparkpostData,\n showTitle = true,\n}) => {\n const { t } = useTranslation();\n\n const formatPurpose = purpose => {\n switch (purpose) {\n case \"dkim\":\n return t(\"neetoEmailDelivery.sparkpost.dnsRecords.dkimSigning\");\n case \"txt\":\n return t(\"neetoEmailDelivery.sparkpost.dnsRecords.txtVerification\");\n default:\n return purpose;\n }\n };\n\n const formatRecordName = hostname => {\n if (!hostname) return \"\";\n\n return hostname.endsWith(`.${domain}`) ? hostname : `${hostname}.${domain}`;\n };\n\n const { status, txtVerificationValue, txtVerificationHostname } =\n sparkpostData;\n\n const allRecords = [];\n const isTxtUnverified = status === \"txt_unverified\";\n\n if (isTxtUnverified) {\n if (txtVerificationValue && txtVerificationHostname) {\n allRecords.push({\n type: \"TXT\",\n purpose: \"txt\",\n hostname: txtVerificationHostname,\n value: txtVerificationValue,\n });\n }\n } else {\n allRecords.push(...dnsRecords);\n }\n\n if (isEmpty(allRecords)) {\n return (\n <div className=\"p-8 text-center\">\n <Typography className=\"neeto-ui-text-gray-600\" style=\"body2\">\n {sparkpostData?.connected\n ? t(\"neetoEmailDelivery.sparkpost.dnsRecords.alreadyVerified\")\n : t(\"neetoEmailDelivery.sparkpost.dnsRecords.loading\")}\n </Typography>\n </div>\n );\n }\n\n return (\n <div className=\"flex flex-col gap-2\">\n {showTitle && (\n <Typography style=\"h4\" weight=\"medium\">\n {t(\"neetoEmailDelivery.sparkpost.dnsRecords.title\")}\n </Typography>\n )}\n {allRecords.map((record, index) => (\n <div\n className=\"neeto-ui-rounded-lg neeto-ui-bg-white neeto-ui-border-gray-300 border p-2\"\n key={index}\n >\n <div className=\"mb-2 flex items-center justify-between\">\n <div className=\"flex items-center gap-2\">\n <Tag\n label={formatPurpose(record.purpose)}\n size=\"small\"\n style={PURPOSE_COLORS[record.purpose] || DEFAULT_COLOR}\n />\n <Tag label={record.type} size=\"small\" style=\"secondary\" />\n </div>\n </div>\n <div className=\"flex flex-col gap-2\">\n <RecordField\n dataTestid=\"record-name\"\n label={t(\"neetoEmailDelivery.sparkpost.dnsRecords.nameLabel\")}\n value={formatRecordName(record.hostname)}\n />\n <RecordField\n dataTestid=\"record-value\"\n label={t(\"neetoEmailDelivery.sparkpost.dnsRecords.valueLabel\")}\n value={record.value}\n />\n </div>\n </div>\n ))}\n </div>\n );\n};\n\nexport default DnsRecordsSection;\n","import { withT } from \"neetocommons/react-utils\";\nimport { Button } from \"neetoui\";\n\nconst VerificationActions = withT(\n ({ t, isVerifying, verificationStatus, onVerify, onCancel }) => (\n <div className=\"flex gap-3\">\n <Button\n data-testid=\"verify-domain-button\"\n disabled={isVerifying || verificationStatus === \"success\"}\n loading={isVerifying}\n onClick={onVerify}\n >\n {isVerifying\n ? t(\"neetoEmailDelivery.sparkpost.verify.verifying\")\n : t(\"neetoEmailDelivery.sparkpost.verify.verifyDomain\")}\n </Button>\n <Button\n data-testid=\"cancel-button\"\n disabled={isVerifying}\n style=\"secondary\"\n onClick={onCancel}\n >\n {t(\"neetoEmailDelivery.sparkpost.verify.cancel\")}\n </Button>\n </div>\n )\n);\n\nexport default VerificationActions;\n","import { Typography, Callout } from \"neetoui\";\nimport { useTranslation } from \"react-i18next\";\n\nconst VerificationInstructions = () => {\n const { t } = useTranslation();\n\n const instructionText = t(\n \"neetoEmailDelivery.sparkpost.instructions.fullText\"\n );\n const lines = instructionText.split(\"\\n\");\n\n return (\n <Callout style=\"info\">\n <div className=\"w-full\">\n <Typography style=\"body2\">\n {lines.map((line, index) => (\n <span key={index}>\n {line}\n {index < lines.length - 1 && <br />}\n </span>\n ))}\n </Typography>\n </div>\n </Callout>\n );\n};\n\nexport default VerificationInstructions;\n","import { Callout, Typography } from \"neetoui\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { VERIFICATION_STATUS_CONFIG } from \"./constants\";\n\nconst VerificationStatusCallout = ({ verificationStatus }) => {\n const { t } = useTranslation();\n\n const config = VERIFICATION_STATUS_CONFIG[verificationStatus];\n\n if (!config) return null;\n\n return (\n <Callout style={config.style}>\n <div className=\"space-y-1\">\n <Typography style=\"body2\" weight=\"medium\">\n {t(config.titleKey)}\n </Typography>\n <Typography style=\"body3\">{t(config.descriptionKey)}</Typography>\n </div>\n </Callout>\n );\n};\n\nexport default VerificationStatusCallout;\n","import { useState, useEffect } from \"react\";\n\nimport { useQueryParams } from \"neetocommons/react-utils\";\nimport CardLayout from \"neetomolecules/CardLayout\";\nimport { Spinner } from \"neetoui\";\nimport { pathOr } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\nimport { useHistory } from \"react-router-dom\";\n\nimport { PageContent, PageWrapper } from \"components/PageLayout\";\nimport useSparkpostDomain from \"hooks/integrations/useSparkpostDomain\";\nimport { useFetchConnectedIntegration } from \"hooks/reactQuery/integrations/useEmailDeliveryIntegrationApi\";\nimport { useFetchSparkpostDomain } from \"hooks/reactQuery/integrations/useSparkpostApi\";\n\nimport { VERIFICATION_STATUSES } from \"./constants\";\nimport DnsRecordsSection from \"./DnsRecordsSection\";\nimport VerificationActions from \"./VerificationActions\";\nimport VerificationInstructions from \"./VerificationInstructions\";\nimport VerificationStatusCallout from \"./VerificationStatusCallout\";\n\nconst SparkpostDomainVerify = ({\n ownerId,\n canManageIntegrations,\n emailDeliveryIndexRoute,\n}) => {\n const [verificationStatus, setVerificationStatus] = useState(\"\");\n const { t } = useTranslation();\n\n const history = useHistory();\n\n const { integration, isLoading: isIntegrationLoading } =\n useFetchConnectedIntegration(ownerId);\n\n const hasConnectedIntegration = integration && !integration.isPending;\n\n const { domain: queryDomain } = useQueryParams();\n\n const { data: sparkpostData, isLoading } = useFetchSparkpostDomain(ownerId);\n const { onVerifyDomain, isVerifying } = useSparkpostDomain({\n ownerId,\n canManageIntegrations,\n });\n\n const domain = pathOr(queryDomain, [\"domain\"], sparkpostData);\n const dnsRecords = pathOr([], [\"verificationRecords\"], sparkpostData);\n\n useEffect(() => {\n // Check if domain is already verified\n if (!sparkpostData?.connected) return;\n setVerificationStatus(VERIFICATION_STATUSES.SUCCESS);\n setTimeout(() => {\n history.push(emailDeliveryIndexRoute);\n }, 5000);\n }, [sparkpostData, emailDeliveryIndexRoute, history]);\n\n const handleVerify = () => {\n onVerifyDomain(\n response => {\n if (response?.status === \"active\") {\n setVerificationStatus(VERIFICATION_STATUSES.SUCCESS);\n setTimeout(() => {\n history.push(emailDeliveryIndexRoute);\n }, 3000);\n } else {\n setVerificationStatus(VERIFICATION_STATUSES.PENDING);\n }\n },\n _error => {\n setVerificationStatus(VERIFICATION_STATUSES.ERROR);\n }\n );\n };\n\n const isVerificationSuccessful =\n verificationStatus === VERIFICATION_STATUSES.SUCCESS;\n\n const handleCancel = () => {\n history.push(emailDeliveryIndexRoute);\n };\n\n if (isLoading || isIntegrationLoading) {\n return (\n <div className=\"flex justify-center p-6\">\n <Spinner />\n </div>\n );\n }\n\n if (hasConnectedIntegration) {\n history.replace(emailDeliveryIndexRoute);\n\n return null;\n }\n\n return (\n <PageWrapper>\n <PageContent>\n <CardLayout\n title={t(\"neetoEmailDelivery.sparkpost.verify.title\")}\n actionBlock={\n <VerificationActions\n {...{ isVerifying, verificationStatus }}\n onCancel={handleCancel}\n onVerify={handleVerify}\n />\n }\n description={t(\"neetoEmailDelivery.sparkpost.verify.description\", {\n domain,\n }).replace(/<strong>|<\\/strong>/g, \"\")}\n >\n <div className=\"flex flex-col gap-4\">\n <VerificationStatusCallout {...{ verificationStatus }} />\n {!isVerificationSuccessful && (\n <>\n <DnsRecordsSection {...{ dnsRecords, domain, sparkpostData }} />\n <VerificationInstructions />\n </>\n )}\n </div>\n </CardLayout>\n </PageContent>\n </PageWrapper>\n );\n};\n\nexport default SparkpostDomainVerify;\n"],"names":["RecordField","_ref","label","value","dataTestid","_jsxs","className","children","_jsx","Typography","style","CopyToClipboardButton","DnsRecordsSection","dnsRecords","domain","sparkpostData","_ref$showTitle","showTitle","_useTranslation","useTranslation","t","formatPurpose","purpose","formatRecordName","hostname","endsWith","concat","status","txtVerificationValue","txtVerificationHostname","allRecords","isTxtUnverified","push","type","apply","_toConsumableArray","isEmpty","connected","weight","map","record","index","Tag","size","PURPOSE_COLORS","DEFAULT_COLOR","VerificationActions","withT","isVerifying","verificationStatus","onVerify","onCancel","Button","disabled","loading","onClick","VerificationInstructions","instructionText","lines","split","Callout","line","length","VerificationStatusCallout","config","VERIFICATION_STATUS_CONFIG","titleKey","descriptionKey","SparkpostDomainVerify","ownerId","canManageIntegrations","emailDeliveryIndexRoute","_useState","useState","_useState2","_slicedToArray","setVerificationStatus","history","useHistory","_useFetchConnectedInt","useFetchConnectedIntegration","integration","isIntegrationLoading","isLoading","hasConnectedIntegration","isPending","_useQueryParams","useQueryParams","queryDomain","_useFetchSparkpostDom","useFetchSparkpostDomain","data","_useSparkpostDomain","useSparkpostDomain","onVerifyDomain","pathOr","useEffect","VERIFICATION_STATUSES","SUCCESS","setTimeout","handleVerify","response","PENDING","_error","ERROR","isVerificationSuccessful","handleCancel","Spinner","replace","PageWrapper","PageContent","CardLayout","title","actionBlock","description","_Fragment"],"mappings":";;;;;;;;;;;;;;;;;;;;AAGA,IAAMA,WAAW,GAAG,SAAdA,WAAWA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAAMC,KAAK,GAAAD,IAAA,CAALC,KAAK;IAAEC,KAAK,GAAAF,IAAA,CAALE,KAAK;IAAEC,UAAU,GAAAH,IAAA,CAAVG,UAAU;AAAA,EAAA,oBAC7CC,IAAA,CAAA,KAAA,EAAA;AAAKC,IAAAA,SAAS,EAAC,4BAA4B;AAAAC,IAAAA,QAAA,gBACzCC,GAAA,CAAA,KAAA,EAAA;AAAKF,MAAAA,SAAS,EAAC,mCAAmC;MAAAC,QAAA,eAChDC,GAAA,CAACC,UAAU,EAAA;AAACC,QAAAA,KAAK,EAAC,IAAI;AAAAH,QAAAA,QAAA,EAAEL;OAAkB;KACvC,CAAC,eACNG,IAAA,CAAA,MAAA,EAAA;AACEC,MAAAA,SAAS,EAAC,sHAAsH;AAChI,MAAA,aAAA,EAAaF,UAAW;AAAAG,MAAAA,QAAA,EAAA,CAEvBJ,KAAK,eACNK,GAAA,CAACG,qBAAqB,EAAA;AACdR,QAAAA,KAAK,EAALA,KAAK;AACXG,QAAAA,SAAS,EAAC,+BAA+B;AACzCI,QAAAA,KAAK,EAAC;AAAU,OACjB,CAAC;AAAA,KACE,CAAC;AAAA,GACJ,CAAC;AAAA,CACP;;ACbD,IAAME,iBAAiB,G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AlBA;AAAkB,WAAK,CAAC,EACxD,CAACwD,wBAAwB,iBACxBpG,IAAA,CAAA8G,QAAA,EAAA;YAAA5G,QAAA,EAAA,cACEC,GAAA,CAACI,iBAAiB,EAAA;AAAOC,cAAAA,UAAU,EAAVA,UAAU;AAAEC,cAAAA,MAAM,EAANA,MAAM;AAAEC,cAAAA,aAAa,EAAbA;AAAa,aAAK,CAAC,eAChEP,GAAA,CAACgD,wBAAwB,IAAE,CAAC;AAAA,WAC5B,CACH;SACE;OACK;KACD;AAAC,GACH,CAAC;AAElB;;;;"}
@@ -5,7 +5,7 @@ require('@bigbinary/neeto-icons/misc/Gmail');
5
5
  require('@bigbinary/neeto-icons/misc/Outlook');
6
6
  require('@bigbinary/neetoui/Spinner');
7
7
  require('react-i18next');
8
- var EmailDeliveryScreen = require('../index-53D1H-cp.js');
8
+ var EmailDeliveryScreen = require('../index-YMe54v79.js');
9
9
  require('../useSparkpostDomain-CXs_VuGP.js');
10
10
  require('react/jsx-runtime');
11
11
  require('@babel/runtime/helpers/slicedToArray');
@@ -9,18 +9,18 @@ var ActionBlock = require('@bigbinary/neetoui/formik/ActionBlock');
9
9
  var Form = require('@bigbinary/neetoui/formik/Form');
10
10
  var reactI18next = require('react-i18next');
11
11
  var reactRouterDom = require('react-router-dom');
12
- var constants = require('../constants-DPhFGbtO.js');
12
+ var PageLayout = require('../PageLayout-CUMq2CmP.js');
13
13
  var useSparkpostDomain = require('../useSparkpostDomain-CXs_VuGP.js');
14
14
  var useEmailDeliveryIntegrationApi = require('../useEmailDeliveryIntegrationApi-BcQDhMIH.js');
15
15
  var jsxRuntime = require('react/jsx-runtime');
16
+ require('i18next');
17
+ require('yup');
16
18
  require('@babel/runtime/helpers/defineProperty');
17
19
  require('@babel/runtime/helpers/objectWithoutProperties');
18
20
  require('react');
19
21
  require('classnames');
20
22
  require('@bigbinary/neeto-molecules/Container');
21
23
  require('@bigbinary/neeto-molecules/Header');
22
- require('i18next');
23
- require('yup');
24
24
  require('@babel/runtime/helpers/slicedToArray');
25
25
  require('@tanstack/react-query');
26
26
  require('@bigbinary/neetoui/Toastr');
@@ -86,13 +86,13 @@ var SparkpostDomainSetup = function SparkpostDomainSetup(_ref) {
86
86
  history.replace(onCancelRoute);
87
87
  return null;
88
88
  }
89
- return /*#__PURE__*/jsxRuntime.jsx(constants.PageWrapper, {
90
- children: /*#__PURE__*/jsxRuntime.jsx(constants.PageContent, {
89
+ return /*#__PURE__*/jsxRuntime.jsx(PageLayout.PageWrapper, {
90
+ children: /*#__PURE__*/jsxRuntime.jsx(PageLayout.PageContent, {
91
91
  children: /*#__PURE__*/jsxRuntime.jsx(Form, {
92
92
  className: "w-full",
93
93
  formikProps: {
94
- initialValues: constants.INITIAL_VALUES,
95
- validationSchema: constants.VALIDATION_SCHEMA,
94
+ initialValues: PageLayout.INITIAL_VALUES,
95
+ validationSchema: PageLayout.VALIDATION_SCHEMA,
96
96
  onSubmit: handleSubmit
97
97
  },
98
98
  children: function children(_ref3) {
@@ -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, Spinner } 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\";\nimport { useFetchConnectedIntegration } from \"hooks/reactQuery/integrations/useEmailDeliveryIntegrationApi\";\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 { integration, isLoading: isIntegrationLoading } =\n useFetchConnectedIntegration(ownerId);\n\n const hasConnectedIntegration = integration && !integration.isPending;\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 if (isIntegrationLoading) {\n return (\n <div className=\"flex justify-center p-6\">\n <Spinner />\n </div>\n );\n }\n\n if (hasConnectedIntegration) {\n history.replace(onCancelRoute);\n\n return null;\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","_useFetchConnectedInt","useFetchConnectedIntegration","integration","isIntegrationLoading","isLoading","hasConnectedIntegration","isPending","_useSparkpostDomain","useSparkpostDomain","onCreateDomain","isCreating","handleSubmit","values","_ref2","setFieldError","displayName","response","alreadyVerified","push","domain","buildUrl","error","_error$response","errorMessage","data","handleCancel","_jsx","className","children","Spinner","replace","PageWrapper","PageContent","Form","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;;ACc9D,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AA;gBACJC,QAAQ,EAAA,IAAA;gBACRC,cAAc,EAAA,IAAA;AACdP,gBAAAA,KAAK,EAAErD,CAAC,CAAC,+CAA+C,CAAE;AAC1D6D,gBAAAA,IAAI,EAAC,OAAO;AACZC,gBAAAA,IAAI,EAAC,OAAO;AACZC,gBAAAA,QAAQ,EAAE/D,CAAC,CACT,8CAA8C,EAC9C;AAAEsB,kBAAAA,MAAM,EAANA;AAAO,iBACX,CAAE;gBACF0C,WAAW,EAAEhE,CAAC,CACZ,qDACF;AAAE,eACH,CAAC,eACF6B,cAAA,CAAC6B,KAAK,EAAA;gBACJC,QAAQ,EAAA,IAAA;AACRE,gBAAAA,IAAI,EAAC,aAAa;AAClBE,gBAAAA,QAAQ,EAAE/D,CAAC,CACT,oDACF,CAAE;gBACFqD,KAAK,EAAErD,CAAC,CACN,qDACF;AAAE,eACH,CAAC;aACC;AAAC,WACI,CAAC;AAEjB,QAAA;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, Spinner } 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\";\nimport { useFetchConnectedIntegration } from \"hooks/reactQuery/integrations/useEmailDeliveryIntegrationApi\";\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 { integration, isLoading: isIntegrationLoading } =\n useFetchConnectedIntegration(ownerId);\n\n const hasConnectedIntegration = integration && !integration.isPending;\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 if (isIntegrationLoading) {\n return (\n <div className=\"flex justify-center p-6\">\n <Spinner />\n </div>\n );\n }\n\n if (hasConnectedIntegration) {\n history.replace(onCancelRoute);\n\n return null;\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","_useFetchConnectedInt","useFetchConnectedIntegration","integration","isIntegrationLoading","isLoading","hasConnectedIntegration","isPending","_useSparkpostDomain","useSparkpostDomain","onCreateDomain","isCreating","handleSubmit","values","_ref2","setFieldError","displayName","response","alreadyVerified","push","domain","buildUrl","error","_error$response","errorMessage","data","handleCancel","_jsx","className","children","Spinner","replace","PageWrapper","PageContent","Form","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;;ACc9D,IAAMC,oBAA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AAQ,EAAA,IAAA;gBACRC,cAAc,EAAA,IAAA;AACdP,gBAAAA,KAAK,EAAErD,CAAC,CAAC,+CAA+C,CAAE;AAC1D6D,gBAAAA,IAAI,EAAC,OAAO;AACZC,gBAAAA,IAAI,EAAC,OAAO;AACZC,gBAAAA,QAAQ,EAAE/D,CAAC,CACT,8CAA8C,EAC9C;AAAEsB,kBAAAA,MAAM,EAANA;AAAO,iBACX,CAAE;gBACF0C,WAAW,EAAEhE,CAAC,CACZ,qDACF;AAAE,eACH,CAAC,eACF6B,cAAA,CAAC6B,KAAK,EAAA;gBACJC,QAAQ,EAAA,IAAA;AACRE,gBAAAA,IAAI,EAAC,aAAa;AAClBE,gBAAAA,QAAQ,EAAE/D,CAAC,CACT,oDACF,CAAE;gBACFqD,KAAK,EAAErD,CAAC,CACN,qDACF;AAAE,eACH,CAAC;aACC;AAAC,WACI,CAAC;AAEjB,QAAA;OACI;KACK;AAAC,GACH,CAAC;AAElB;;;;"}
@@ -1,308 +1,39 @@
1
1
  'use strict';
2
2
 
3
- var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
4
- var react = require('react');
5
- var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
6
- var CardLayout = require('@bigbinary/neeto-molecules/CardLayout');
7
- var Spinner = require('@bigbinary/neetoui/Spinner');
8
- var ramda = require('ramda');
9
- var reactI18next = require('react-i18next');
10
- var reactRouterDom = require('react-router-dom');
11
- var constants = require('../constants-DPhFGbtO.js');
12
- var useSparkpostDomain = require('../useSparkpostDomain-CXs_VuGP.js');
13
- var useEmailDeliveryIntegrationApi = require('../useEmailDeliveryIntegrationApi-BcQDhMIH.js');
14
- var useSparkpostApi = require('../useSparkpostApi-DlgW14Wu.js');
15
- var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
16
- var Typography = require('@bigbinary/neetoui/Typography');
17
- var Tag = require('@bigbinary/neetoui/Tag');
18
- var CopyToClipboardButton = require('@bigbinary/neeto-molecules/CopyToClipboardButton');
19
- var jsxRuntime = require('react/jsx-runtime');
20
- var Button = require('@bigbinary/neetoui/Button');
21
- var Callout = require('@bigbinary/neetoui/Callout');
3
+ require('@babel/runtime/helpers/slicedToArray');
4
+ require('react');
5
+ require('@bigbinary/neeto-commons-frontend/react-utils');
6
+ require('@bigbinary/neeto-molecules/CardLayout');
7
+ require('@bigbinary/neetoui/Spinner');
8
+ require('ramda');
9
+ require('react-i18next');
10
+ require('react-router-dom');
11
+ require('../PageLayout-CUMq2CmP.js');
12
+ require('../useSparkpostDomain-CXs_VuGP.js');
13
+ require('../useEmailDeliveryIntegrationApi-BcQDhMIH.js');
14
+ require('../useSparkpostApi-DlgW14Wu.js');
15
+ var SparkpostDomainVerify = require('../Verify-BDOXn-By.js');
16
+ require('react/jsx-runtime');
17
+ require('i18next');
18
+ require('yup');
22
19
  require('@babel/runtime/helpers/defineProperty');
23
20
  require('@babel/runtime/helpers/objectWithoutProperties');
24
21
  require('classnames');
25
22
  require('@bigbinary/neeto-molecules/Container');
26
23
  require('@bigbinary/neeto-molecules/Header');
27
- require('i18next');
28
- require('yup');
29
24
  require('@tanstack/react-query');
30
25
  require('@bigbinary/neetoui/Toastr');
31
26
  require('@bigbinary/neeto-cist');
32
27
  require('axios');
33
28
  require('@bigbinary/neeto-commons-frontend/utils');
29
+ require('@babel/runtime/helpers/toConsumableArray');
30
+ require('@bigbinary/neetoui/Typography');
31
+ require('@bigbinary/neetoui/Tag');
32
+ require('@bigbinary/neeto-molecules/CopyToClipboardButton');
33
+ require('@bigbinary/neetoui/Button');
34
+ require('@bigbinary/neetoui/Callout');
34
35
 
35
- var RecordField = function RecordField(_ref) {
36
- var label = _ref.label,
37
- value = _ref.value,
38
- dataTestid = _ref.dataTestid;
39
- return /*#__PURE__*/jsxRuntime.jsxs("div", {
40
- className: "flex w-full flex-col gap-2",
41
- children: [/*#__PURE__*/jsxRuntime.jsx("div", {
42
- className: "flex items-center justify-between",
43
- children: /*#__PURE__*/jsxRuntime.jsx(Typography, {
44
- style: "h5",
45
- children: label
46
- })
47
- }), /*#__PURE__*/jsxRuntime.jsxs("code", {
48
- className: "neeto-ui-text-gray-800 neeto-ui-bg-gray-100 neeto-ui-rounded-md relative block p-4 pe-10 font-mono text-xs break-all",
49
- "data-testid": dataTestid,
50
- children: [value, /*#__PURE__*/jsxRuntime.jsx(CopyToClipboardButton, {
51
- value: value,
52
- className: "absolute top-1 end-1 shrink-0",
53
- style: "tertiary"
54
- })]
55
- })]
56
- });
57
- };
58
-
59
- var DnsRecordsSection = function DnsRecordsSection(_ref) {
60
- var dnsRecords = _ref.dnsRecords,
61
- domain = _ref.domain,
62
- sparkpostData = _ref.sparkpostData;
63
- var _useTranslation = reactI18next.useTranslation(),
64
- t = _useTranslation.t;
65
- var formatPurpose = function formatPurpose(purpose) {
66
- switch (purpose) {
67
- case "dkim":
68
- return t("neetoEmailDelivery.sparkpost.dnsRecords.dkimSigning");
69
- case "txt":
70
- return t("neetoEmailDelivery.sparkpost.dnsRecords.txtVerification");
71
- default:
72
- return purpose;
73
- }
74
- };
75
- var formatRecordName = function formatRecordName(hostname) {
76
- if (!hostname) return "";
77
- return hostname.endsWith(".".concat(domain)) ? hostname : "".concat(hostname, ".").concat(domain);
78
- };
79
- var status = sparkpostData.status,
80
- txtVerificationValue = sparkpostData.txtVerificationValue,
81
- txtVerificationHostname = sparkpostData.txtVerificationHostname;
82
- var allRecords = [];
83
- var isTxtUnverified = status === "txt_unverified";
84
- if (isTxtUnverified) {
85
- if (txtVerificationValue && txtVerificationHostname) {
86
- allRecords.push({
87
- type: "TXT",
88
- purpose: "txt",
89
- hostname: txtVerificationHostname,
90
- value: txtVerificationValue
91
- });
92
- }
93
- } else {
94
- allRecords.push.apply(allRecords, _toConsumableArray(dnsRecords));
95
- }
96
- if (ramda.isEmpty(allRecords)) {
97
- return /*#__PURE__*/jsxRuntime.jsx("div", {
98
- className: "p-8 text-center",
99
- children: /*#__PURE__*/jsxRuntime.jsx(Typography, {
100
- className: "neeto-ui-text-gray-600",
101
- style: "body2",
102
- children: sparkpostData !== null && sparkpostData !== void 0 && sparkpostData.connected ? t("neetoEmailDelivery.sparkpost.dnsRecords.alreadyVerified") : t("neetoEmailDelivery.sparkpost.dnsRecords.loading")
103
- })
104
- });
105
- }
106
- return /*#__PURE__*/jsxRuntime.jsxs("div", {
107
- className: "flex flex-col gap-4",
108
- children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
109
- style: "h4",
110
- weight: "medium",
111
- children: t("neetoEmailDelivery.sparkpost.dnsRecords.title")
112
- }), allRecords.map(function (record, index) {
113
- return /*#__PURE__*/jsxRuntime.jsxs("div", {
114
- className: "neeto-ui-rounded-lg neeto-ui-bg-white neeto-ui-border-gray-300 border p-3",
115
- children: [/*#__PURE__*/jsxRuntime.jsx("div", {
116
- className: "mb-4 flex items-center justify-between",
117
- children: /*#__PURE__*/jsxRuntime.jsxs("div", {
118
- className: "flex items-center gap-2",
119
- children: [/*#__PURE__*/jsxRuntime.jsx(Tag, {
120
- label: formatPurpose(record.purpose),
121
- size: "small",
122
- style: constants.PURPOSE_COLORS[record.purpose] || constants.DEFAULT_COLOR
123
- }), /*#__PURE__*/jsxRuntime.jsx(Tag, {
124
- label: record.type,
125
- size: "small",
126
- style: "secondary"
127
- })]
128
- })
129
- }), /*#__PURE__*/jsxRuntime.jsxs("div", {
130
- className: "flex flex-col gap-4",
131
- children: [/*#__PURE__*/jsxRuntime.jsx(RecordField, {
132
- dataTestid: "record-name",
133
- label: t("neetoEmailDelivery.sparkpost.dnsRecords.nameLabel"),
134
- value: formatRecordName(record.hostname)
135
- }), /*#__PURE__*/jsxRuntime.jsx(RecordField, {
136
- dataTestid: "record-value",
137
- label: t("neetoEmailDelivery.sparkpost.dnsRecords.valueLabel"),
138
- value: record.value
139
- })]
140
- })]
141
- }, index);
142
- })]
143
- });
144
- };
145
-
146
- var VerificationActions = reactUtils.withT(function (_ref) {
147
- var t = _ref.t,
148
- isVerifying = _ref.isVerifying,
149
- verificationStatus = _ref.verificationStatus,
150
- onVerify = _ref.onVerify,
151
- onCancel = _ref.onCancel;
152
- return /*#__PURE__*/jsxRuntime.jsxs("div", {
153
- className: "flex gap-3",
154
- children: [/*#__PURE__*/jsxRuntime.jsx(Button, {
155
- "data-testid": "verify-domain-button",
156
- disabled: isVerifying || verificationStatus === "success",
157
- loading: isVerifying,
158
- onClick: onVerify,
159
- children: isVerifying ? t("neetoEmailDelivery.sparkpost.verify.verifying") : t("neetoEmailDelivery.sparkpost.verify.verifyDomain")
160
- }), /*#__PURE__*/jsxRuntime.jsx(Button, {
161
- "data-testid": "cancel-button",
162
- disabled: isVerifying,
163
- style: "secondary",
164
- onClick: onCancel,
165
- children: t("neetoEmailDelivery.sparkpost.verify.cancel")
166
- })]
167
- });
168
- });
169
-
170
- var VerificationInstructions = function VerificationInstructions() {
171
- var _useTranslation = reactI18next.useTranslation(),
172
- t = _useTranslation.t;
173
- var instructionText = t("neetoEmailDelivery.sparkpost.instructions.fullText");
174
- var lines = instructionText.split("\n");
175
- return /*#__PURE__*/jsxRuntime.jsx(Callout, {
176
- style: "info",
177
- children: /*#__PURE__*/jsxRuntime.jsx("div", {
178
- className: "w-full",
179
- children: /*#__PURE__*/jsxRuntime.jsx(Typography, {
180
- style: "body2",
181
- children: lines.map(function (line, index) {
182
- return /*#__PURE__*/jsxRuntime.jsxs("span", {
183
- children: [line, index < lines.length - 1 && /*#__PURE__*/jsxRuntime.jsx("br", {})]
184
- }, index);
185
- })
186
- })
187
- })
188
- });
189
- };
190
-
191
- var VerificationStatusCallout = function VerificationStatusCallout(_ref) {
192
- var verificationStatus = _ref.verificationStatus;
193
- var _useTranslation = reactI18next.useTranslation(),
194
- t = _useTranslation.t;
195
- var config = constants.VERIFICATION_STATUS_CONFIG[verificationStatus];
196
- if (!config) return null;
197
- return /*#__PURE__*/jsxRuntime.jsx(Callout, {
198
- style: config.style,
199
- children: /*#__PURE__*/jsxRuntime.jsxs("div", {
200
- className: "space-y-1",
201
- children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
202
- style: "body2",
203
- weight: "medium",
204
- children: t(config.titleKey)
205
- }), /*#__PURE__*/jsxRuntime.jsx(Typography, {
206
- style: "body3",
207
- children: t(config.descriptionKey)
208
- })]
209
- })
210
- });
211
- };
212
36
 
213
- var SparkpostDomainVerify = function SparkpostDomainVerify(_ref) {
214
- var ownerId = _ref.ownerId,
215
- canManageIntegrations = _ref.canManageIntegrations,
216
- emailDeliveryIndexRoute = _ref.emailDeliveryIndexRoute;
217
- var _useState = react.useState(""),
218
- _useState2 = _slicedToArray(_useState, 2),
219
- verificationStatus = _useState2[0],
220
- setVerificationStatus = _useState2[1];
221
- var _useTranslation = reactI18next.useTranslation(),
222
- t = _useTranslation.t;
223
- var history = reactRouterDom.useHistory();
224
- var _useFetchConnectedInt = useEmailDeliveryIntegrationApi.useFetchConnectedIntegration(ownerId),
225
- integration = _useFetchConnectedInt.integration,
226
- isIntegrationLoading = _useFetchConnectedInt.isLoading;
227
- var hasConnectedIntegration = integration && !integration.isPending;
228
- var _useQueryParams = reactUtils.useQueryParams(),
229
- queryDomain = _useQueryParams.domain;
230
- var _useFetchSparkpostDom = useSparkpostApi.useFetchSparkpostDomain(ownerId),
231
- sparkpostData = _useFetchSparkpostDom.data,
232
- isLoading = _useFetchSparkpostDom.isLoading;
233
- var _useSparkpostDomain = useSparkpostDomain.useSparkpostDomain({
234
- ownerId: ownerId,
235
- canManageIntegrations: canManageIntegrations
236
- }),
237
- onVerifyDomain = _useSparkpostDomain.onVerifyDomain,
238
- isVerifying = _useSparkpostDomain.isVerifying;
239
- var domain = ramda.pathOr(queryDomain, ["domain"], sparkpostData);
240
- var dnsRecords = ramda.pathOr([], ["verificationRecords"], sparkpostData);
241
- react.useEffect(function () {
242
- // Check if domain is already verified
243
- if (!(sparkpostData !== null && sparkpostData !== void 0 && sparkpostData.connected)) return;
244
- setVerificationStatus(constants.VERIFICATION_STATUSES.SUCCESS);
245
- setTimeout(function () {
246
- history.push(emailDeliveryIndexRoute);
247
- }, 5000);
248
- }, [sparkpostData, emailDeliveryIndexRoute, history]);
249
- var handleVerify = function handleVerify() {
250
- onVerifyDomain(function (response) {
251
- if ((response === null || response === void 0 ? void 0 : response.status) === "active") {
252
- setVerificationStatus(constants.VERIFICATION_STATUSES.SUCCESS);
253
- setTimeout(function () {
254
- history.push(emailDeliveryIndexRoute);
255
- }, 3000);
256
- } else {
257
- setVerificationStatus(constants.VERIFICATION_STATUSES.PENDING);
258
- }
259
- }, function (_error) {
260
- setVerificationStatus(constants.VERIFICATION_STATUSES.ERROR);
261
- });
262
- };
263
- var isVerificationSuccessful = verificationStatus === constants.VERIFICATION_STATUSES.SUCCESS;
264
- var handleCancel = function handleCancel() {
265
- history.push(emailDeliveryIndexRoute);
266
- };
267
- if (isLoading || isIntegrationLoading) {
268
- return /*#__PURE__*/jsxRuntime.jsx("div", {
269
- className: "flex justify-center p-6",
270
- children: /*#__PURE__*/jsxRuntime.jsx(Spinner, {})
271
- });
272
- }
273
- if (hasConnectedIntegration) {
274
- history.replace(emailDeliveryIndexRoute);
275
- return null;
276
- }
277
- return /*#__PURE__*/jsxRuntime.jsx(constants.PageWrapper, {
278
- children: /*#__PURE__*/jsxRuntime.jsx(constants.PageContent, {
279
- children: /*#__PURE__*/jsxRuntime.jsx(CardLayout, {
280
- title: t("neetoEmailDelivery.sparkpost.verify.title"),
281
- actionBlock: /*#__PURE__*/jsxRuntime.jsx(VerificationActions, {
282
- isVerifying: isVerifying,
283
- verificationStatus: verificationStatus,
284
- onCancel: handleCancel,
285
- onVerify: handleVerify
286
- }),
287
- description: t("neetoEmailDelivery.sparkpost.verify.description", {
288
- domain: domain
289
- }).replace(/<strong>|<\/strong>/g, ""),
290
- children: /*#__PURE__*/jsxRuntime.jsxs("div", {
291
- className: "flex flex-col gap-4",
292
- children: [/*#__PURE__*/jsxRuntime.jsx(VerificationStatusCallout, {
293
- verificationStatus: verificationStatus
294
- }), !isVerificationSuccessful && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
295
- children: [/*#__PURE__*/jsxRuntime.jsx(DnsRecordsSection, {
296
- dnsRecords: dnsRecords,
297
- domain: domain,
298
- sparkpostData: sparkpostData
299
- }), /*#__PURE__*/jsxRuntime.jsx(VerificationInstructions, {})]
300
- })]
301
- })
302
- })
303
- })
304
- });
305
- };
306
37
 
307
- module.exports = SparkpostDomainVerify;
38
+ module.exports = SparkpostDomainVerify.SparkpostDomainVerify;
308
39
  //# sourceMappingURL=SparkpostDomainVerify.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SparkpostDomainVerify.js","sources":["../../app/javascript/src/components/SparkpostDomain/RecordField.jsx","../../app/javascript/src/components/SparkpostDomain/DnsRecordsSection.jsx","../../app/javascript/src/components/SparkpostDomain/VerificationActions.jsx","../../app/javascript/src/components/SparkpostDomain/VerificationInstructions.jsx","../../app/javascript/src/components/SparkpostDomain/VerificationStatusCallout.jsx","../../app/javascript/src/components/SparkpostDomain/Verify.jsx"],"sourcesContent":["import CopyToClipboardButton from \"neetomolecules/CopyToClipboardButton\";\nimport { Typography } from \"neetoui\";\n\nconst RecordField = ({ label, value, dataTestid }) => (\n <div className=\"flex w-full flex-col gap-2\">\n <div className=\"flex items-center justify-between\">\n <Typography style=\"h5\">{label}</Typography>\n </div>\n <code\n className=\"neeto-ui-text-gray-800 neeto-ui-bg-gray-100 neeto-ui-rounded-md relative block p-4 pe-10 font-mono text-xs break-all\"\n data-testid={dataTestid}\n >\n {value}\n <CopyToClipboardButton\n {...{ value }}\n className=\"absolute top-1 end-1 shrink-0\"\n style=\"tertiary\"\n />\n </code>\n </div>\n);\n\nexport default RecordField;\n","import { Typography, Tag } from \"neetoui\";\nimport { isEmpty } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { PURPOSE_COLORS, DEFAULT_COLOR } from \"./constants\";\nimport RecordField from \"./RecordField\";\n\nconst DnsRecordsSection = ({ dnsRecords, domain, sparkpostData }) => {\n const { t } = useTranslation();\n\n const formatPurpose = purpose => {\n switch (purpose) {\n case \"dkim\":\n return t(\"neetoEmailDelivery.sparkpost.dnsRecords.dkimSigning\");\n case \"txt\":\n return t(\"neetoEmailDelivery.sparkpost.dnsRecords.txtVerification\");\n default:\n return purpose;\n }\n };\n\n const formatRecordName = hostname => {\n if (!hostname) return \"\";\n\n return hostname.endsWith(`.${domain}`) ? hostname : `${hostname}.${domain}`;\n };\n\n const { status, txtVerificationValue, txtVerificationHostname } =\n sparkpostData;\n\n const allRecords = [];\n const isTxtUnverified = status === \"txt_unverified\";\n\n if (isTxtUnverified) {\n if (txtVerificationValue && txtVerificationHostname) {\n allRecords.push({\n type: \"TXT\",\n purpose: \"txt\",\n hostname: txtVerificationHostname,\n value: txtVerificationValue,\n });\n }\n } else {\n allRecords.push(...dnsRecords);\n }\n\n if (isEmpty(allRecords)) {\n return (\n <div className=\"p-8 text-center\">\n <Typography className=\"neeto-ui-text-gray-600\" style=\"body2\">\n {sparkpostData?.connected\n ? t(\"neetoEmailDelivery.sparkpost.dnsRecords.alreadyVerified\")\n : t(\"neetoEmailDelivery.sparkpost.dnsRecords.loading\")}\n </Typography>\n </div>\n );\n }\n\n return (\n <div className=\"flex flex-col gap-4\">\n <Typography style=\"h4\" weight=\"medium\">\n {t(\"neetoEmailDelivery.sparkpost.dnsRecords.title\")}\n </Typography>\n {allRecords.map((record, index) => (\n <div\n className=\"neeto-ui-rounded-lg neeto-ui-bg-white neeto-ui-border-gray-300 border p-3\"\n key={index}\n >\n <div className=\"mb-4 flex items-center justify-between\">\n <div className=\"flex items-center gap-2\">\n <Tag\n label={formatPurpose(record.purpose)}\n size=\"small\"\n style={PURPOSE_COLORS[record.purpose] || DEFAULT_COLOR}\n />\n <Tag label={record.type} size=\"small\" style=\"secondary\" />\n </div>\n </div>\n <div className=\"flex flex-col gap-4\">\n <RecordField\n dataTestid=\"record-name\"\n label={t(\"neetoEmailDelivery.sparkpost.dnsRecords.nameLabel\")}\n value={formatRecordName(record.hostname)}\n />\n <RecordField\n dataTestid=\"record-value\"\n label={t(\"neetoEmailDelivery.sparkpost.dnsRecords.valueLabel\")}\n value={record.value}\n />\n </div>\n </div>\n ))}\n </div>\n );\n};\n\nexport default DnsRecordsSection;\n","import { withT } from \"neetocommons/react-utils\";\nimport { Button } from \"neetoui\";\n\nconst VerificationActions = withT(\n ({ t, isVerifying, verificationStatus, onVerify, onCancel }) => (\n <div className=\"flex gap-3\">\n <Button\n data-testid=\"verify-domain-button\"\n disabled={isVerifying || verificationStatus === \"success\"}\n loading={isVerifying}\n onClick={onVerify}\n >\n {isVerifying\n ? t(\"neetoEmailDelivery.sparkpost.verify.verifying\")\n : t(\"neetoEmailDelivery.sparkpost.verify.verifyDomain\")}\n </Button>\n <Button\n data-testid=\"cancel-button\"\n disabled={isVerifying}\n style=\"secondary\"\n onClick={onCancel}\n >\n {t(\"neetoEmailDelivery.sparkpost.verify.cancel\")}\n </Button>\n </div>\n )\n);\n\nexport default VerificationActions;\n","import { Typography, Callout } from \"neetoui\";\nimport { useTranslation } from \"react-i18next\";\n\nconst VerificationInstructions = () => {\n const { t } = useTranslation();\n\n const instructionText = t(\n \"neetoEmailDelivery.sparkpost.instructions.fullText\"\n );\n const lines = instructionText.split(\"\\n\");\n\n return (\n <Callout style=\"info\">\n <div className=\"w-full\">\n <Typography style=\"body2\">\n {lines.map((line, index) => (\n <span key={index}>\n {line}\n {index < lines.length - 1 && <br />}\n </span>\n ))}\n </Typography>\n </div>\n </Callout>\n );\n};\n\nexport default VerificationInstructions;\n","import { Callout, Typography } from \"neetoui\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { VERIFICATION_STATUS_CONFIG } from \"./constants\";\n\nconst VerificationStatusCallout = ({ verificationStatus }) => {\n const { t } = useTranslation();\n\n const config = VERIFICATION_STATUS_CONFIG[verificationStatus];\n\n if (!config) return null;\n\n return (\n <Callout style={config.style}>\n <div className=\"space-y-1\">\n <Typography style=\"body2\" weight=\"medium\">\n {t(config.titleKey)}\n </Typography>\n <Typography style=\"body3\">{t(config.descriptionKey)}</Typography>\n </div>\n </Callout>\n );\n};\n\nexport default VerificationStatusCallout;\n","import { useState, useEffect } from \"react\";\n\nimport { useQueryParams } from \"neetocommons/react-utils\";\nimport CardLayout from \"neetomolecules/CardLayout\";\nimport { Spinner } from \"neetoui\";\nimport { pathOr } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\nimport { useHistory } from \"react-router-dom\";\n\nimport { PageContent, PageWrapper } from \"components/PageLayout\";\nimport useSparkpostDomain from \"hooks/integrations/useSparkpostDomain\";\nimport { useFetchConnectedIntegration } from \"hooks/reactQuery/integrations/useEmailDeliveryIntegrationApi\";\nimport { useFetchSparkpostDomain } from \"hooks/reactQuery/integrations/useSparkpostApi\";\n\nimport { VERIFICATION_STATUSES } from \"./constants\";\nimport DnsRecordsSection from \"./DnsRecordsSection\";\nimport VerificationActions from \"./VerificationActions\";\nimport VerificationInstructions from \"./VerificationInstructions\";\nimport VerificationStatusCallout from \"./VerificationStatusCallout\";\n\nconst SparkpostDomainVerify = ({\n ownerId,\n canManageIntegrations,\n emailDeliveryIndexRoute,\n}) => {\n const [verificationStatus, setVerificationStatus] = useState(\"\");\n const { t } = useTranslation();\n\n const history = useHistory();\n\n const { integration, isLoading: isIntegrationLoading } =\n useFetchConnectedIntegration(ownerId);\n\n const hasConnectedIntegration = integration && !integration.isPending;\n\n const { domain: queryDomain } = useQueryParams();\n\n const { data: sparkpostData, isLoading } = useFetchSparkpostDomain(ownerId);\n const { onVerifyDomain, isVerifying } = useSparkpostDomain({\n ownerId,\n canManageIntegrations,\n });\n\n const domain = pathOr(queryDomain, [\"domain\"], sparkpostData);\n const dnsRecords = pathOr([], [\"verificationRecords\"], sparkpostData);\n\n useEffect(() => {\n // Check if domain is already verified\n if (!sparkpostData?.connected) return;\n setVerificationStatus(VERIFICATION_STATUSES.SUCCESS);\n setTimeout(() => {\n history.push(emailDeliveryIndexRoute);\n }, 5000);\n }, [sparkpostData, emailDeliveryIndexRoute, history]);\n\n const handleVerify = () => {\n onVerifyDomain(\n response => {\n if (response?.status === \"active\") {\n setVerificationStatus(VERIFICATION_STATUSES.SUCCESS);\n setTimeout(() => {\n history.push(emailDeliveryIndexRoute);\n }, 3000);\n } else {\n setVerificationStatus(VERIFICATION_STATUSES.PENDING);\n }\n },\n _error => {\n setVerificationStatus(VERIFICATION_STATUSES.ERROR);\n }\n );\n };\n\n const isVerificationSuccessful =\n verificationStatus === VERIFICATION_STATUSES.SUCCESS;\n\n const handleCancel = () => {\n history.push(emailDeliveryIndexRoute);\n };\n\n if (isLoading || isIntegrationLoading) {\n return (\n <div className=\"flex justify-center p-6\">\n <Spinner />\n </div>\n );\n }\n\n if (hasConnectedIntegration) {\n history.replace(emailDeliveryIndexRoute);\n\n return null;\n }\n\n return (\n <PageWrapper>\n <PageContent>\n <CardLayout\n title={t(\"neetoEmailDelivery.sparkpost.verify.title\")}\n actionBlock={\n <VerificationActions\n {...{ isVerifying, verificationStatus }}\n onCancel={handleCancel}\n onVerify={handleVerify}\n />\n }\n description={t(\"neetoEmailDelivery.sparkpost.verify.description\", {\n domain,\n }).replace(/<strong>|<\\/strong>/g, \"\")}\n >\n <div className=\"flex flex-col gap-4\">\n <VerificationStatusCallout {...{ verificationStatus }} />\n {!isVerificationSuccessful && (\n <>\n <DnsRecordsSection {...{ dnsRecords, domain, sparkpostData }} />\n <VerificationInstructions />\n </>\n )}\n </div>\n </CardLayout>\n </PageContent>\n </PageWrapper>\n );\n};\n\nexport default SparkpostDomainVerify;\n"],"names":["RecordField","_ref","label","value","dataTestid","_jsxs","className","children","_jsx","Typography","style","CopyToClipboardButton","DnsRecordsSection","dnsRecords","domain","sparkpostData","_useTranslation","useTranslation","t","formatPurpose","purpose","formatRecordName","hostname","endsWith","concat","status","txtVerificationValue","txtVerificationHostname","allRecords","isTxtUnverified","push","type","apply","_toConsumableArray","isEmpty","connected","weight","map","record","index","Tag","size","PURPOSE_COLORS","DEFAULT_COLOR","VerificationActions","withT","isVerifying","verificationStatus","onVerify","onCancel","Button","disabled","loading","onClick","VerificationInstructions","instructionText","lines","split","Callout","line","length","VerificationStatusCallout","config","VERIFICATION_STATUS_CONFIG","titleKey","descriptionKey","SparkpostDomainVerify","ownerId","canManageIntegrations","emailDeliveryIndexRoute","_useState","useState","_useState2","_slicedToArray","setVerificationStatus","history","useHistory","_useFetchConnectedInt","useFetchConnectedIntegration","integration","isIntegrationLoading","isLoading","hasConnectedIntegration","isPending","_useQueryParams","useQueryParams","queryDomain","_useFetchSparkpostDom","useFetchSparkpostDomain","data","_useSparkpostDomain","useSparkpostDomain","onVerifyDomain","pathOr","useEffect","VERIFICATION_STATUSES","SUCCESS","setTimeout","handleVerify","response","PENDING","_error","ERROR","isVerificationSuccessful","handleCancel","Spinner","replace","PageWrapper","PageContent","CardLayout","title","actionBlock","description","_Fragment"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAMA,WAAW,GAAG,SAAdA,WAAWA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAAMC,KAAK,GAAAD,IAAA,CAALC,KAAK;IAAEC,KAAK,GAAAF,IAAA,CAALE,KAAK;IAAEC,UAAU,GAAAH,IAAA,CAAVG,UAAU;AAAA,EAAA,oBAC7CC,eAAA,CAAA,KAAA,EAAA;AAAKC,IAAAA,SAAS,EAAC,4BAA4B;AAAAC,IAAAA,QAAA,gBACzCC,cAAA,CAAA,KAAA,EAAA;AAAKF,MAAAA,SAAS,EAAC,mCAAmC;MAAAC,QAAA,eAChDC,cAAA,CAACC,UAAU,EAAA;AAACC,QAAAA,KAAK,EAAC,IAAI;AAAAH,QAAAA,QAAA,EAAEL;OAAkB;KACvC,CAAC,eACNG,eAAA,CAAA,MAAA,EAAA;AACEC,MAAAA,SAAS,EAAC,sHAAsH;AAChI,MAAA,aAAA,EAAaF,UAAW;AAAAG,MAAAA,QAAA,EAAA,CAEvBJ,KAAK,eACNK,cAAA,CAACG,qBAAqB,EAAA;AACdR,QAAAA,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