@bigbinary/neeto-email-delivery-frontend 1.0.7 → 1.0.9
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 +39 -0
- package/app/javascript/src/translations/en.json +4 -1
- package/dist/EmailDeliveryScreen.js +52 -99
- package/dist/EmailDeliveryScreen.js.map +1 -1
- package/dist/SparkpostDomainSetup.js +2 -1
- package/dist/SparkpostDomainSetup.js.map +1 -1
- package/dist/SparkpostDomainVerify.js +2 -1
- package/dist/SparkpostDomainVerify.js.map +1 -1
- package/dist/cjs/EmailDeliveryScreen.js +57 -104
- package/dist/cjs/EmailDeliveryScreen.js.map +1 -1
- package/dist/cjs/SparkpostDomainSetup.js +2 -1
- package/dist/cjs/SparkpostDomainSetup.js.map +1 -1
- package/dist/cjs/SparkpostDomainVerify.js +3 -2
- package/dist/cjs/SparkpostDomainVerify.js.map +1 -1
- package/dist/cjs/hooks.js +52 -0
- package/dist/cjs/hooks.js.map +1 -0
- package/dist/cjs/index.js +5 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/hooks.js +50 -0
- package/dist/hooks.js.map +1 -0
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/dist/useOutlookIntegrationApi-CtHj_BzG.js +92 -0
- package/dist/useOutlookIntegrationApi-CtHj_BzG.js.map +1 -0
- package/dist/useOutlookIntegrationApi-ZgRWrUQN.js +87 -0
- package/dist/useOutlookIntegrationApi-ZgRWrUQN.js.map +1 -0
- package/dist/{useSparkpostDomain-DdG5InhX.js → useSparkpostApi-W7XibjIp.js} +2 -92
- package/dist/useSparkpostApi-W7XibjIp.js.map +1 -0
- package/dist/{useSparkpostDomain-qxCkAS6s.js → useSparkpostApi-pa64NIl6.js} +4 -92
- package/dist/useSparkpostApi-pa64NIl6.js.map +1 -0
- package/dist/useSparkpostDomain-DO4bG1HD.js +95 -0
- package/dist/useSparkpostDomain-DO4bG1HD.js.map +1 -0
- package/dist/useSparkpostDomain-wsENCoto.js +97 -0
- package/dist/useSparkpostDomain-wsENCoto.js.map +1 -0
- package/hooks.d.ts +21 -0
- package/package.json +8 -7
- package/dist/useSparkpostDomain-DdG5InhX.js.map +0 -1
- package/dist/useSparkpostDomain-qxCkAS6s.js.map +0 -1
|
@@ -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 }) => (\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 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 {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 label={t(\"neetoEmailDelivery.sparkpost.dnsRecords.nameLabel\")}\n value={formatRecordName(record.hostname)}\n />\n <RecordField\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 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 disabled={isVerifying} style=\"secondary\" onClick={onCancel}>\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 { 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 { 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) {\n return (\n <div className=\"flex justify-center p-6\">\n <Spinner />\n </div>\n );\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","_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","_useQueryParams","useQueryParams","queryDomain","_useFetchSparkpostDom","useFetchSparkpostDomain","data","isLoading","_useSparkpostDomain","useSparkpostDomain","onVerifyDomain","pathOr","useEffect","VERIFICATION_STATUSES","SUCCESS","setTimeout","handleVerify","response","PENDING","_error","ERROR","isVerificationSuccessful","handleCancel","Spinner","PageWrapper","PageContent","CardLayout","title","actionBlock","description","replace","_Fragment"],"mappings":";;;;;;;;;;;;;;;;;;;;;;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,QAAA,EAAA,cAClCC,GAAA,CAACqD,yBAAyB,EAAA;AAAOd,YAAAA,kBAAkB,EAAlBA;AAAkB,WAAK,CAAC,EACxD,CAACkD,wBAAwB,iBACxB5F,IAAA,CAAAsG,QAAA,EAAA;YAAApG,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,CAAC8C,wBAAwB,IAAE,CAAC;AAAA,WAC5B,CACH;SACE;OACK;KACD;AAAC,GACH,CAAC;AAElB;;;;"}
|
|
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 }) => (\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 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 {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 label={t(\"neetoEmailDelivery.sparkpost.dnsRecords.nameLabel\")}\n value={formatRecordName(record.hostname)}\n />\n <RecordField\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 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 disabled={isVerifying} style=\"secondary\" onClick={onCancel}>\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 { 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 { 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) {\n return (\n <div className=\"flex justify-center p-6\">\n <Spinner />\n </div>\n );\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","_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","_useQueryParams","useQueryParams","queryDomain","_useFetchSparkpostDom","useFetchSparkpostDomain","data","isLoading","_useSparkpostDomain","useSparkpostDomain","onVerifyDomain","pathOr","useEffect","VERIFICATION_STATUSES","SUCCESS","setTimeout","handleVerify","response","PENDING","_error","ERROR","isVerificationSuccessful","handleCancel","Spinner","PageWrapper","PageContent","CardLayout","title","actionBlock","description","replace","_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;AAAA,EAAA,oBACjCC,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,EAAEJ;OAAkB;KACvC,CAAC,eACNE,IAAA,CAAA,MAAA,EAAA;AAAMC,MAAAA,SAAS,EAAC,sHAAsH;AAAAC,MAAAA,QAAA,EACnIH,CAAAA,KAAK,eACNI,GAAA,CAACG,qBAAqB,EAAA;AACdP,QAAAA,KAAK,EAALA,KAAK;AACXE,QAAAA,SAAS,EAAC,+BAA+B;AACzCI,QAAAA,KAAK,EAAC;AAAU,OACjB,CAAC;AAAA,KACE,CAAC;AAAA,GACJ,CAAC;AAAA,CACP;;ACVD,IAAME,iBAAiB,GAAG,SAApBA,iBAAiBA,CAAAV,IAAA,EAA8C;AAAA,EAAA,IAAxCW,UAAU,GAAAX,IAAA,CAAVW,UAAU;IAAEC,MAAM,GAAAZ,IAAA,CAANY,MAAM;IAAEC,aAAa,GAAAb,IAAA,CAAba,aAAa;AAC5D,EAAA,IAAAC,eAAA,GAAcC,cAAc,EAAE;IAAtBC,CAAC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,QAAAA,WAAW,EAAEvF,CAAC,CAAC,iDAAiD,EAAE;AAChEJ,UAAAA,MAAM,EAANA;AACF,SAAC,CAAC,CAAC4F,OAAO,CAAC,sBAAsB,EAAE,EAAE,CAAE;AAAAnG,QAAAA,QAAA,eAEvCF,IAAA,CAAA,KAAA,EAAA;AAAKC,UAAAA,SAAS,EAAC,qBAAqB;UAAAC,QAAA,EAAA,cAClCC,GAAA,CAACqD,yBAAyB,EAAA;AAAOd,YAAAA,kBAAkB,EAAlBA;AAAkB,WAAK,CAAC,EACxD,CAACkD,wBAAwB,iBACxB5F,IAAA,CAAAsG,QAAA,EAAA;YAAApG,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,CAAC8C,wBAAwB,IAAE,CAAC;AAAA,WAC5B,CACH;SACE;OACK;KACD;AAAC,GACH,CAAC;AAElB;;;;"}
|
|
@@ -12,56 +12,19 @@ var Toastr = require('@bigbinary/neetoui/Toastr');
|
|
|
12
12
|
var ramda = require('ramda');
|
|
13
13
|
var reactI18next = require('react-i18next');
|
|
14
14
|
var reactRouterDom = require('react-router-dom');
|
|
15
|
-
var
|
|
15
|
+
var useSparkpostApi = require('../useSparkpostApi-pa64NIl6.js');
|
|
16
16
|
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
17
17
|
var react = require('react');
|
|
18
18
|
var reactQuery = require('@tanstack/react-query');
|
|
19
|
-
var
|
|
20
|
-
var
|
|
19
|
+
var useOutlookIntegrationApi = require('../useOutlookIntegrationApi-CtHj_BzG.js');
|
|
20
|
+
var useSparkpostDomain = require('../useSparkpostDomain-wsENCoto.js');
|
|
21
21
|
var i18next = require('i18next');
|
|
22
22
|
var Button = require('@bigbinary/neetoui/Button');
|
|
23
23
|
var Tag = require('@bigbinary/neetoui/Tag');
|
|
24
24
|
var Typography = require('@bigbinary/neetoui/Typography');
|
|
25
25
|
var jsxRuntime = require('react/jsx-runtime');
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
return axios.get(utils.buildUrl(useSparkpostDomain.GMAIL_URL, {
|
|
29
|
-
ownerId: ownerId
|
|
30
|
-
}), {
|
|
31
|
-
showToastr: false
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
var destroy$1 = function destroy(ownerId) {
|
|
35
|
-
axios["delete"](utils.buildUrl(useSparkpostDomain.GMAIL_OAUTH_URL, {
|
|
36
|
-
ownerId: ownerId
|
|
37
|
-
}), {
|
|
38
|
-
showToastr: false
|
|
39
|
-
});
|
|
40
|
-
};
|
|
41
|
-
var gmailApi = {
|
|
42
|
-
get: get$1,
|
|
43
|
-
destroy: destroy$1
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
47
|
-
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
48
|
-
var useFetchGmail = function useFetchGmail(ownerId, options) {
|
|
49
|
-
return reactQuery.useQuery(_objectSpread$1({
|
|
50
|
-
queryKey: [useSparkpostDomain.QUERY_KEYS.INTEGRATION_GMAIL, ownerId],
|
|
51
|
-
queryFn: function queryFn() {
|
|
52
|
-
return gmailApi.get(ownerId);
|
|
53
|
-
},
|
|
54
|
-
retry: 1
|
|
55
|
-
}, options));
|
|
56
|
-
};
|
|
57
|
-
var useDestroyGmail = function useDestroyGmail(_ref) {
|
|
58
|
-
var ownerId = _ref.ownerId;
|
|
59
|
-
return reactUtils.useMutationWithInvalidation(function () {
|
|
60
|
-
return gmailApi.destroy(ownerId);
|
|
61
|
-
}, {
|
|
62
|
-
keysToInvalidate: [[useSparkpostDomain.QUERY_KEYS.INTEGRATION_GMAIL, ownerId]]
|
|
63
|
-
});
|
|
64
|
-
};
|
|
26
|
+
require('@babel/runtime/helpers/defineProperty');
|
|
27
|
+
require('axios');
|
|
65
28
|
|
|
66
29
|
var useGmail = function useGmail(_ref) {
|
|
67
30
|
var ownerId = _ref.ownerId,
|
|
@@ -73,14 +36,14 @@ var useGmail = function useGmail(_ref) {
|
|
|
73
36
|
setIsDisconnectAlertOpen = _useState2[1];
|
|
74
37
|
var history = reactRouterDom.useHistory();
|
|
75
38
|
var queryClient = reactQuery.useQueryClient();
|
|
76
|
-
var _useFetchGmail = useFetchGmail(ownerId, {
|
|
39
|
+
var _useFetchGmail = useOutlookIntegrationApi.useFetchGmail(ownerId, {
|
|
77
40
|
enabled: canManageIntegrations
|
|
78
41
|
}),
|
|
79
42
|
isLoading = _useFetchGmail.isLoading,
|
|
80
43
|
_useFetchGmail$data = _useFetchGmail.data,
|
|
81
44
|
data = _useFetchGmail$data === void 0 ? {} : _useFetchGmail$data,
|
|
82
45
|
isGmailFetched = _useFetchGmail.isSuccess;
|
|
83
|
-
var _useDestroyGmail = useDestroyGmail({
|
|
46
|
+
var _useDestroyGmail = useOutlookIntegrationApi.useDestroyGmail({
|
|
84
47
|
ownerId: ownerId
|
|
85
48
|
}),
|
|
86
49
|
isDestroying = _useDestroyGmail.isPending,
|
|
@@ -104,7 +67,7 @@ var useGmail = function useGmail(_ref) {
|
|
|
104
67
|
var _query$queryKey = _slicedToArray(query.queryKey, 2),
|
|
105
68
|
key = _query$queryKey[0],
|
|
106
69
|
id = _query$queryKey[1];
|
|
107
|
-
return key ===
|
|
70
|
+
return key === useSparkpostApi.QUERY_KEYS.INTEGRATION_GMAIL && id !== ownerId;
|
|
108
71
|
}
|
|
109
72
|
});
|
|
110
73
|
}
|
|
@@ -113,6 +76,7 @@ var useGmail = function useGmail(_ref) {
|
|
|
113
76
|
data: data,
|
|
114
77
|
isLoading: isLoading,
|
|
115
78
|
isDestroying: isDestroying,
|
|
79
|
+
exists: data === null || data === void 0 ? void 0 : data.exists,
|
|
116
80
|
isConnected: data === null || data === void 0 ? void 0 : data.connected,
|
|
117
81
|
isDisconnectAlertOpen: isDisconnectAlertOpen,
|
|
118
82
|
setIsDisconnectAlertOpen: setIsDisconnectAlertOpen,
|
|
@@ -122,45 +86,6 @@ var useGmail = function useGmail(_ref) {
|
|
|
122
86
|
};
|
|
123
87
|
};
|
|
124
88
|
|
|
125
|
-
var get = function get(ownerId) {
|
|
126
|
-
return axios.get(utils.buildUrl(useSparkpostDomain.OUTLOOK_URL, {
|
|
127
|
-
ownerId: ownerId
|
|
128
|
-
}), {
|
|
129
|
-
showToastr: false
|
|
130
|
-
});
|
|
131
|
-
};
|
|
132
|
-
var destroy = function destroy(ownerId) {
|
|
133
|
-
axios["delete"](utils.buildUrl(useSparkpostDomain.OUTLOOK_OAUTH_URL, {
|
|
134
|
-
ownerId: ownerId
|
|
135
|
-
}), {
|
|
136
|
-
showToastr: false
|
|
137
|
-
});
|
|
138
|
-
};
|
|
139
|
-
var outlookApi = {
|
|
140
|
-
get: get,
|
|
141
|
-
destroy: destroy
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
145
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
146
|
-
var useFetchOutlook = function useFetchOutlook(ownerId, options) {
|
|
147
|
-
return reactQuery.useQuery(_objectSpread({
|
|
148
|
-
queryKey: [useSparkpostDomain.QUERY_KEYS.INTEGRATION_OUTLOOK, ownerId],
|
|
149
|
-
queryFn: function queryFn() {
|
|
150
|
-
return outlookApi.get(ownerId);
|
|
151
|
-
},
|
|
152
|
-
retry: 1
|
|
153
|
-
}, options));
|
|
154
|
-
};
|
|
155
|
-
var useDestroyOutlook = function useDestroyOutlook(_ref) {
|
|
156
|
-
var ownerId = _ref.ownerId;
|
|
157
|
-
return reactUtils.useMutationWithInvalidation(function () {
|
|
158
|
-
return outlookApi.destroy(ownerId);
|
|
159
|
-
}, {
|
|
160
|
-
keysToInvalidate: [[useSparkpostDomain.QUERY_KEYS.INTEGRATION_OUTLOOK, ownerId]]
|
|
161
|
-
});
|
|
162
|
-
};
|
|
163
|
-
|
|
164
89
|
var useOutlook = function useOutlook(_ref) {
|
|
165
90
|
var ownerId = _ref.ownerId,
|
|
166
91
|
indexRoute = _ref.indexRoute,
|
|
@@ -171,14 +96,14 @@ var useOutlook = function useOutlook(_ref) {
|
|
|
171
96
|
setIsDisconnectAlertOpen = _useState2[1];
|
|
172
97
|
var history = reactRouterDom.useHistory();
|
|
173
98
|
var queryClient = reactQuery.useQueryClient();
|
|
174
|
-
var _useFetchOutlook = useFetchOutlook(ownerId, {
|
|
99
|
+
var _useFetchOutlook = useOutlookIntegrationApi.useFetchOutlook(ownerId, {
|
|
175
100
|
enabled: canManageIntegrations
|
|
176
101
|
}),
|
|
177
102
|
isLoading = _useFetchOutlook.isLoading,
|
|
178
103
|
_useFetchOutlook$data = _useFetchOutlook.data,
|
|
179
104
|
data = _useFetchOutlook$data === void 0 ? {} : _useFetchOutlook$data,
|
|
180
105
|
isOutlookFetched = _useFetchOutlook.isSuccess;
|
|
181
|
-
var _useDestroyOutlook = useDestroyOutlook({
|
|
106
|
+
var _useDestroyOutlook = useOutlookIntegrationApi.useDestroyOutlook({
|
|
182
107
|
ownerId: ownerId
|
|
183
108
|
}),
|
|
184
109
|
isDestroying = _useDestroyOutlook.isPending,
|
|
@@ -202,7 +127,7 @@ var useOutlook = function useOutlook(_ref) {
|
|
|
202
127
|
var _query$queryKey = _slicedToArray(query.queryKey, 2),
|
|
203
128
|
key = _query$queryKey[0],
|
|
204
129
|
id = _query$queryKey[1];
|
|
205
|
-
return key ===
|
|
130
|
+
return key === useSparkpostApi.QUERY_KEYS.INTEGRATION_OUTLOOK && id !== ownerId;
|
|
206
131
|
}
|
|
207
132
|
});
|
|
208
133
|
}
|
|
@@ -210,6 +135,10 @@ var useOutlook = function useOutlook(_ref) {
|
|
|
210
135
|
return {
|
|
211
136
|
data: data,
|
|
212
137
|
isLoading: isLoading,
|
|
138
|
+
exists: data === null || data === void 0 ? void 0 : data.exists,
|
|
139
|
+
status: data === null || data === void 0 ? void 0 : data.status,
|
|
140
|
+
shadowAccount: data === null || data === void 0 ? void 0 : data.shadowAccount,
|
|
141
|
+
isWaitingForTestEmail: (data === null || data === void 0 ? void 0 : data.status) === "inactive" && !(data !== null && data !== void 0 && data.connected),
|
|
213
142
|
isDestroying: isDestroying,
|
|
214
143
|
isConnected: data === null || data === void 0 ? void 0 : data.connected,
|
|
215
144
|
isDisconnectAlertOpen: isDisconnectAlertOpen,
|
|
@@ -227,9 +156,8 @@ var ERROR_MESSAGES = {
|
|
|
227
156
|
outlook_nil_json_web_token: i18next.t("neetoEmailDelivery.outlook.nilJsonWebToken")
|
|
228
157
|
};
|
|
229
158
|
|
|
230
|
-
var IntegrationCard =
|
|
231
|
-
var
|
|
232
|
-
Icon = _ref.icon,
|
|
159
|
+
var IntegrationCard = function IntegrationCard(_ref) {
|
|
160
|
+
var Icon = _ref.icon,
|
|
233
161
|
title = _ref.title,
|
|
234
162
|
description = _ref.description,
|
|
235
163
|
isConnected = _ref.isConnected,
|
|
@@ -240,7 +168,12 @@ var IntegrationCard = reactUtils.withT(function (_ref) {
|
|
|
240
168
|
_ref$disconnectButton = _ref.disconnectButtonText,
|
|
241
169
|
disconnectButtonText = _ref$disconnectButton === void 0 ? "neetoEmailDelivery.sparkpost.emailDelivery.disconnect" : _ref$disconnectButton,
|
|
242
170
|
_ref$connectedTagText = _ref.connectedTagText,
|
|
243
|
-
connectedTagText = _ref$connectedTagText === void 0 ? "neetoEmailDelivery.sparkpost.emailDelivery.connected" : _ref$connectedTagText
|
|
171
|
+
connectedTagText = _ref$connectedTagText === void 0 ? "neetoEmailDelivery.sparkpost.emailDelivery.connected" : _ref$connectedTagText,
|
|
172
|
+
_ref$showDisconnect = _ref.showDisconnect,
|
|
173
|
+
showDisconnect = _ref$showDisconnect === void 0 ? false : _ref$showDisconnect;
|
|
174
|
+
var _useTranslation = reactI18next.useTranslation(),
|
|
175
|
+
t = _useTranslation.t;
|
|
176
|
+
var shouldShowDisconnect = isConnected || showDisconnect;
|
|
244
177
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
245
178
|
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",
|
|
246
179
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
@@ -268,7 +201,7 @@ var IntegrationCard = reactUtils.withT(function (_ref) {
|
|
|
268
201
|
children: description
|
|
269
202
|
}), connectButtonText && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
270
203
|
className: "flex gap-2",
|
|
271
|
-
children:
|
|
204
|
+
children: shouldShowDisconnect ? /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
272
205
|
"data-cy": "disconnect-button",
|
|
273
206
|
label: t(disconnectButtonText),
|
|
274
207
|
loading: isDisconnecting,
|
|
@@ -285,7 +218,7 @@ var IntegrationCard = reactUtils.withT(function (_ref) {
|
|
|
285
218
|
})]
|
|
286
219
|
})
|
|
287
220
|
});
|
|
288
|
-
}
|
|
221
|
+
};
|
|
289
222
|
|
|
290
223
|
var EmailDeliveryScreen = function EmailDeliveryScreen(_ref) {
|
|
291
224
|
var indexRoute = _ref.indexRoute,
|
|
@@ -326,28 +259,36 @@ var EmailDeliveryScreen = function EmailDeliveryScreen(_ref) {
|
|
|
326
259
|
isGmailConnected = gmailIntegration.isConnected,
|
|
327
260
|
isGmailLoading = gmailIntegration.isLoading,
|
|
328
261
|
isGmailDisconnecting = gmailIntegration.isDestroying,
|
|
329
|
-
onGmailDisconnect = gmailIntegration.onDisconnect
|
|
262
|
+
onGmailDisconnect = gmailIntegration.onDisconnect,
|
|
263
|
+
isGmailExists = gmailIntegration.exists;
|
|
330
264
|
var _outlookIntegration$d = outlookIntegration.data,
|
|
331
265
|
outlookData = _outlookIntegration$d === void 0 ? {} : _outlookIntegration$d,
|
|
332
266
|
isOutlookConnected = outlookIntegration.isConnected,
|
|
333
267
|
isOutlookLoading = outlookIntegration.isLoading,
|
|
334
268
|
isOutlookDisconnecting = outlookIntegration.isDestroying,
|
|
335
|
-
|
|
269
|
+
isOutlookWaitingForTestEmail = outlookIntegration.isWaitingForTestEmail,
|
|
270
|
+
isOutlookShadowAccount = outlookIntegration.shadowAccount,
|
|
271
|
+
onOutlookDisconnect = outlookIntegration.onDisconnect,
|
|
272
|
+
isOutlookExists = outlookIntegration.exists;
|
|
336
273
|
var _sparkpostIntegration = sparkpostIntegration.data,
|
|
337
274
|
sparkpostData = _sparkpostIntegration === void 0 ? {} : _sparkpostIntegration,
|
|
338
275
|
isSparkpostConnected = sparkpostIntegration.isConnected,
|
|
339
276
|
isSparkpostLoading = sparkpostIntegration.isLoading,
|
|
340
277
|
onSparkpostDisconnect = sparkpostIntegration.onDisconnect,
|
|
341
|
-
isSparkpostDisconnecting = sparkpostIntegration.isDestroying
|
|
278
|
+
isSparkpostDisconnecting = sparkpostIntegration.isDestroying,
|
|
279
|
+
isSparkpostExists = sparkpostIntegration.exists;
|
|
342
280
|
var isLoading = isGmailLoading || isOutlookLoading || isSparkpostLoading;
|
|
343
|
-
var
|
|
281
|
+
var noneExists = !isGmailExists && !isOutlookExists && !isSparkpostExists;
|
|
282
|
+
var showGmail = noneExists || isGmailExists;
|
|
283
|
+
var showOutlook = noneExists || isOutlookExists;
|
|
284
|
+
var showSparkpost = noneExists || isSparkpostExists;
|
|
344
285
|
var handleGmailConnect = function handleGmailConnect() {
|
|
345
|
-
window.location.href = utils.buildUrl(
|
|
286
|
+
window.location.href = utils.buildUrl(useSparkpostApi.GMAIL_OAUTH_CONNECT_URL, {
|
|
346
287
|
ownerId: ownerId
|
|
347
288
|
});
|
|
348
289
|
};
|
|
349
290
|
var handleOutlookConnect = function handleOutlookConnect() {
|
|
350
|
-
window.location.href = utils.buildUrl(
|
|
291
|
+
window.location.href = utils.buildUrl(useSparkpostApi.OUTLOOK_OAUTH_CONNECT_URL, {
|
|
351
292
|
ownerId: ownerId
|
|
352
293
|
});
|
|
353
294
|
};
|
|
@@ -375,13 +316,14 @@ var EmailDeliveryScreen = function EmailDeliveryScreen(_ref) {
|
|
|
375
316
|
children: /*#__PURE__*/jsxRuntime.jsx(Spinner, {})
|
|
376
317
|
});
|
|
377
318
|
}
|
|
319
|
+
var activeMessage = isGmailConnected && t("neetoEmailDelivery.gmail.gmailConfigured") || isOutlookConnected && t("neetoEmailDelivery.outlook.outlookConfigured") || isSparkpostConnected && t("neetoEmailDelivery.sparkpost.ownDomainConfigured");
|
|
378
320
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
379
321
|
className: "min-h-0 w-full grow",
|
|
380
322
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
381
323
|
className: "@container mx-auto space-y-6",
|
|
382
324
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
383
325
|
className: "grid grid-cols-1 gap-3 py-1 @lg:grid-cols-2 @lg:gap-6 @3xl:grid-cols-3 @7xl:grid-cols-4",
|
|
384
|
-
children: [
|
|
326
|
+
children: [showGmail && /*#__PURE__*/jsxRuntime.jsx(IntegrationCard, {
|
|
385
327
|
connectButtonText: "neetoEmailDelivery.gmail.connectGmail",
|
|
386
328
|
description: gmailDescription,
|
|
387
329
|
icon: GmailIcon,
|
|
@@ -390,16 +332,17 @@ var EmailDeliveryScreen = function EmailDeliveryScreen(_ref) {
|
|
|
390
332
|
title: gmailTitle,
|
|
391
333
|
onConnect: handleGmailConnect,
|
|
392
334
|
onDisconnect: onGmailDisconnect
|
|
393
|
-
}),
|
|
335
|
+
}), showOutlook && /*#__PURE__*/jsxRuntime.jsx(IntegrationCard, {
|
|
394
336
|
connectButtonText: "neetoEmailDelivery.outlook.connectOutlook",
|
|
395
337
|
description: outlookDescription,
|
|
396
338
|
icon: OutlookIcon,
|
|
397
339
|
isConnected: isOutlookConnected,
|
|
398
340
|
isDisconnecting: isOutlookDisconnecting,
|
|
399
341
|
title: outlookTitle,
|
|
342
|
+
showDisconnect: isOutlookWaitingForTestEmail || isOutlookShadowAccount,
|
|
400
343
|
onConnect: handleOutlookConnect,
|
|
401
344
|
onDisconnect: onOutlookDisconnect
|
|
402
|
-
}),
|
|
345
|
+
}), showSparkpost && /*#__PURE__*/jsxRuntime.jsx(IntegrationCard, {
|
|
403
346
|
connectButtonText: "neetoEmailDelivery.sparkpost.emailDelivery.setupDomain",
|
|
404
347
|
description: ownDomainDescription,
|
|
405
348
|
icon: MailSend,
|
|
@@ -409,9 +352,19 @@ var EmailDeliveryScreen = function EmailDeliveryScreen(_ref) {
|
|
|
409
352
|
onConnect: handleOwnDomainConnect,
|
|
410
353
|
onDisconnect: onSparkpostDisconnect
|
|
411
354
|
})]
|
|
412
|
-
}),
|
|
355
|
+
}), activeMessage && /*#__PURE__*/jsxRuntime.jsx(Callout, {
|
|
413
356
|
style: "success",
|
|
414
|
-
children:
|
|
357
|
+
children: activeMessage
|
|
358
|
+
}), isOutlookWaitingForTestEmail && /*#__PURE__*/jsxRuntime.jsx(Callout, {
|
|
359
|
+
style: "warning",
|
|
360
|
+
children: t("neetoEmailDelivery.outlook.waitingForTestEmail", {
|
|
361
|
+
email: outlookEmail
|
|
362
|
+
})
|
|
363
|
+
}), isOutlookShadowAccount && /*#__PURE__*/jsxRuntime.jsx(Callout, {
|
|
364
|
+
style: "warning",
|
|
365
|
+
children: t("neetoEmailDelivery.outlook.shadowAccountMessage", {
|
|
366
|
+
email: outlookEmail
|
|
367
|
+
})
|
|
415
368
|
})]
|
|
416
369
|
})
|
|
417
370
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmailDeliveryScreen.js","sources":["../../app/javascript/src/apis/integrations/gmail.js","../../app/javascript/src/hooks/reactQuery/integrations/useGmailIntegrationApi.js","../../app/javascript/src/hooks/integrations/useGmail.js","../../app/javascript/src/apis/integrations/outlook.js","../../app/javascript/src/hooks/reactQuery/integrations/useOutlookIntegrationApi.js","../../app/javascript/src/hooks/integrations/useOutlook.js","../../app/javascript/src/components/EmailDeliveryScreen/constants.js","../../app/javascript/src/components/EmailDeliveryScreen/IntegrationCard.jsx","../../app/javascript/src/components/EmailDeliveryScreen/index.jsx"],"sourcesContent":["import axios from \"axios\";\nimport { buildUrl } from \"neetocommons/utils\";\n\nimport { GMAIL_URL, GMAIL_OAUTH_URL } from \"./constants\";\n\nconst get = ownerId =>\n axios.get(buildUrl(GMAIL_URL, { ownerId }), { showToastr: false });\n\nconst destroy = ownerId => {\n axios.delete(buildUrl(GMAIL_OAUTH_URL, { ownerId }), { showToastr: false });\n};\n\nconst gmailApi = { get, destroy };\n\nexport default gmailApi;\n","import { useQuery } from \"@tanstack/react-query\";\nimport { useMutationWithInvalidation } from \"neetocommons/react-utils\";\n\nimport gmailApi from \"apis/integrations/gmail\";\nimport { QUERY_KEYS } from \"src/constants/query\";\n\nexport const useFetchGmail = (ownerId, options) =>\n useQuery({\n queryKey: [QUERY_KEYS.INTEGRATION_GMAIL, ownerId],\n queryFn: () => gmailApi.get(ownerId),\n retry: 1,\n ...options,\n });\n\nexport const useDestroyGmail = ({ ownerId }) =>\n useMutationWithInvalidation(() => gmailApi.destroy(ownerId), {\n keysToInvalidate: [[QUERY_KEYS.INTEGRATION_GMAIL, ownerId]],\n });\n","import { useEffect, useState } from \"react\";\n\nimport { useQueryClient } from \"@tanstack/react-query\";\nimport { showThumbsUpToastr } from \"neetocommons/utils\";\nimport { useHistory } from \"react-router-dom\";\n\nimport {\n useFetchGmail,\n useDestroyGmail,\n} from \"hooks/reactQuery/integrations/useGmailIntegrationApi\";\nimport { QUERY_KEYS } from \"src/constants/query\";\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 {\n isLoading,\n data = {},\n isSuccess: isGmailFetched,\n } = useFetchGmail(ownerId, { enabled: canManageIntegrations });\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 showThumbsUpToastr();\n setIsDisconnectAlertOpen(false);\n history.replace(indexRoute);\n },\n });\n };\n\n useEffect(() => {\n if (isGmailFetched) {\n queryClient.invalidateQueries({\n predicate: query => {\n const [key, id] = query.queryKey;\n\n return key === QUERY_KEYS.INTEGRATION_GMAIL && id !== ownerId;\n },\n });\n }\n }, [isGmailFetched, queryClient, ownerId]);\n\n return {\n data,\n isLoading,\n isDestroying,\n isConnected: data?.connected,\n isDisconnectAlertOpen,\n setIsDisconnectAlertOpen,\n onDisconnect,\n onClose,\n errorMessage: data?.error,\n };\n};\n\nexport default useGmail;\n","import axios from \"axios\";\nimport { buildUrl } from \"neetocommons/utils\";\n\nimport { OUTLOOK_URL, OUTLOOK_OAUTH_URL } from \"./constants\";\n\nconst get = ownerId =>\n axios.get(buildUrl(OUTLOOK_URL, { ownerId }), { showToastr: false });\n\nconst destroy = ownerId => {\n axios.delete(buildUrl(OUTLOOK_OAUTH_URL, { ownerId }), { showToastr: false });\n};\n\nconst outlookApi = { get, destroy };\n\nexport default outlookApi;\n","import { useQuery } from \"@tanstack/react-query\";\nimport { useMutationWithInvalidation } from \"neetocommons/react-utils\";\n\nimport outlookApi from \"apis/integrations/outlook\";\nimport { QUERY_KEYS } from \"src/constants/query\";\n\nexport const useFetchOutlook = (ownerId, options) =>\n useQuery({\n queryKey: [QUERY_KEYS.INTEGRATION_OUTLOOK, ownerId],\n queryFn: () => outlookApi.get(ownerId),\n retry: 1,\n ...options,\n });\n\nexport const useDestroyOutlook = ({ ownerId }) =>\n useMutationWithInvalidation(() => outlookApi.destroy(ownerId), {\n keysToInvalidate: [[QUERY_KEYS.INTEGRATION_OUTLOOK, ownerId]],\n });\n","import { useEffect, useState } from \"react\";\n\nimport { useQueryClient } from \"@tanstack/react-query\";\nimport { showThumbsUpToastr } from \"neetocommons/utils\";\nimport { useHistory } from \"react-router-dom\";\n\nimport {\n useFetchOutlook,\n useDestroyOutlook,\n} from \"hooks/reactQuery/integrations/useOutlookIntegrationApi\";\nimport { QUERY_KEYS } from \"src/constants/query\";\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 {\n isLoading,\n data = {},\n isSuccess: isOutlookFetched,\n } = useFetchOutlook(ownerId, { enabled: canManageIntegrations });\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 showThumbsUpToastr();\n setIsDisconnectAlertOpen(false);\n history.replace(indexRoute);\n },\n });\n };\n\n useEffect(() => {\n if (isOutlookFetched) {\n queryClient.invalidateQueries({\n predicate: query => {\n const [key, id] = query.queryKey;\n\n return key === QUERY_KEYS.INTEGRATION_OUTLOOK && id !== ownerId;\n },\n });\n }\n }, [isOutlookFetched, queryClient, ownerId]);\n\n return {\n data,\n isLoading,\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 { 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 { withT } from \"neetocommons/react-utils\";\nimport { Button, Tag, Typography } from \"neetoui\";\n\nconst IntegrationCard = withT(\n ({\n t,\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 }) => (\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 {isConnected ? (\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 { 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 useGmail from \"hooks/integrations/useGmail\";\nimport useOutlook from \"hooks/integrations/useOutlook\";\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 { 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 {\n data: gmailData = {},\n isConnected: isGmailConnected,\n isLoading: isGmailLoading,\n isDestroying: isGmailDisconnecting,\n onDisconnect: onGmailDisconnect,\n } = gmailIntegration;\n\n const {\n data: outlookData = {},\n isConnected: isOutlookConnected,\n isLoading: isOutlookLoading,\n isDestroying: isOutlookDisconnecting,\n onDisconnect: onOutlookDisconnect,\n } = outlookIntegration;\n\n const {\n data: sparkpostData = {},\n isConnected: isSparkpostConnected,\n isLoading: isSparkpostLoading,\n onDisconnect: onSparkpostDisconnect,\n isDestroying: isSparkpostDisconnecting,\n } = sparkpostIntegration;\n\n const isLoading = isGmailLoading || isOutlookLoading || isSparkpostLoading;\n const hasActiveIntegration =\n isGmailConnected || isOutlookConnected || 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 gmailEmail = prop(\"email\", gmailData);\n const outlookEmail = prop(\"email\", outlookData);\n const sparkpostEmail = prop(\"email\", sparkpostData);\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 if (isLoading) {\n return (\n <div className=\"flex grow items-center justify-center w-full\">\n <Spinner />\n </div>\n );\n }\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 {(!hasActiveIntegration || isGmailConnected) && (\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 {(!hasActiveIntegration || isOutlookConnected) && (\n <IntegrationCard\n connectButtonText=\"neetoEmailDelivery.outlook.connectOutlook\"\n description={outlookDescription}\n icon={OutlookIcon}\n isConnected={isOutlookConnected}\n isDisconnecting={isOutlookDisconnecting}\n title={outlookTitle}\n onConnect={handleOutlookConnect}\n onDisconnect={onOutlookDisconnect}\n />\n )}\n {/* Own Domain (Sparkpost) Option */}\n {(!hasActiveIntegration || isSparkpostConnected) && (\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 </div>\n {hasActiveIntegration && (\n <Callout style=\"success\">\n {isGmailConnected\n ? t(\"neetoEmailDelivery.gmail.gmailConfigured\")\n : isOutlookConnected\n ? t(\"neetoEmailDelivery.outlook.outlookConfigured\")\n : t(\"neetoEmailDelivery.sparkpost.ownDomainConfigured\")}\n </Callout>\n )}\n </div>\n </div>\n );\n};\n\nexport default EmailDeliveryScreen;\n"],"names":["get","ownerId","axios","buildUrl","GMAIL_URL","showToastr","destroy","GMAIL_OAUTH_URL","gmailApi","useFetchGmail","options","useQuery","_objectSpread","queryKey","QUERY_KEYS","INTEGRATION_GMAIL","queryFn","retry","useDestroyGmail","_ref","useMutationWithInvalidation","keysToInvalidate","useGmail","indexRoute","canManageIntegrations","_useState","useState","_useState2","_slicedToArray","isDisconnectAlertOpen","setIsDisconnectAlertOpen","history","useHistory","queryClient","useQueryClient","_useFetchGmail","enabled","isLoading","_useFetchGmail$data","data","isGmailFetched","isSuccess","_useDestroyGmail","isDestroying","isPending","destroyIntegration","mutate","onClose","replace","onDisconnect","onSuccess","showThumbsUpToastr","useEffect","invalidateQueries","predicate","query","_query$queryKey","key","id","isConnected","connected","errorMessage","error","OUTLOOK_URL","OUTLOOK_OAUTH_URL","outlookApi","useFetchOutlook","INTEGRATION_OUTLOOK","useDestroyOutlook","useOutlook","_useFetchOutlook","_useFetchOutlook$data","isOutlookFetched","_useDestroyOutlook","ERROR_MESSAGES","gmail_permission_not_given","t","outlook_permission_not_given","outlook_invalid_client","outlook_nil_json_web_token","IntegrationCard","withT","Icon","icon","title","description","isDisconnecting","onConnect","connectButtonText","_ref$disconnectButton","disconnectButtonText","_ref$connectedTagText","connectedTagText","_jsx","className","children","_jsxs","size","Typography","style","weight","Tag","label","Button","loading","onClick","EmailDeliveryScreen","ownDomainSetupRoute","_useTranslation","useTranslation","_useQueryParams","useQueryParams","errorDescription","isPresent","_errorMessage","concat","Toastr","humanize","gmailIntegration","outlookIntegration","sparkpostIntegration","useSparkpostDomain","_gmailIntegration$dat","gmailData","isGmailConnected","isGmailLoading","isGmailDisconnecting","onGmailDisconnect","_outlookIntegration$d","outlookData","isOutlookConnected","isOutlookLoading","isOutlookDisconnecting","onOutlookDisconnect","_sparkpostIntegration","sparkpostData","isSparkpostConnected","isSparkpostLoading","onSparkpostDisconnect","isSparkpostDisconnecting","hasActiveIntegration","handleGmailConnect","window","location","href","GMAIL_OAUTH_CONNECT_URL","handleOutlookConnect","OUTLOOK_OAUTH_CONNECT_URL","handleOwnDomainConnect","push","gmailEmail","prop","outlookEmail","sparkpostEmail","gmailTitle","gmailDescription","email","outlookTitle","outlookDescription","ownDomainTitle","ownDomainDescription","Spinner","GmailIcon","OutlookIcon","MailSend","Callout"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,IAAMA,KAAG,GAAG,SAANA,GAAGA,CAAGC,OAAO,EAAA;AAAA,EAAA,OACjBC,KAAK,CAACF,GAAG,CAACG,cAAQ,CAACC,4BAAS,EAAE;AAAEH,IAAAA,OAAO,EAAPA;AAAQ,GAAC,CAAC,EAAE;AAAEI,IAAAA,UAAU,EAAE;AAAM,GAAC,CAAC;AAAA,CAAA;AAEpE,IAAMC,SAAO,GAAG,SAAVA,OAAOA,CAAGL,OAAO,EAAI;AACzBC,EAAAA,KAAK,CAAO,QAAA,CAAA,CAACC,cAAQ,CAACI,kCAAe,EAAE;AAAEN,IAAAA,OAAO,EAAPA;AAAQ,GAAC,CAAC,EAAE;AAAEI,IAAAA,UAAU,EAAE;AAAM,GAAC,CAAC;AAC7E,CAAC;AAED,IAAMG,QAAQ,GAAG;AAAER,EAAAA,GAAG,EAAHA,KAAG;AAAEM,EAAAA,OAAO,EAAPA;AAAQ,CAAC;;;;ACN1B,IAAMG,aAAa,GAAG,SAAhBA,aAAaA,CAAIR,OAAO,EAAES,OAAO,EAAA;EAAA,OAC5CC,mBAAQ,CAAAC,eAAA,CAAA;AACNC,IAAAA,QAAQ,EAAE,CAACC,6BAAU,CAACC,iBAAiB,EAAEd,OAAO,CAAC;IACjDe,OAAO,EAAE,SAATA,OAAOA,GAAA;AAAA,MAAA,OAAQR,QAAQ,CAACR,GAAG,CAACC,OAAO,CAAC;AAAA,KAAA;AACpCgB,IAAAA,KAAK,EAAE;GACJP,EAAAA,OAAO,CACX,CAAC;AAAA,CAAA;AAEG,IAAMQ,eAAe,GAAG,SAAlBA,eAAeA,CAAAC,IAAA,EAA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wE,OAAO,EAAA;AAAClE,QAAAA,KAAK,EAAC,SAAS;AAAAJ,QAAAA,QAAA,EACrB6B,gBAAgB,GACbhD,CAAC,CAAC,0CAA0C,CAAC,GAC7CsD,kBAAkB,GAChBtD,CAAC,CAAC,8CAA8C,CAAC,GACjDA,CAAC,CAAC,kDAAkD;AAAC,OACpD,CACV;KACE;AAAC,GACH,CAAC;AAEV;;;;"}
|
|
1
|
+
{"version":3,"file":"EmailDeliveryScreen.js","sources":["../../app/javascript/src/hooks/integrations/useGmail.js","../../app/javascript/src/hooks/integrations/useOutlook.js","../../app/javascript/src/components/EmailDeliveryScreen/constants.js","../../app/javascript/src/components/EmailDeliveryScreen/IntegrationCard.jsx","../../app/javascript/src/components/EmailDeliveryScreen/index.jsx"],"sourcesContent":["import { useEffect, useState } from \"react\";\n\nimport { useQueryClient } from \"@tanstack/react-query\";\nimport { showThumbsUpToastr } from \"neetocommons/utils\";\nimport { useHistory } from \"react-router-dom\";\n\nimport {\n useFetchGmail,\n useDestroyGmail,\n} from \"hooks/reactQuery/integrations/useGmailIntegrationApi\";\nimport { QUERY_KEYS } from \"src/constants/query\";\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 {\n isLoading,\n data = {},\n isSuccess: isGmailFetched,\n } = useFetchGmail(ownerId, { enabled: canManageIntegrations });\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 showThumbsUpToastr();\n setIsDisconnectAlertOpen(false);\n history.replace(indexRoute);\n },\n });\n };\n\n useEffect(() => {\n if (isGmailFetched) {\n queryClient.invalidateQueries({\n predicate: query => {\n const [key, id] = query.queryKey;\n\n return key === QUERY_KEYS.INTEGRATION_GMAIL && id !== ownerId;\n },\n });\n }\n }, [isGmailFetched, queryClient, ownerId]);\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 { useEffect, useState } from \"react\";\n\nimport { useQueryClient } from \"@tanstack/react-query\";\nimport { showThumbsUpToastr } from \"neetocommons/utils\";\nimport { useHistory } from \"react-router-dom\";\n\nimport {\n useFetchOutlook,\n useDestroyOutlook,\n} from \"hooks/reactQuery/integrations/useOutlookIntegrationApi\";\nimport { QUERY_KEYS } from \"src/constants/query\";\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 {\n isLoading,\n data = {},\n isSuccess: isOutlookFetched,\n } = useFetchOutlook(ownerId, { enabled: canManageIntegrations });\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 showThumbsUpToastr();\n setIsDisconnectAlertOpen(false);\n history.replace(indexRoute);\n },\n });\n };\n\n useEffect(() => {\n if (isOutlookFetched) {\n queryClient.invalidateQueries({\n predicate: query => {\n const [key, id] = query.queryKey;\n\n return key === QUERY_KEYS.INTEGRATION_OUTLOOK && id !== ownerId;\n },\n });\n }\n }, [isOutlookFetched, queryClient, ownerId]);\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 { 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 { 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 useGmail from \"hooks/integrations/useGmail\";\nimport useOutlook from \"hooks/integrations/useOutlook\";\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 { 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 {\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 isLoading = isGmailLoading || isOutlookLoading || isSparkpostLoading;\n const noneExists = !isGmailExists && !isOutlookExists && !isSparkpostExists;\n const showGmail = noneExists || isGmailExists;\n const showOutlook = noneExists || isOutlookExists;\n const showSparkpost = noneExists || isSparkpostExists;\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 gmailEmail = prop(\"email\", gmailData);\n const outlookEmail = prop(\"email\", outlookData);\n const sparkpostEmail = prop(\"email\", sparkpostData);\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 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\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 </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 </div>\n );\n};\n\nexport default EmailDeliveryScreen;\n"],"names":["useGmail","_ref","ownerId","indexRoute","canManageIntegrations","_useState","useState","_useState2","_slicedToArray","isDisconnectAlertOpen","setIsDisconnectAlertOpen","history","useHistory","queryClient","useQueryClient","_useFetchGmail","useFetchGmail","enabled","isLoading","_useFetchGmail$data","data","isGmailFetched","isSuccess","_useDestroyGmail","useDestroyGmail","isDestroying","isPending","destroyIntegration","mutate","onClose","replace","onDisconnect","onSuccess","showThumbsUpToastr","useEffect","invalidateQueries","predicate","query","_query$queryKey","queryKey","key","id","QUERY_KEYS","INTEGRATION_GMAIL","exists","isConnected","connected","errorMessage","error","useOutlook","_useFetchOutlook","useFetchOutlook","_useFetchOutlook$data","isOutlookFetched","_useDestroyOutlook","useDestroyOutlook","INTEGRATION_OUTLOOK","status","shadowAccount","isWaitingForTestEmail","ERROR_MESSAGES","gmail_permission_not_given","t","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","_useTranslation","useTranslation","shouldShowDisconnect","_jsx","className","children","_jsxs","size","Typography","style","weight","Tag","label","Button","loading","onClick","EmailDeliveryScreen","ownDomainSetupRoute","_useQueryParams","useQueryParams","errorDescription","isPresent","_errorMessage","concat","Toastr","humanize","gmailIntegration","outlookIntegration","sparkpostIntegration","useSparkpostDomain","_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","noneExists","showGmail","showOutlook","showSparkpost","handleGmailConnect","window","location","href","buildUrl","GMAIL_OAUTH_CONNECT_URL","handleOutlookConnect","OUTLOOK_OAUTH_CONNECT_URL","handleOwnDomainConnect","push","gmailEmail","prop","outlookEmail","sparkpostEmail","gmailTitle","gmailDescription","email","outlookTitle","outlookDescription","ownDomainTitle","ownDomainDescription","Spinner","activeMessage","GmailIcon","OutlookIcon","MailSend","Callout"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,IAAMA,QAAQ,GAAG,SAAXA,QAAQA,CAAAC,IAAA,EAAuD;AAAA,EAAA,IAAjDC,OAAO,GAAAD,IAAA,CAAPC,OAAO;IAAEC,UAAU,GAAAF,IAAA,CAAVE,UAAU;IAAEC,qBAAqB,GAAAH,IAAA,CAArBG,qBAAqB;AAC5D,EAAA,IAAAC,SAAA,GAA0DC,cAAQ,CAAC,KAAK,CAAC;IAAAC,UAAA,GAAAC,cAAA,CAAAH,SAAA,EAAA,CAAA,CAAA;AAAlEI,IAAAA,qBAAqB,GAAAF,UAAA,CAAA,CAAA,CAAA;AAAEG,IAAAA,wBAAwB,GAAAH,UAAA,CAAA,CAAA,CAAA;AAEtD,EAAA,IAAMI,OAAO,GAAGC,yBAAU,EAAE;AAE5B,EAAA,IAAMC,WAAW,GAAGC,yBAAc,EAAE;AAEpC,EAAA,IAAAC,cAAA,GAIIC,sCAAa,CAACd,OAAO,EAAE;AAAEe,MAAAA,OAAO,EAAEb;AAAsB,KAAC,CAAC;IAH5Dc,SAAS,GAAAH,cAAA,CAATG,SAAS;IAAAC,mBAAA,GAAAJ,cAAA,CACTK,IAAI;AAAJA,IAAAA,IAAI,GAAAD,mBAAA,KAAA,KAAA,CAAA,GAAG,EAAE,GAAAA,mBAAA;IACEE,cAAc,GAAAN,cAAA,CAAzBO,SAAS;EAGX,IAAAC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,oBAAqB;AAClCzF,UAAAA,IAAI,EAAE8F,QAAS;AACfrH,UAAAA,WAAW,EAAEmF,oBAAqB;AAClCzD,UAAAA,eAAe,EAAE4D,wBAAyB;AAC1C9D,UAAAA,KAAK,EAAEuF,cAAe;AACtBpF,UAAAA,SAAS,EAAEyE,sBAAuB;AAClClH,UAAAA,YAAY,EAAEmG;AAAsB,SACrC,CACF;AAAA,OACE,CAAC,EACL6B,aAAa,iBAAI5E,cAAA,CAACgF,OAAO,EAAA;AAAC1E,QAAAA,KAAK,EAAC,SAAS;AAAAJ,QAAAA,QAAA,EAAE0E;AAAa,OAAU,CAAC,EACnErC,4BAA4B,iBAC3BvC,cAAA,CAACgF,OAAO,EAAA;AAAC1E,QAAAA,KAAK,EAAC,SAAS;AAAAJ,QAAAA,QAAA,EACrBvB,CAAC,CAAC,gDAAgD,EAAE;AACnD2F,UAAAA,KAAK,EAAEJ;SACR;AAAC,OACK,CACV,EACA1B,sBAAsB,iBACrBxC,cAAA,CAACgF,OAAO,EAAA;AAAC1E,QAAAA,KAAK,EAAC,SAAS;AAAAJ,QAAAA,QAAA,EACrBvB,CAAC,CAAC,iDAAiD,EAAE;AACpD2F,UAAAA,KAAK,EAAEJ;SACR;AAAC,OACK,CACV;KACE;AAAC,GACH,CAAC;AAEV;;;;"}
|
|
@@ -9,7 +9,7 @@ var Form = require('@bigbinary/neetoui/formik/Form');
|
|
|
9
9
|
var reactI18next = require('react-i18next');
|
|
10
10
|
var reactRouterDom = require('react-router-dom');
|
|
11
11
|
var constants = require('../constants-D3nzz3Te.js');
|
|
12
|
-
var useSparkpostDomain = require('../useSparkpostDomain-
|
|
12
|
+
var useSparkpostDomain = require('../useSparkpostDomain-wsENCoto.js');
|
|
13
13
|
var jsxRuntime = require('react/jsx-runtime');
|
|
14
14
|
require('@babel/runtime/helpers/defineProperty');
|
|
15
15
|
require('@babel/runtime/helpers/objectWithoutProperties');
|
|
@@ -21,6 +21,7 @@ require('i18next');
|
|
|
21
21
|
require('yup');
|
|
22
22
|
require('@babel/runtime/helpers/slicedToArray');
|
|
23
23
|
require('@bigbinary/neetoui/Toastr');
|
|
24
|
+
require('../useSparkpostApi-pa64NIl6.js');
|
|
24
25
|
require('@tanstack/react-query');
|
|
25
26
|
require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
26
27
|
require('axios');
|