@bigbinary/neeto-email-delivery-frontend 1.0.27 → 1.0.28
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/app/javascript/src/translations/en.json +1 -0
- package/dist/cjs/index.js +46 -23
- package/dist/cjs/index.js.map +1 -1
- package/dist/index.js +47 -24
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -113,6 +113,7 @@
|
|
|
113
113
|
"integrationDetail": {
|
|
114
114
|
"connectTitle": "Connect {{appName, anyCase}} with {{provider, anyCase}}.",
|
|
115
115
|
"connectedTitle": "Your {{provider, anyCase}} account is connected now.",
|
|
116
|
+
"pendingTitle": "Your {{provider, anyCase}} setup is pending.",
|
|
116
117
|
"connectedEmail": "Connected email: <bold>{{email}}</bold>",
|
|
117
118
|
"onlyOneIntegration": "Currently, you can connect only one email integration at a time. Either Gmail, Outlook, Custom email provider, or SMTP. Please disconnect your <disconnectLink>{{activeProvider, anyCase}}</disconnectLink> integration to connect {{targetProvider, anyCase}}.",
|
|
118
119
|
"pendingIntegrationBlocked": "You have a pending <disconnectLink>{{activeProvider, anyCase}}</disconnectLink> integration. Please disconnect it before connecting {{targetProvider, anyCase}}.",
|
package/dist/cjs/index.js
CHANGED
|
@@ -5,7 +5,8 @@ var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
|
5
5
|
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
6
6
|
var react = require('react');
|
|
7
7
|
var utils = require('@bigbinary/neeto-commons-frontend/utils');
|
|
8
|
-
var
|
|
8
|
+
var Check = require('@bigbinary/neeto-icons/Check');
|
|
9
|
+
var Warning = require('@bigbinary/neeto-icons/Warning');
|
|
9
10
|
var CardLayout = require('@bigbinary/neeto-molecules/CardLayout');
|
|
10
11
|
var Button = require('@bigbinary/neetoui/Button');
|
|
11
12
|
var Callout = require('@bigbinary/neetoui/Callout');
|
|
@@ -33,8 +34,6 @@ require('@bigbinary/neeto-cist');
|
|
|
33
34
|
require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
34
35
|
require('@bigbinary/neetoui/Toastr');
|
|
35
36
|
require('@tanstack/react-query');
|
|
36
|
-
require('@bigbinary/neeto-icons/Check');
|
|
37
|
-
require('@bigbinary/neeto-icons/Warning');
|
|
38
37
|
require('@bigbinary/neetoui/Tag');
|
|
39
38
|
require('axios');
|
|
40
39
|
require('ramda');
|
|
@@ -306,6 +305,42 @@ var IntegrationDetailPage = function IntegrationDetailPage(_ref) {
|
|
|
306
305
|
return "";
|
|
307
306
|
}
|
|
308
307
|
};
|
|
308
|
+
var renderTitle = function renderTitle() {
|
|
309
|
+
if (isConnected) {
|
|
310
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
311
|
+
className: "flex items-center gap-2",
|
|
312
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
313
|
+
children: t("neetoEmailDelivery.integrationDetail.connectedTitle", {
|
|
314
|
+
provider: providerLabel
|
|
315
|
+
})
|
|
316
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
317
|
+
className: "neeto-ui-bg-success-500 neeto-ui-text-white neeto-ui-rounded-full flex items-center justify-center p-1",
|
|
318
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Check, {
|
|
319
|
+
size: 24
|
|
320
|
+
})
|
|
321
|
+
})]
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
if (isPending) {
|
|
325
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
326
|
+
className: "flex items-center gap-2",
|
|
327
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
328
|
+
children: t("neetoEmailDelivery.integrationDetail.pendingTitle", {
|
|
329
|
+
provider: providerLabel
|
|
330
|
+
})
|
|
331
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
332
|
+
className: "neeto-ui-text-warning-500 flex items-center justify-center p-1",
|
|
333
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Warning, {
|
|
334
|
+
size: 24
|
|
335
|
+
})
|
|
336
|
+
})]
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
return t("neetoEmailDelivery.integrationDetail.connectTitle", {
|
|
340
|
+
appName: appName,
|
|
341
|
+
provider: providerLabel
|
|
342
|
+
});
|
|
343
|
+
};
|
|
309
344
|
var renderActionBlock = function renderActionBlock() {
|
|
310
345
|
if (isConnected) {
|
|
311
346
|
return /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
@@ -352,6 +387,7 @@ var IntegrationDetailPage = function IntegrationDetailPage(_ref) {
|
|
|
352
387
|
icon: /*#__PURE__*/jsxRuntime.jsx(Icon, {
|
|
353
388
|
size: 48
|
|
354
389
|
}),
|
|
390
|
+
title: renderTitle(),
|
|
355
391
|
description: isConnected ? /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
|
|
356
392
|
components: {
|
|
357
393
|
bold: /*#__PURE__*/jsxRuntime.jsx("strong", {})
|
|
@@ -361,20 +397,6 @@ var IntegrationDetailPage = function IntegrationDetailPage(_ref) {
|
|
|
361
397
|
email: connectedEmail
|
|
362
398
|
}
|
|
363
399
|
}) : description,
|
|
364
|
-
title: isConnected ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
365
|
-
className: "flex items-center gap-2",
|
|
366
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
367
|
-
children: t("neetoEmailDelivery.integrationDetail.connectedTitle", {
|
|
368
|
-
provider: providerLabel
|
|
369
|
-
})
|
|
370
|
-
}), /*#__PURE__*/jsxRuntime.jsx(CheckCircle, {
|
|
371
|
-
color: "#16A34A",
|
|
372
|
-
size: 24
|
|
373
|
-
})]
|
|
374
|
-
}) : t("neetoEmailDelivery.integrationDetail.connectTitle", {
|
|
375
|
-
appName: appName,
|
|
376
|
-
provider: providerLabel
|
|
377
|
-
}),
|
|
378
400
|
children: [(isConnected ? connectedScopeText || scopeText : scopeText) && /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
379
401
|
style: "body1",
|
|
380
402
|
children: isConnected ? connectedScopeText || scopeText : scopeText
|
|
@@ -387,10 +409,10 @@ var IntegrationDetailPage = function IntegrationDetailPage(_ref) {
|
|
|
387
409
|
provider: providerLabel
|
|
388
410
|
},
|
|
389
411
|
components: {
|
|
390
|
-
helpLink: /*#__PURE__*/jsxRuntime.jsx(
|
|
391
|
-
|
|
412
|
+
helpLink: /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
413
|
+
"data-testid": "help-doc-link",
|
|
392
414
|
href: helpArticleUrl,
|
|
393
|
-
|
|
415
|
+
style: "link",
|
|
394
416
|
target: "_blank"
|
|
395
417
|
})
|
|
396
418
|
}
|
|
@@ -400,9 +422,10 @@ var IntegrationDetailPage = function IntegrationDetailPage(_ref) {
|
|
|
400
422
|
children: /*#__PURE__*/jsxRuntime.jsx("p", {
|
|
401
423
|
children: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
|
|
402
424
|
components: {
|
|
403
|
-
disconnectLink: /*#__PURE__*/jsxRuntime.jsx(
|
|
404
|
-
|
|
405
|
-
|
|
425
|
+
disconnectLink: /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
426
|
+
"data-testid": "disconnect-link",
|
|
427
|
+
href: activeProviderRoute,
|
|
428
|
+
style: "link"
|
|
406
429
|
})
|
|
407
430
|
},
|
|
408
431
|
i18nKey: connectedIntegration.isPending ? "neetoEmailDelivery.integrationDetail.pendingIntegrationBlocked" : "neetoEmailDelivery.integrationDetail.onlyOneIntegration",
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../app/javascript/src/components/Smtp/constants.js","../../app/javascript/src/components/Smtp/Setup.jsx","../../app/javascript/src/components/IntegrationDetailPage/constants.js","../../app/javascript/src/components/IntegrationDetailPage/index.jsx"],"sourcesContent":["import { t } from \"i18next\";\nimport * as yup from \"yup\";\n\nexport const ENCRYPTION_OPTIONS = [\n { label: \"None\", value: \"none\" },\n { label: \"StartTLS\", value: \"starttls\" },\n { label: \"SSL\", value: \"ssl\" },\n];\n\nexport const SMTP_ACCOUNT_INITIAL_VALUES = {\n host: \"\",\n port: 587,\n username: \"\",\n password: \"\",\n email: \"\",\n encryption: \"starttls\",\n displayName: \"\",\n};\n\nexport const SMTP_ACCOUNT_VALIDATION_SCHEMA = yup.object().shape({\n host: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.hostLabel\"),\n })\n ),\n port: yup.number().required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.portLabel\"),\n })\n ),\n username: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.usernameLabel\"),\n })\n ),\n password: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.passwordLabel\"),\n })\n ),\n email: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.emailLabel\"),\n })\n )\n .email(t(\"neetoEmailDelivery.smtp.setup.emailInvalid\")),\n displayName: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.displayNameLabel\"),\n })\n ),\n encryption: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.encryptionLabel\"),\n })\n ),\n});\n","import { Callout, Pane, Typography } from \"neetoui\";\nimport { Form, Input, Radio, ActionBlock } from \"neetoui/formik\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { useCreateSmtp } from \"hooks/reactQuery/integrations/useSmtpIntegrationApi\";\n\nimport {\n SMTP_ACCOUNT_INITIAL_VALUES,\n SMTP_ACCOUNT_VALIDATION_SCHEMA,\n ENCRYPTION_OPTIONS,\n} from \"./constants\";\n\nconst SmtpSetup = ({ ownerId, onDone, onCancel, isOpen }) => {\n const { t } = useTranslation();\n\n const { isPending: isCreating, mutate: createSmtp } = useCreateSmtp({\n ownerId,\n });\n\n const handleSubmit = values => {\n createSmtp({ smtp_account: values }, { onSuccess: onDone });\n };\n\n return (\n <Pane {...{ isOpen }} size=\"lg\" onClose={onCancel}>\n <Pane.Header>\n <Typography style=\"h2\" weight=\"semibold\">\n {t(\"neetoEmailDelivery.smtp.setup.title\")}\n </Typography>\n </Pane.Header>\n <Form\n className=\"w-full\"\n formikProps={{\n initialValues: SMTP_ACCOUNT_INITIAL_VALUES,\n validationSchema: SMTP_ACCOUNT_VALIDATION_SCHEMA,\n onSubmit: handleSubmit,\n }}\n >\n <Pane.Body className=\"space-y-4\">\n <div className=\"flex flex-col gap-6\">\n <Callout style=\"warning\">\n {t(\"neetoEmailDelivery.smtp.setup.note\")}\n </Callout>\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.hostLabel\")}\n name=\"host\"\n />\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.portLabel\")}\n name=\"port\"\n type=\"number\"\n />\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.usernameLabel\")}\n name=\"username\"\n />\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.passwordLabel\")}\n name=\"password\"\n type=\"password\"\n />\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.emailLabel\")}\n name=\"email\"\n type=\"email\"\n />\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.displayNameLabel\")}\n name=\"displayName\"\n />\n <Radio\n label={t(\"neetoEmailDelivery.smtp.setup.encryptionLabel\")}\n name=\"encryption\"\n >\n {ENCRYPTION_OPTIONS.map(option => (\n <Radio.Item\n key={option.value}\n label={option.label}\n value={option.value}\n />\n ))}\n </Radio>\n </div>\n </Pane.Body>\n <Pane.Footer>\n <ActionBlock\n cancelButtonProps={{ onClick: onCancel }}\n isSubmitting={isCreating}\n submitButtonProps={{\n label: t(\"neetoEmailDelivery.smtp.setup.saveAndActivate\"),\n }}\n />\n </Pane.Footer>\n </Form>\n </Pane>\n );\n};\n\nexport default SmtpSetup;\n","import { MailSend } from \"neetoicons\";\nimport { Gmail as GmailIcon, Outlook as OutlookIcon } from \"neetoicons/misc\";\n\nexport const INTEGRATION_TYPES = {\n GMAIL: \"gmail\",\n OUTLOOK: \"outlook\",\n SPARKPOST: \"sparkpost\",\n SMTP: \"smtp\",\n};\n\nexport const PROVIDER_LABELS = {\n [INTEGRATION_TYPES.GMAIL]: \"Gmail\",\n [INTEGRATION_TYPES.OUTLOOK]: \"Outlook\",\n [INTEGRATION_TYPES.SPARKPOST]: \"Custom email provider\",\n [INTEGRATION_TYPES.SMTP]: \"SMTP\",\n};\n\nexport const PROVIDER_ICONS = {\n [INTEGRATION_TYPES.GMAIL]: GmailIcon,\n [INTEGRATION_TYPES.OUTLOOK]: OutlookIcon,\n [INTEGRATION_TYPES.SPARKPOST]: MailSend,\n [INTEGRATION_TYPES.SMTP]: MailSend,\n};\n","import { useState } from \"react\";\n\nimport { buildUrl } from \"neetocommons/utils\";\nimport { CheckCircle } from \"neetoicons\";\nimport CardLayout from \"neetomolecules/CardLayout\";\nimport { Button, Callout, Spinner, Typography } from \"neetoui\";\nimport { Trans, useTranslation } from \"react-i18next\";\nimport { useHistory, Link } from \"react-router-dom\";\n\nimport {\n GMAIL_OAUTH_CONNECT_URL,\n OUTLOOK_OAUTH_CONNECT_URL,\n} from \"apis/integrations/constants\";\nimport SmtpSetup from \"components/Smtp/Setup\";\nimport useGmail from \"hooks/integrations/useGmail\";\nimport useOutlook from \"hooks/integrations/useOutlook\";\nimport useSmtp from \"hooks/integrations/useSmtp\";\nimport useSparkpostDomain from \"hooks/integrations/useSparkpostDomain\";\nimport { useFetchConnectedIntegration } from \"hooks/reactQuery/integrations/useEmailDeliveryIntegrationApi\";\n\nimport {\n INTEGRATION_TYPES,\n PROVIDER_LABELS,\n PROVIDER_ICONS,\n} from \"./constants\";\n\nconst IntegrationDetailPage = ({\n type,\n ownerId,\n canManageIntegrations,\n appName,\n scopeText,\n connectedScopeText,\n helpArticleUrl,\n indexRoute,\n integrationRoutes,\n ownDomainSetupRoute,\n ownDomainVerifyRoute,\n}) => {\n const { t } = useTranslation();\n const history = useHistory();\n const [isSmtpPaneOpen, setIsSmtpPaneOpen] = useState(false);\n\n const providerLabel = PROVIDER_LABELS[type];\n const Icon = PROVIDER_ICONS[type];\n const description = t(`neetoEmailDelivery.${type}.description`);\n\n const gmailIntegration = useGmail({\n ownerId,\n indexRoute,\n canManageIntegrations,\n });\n\n const outlookIntegration = useOutlook({\n ownerId,\n indexRoute,\n canManageIntegrations,\n });\n\n const sparkpostIntegration = useSparkpostDomain({\n ownerId,\n canManageIntegrations,\n });\n\n const smtpIntegration = useSmtp({ ownerId, canManageIntegrations });\n\n const { integration: connectedIntegration, isLoading: isIntegrationLoading } =\n useFetchConnectedIntegration(ownerId);\n\n const integrationMap = {\n [INTEGRATION_TYPES.GMAIL]: gmailIntegration,\n [INTEGRATION_TYPES.OUTLOOK]: outlookIntegration,\n [INTEGRATION_TYPES.SPARKPOST]: sparkpostIntegration,\n [INTEGRATION_TYPES.SMTP]: smtpIntegration,\n };\n\n const currentIntegration = integrationMap[type];\n const {\n isConnected,\n isDestroying,\n onDisconnect,\n data = {},\n errorMessage,\n } = currentIntegration;\n\n const connectedEmail = data?.email;\n\n const isOutlookPending =\n type === INTEGRATION_TYPES.OUTLOOK &&\n outlookIntegration.isWaitingForTestEmail;\n\n const isSparkpostPending =\n type === INTEGRATION_TYPES.SPARKPOST &&\n sparkpostIntegration.exists &&\n !isConnected;\n\n const isPending = isOutlookPending || isSparkpostPending;\n\n const isLoading =\n gmailIntegration.isLoading ||\n outlookIntegration.isLoading ||\n sparkpostIntegration.isLoading ||\n smtpIntegration.isLoading ||\n isIntegrationLoading;\n\n const isBlocked = connectedIntegration && connectedIntegration.type !== type;\n\n const activeProviderLabel = isBlocked\n ? PROVIDER_LABELS[connectedIntegration.type]\n : null;\n\n const activeProviderRoute = isBlocked\n ? integrationRoutes?.[connectedIntegration.type]\n : null;\n\n const handleConnect = () => {\n switch (type) {\n case INTEGRATION_TYPES.GMAIL:\n window.location.href = buildUrl(GMAIL_OAUTH_CONNECT_URL, { ownerId });\n break;\n case INTEGRATION_TYPES.OUTLOOK:\n window.location.href = buildUrl(OUTLOOK_OAUTH_CONNECT_URL, {\n ownerId,\n });\n break;\n case INTEGRATION_TYPES.SPARKPOST:\n history.push(ownDomainSetupRoute);\n break;\n case INTEGRATION_TYPES.SMTP:\n setIsSmtpPaneOpen(true);\n break;\n default:\n break;\n }\n };\n\n const getConnectButtonLabel = () => {\n switch (type) {\n case INTEGRATION_TYPES.GMAIL:\n return t(\"neetoEmailDelivery.integrationDetail.connectGmail\");\n case INTEGRATION_TYPES.OUTLOOK:\n return t(\"neetoEmailDelivery.integrationDetail.connectOutlook\");\n case INTEGRATION_TYPES.SPARKPOST:\n return t(\"neetoEmailDelivery.integrationDetail.setupDomain\");\n case INTEGRATION_TYPES.SMTP:\n return t(\"neetoEmailDelivery.integrationDetail.connectSmtp\");\n default:\n return \"\";\n }\n };\n\n const renderActionBlock = () => {\n if (isConnected) {\n return (\n <Button\n data-testid=\"disconnect-button\"\n label={t(\"neetoEmailDelivery.integrationDetail.disconnect\")}\n loading={isDestroying}\n style=\"danger\"\n onClick={onDisconnect}\n />\n );\n }\n\n if (isPending) {\n return (\n <div className=\"flex items-center gap-2\">\n {isSparkpostPending && (\n <Button\n data-testid=\"continue-verification-button\"\n to={ownDomainVerifyRoute}\n label={t(\n \"neetoEmailDelivery.sparkpost.emailDelivery.continueVerification\"\n )}\n />\n )}\n <Button\n data-testid=\"disconnect-button\"\n label={t(\"neetoEmailDelivery.integrationDetail.disconnect\")}\n loading={isDestroying}\n style=\"danger\"\n onClick={onDisconnect}\n />\n </div>\n );\n }\n\n if (isBlocked) return null;\n\n return (\n <Button\n data-testid=\"connect-button\"\n label={getConnectButtonLabel()}\n style=\"primary\"\n onClick={handleConnect}\n />\n );\n };\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 <>\n <CardLayout\n actionBlock={renderActionBlock()}\n icon={<Icon size={48} />}\n description={\n isConnected ? (\n <Trans\n components={{ bold: <strong /> }}\n i18nKey=\"neetoEmailDelivery.integrationDetail.connectedEmail\"\n values={{ email: connectedEmail }}\n />\n ) : (\n description\n )\n }\n title={\n isConnected ? (\n <div className=\"flex items-center gap-2\">\n <span>\n {t(\"neetoEmailDelivery.integrationDetail.connectedTitle\", {\n provider: providerLabel,\n })}\n </span>\n <CheckCircle color=\"#16A34A\" size={24} />\n </div>\n ) : (\n t(\"neetoEmailDelivery.integrationDetail.connectTitle\", {\n appName,\n provider: providerLabel,\n })\n )\n }\n >\n {(isConnected ? connectedScopeText || scopeText : scopeText) && (\n <Typography style=\"body1\">\n {isConnected ? connectedScopeText || scopeText : scopeText}\n </Typography>\n )}\n {!isConnected && helpArticleUrl && (\n <Typography className=\"my-2\" style=\"body2\">\n <Trans\n i18nKey=\"neetoEmailDelivery.integrationDetail.helpArticleText\"\n values={{ provider: providerLabel }}\n components={{\n helpLink: (\n <a\n className=\"neeto-ui-text-primary-500\"\n href={helpArticleUrl}\n rel=\"noopener noreferrer\"\n target=\"_blank\"\n />\n ),\n }}\n />\n </Typography>\n )}\n {!isConnected && !isPending && isBlocked && (\n <Callout\n style={connectedIntegration.isPending ? \"warning\" : \"danger\"}\n >\n <p>\n <Trans\n components={{\n disconnectLink: (\n <Link\n className=\"neeto-ui-font-semibold neeto-ui-text-primary-500\"\n to={activeProviderRoute}\n />\n ),\n }}\n i18nKey={\n connectedIntegration.isPending\n ? \"neetoEmailDelivery.integrationDetail.pendingIntegrationBlocked\"\n : \"neetoEmailDelivery.integrationDetail.onlyOneIntegration\"\n }\n values={{\n activeProvider: activeProviderLabel,\n targetProvider: providerLabel,\n }}\n />\n </p>\n </Callout>\n )}\n {errorMessage && <Callout style=\"danger\">{errorMessage}</Callout>}\n {isOutlookPending && (\n <Callout style=\"warning\">\n {t(\"neetoEmailDelivery.outlook.waitingForTestEmail\", {\n email: connectedEmail,\n })}\n </Callout>\n )}\n {isSparkpostPending && (\n <Callout style=\"warning\">\n {t(\n \"neetoEmailDelivery.sparkpost.emailDelivery.verificationPending\",\n { domain: data?.domain }\n )}\n </Callout>\n )}\n </CardLayout>\n {type === INTEGRATION_TYPES.SMTP && (\n <SmtpSetup\n {...{ ownerId }}\n isOpen={isSmtpPaneOpen}\n onCancel={() => setIsSmtpPaneOpen(false)}\n onDone={() => setIsSmtpPaneOpen(false)}\n />\n )}\n </>\n );\n};\n\nexport default IntegrationDetailPage;\n"],"names":["ENCRYPTION_OPTIONS","label","value","SMTP_ACCOUNT_INITIAL_VALUES","host","port","username","password","email","encryption","displayName","SMTP_ACCOUNT_VALIDATION_SCHEMA","yup","object","shape","string","trim","required","t","field","number","SmtpSetup","_ref","ownerId","onDone","onCancel","isOpen","_useTranslation","useTranslation","_useCreateSmtp","useCreateSmtp","isCreating","isPending","createSmtp","mutate","handleSubmit","values","smtp_account","onSuccess","_jsxs","Pane","size","onClose","children","_jsx","Header","Typography","style","weight","Form","className","formikProps","initialValues","validationSchema","onSubmit","Body","Callout","Input","name","type","Radio","map","option","Item","Footer","ActionBlock","cancelButtonProps","onClick","isSubmitting","submitButtonProps","INTEGRATION_TYPES","GMAIL","OUTLOOK","SPARKPOST","SMTP","PROVIDER_LABELS","_defineProperty","PROVIDER_ICONS","GmailIcon","OutlookIcon","MailSend","IntegrationDetailPage","canManageIntegrations","appName","scopeText","connectedScopeText","helpArticleUrl","indexRoute","integrationRoutes","ownDomainSetupRoute","ownDomainVerifyRoute","history","useHistory","_useState","useState","_useState2","_slicedToArray","isSmtpPaneOpen","setIsSmtpPaneOpen","providerLabel","Icon","description","concat","gmailIntegration","useGmail","outlookIntegration","useOutlook","sparkpostIntegration","useSparkpostDomain","smtpIntegration","useSmtp","_useFetchConnectedInt","useFetchConnectedIntegration","connectedIntegration","integration","isIntegrationLoading","isLoading","integrationMap","currentIntegration","isConnected","isDestroying","onDisconnect","_currentIntegration$d","data","errorMessage","connectedEmail","isOutlookPending","isWaitingForTestEmail","isSparkpostPending","exists","isBlocked","activeProviderLabel","activeProviderRoute","handleConnect","window","location","href","buildUrl","GMAIL_OAUTH_CONNECT_URL","OUTLOOK_OAUTH_CONNECT_URL","push","getConnectButtonLabel","renderActionBlock","Button","loading","to","Spinner","_Fragment","CardLayout","actionBlock","icon","Trans","components","bold","i18nKey","title","provider","CheckCircle","color","helpLink","rel","target","disconnectLink","Link","activeProvider","targetProvider","domain"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGO,IAAMA,kBAAkB,GAAG,CAChC;AAAEC,EAAAA,KAAK,EAAE,MAAM;AAAEC,EAAAA,KAAK,EAAE;AAAO,CAAC,EAChC;AAAED,EAAAA,KAAK,EAAE,UAAU;AAAEC,EAAAA,KAAK,EAAE;AAAW,CAAC,EACxC;AAAED,EAAAA,KAAK,EAAE,KAAK;AAAEC,EAAAA,KAAK,EAAE;AAAM,CAAC,CAC/B;AAEM,IAAMC,2BAA2B,GAAG;AACzCC,EAAAA,IAAI,EAAE,EAAE;AACRC,EAAAA,IAAI,EAAE,GAAG;AACTC,EAAAA,QAAQ,EAAE,EAAE;AACZC,EAAAA,QAAQ,EAAE,EAAE;AACZC,EAAAA,KAAK,EAAE,EAAE;AACTC,EAAAA,UAAU,EAAE,UAAU;AACtBC,EAAAA,WAAW,EAAE;AACf,CAAC;AAEM,IAAMC,8BAA8B,GAAGC,cAAG,CAACC,MAAM,EAAE,CAACC,KAAK,CAAC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AAEjC,mBAAmB;AACnCkC,cAAAA,cAAc,EAAElE;AAClB;WACD;SACA;AAAC,OACG,CACV,EACAyB,YAAY,iBAAIhF,cAAA,CAACY,OAAO,EAAA;AAACT,QAAAA,KAAK,EAAC,QAAQ;AAAAJ,QAAAA,QAAA,EAAEiF;AAAY,OAAU,CAAC,EAChEE,gBAAgB,iBACflF,cAAA,CAACY,OAAO,EAAA;AAACT,QAAAA,KAAK,EAAC,SAAS;AAAAJ,QAAAA,QAAA,EACrBzB,CAAC,CAAC,gDAAgD,EAAE;AACnDV,UAAAA,KAAK,EAAEqH;SACR;AAAC,OACK,CACV,EACAG,kBAAkB,iBACjBpF,cAAA,CAACY,OAAO,EAAA;AAACT,QAAAA,KAAK,EAAC,SAAS;AAAAJ,QAAAA,QAAA,EACrBzB,CAAC,CACA,gEAAgE,EAChE;AAAEoJ,UAAAA,MAAM,EAAE3C,IAAI,KAAA,IAAA,IAAJA,IAAI,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAJA,IAAI,CAAE2C;SAClB;AAAC,OACM,CACV;KACS,CAAC,EACZ3G,IAAI,KAAKW,iBAAiB,CAACI,IAAI,iBAC9B9B,cAAA,CAACvB,SAAS,EAAA;AACFE,MAAAA,OAAO,EAAPA,OAAO;AACbG,MAAAA,MAAM,EAAEuE,cAAe;MACvBxE,QAAQ,EAAE,SAAVA,QAAQA,GAAA;QAAA,OAAQyE,iBAAiB,CAAC,KAAK,CAAC;OAAC;MACzC1E,MAAM,EAAE,SAARA,MAAMA,GAAA;QAAA,OAAQ0E,iBAAiB,CAAC,KAAK,CAAC;AAAA;AAAC,KACxC,CACF;AAAA,GACD,CAAC;AAEP;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../app/javascript/src/components/Smtp/constants.js","../../app/javascript/src/components/Smtp/Setup.jsx","../../app/javascript/src/components/IntegrationDetailPage/constants.js","../../app/javascript/src/components/IntegrationDetailPage/index.jsx"],"sourcesContent":["import { t } from \"i18next\";\nimport * as yup from \"yup\";\n\nexport const ENCRYPTION_OPTIONS = [\n { label: \"None\", value: \"none\" },\n { label: \"StartTLS\", value: \"starttls\" },\n { label: \"SSL\", value: \"ssl\" },\n];\n\nexport const SMTP_ACCOUNT_INITIAL_VALUES = {\n host: \"\",\n port: 587,\n username: \"\",\n password: \"\",\n email: \"\",\n encryption: \"starttls\",\n displayName: \"\",\n};\n\nexport const SMTP_ACCOUNT_VALIDATION_SCHEMA = yup.object().shape({\n host: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.hostLabel\"),\n })\n ),\n port: yup.number().required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.portLabel\"),\n })\n ),\n username: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.usernameLabel\"),\n })\n ),\n password: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.passwordLabel\"),\n })\n ),\n email: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.emailLabel\"),\n })\n )\n .email(t(\"neetoEmailDelivery.smtp.setup.emailInvalid\")),\n displayName: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.displayNameLabel\"),\n })\n ),\n encryption: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.encryptionLabel\"),\n })\n ),\n});\n","import { Callout, Pane, Typography } from \"neetoui\";\nimport { Form, Input, Radio, ActionBlock } from \"neetoui/formik\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { useCreateSmtp } from \"hooks/reactQuery/integrations/useSmtpIntegrationApi\";\n\nimport {\n SMTP_ACCOUNT_INITIAL_VALUES,\n SMTP_ACCOUNT_VALIDATION_SCHEMA,\n ENCRYPTION_OPTIONS,\n} from \"./constants\";\n\nconst SmtpSetup = ({ ownerId, onDone, onCancel, isOpen }) => {\n const { t } = useTranslation();\n\n const { isPending: isCreating, mutate: createSmtp } = useCreateSmtp({\n ownerId,\n });\n\n const handleSubmit = values => {\n createSmtp({ smtp_account: values }, { onSuccess: onDone });\n };\n\n return (\n <Pane {...{ isOpen }} size=\"lg\" onClose={onCancel}>\n <Pane.Header>\n <Typography style=\"h2\" weight=\"semibold\">\n {t(\"neetoEmailDelivery.smtp.setup.title\")}\n </Typography>\n </Pane.Header>\n <Form\n className=\"w-full\"\n formikProps={{\n initialValues: SMTP_ACCOUNT_INITIAL_VALUES,\n validationSchema: SMTP_ACCOUNT_VALIDATION_SCHEMA,\n onSubmit: handleSubmit,\n }}\n >\n <Pane.Body className=\"space-y-4\">\n <div className=\"flex flex-col gap-6\">\n <Callout style=\"warning\">\n {t(\"neetoEmailDelivery.smtp.setup.note\")}\n </Callout>\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.hostLabel\")}\n name=\"host\"\n />\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.portLabel\")}\n name=\"port\"\n type=\"number\"\n />\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.usernameLabel\")}\n name=\"username\"\n />\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.passwordLabel\")}\n name=\"password\"\n type=\"password\"\n />\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.emailLabel\")}\n name=\"email\"\n type=\"email\"\n />\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.displayNameLabel\")}\n name=\"displayName\"\n />\n <Radio\n label={t(\"neetoEmailDelivery.smtp.setup.encryptionLabel\")}\n name=\"encryption\"\n >\n {ENCRYPTION_OPTIONS.map(option => (\n <Radio.Item\n key={option.value}\n label={option.label}\n value={option.value}\n />\n ))}\n </Radio>\n </div>\n </Pane.Body>\n <Pane.Footer>\n <ActionBlock\n cancelButtonProps={{ onClick: onCancel }}\n isSubmitting={isCreating}\n submitButtonProps={{\n label: t(\"neetoEmailDelivery.smtp.setup.saveAndActivate\"),\n }}\n />\n </Pane.Footer>\n </Form>\n </Pane>\n );\n};\n\nexport default SmtpSetup;\n","import { MailSend } from \"neetoicons\";\nimport { Gmail as GmailIcon, Outlook as OutlookIcon } from \"neetoicons/misc\";\n\nexport const INTEGRATION_TYPES = {\n GMAIL: \"gmail\",\n OUTLOOK: \"outlook\",\n SPARKPOST: \"sparkpost\",\n SMTP: \"smtp\",\n};\n\nexport const PROVIDER_LABELS = {\n [INTEGRATION_TYPES.GMAIL]: \"Gmail\",\n [INTEGRATION_TYPES.OUTLOOK]: \"Outlook\",\n [INTEGRATION_TYPES.SPARKPOST]: \"Custom email provider\",\n [INTEGRATION_TYPES.SMTP]: \"SMTP\",\n};\n\nexport const PROVIDER_ICONS = {\n [INTEGRATION_TYPES.GMAIL]: GmailIcon,\n [INTEGRATION_TYPES.OUTLOOK]: OutlookIcon,\n [INTEGRATION_TYPES.SPARKPOST]: MailSend,\n [INTEGRATION_TYPES.SMTP]: MailSend,\n};\n","import { useState } from \"react\";\n\nimport { buildUrl } from \"neetocommons/utils\";\nimport { Check, Warning } from \"neetoicons\";\nimport CardLayout from \"neetomolecules/CardLayout\";\nimport { Button, Callout, Spinner, Typography } from \"neetoui\";\nimport { Trans, useTranslation } from \"react-i18next\";\nimport { useHistory } from \"react-router-dom\";\n\nimport {\n GMAIL_OAUTH_CONNECT_URL,\n OUTLOOK_OAUTH_CONNECT_URL,\n} from \"apis/integrations/constants\";\nimport SmtpSetup from \"components/Smtp/Setup\";\nimport useGmail from \"hooks/integrations/useGmail\";\nimport useOutlook from \"hooks/integrations/useOutlook\";\nimport useSmtp from \"hooks/integrations/useSmtp\";\nimport useSparkpostDomain from \"hooks/integrations/useSparkpostDomain\";\nimport { useFetchConnectedIntegration } from \"hooks/reactQuery/integrations/useEmailDeliveryIntegrationApi\";\n\nimport {\n INTEGRATION_TYPES,\n PROVIDER_LABELS,\n PROVIDER_ICONS,\n} from \"./constants\";\n\nconst IntegrationDetailPage = ({\n type,\n ownerId,\n canManageIntegrations,\n appName,\n scopeText,\n connectedScopeText,\n helpArticleUrl,\n indexRoute,\n integrationRoutes,\n ownDomainSetupRoute,\n ownDomainVerifyRoute,\n}) => {\n const { t } = useTranslation();\n const history = useHistory();\n const [isSmtpPaneOpen, setIsSmtpPaneOpen] = useState(false);\n\n const providerLabel = PROVIDER_LABELS[type];\n const Icon = PROVIDER_ICONS[type];\n const description = t(`neetoEmailDelivery.${type}.description`);\n\n const gmailIntegration = useGmail({\n ownerId,\n indexRoute,\n canManageIntegrations,\n });\n\n const outlookIntegration = useOutlook({\n ownerId,\n indexRoute,\n canManageIntegrations,\n });\n\n const sparkpostIntegration = useSparkpostDomain({\n ownerId,\n canManageIntegrations,\n });\n\n const smtpIntegration = useSmtp({ ownerId, canManageIntegrations });\n\n const { integration: connectedIntegration, isLoading: isIntegrationLoading } =\n useFetchConnectedIntegration(ownerId);\n\n const integrationMap = {\n [INTEGRATION_TYPES.GMAIL]: gmailIntegration,\n [INTEGRATION_TYPES.OUTLOOK]: outlookIntegration,\n [INTEGRATION_TYPES.SPARKPOST]: sparkpostIntegration,\n [INTEGRATION_TYPES.SMTP]: smtpIntegration,\n };\n\n const currentIntegration = integrationMap[type];\n const {\n isConnected,\n isDestroying,\n onDisconnect,\n data = {},\n errorMessage,\n } = currentIntegration;\n\n const connectedEmail = data?.email;\n\n const isOutlookPending =\n type === INTEGRATION_TYPES.OUTLOOK &&\n outlookIntegration.isWaitingForTestEmail;\n\n const isSparkpostPending =\n type === INTEGRATION_TYPES.SPARKPOST &&\n sparkpostIntegration.exists &&\n !isConnected;\n\n const isPending = isOutlookPending || isSparkpostPending;\n\n const isLoading =\n gmailIntegration.isLoading ||\n outlookIntegration.isLoading ||\n sparkpostIntegration.isLoading ||\n smtpIntegration.isLoading ||\n isIntegrationLoading;\n\n const isBlocked = connectedIntegration && connectedIntegration.type !== type;\n\n const activeProviderLabel = isBlocked\n ? PROVIDER_LABELS[connectedIntegration.type]\n : null;\n\n const activeProviderRoute = isBlocked\n ? integrationRoutes?.[connectedIntegration.type]\n : null;\n\n const handleConnect = () => {\n switch (type) {\n case INTEGRATION_TYPES.GMAIL:\n window.location.href = buildUrl(GMAIL_OAUTH_CONNECT_URL, { ownerId });\n break;\n case INTEGRATION_TYPES.OUTLOOK:\n window.location.href = buildUrl(OUTLOOK_OAUTH_CONNECT_URL, {\n ownerId,\n });\n break;\n case INTEGRATION_TYPES.SPARKPOST:\n history.push(ownDomainSetupRoute);\n break;\n case INTEGRATION_TYPES.SMTP:\n setIsSmtpPaneOpen(true);\n break;\n default:\n break;\n }\n };\n\n const getConnectButtonLabel = () => {\n switch (type) {\n case INTEGRATION_TYPES.GMAIL:\n return t(\"neetoEmailDelivery.integrationDetail.connectGmail\");\n case INTEGRATION_TYPES.OUTLOOK:\n return t(\"neetoEmailDelivery.integrationDetail.connectOutlook\");\n case INTEGRATION_TYPES.SPARKPOST:\n return t(\"neetoEmailDelivery.integrationDetail.setupDomain\");\n case INTEGRATION_TYPES.SMTP:\n return t(\"neetoEmailDelivery.integrationDetail.connectSmtp\");\n default:\n return \"\";\n }\n };\n\n const renderTitle = () => {\n if (isConnected) {\n return (\n <div className=\"flex items-center gap-2\">\n <span>\n {t(\"neetoEmailDelivery.integrationDetail.connectedTitle\", {\n provider: providerLabel,\n })}\n </span>\n <div className=\"neeto-ui-bg-success-500 neeto-ui-text-white neeto-ui-rounded-full flex items-center justify-center p-1\">\n <Check size={24} />\n </div>\n </div>\n );\n }\n\n if (isPending) {\n return (\n <div className=\"flex items-center gap-2\">\n <span>\n {t(\"neetoEmailDelivery.integrationDetail.pendingTitle\", {\n provider: providerLabel,\n })}\n </span>\n <div className=\"neeto-ui-text-warning-500 flex items-center justify-center p-1\">\n <Warning size={24} />\n </div>\n </div>\n );\n }\n\n return t(\"neetoEmailDelivery.integrationDetail.connectTitle\", {\n appName,\n provider: providerLabel,\n });\n };\n\n const renderActionBlock = () => {\n if (isConnected) {\n return (\n <Button\n data-testid=\"disconnect-button\"\n label={t(\"neetoEmailDelivery.integrationDetail.disconnect\")}\n loading={isDestroying}\n style=\"danger\"\n onClick={onDisconnect}\n />\n );\n }\n\n if (isPending) {\n return (\n <div className=\"flex items-center gap-2\">\n {isSparkpostPending && (\n <Button\n data-testid=\"continue-verification-button\"\n to={ownDomainVerifyRoute}\n label={t(\n \"neetoEmailDelivery.sparkpost.emailDelivery.continueVerification\"\n )}\n />\n )}\n <Button\n data-testid=\"disconnect-button\"\n label={t(\"neetoEmailDelivery.integrationDetail.disconnect\")}\n loading={isDestroying}\n style=\"danger\"\n onClick={onDisconnect}\n />\n </div>\n );\n }\n\n if (isBlocked) return null;\n\n return (\n <Button\n data-testid=\"connect-button\"\n label={getConnectButtonLabel()}\n style=\"primary\"\n onClick={handleConnect}\n />\n );\n };\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 <>\n <CardLayout\n actionBlock={renderActionBlock()}\n icon={<Icon size={48} />}\n title={renderTitle()}\n description={\n isConnected ? (\n <Trans\n components={{ bold: <strong /> }}\n i18nKey=\"neetoEmailDelivery.integrationDetail.connectedEmail\"\n values={{ email: connectedEmail }}\n />\n ) : (\n description\n )\n }\n >\n {(isConnected ? connectedScopeText || scopeText : scopeText) && (\n <Typography style=\"body1\">\n {isConnected ? connectedScopeText || scopeText : scopeText}\n </Typography>\n )}\n {!isConnected && helpArticleUrl && (\n <Typography className=\"my-2\" style=\"body2\">\n <Trans\n i18nKey=\"neetoEmailDelivery.integrationDetail.helpArticleText\"\n values={{ provider: providerLabel }}\n components={{\n helpLink: (\n <Button\n data-testid=\"help-doc-link\"\n href={helpArticleUrl}\n style=\"link\"\n target=\"_blank\"\n />\n ),\n }}\n />\n </Typography>\n )}\n {!isConnected && !isPending && isBlocked && (\n <Callout\n style={connectedIntegration.isPending ? \"warning\" : \"danger\"}\n >\n <p>\n <Trans\n components={{\n disconnectLink: (\n <Button\n data-testid=\"disconnect-link\"\n href={activeProviderRoute}\n style=\"link\"\n />\n ),\n }}\n i18nKey={\n connectedIntegration.isPending\n ? \"neetoEmailDelivery.integrationDetail.pendingIntegrationBlocked\"\n : \"neetoEmailDelivery.integrationDetail.onlyOneIntegration\"\n }\n values={{\n activeProvider: activeProviderLabel,\n targetProvider: providerLabel,\n }}\n />\n </p>\n </Callout>\n )}\n {errorMessage && <Callout style=\"danger\">{errorMessage}</Callout>}\n {isOutlookPending && (\n <Callout style=\"warning\">\n {t(\"neetoEmailDelivery.outlook.waitingForTestEmail\", {\n email: connectedEmail,\n })}\n </Callout>\n )}\n {isSparkpostPending && (\n <Callout style=\"warning\">\n {t(\n \"neetoEmailDelivery.sparkpost.emailDelivery.verificationPending\",\n { domain: data?.domain }\n )}\n </Callout>\n )}\n </CardLayout>\n {type === INTEGRATION_TYPES.SMTP && (\n <SmtpSetup\n {...{ ownerId }}\n isOpen={isSmtpPaneOpen}\n onCancel={() => setIsSmtpPaneOpen(false)}\n onDone={() => setIsSmtpPaneOpen(false)}\n />\n )}\n </>\n );\n};\n\nexport default IntegrationDetailPage;\n"],"names":["ENCRYPTION_OPTIONS","label","value","SMTP_ACCOUNT_INITIAL_VALUES","host","port","username","password","email","encryption","displayName","SMTP_ACCOUNT_VALIDATION_SCHEMA","yup","object","shape","string","trim","required","t","field","number","SmtpSetup","_ref","ownerId","onDone","onCancel","isOpen","_useTranslation","useTranslation","_useCreateSmtp","useCreateSmtp","isCreating","isPending","createSmtp","mutate","handleSubmit","values","smtp_account","onSuccess","_jsxs","Pane","size","onClose","children","_jsx","Header","Typography","style","weight","Form","className","formikProps","initialValues","validationSchema","onSubmit","Body","Callout","Input","name","type","Radio","map","option","Item","Footer","ActionBlock","cancelButtonProps","onClick","isSubmitting","submitButtonProps","INTEGRATION_TYPES","GMAIL","OUTLOOK","SPARKPOST","SMTP","PROVIDER_LABELS","_defineProperty","PROVIDER_ICONS","GmailIcon","OutlookIcon","MailSend","IntegrationDetailPage","canManageIntegrations","appName","scopeText","connectedScopeText","helpArticleUrl","indexRoute","integrationRoutes","ownDomainSetupRoute","ownDomainVerifyRoute","history","useHistory","_useState","useState","_useState2","_slicedToArray","isSmtpPaneOpen","setIsSmtpPaneOpen","providerLabel","Icon","description","concat","gmailIntegration","useGmail","outlookIntegration","useOutlook","sparkpostIntegration","useSparkpostDomain","smtpIntegration","useSmtp","_useFetchConnectedInt","useFetchConnectedIntegration","connectedIntegration","integration","isIntegrationLoading","isLoading","integrationMap","currentIntegration","isConnected","isDestroying","onDisconnect","_currentIntegration$d","data","errorMessage","connectedEmail","isOutlookPending","isWaitingForTestEmail","isSparkpostPending","exists","isBlocked","activeProviderLabel","activeProviderRoute","handleConnect","window","location","href","buildUrl","GMAIL_OAUTH_CONNECT_URL","OUTLOOK_OAUTH_CONNECT_URL","push","getConnectButtonLabel","renderTitle","provider","Check","Warning","renderActionBlock","Button","loading","to","Spinner","_Fragment","CardLayout","actionBlock","icon","title","Trans","components","bold","i18nKey","helpLink","target","disconnectLink","activeProvider","targetProvider","domain"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGO,IAAMA,kBAAkB,GAAG,CAChC;AAAEC,EAAAA,KAAK,EAAE,MAAM;AAAEC,EAAAA,KAAK,EAAE;AAAO,CAAC,EAChC;AAAED,EAAAA,KAAK,EAAE,UAAU;AAAEC,EAAAA,KAAK,EAAE;AAAW,CAAC,EACxC;AAAED,EAAAA,KAAK,EAAE,KAAK;AAAEC,EAAAA,KAAK,EAAE;AAAM,CAAC,CAC/B;AAEM,IAAMC,2BAA2B,GAAG;AACzCC,EAAAA,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zB,CAAC,CAAC,gDAAgD,EAAE;AACnDV,UAAAA,KAAK,EAAEqH;SACR;AAAC,OACK,CACV,EACAG,kBAAkB,iBACjBpF,cAAA,CAACY,OAAO,EAAA;AAACT,QAAAA,KAAK,EAAC,SAAS;AAAAJ,QAAAA,QAAA,EACrBzB,CAAC,CACA,gEAAgE,EAChE;AAAEmJ,UAAAA,MAAM,EAAE1C,IAAI,KAAA,IAAA,IAAJA,IAAI,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAJA,IAAI,CAAE0C;SAClB;AAAC,OACM,CACV;KACS,CAAC,EACZ1G,IAAI,KAAKW,iBAAiB,CAACI,IAAI,iBAC9B9B,cAAA,CAACvB,SAAS,EAAA;AACFE,MAAAA,OAAO,EAAPA,OAAO;AACbG,MAAAA,MAAM,EAAEuE,cAAe;MACvBxE,QAAQ,EAAE,SAAVA,QAAQA,GAAA;QAAA,OAAQyE,iBAAiB,CAAC,KAAK,CAAC;OAAC;MACzC1E,MAAM,EAAE,SAARA,MAAMA,GAAA;QAAA,OAAQ0E,iBAAiB,CAAC,KAAK,CAAC;AAAA;AAAC,KACxC,CACF;AAAA,GACD,CAAC;AAEP;;;;;;;"}
|
package/dist/index.js
CHANGED
|
@@ -4,14 +4,15 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
|
4
4
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
5
5
|
import { useState } from 'react';
|
|
6
6
|
import { buildUrl } from '@bigbinary/neeto-commons-frontend/utils';
|
|
7
|
-
import
|
|
7
|
+
import Check from '@bigbinary/neeto-icons/Check';
|
|
8
|
+
import Warning from '@bigbinary/neeto-icons/Warning';
|
|
8
9
|
import CardLayout from '@bigbinary/neeto-molecules/CardLayout';
|
|
9
10
|
import Button from '@bigbinary/neetoui/Button';
|
|
10
11
|
import Callout from '@bigbinary/neetoui/Callout';
|
|
11
12
|
import Spinner from '@bigbinary/neetoui/Spinner';
|
|
12
13
|
import Typography from '@bigbinary/neetoui/Typography';
|
|
13
14
|
import { useTranslation, Trans } from 'react-i18next';
|
|
14
|
-
import { useHistory
|
|
15
|
+
import { useHistory } from 'react-router-dom';
|
|
15
16
|
import { g as useCreateSmtp, O as OUTLOOK_OAUTH_CONNECT_URL, G as GMAIL_OAUTH_CONNECT_URL } from './useSparkpostApi-tYImubXZ.js';
|
|
16
17
|
import Pane from '@bigbinary/neetoui/Pane';
|
|
17
18
|
import Form from '@bigbinary/neetoui/formik/Form';
|
|
@@ -32,8 +33,6 @@ import '@bigbinary/neeto-cist';
|
|
|
32
33
|
import '@bigbinary/neeto-commons-frontend/react-utils';
|
|
33
34
|
import '@bigbinary/neetoui/Toastr';
|
|
34
35
|
import '@tanstack/react-query';
|
|
35
|
-
import '@bigbinary/neeto-icons/Check';
|
|
36
|
-
import '@bigbinary/neeto-icons/Warning';
|
|
37
36
|
import '@bigbinary/neetoui/Tag';
|
|
38
37
|
import 'axios';
|
|
39
38
|
import 'ramda';
|
|
@@ -286,6 +285,42 @@ var IntegrationDetailPage = function IntegrationDetailPage(_ref) {
|
|
|
286
285
|
return "";
|
|
287
286
|
}
|
|
288
287
|
};
|
|
288
|
+
var renderTitle = function renderTitle() {
|
|
289
|
+
if (isConnected) {
|
|
290
|
+
return /*#__PURE__*/jsxs("div", {
|
|
291
|
+
className: "flex items-center gap-2",
|
|
292
|
+
children: [/*#__PURE__*/jsx("span", {
|
|
293
|
+
children: t("neetoEmailDelivery.integrationDetail.connectedTitle", {
|
|
294
|
+
provider: providerLabel
|
|
295
|
+
})
|
|
296
|
+
}), /*#__PURE__*/jsx("div", {
|
|
297
|
+
className: "neeto-ui-bg-success-500 neeto-ui-text-white neeto-ui-rounded-full flex items-center justify-center p-1",
|
|
298
|
+
children: /*#__PURE__*/jsx(Check, {
|
|
299
|
+
size: 24
|
|
300
|
+
})
|
|
301
|
+
})]
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
if (isPending) {
|
|
305
|
+
return /*#__PURE__*/jsxs("div", {
|
|
306
|
+
className: "flex items-center gap-2",
|
|
307
|
+
children: [/*#__PURE__*/jsx("span", {
|
|
308
|
+
children: t("neetoEmailDelivery.integrationDetail.pendingTitle", {
|
|
309
|
+
provider: providerLabel
|
|
310
|
+
})
|
|
311
|
+
}), /*#__PURE__*/jsx("div", {
|
|
312
|
+
className: "neeto-ui-text-warning-500 flex items-center justify-center p-1",
|
|
313
|
+
children: /*#__PURE__*/jsx(Warning, {
|
|
314
|
+
size: 24
|
|
315
|
+
})
|
|
316
|
+
})]
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
return t("neetoEmailDelivery.integrationDetail.connectTitle", {
|
|
320
|
+
appName: appName,
|
|
321
|
+
provider: providerLabel
|
|
322
|
+
});
|
|
323
|
+
};
|
|
289
324
|
var renderActionBlock = function renderActionBlock() {
|
|
290
325
|
if (isConnected) {
|
|
291
326
|
return /*#__PURE__*/jsx(Button, {
|
|
@@ -332,6 +367,7 @@ var IntegrationDetailPage = function IntegrationDetailPage(_ref) {
|
|
|
332
367
|
icon: /*#__PURE__*/jsx(Icon, {
|
|
333
368
|
size: 48
|
|
334
369
|
}),
|
|
370
|
+
title: renderTitle(),
|
|
335
371
|
description: isConnected ? /*#__PURE__*/jsx(Trans, {
|
|
336
372
|
components: {
|
|
337
373
|
bold: /*#__PURE__*/jsx("strong", {})
|
|
@@ -341,20 +377,6 @@ var IntegrationDetailPage = function IntegrationDetailPage(_ref) {
|
|
|
341
377
|
email: connectedEmail
|
|
342
378
|
}
|
|
343
379
|
}) : description,
|
|
344
|
-
title: isConnected ? /*#__PURE__*/jsxs("div", {
|
|
345
|
-
className: "flex items-center gap-2",
|
|
346
|
-
children: [/*#__PURE__*/jsx("span", {
|
|
347
|
-
children: t("neetoEmailDelivery.integrationDetail.connectedTitle", {
|
|
348
|
-
provider: providerLabel
|
|
349
|
-
})
|
|
350
|
-
}), /*#__PURE__*/jsx(CheckCircle, {
|
|
351
|
-
color: "#16A34A",
|
|
352
|
-
size: 24
|
|
353
|
-
})]
|
|
354
|
-
}) : t("neetoEmailDelivery.integrationDetail.connectTitle", {
|
|
355
|
-
appName: appName,
|
|
356
|
-
provider: providerLabel
|
|
357
|
-
}),
|
|
358
380
|
children: [(isConnected ? connectedScopeText || scopeText : scopeText) && /*#__PURE__*/jsx(Typography, {
|
|
359
381
|
style: "body1",
|
|
360
382
|
children: isConnected ? connectedScopeText || scopeText : scopeText
|
|
@@ -367,10 +389,10 @@ var IntegrationDetailPage = function IntegrationDetailPage(_ref) {
|
|
|
367
389
|
provider: providerLabel
|
|
368
390
|
},
|
|
369
391
|
components: {
|
|
370
|
-
helpLink: /*#__PURE__*/jsx(
|
|
371
|
-
|
|
392
|
+
helpLink: /*#__PURE__*/jsx(Button, {
|
|
393
|
+
"data-testid": "help-doc-link",
|
|
372
394
|
href: helpArticleUrl,
|
|
373
|
-
|
|
395
|
+
style: "link",
|
|
374
396
|
target: "_blank"
|
|
375
397
|
})
|
|
376
398
|
}
|
|
@@ -380,9 +402,10 @@ var IntegrationDetailPage = function IntegrationDetailPage(_ref) {
|
|
|
380
402
|
children: /*#__PURE__*/jsx("p", {
|
|
381
403
|
children: /*#__PURE__*/jsx(Trans, {
|
|
382
404
|
components: {
|
|
383
|
-
disconnectLink: /*#__PURE__*/jsx(
|
|
384
|
-
|
|
385
|
-
|
|
405
|
+
disconnectLink: /*#__PURE__*/jsx(Button, {
|
|
406
|
+
"data-testid": "disconnect-link",
|
|
407
|
+
href: activeProviderRoute,
|
|
408
|
+
style: "link"
|
|
386
409
|
})
|
|
387
410
|
},
|
|
388
411
|
i18nKey: connectedIntegration.isPending ? "neetoEmailDelivery.integrationDetail.pendingIntegrationBlocked" : "neetoEmailDelivery.integrationDetail.onlyOneIntegration",
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../app/javascript/src/components/Smtp/constants.js","../app/javascript/src/components/Smtp/Setup.jsx","../app/javascript/src/components/IntegrationDetailPage/constants.js","../app/javascript/src/components/IntegrationDetailPage/index.jsx"],"sourcesContent":["import { t } from \"i18next\";\nimport * as yup from \"yup\";\n\nexport const ENCRYPTION_OPTIONS = [\n { label: \"None\", value: \"none\" },\n { label: \"StartTLS\", value: \"starttls\" },\n { label: \"SSL\", value: \"ssl\" },\n];\n\nexport const SMTP_ACCOUNT_INITIAL_VALUES = {\n host: \"\",\n port: 587,\n username: \"\",\n password: \"\",\n email: \"\",\n encryption: \"starttls\",\n displayName: \"\",\n};\n\nexport const SMTP_ACCOUNT_VALIDATION_SCHEMA = yup.object().shape({\n host: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.hostLabel\"),\n })\n ),\n port: yup.number().required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.portLabel\"),\n })\n ),\n username: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.usernameLabel\"),\n })\n ),\n password: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.passwordLabel\"),\n })\n ),\n email: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.emailLabel\"),\n })\n )\n .email(t(\"neetoEmailDelivery.smtp.setup.emailInvalid\")),\n displayName: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.displayNameLabel\"),\n })\n ),\n encryption: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.encryptionLabel\"),\n })\n ),\n});\n","import { Callout, Pane, Typography } from \"neetoui\";\nimport { Form, Input, Radio, ActionBlock } from \"neetoui/formik\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { useCreateSmtp } from \"hooks/reactQuery/integrations/useSmtpIntegrationApi\";\n\nimport {\n SMTP_ACCOUNT_INITIAL_VALUES,\n SMTP_ACCOUNT_VALIDATION_SCHEMA,\n ENCRYPTION_OPTIONS,\n} from \"./constants\";\n\nconst SmtpSetup = ({ ownerId, onDone, onCancel, isOpen }) => {\n const { t } = useTranslation();\n\n const { isPending: isCreating, mutate: createSmtp } = useCreateSmtp({\n ownerId,\n });\n\n const handleSubmit = values => {\n createSmtp({ smtp_account: values }, { onSuccess: onDone });\n };\n\n return (\n <Pane {...{ isOpen }} size=\"lg\" onClose={onCancel}>\n <Pane.Header>\n <Typography style=\"h2\" weight=\"semibold\">\n {t(\"neetoEmailDelivery.smtp.setup.title\")}\n </Typography>\n </Pane.Header>\n <Form\n className=\"w-full\"\n formikProps={{\n initialValues: SMTP_ACCOUNT_INITIAL_VALUES,\n validationSchema: SMTP_ACCOUNT_VALIDATION_SCHEMA,\n onSubmit: handleSubmit,\n }}\n >\n <Pane.Body className=\"space-y-4\">\n <div className=\"flex flex-col gap-6\">\n <Callout style=\"warning\">\n {t(\"neetoEmailDelivery.smtp.setup.note\")}\n </Callout>\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.hostLabel\")}\n name=\"host\"\n />\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.portLabel\")}\n name=\"port\"\n type=\"number\"\n />\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.usernameLabel\")}\n name=\"username\"\n />\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.passwordLabel\")}\n name=\"password\"\n type=\"password\"\n />\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.emailLabel\")}\n name=\"email\"\n type=\"email\"\n />\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.displayNameLabel\")}\n name=\"displayName\"\n />\n <Radio\n label={t(\"neetoEmailDelivery.smtp.setup.encryptionLabel\")}\n name=\"encryption\"\n >\n {ENCRYPTION_OPTIONS.map(option => (\n <Radio.Item\n key={option.value}\n label={option.label}\n value={option.value}\n />\n ))}\n </Radio>\n </div>\n </Pane.Body>\n <Pane.Footer>\n <ActionBlock\n cancelButtonProps={{ onClick: onCancel }}\n isSubmitting={isCreating}\n submitButtonProps={{\n label: t(\"neetoEmailDelivery.smtp.setup.saveAndActivate\"),\n }}\n />\n </Pane.Footer>\n </Form>\n </Pane>\n );\n};\n\nexport default SmtpSetup;\n","import { MailSend } from \"neetoicons\";\nimport { Gmail as GmailIcon, Outlook as OutlookIcon } from \"neetoicons/misc\";\n\nexport const INTEGRATION_TYPES = {\n GMAIL: \"gmail\",\n OUTLOOK: \"outlook\",\n SPARKPOST: \"sparkpost\",\n SMTP: \"smtp\",\n};\n\nexport const PROVIDER_LABELS = {\n [INTEGRATION_TYPES.GMAIL]: \"Gmail\",\n [INTEGRATION_TYPES.OUTLOOK]: \"Outlook\",\n [INTEGRATION_TYPES.SPARKPOST]: \"Custom email provider\",\n [INTEGRATION_TYPES.SMTP]: \"SMTP\",\n};\n\nexport const PROVIDER_ICONS = {\n [INTEGRATION_TYPES.GMAIL]: GmailIcon,\n [INTEGRATION_TYPES.OUTLOOK]: OutlookIcon,\n [INTEGRATION_TYPES.SPARKPOST]: MailSend,\n [INTEGRATION_TYPES.SMTP]: MailSend,\n};\n","import { useState } from \"react\";\n\nimport { buildUrl } from \"neetocommons/utils\";\nimport { CheckCircle } from \"neetoicons\";\nimport CardLayout from \"neetomolecules/CardLayout\";\nimport { Button, Callout, Spinner, Typography } from \"neetoui\";\nimport { Trans, useTranslation } from \"react-i18next\";\nimport { useHistory, Link } from \"react-router-dom\";\n\nimport {\n GMAIL_OAUTH_CONNECT_URL,\n OUTLOOK_OAUTH_CONNECT_URL,\n} from \"apis/integrations/constants\";\nimport SmtpSetup from \"components/Smtp/Setup\";\nimport useGmail from \"hooks/integrations/useGmail\";\nimport useOutlook from \"hooks/integrations/useOutlook\";\nimport useSmtp from \"hooks/integrations/useSmtp\";\nimport useSparkpostDomain from \"hooks/integrations/useSparkpostDomain\";\nimport { useFetchConnectedIntegration } from \"hooks/reactQuery/integrations/useEmailDeliveryIntegrationApi\";\n\nimport {\n INTEGRATION_TYPES,\n PROVIDER_LABELS,\n PROVIDER_ICONS,\n} from \"./constants\";\n\nconst IntegrationDetailPage = ({\n type,\n ownerId,\n canManageIntegrations,\n appName,\n scopeText,\n connectedScopeText,\n helpArticleUrl,\n indexRoute,\n integrationRoutes,\n ownDomainSetupRoute,\n ownDomainVerifyRoute,\n}) => {\n const { t } = useTranslation();\n const history = useHistory();\n const [isSmtpPaneOpen, setIsSmtpPaneOpen] = useState(false);\n\n const providerLabel = PROVIDER_LABELS[type];\n const Icon = PROVIDER_ICONS[type];\n const description = t(`neetoEmailDelivery.${type}.description`);\n\n const gmailIntegration = useGmail({\n ownerId,\n indexRoute,\n canManageIntegrations,\n });\n\n const outlookIntegration = useOutlook({\n ownerId,\n indexRoute,\n canManageIntegrations,\n });\n\n const sparkpostIntegration = useSparkpostDomain({\n ownerId,\n canManageIntegrations,\n });\n\n const smtpIntegration = useSmtp({ ownerId, canManageIntegrations });\n\n const { integration: connectedIntegration, isLoading: isIntegrationLoading } =\n useFetchConnectedIntegration(ownerId);\n\n const integrationMap = {\n [INTEGRATION_TYPES.GMAIL]: gmailIntegration,\n [INTEGRATION_TYPES.OUTLOOK]: outlookIntegration,\n [INTEGRATION_TYPES.SPARKPOST]: sparkpostIntegration,\n [INTEGRATION_TYPES.SMTP]: smtpIntegration,\n };\n\n const currentIntegration = integrationMap[type];\n const {\n isConnected,\n isDestroying,\n onDisconnect,\n data = {},\n errorMessage,\n } = currentIntegration;\n\n const connectedEmail = data?.email;\n\n const isOutlookPending =\n type === INTEGRATION_TYPES.OUTLOOK &&\n outlookIntegration.isWaitingForTestEmail;\n\n const isSparkpostPending =\n type === INTEGRATION_TYPES.SPARKPOST &&\n sparkpostIntegration.exists &&\n !isConnected;\n\n const isPending = isOutlookPending || isSparkpostPending;\n\n const isLoading =\n gmailIntegration.isLoading ||\n outlookIntegration.isLoading ||\n sparkpostIntegration.isLoading ||\n smtpIntegration.isLoading ||\n isIntegrationLoading;\n\n const isBlocked = connectedIntegration && connectedIntegration.type !== type;\n\n const activeProviderLabel = isBlocked\n ? PROVIDER_LABELS[connectedIntegration.type]\n : null;\n\n const activeProviderRoute = isBlocked\n ? integrationRoutes?.[connectedIntegration.type]\n : null;\n\n const handleConnect = () => {\n switch (type) {\n case INTEGRATION_TYPES.GMAIL:\n window.location.href = buildUrl(GMAIL_OAUTH_CONNECT_URL, { ownerId });\n break;\n case INTEGRATION_TYPES.OUTLOOK:\n window.location.href = buildUrl(OUTLOOK_OAUTH_CONNECT_URL, {\n ownerId,\n });\n break;\n case INTEGRATION_TYPES.SPARKPOST:\n history.push(ownDomainSetupRoute);\n break;\n case INTEGRATION_TYPES.SMTP:\n setIsSmtpPaneOpen(true);\n break;\n default:\n break;\n }\n };\n\n const getConnectButtonLabel = () => {\n switch (type) {\n case INTEGRATION_TYPES.GMAIL:\n return t(\"neetoEmailDelivery.integrationDetail.connectGmail\");\n case INTEGRATION_TYPES.OUTLOOK:\n return t(\"neetoEmailDelivery.integrationDetail.connectOutlook\");\n case INTEGRATION_TYPES.SPARKPOST:\n return t(\"neetoEmailDelivery.integrationDetail.setupDomain\");\n case INTEGRATION_TYPES.SMTP:\n return t(\"neetoEmailDelivery.integrationDetail.connectSmtp\");\n default:\n return \"\";\n }\n };\n\n const renderActionBlock = () => {\n if (isConnected) {\n return (\n <Button\n data-testid=\"disconnect-button\"\n label={t(\"neetoEmailDelivery.integrationDetail.disconnect\")}\n loading={isDestroying}\n style=\"danger\"\n onClick={onDisconnect}\n />\n );\n }\n\n if (isPending) {\n return (\n <div className=\"flex items-center gap-2\">\n {isSparkpostPending && (\n <Button\n data-testid=\"continue-verification-button\"\n to={ownDomainVerifyRoute}\n label={t(\n \"neetoEmailDelivery.sparkpost.emailDelivery.continueVerification\"\n )}\n />\n )}\n <Button\n data-testid=\"disconnect-button\"\n label={t(\"neetoEmailDelivery.integrationDetail.disconnect\")}\n loading={isDestroying}\n style=\"danger\"\n onClick={onDisconnect}\n />\n </div>\n );\n }\n\n if (isBlocked) return null;\n\n return (\n <Button\n data-testid=\"connect-button\"\n label={getConnectButtonLabel()}\n style=\"primary\"\n onClick={handleConnect}\n />\n );\n };\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 <>\n <CardLayout\n actionBlock={renderActionBlock()}\n icon={<Icon size={48} />}\n description={\n isConnected ? (\n <Trans\n components={{ bold: <strong /> }}\n i18nKey=\"neetoEmailDelivery.integrationDetail.connectedEmail\"\n values={{ email: connectedEmail }}\n />\n ) : (\n description\n )\n }\n title={\n isConnected ? (\n <div className=\"flex items-center gap-2\">\n <span>\n {t(\"neetoEmailDelivery.integrationDetail.connectedTitle\", {\n provider: providerLabel,\n })}\n </span>\n <CheckCircle color=\"#16A34A\" size={24} />\n </div>\n ) : (\n t(\"neetoEmailDelivery.integrationDetail.connectTitle\", {\n appName,\n provider: providerLabel,\n })\n )\n }\n >\n {(isConnected ? connectedScopeText || scopeText : scopeText) && (\n <Typography style=\"body1\">\n {isConnected ? connectedScopeText || scopeText : scopeText}\n </Typography>\n )}\n {!isConnected && helpArticleUrl && (\n <Typography className=\"my-2\" style=\"body2\">\n <Trans\n i18nKey=\"neetoEmailDelivery.integrationDetail.helpArticleText\"\n values={{ provider: providerLabel }}\n components={{\n helpLink: (\n <a\n className=\"neeto-ui-text-primary-500\"\n href={helpArticleUrl}\n rel=\"noopener noreferrer\"\n target=\"_blank\"\n />\n ),\n }}\n />\n </Typography>\n )}\n {!isConnected && !isPending && isBlocked && (\n <Callout\n style={connectedIntegration.isPending ? \"warning\" : \"danger\"}\n >\n <p>\n <Trans\n components={{\n disconnectLink: (\n <Link\n className=\"neeto-ui-font-semibold neeto-ui-text-primary-500\"\n to={activeProviderRoute}\n />\n ),\n }}\n i18nKey={\n connectedIntegration.isPending\n ? \"neetoEmailDelivery.integrationDetail.pendingIntegrationBlocked\"\n : \"neetoEmailDelivery.integrationDetail.onlyOneIntegration\"\n }\n values={{\n activeProvider: activeProviderLabel,\n targetProvider: providerLabel,\n }}\n />\n </p>\n </Callout>\n )}\n {errorMessage && <Callout style=\"danger\">{errorMessage}</Callout>}\n {isOutlookPending && (\n <Callout style=\"warning\">\n {t(\"neetoEmailDelivery.outlook.waitingForTestEmail\", {\n email: connectedEmail,\n })}\n </Callout>\n )}\n {isSparkpostPending && (\n <Callout style=\"warning\">\n {t(\n \"neetoEmailDelivery.sparkpost.emailDelivery.verificationPending\",\n { domain: data?.domain }\n )}\n </Callout>\n )}\n </CardLayout>\n {type === INTEGRATION_TYPES.SMTP && (\n <SmtpSetup\n {...{ ownerId }}\n isOpen={isSmtpPaneOpen}\n onCancel={() => setIsSmtpPaneOpen(false)}\n onDone={() => setIsSmtpPaneOpen(false)}\n />\n )}\n </>\n );\n};\n\nexport default IntegrationDetailPage;\n"],"names":["ENCRYPTION_OPTIONS","label","value","SMTP_ACCOUNT_INITIAL_VALUES","host","port","username","password","email","encryption","displayName","SMTP_ACCOUNT_VALIDATION_SCHEMA","yup","object","shape","string","trim","required","t","field","number","SmtpSetup","_ref","ownerId","onDone","onCancel","isOpen","_useTranslation","useTranslation","_useCreateSmtp","useCreateSmtp","isCreating","isPending","createSmtp","mutate","handleSubmit","values","smtp_account","onSuccess","_jsxs","Pane","size","onClose","children","_jsx","Header","Typography","style","weight","Form","className","formikProps","initialValues","validationSchema","onSubmit","Body","Callout","Input","name","type","Radio","map","option","Item","Footer","ActionBlock","cancelButtonProps","onClick","isSubmitting","submitButtonProps","INTEGRATION_TYPES","GMAIL","OUTLOOK","SPARKPOST","SMTP","PROVIDER_LABELS","_defineProperty","PROVIDER_ICONS","GmailIcon","OutlookIcon","MailSend","IntegrationDetailPage","canManageIntegrations","appName","scopeText","connectedScopeText","helpArticleUrl","indexRoute","integrationRoutes","ownDomainSetupRoute","ownDomainVerifyRoute","history","useHistory","_useState","useState","_useState2","_slicedToArray","isSmtpPaneOpen","setIsSmtpPaneOpen","providerLabel","Icon","description","concat","gmailIntegration","useGmail","outlookIntegration","useOutlook","sparkpostIntegration","useSparkpostDomain","smtpIntegration","useSmtp","_useFetchConnectedInt","useFetchConnectedIntegration","connectedIntegration","integration","isIntegrationLoading","isLoading","integrationMap","currentIntegration","isConnected","isDestroying","onDisconnect","_currentIntegration$d","data","errorMessage","connectedEmail","isOutlookPending","isWaitingForTestEmail","isSparkpostPending","exists","isBlocked","activeProviderLabel","activeProviderRoute","handleConnect","window","location","href","buildUrl","GMAIL_OAUTH_CONNECT_URL","OUTLOOK_OAUTH_CONNECT_URL","push","getConnectButtonLabel","renderActionBlock","Button","loading","to","Spinner","_Fragment","CardLayout","actionBlock","icon","Trans","components","bold","i18nKey","title","provider","CheckCircle","color","helpLink","rel","target","disconnectLink","Link","activeProvider","targetProvider","domain"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGO,IAAMA,kBAAkB,GAAG,CAChC;AAAEC,EAAAA,KAAK,EAAE,MAAM;AAAEC,EAAAA,KAAK,EAAE;AAAO,CAAC,EAChC;AAAED,EAAAA,KAAK,EAAE,UAAU;AAAEC,EAAAA,KAAK,EAAE;AAAW,CAAC,EACxC;AAAED,EAAAA,KAAK,EAAE,KAAK;AAAEC,EAAAA,KAAK,EAAE;AAAM,CAAC,CAC/B;AAEM,IAAMC,2BAA2B,GAAG;AACzCC,EAAAA,IAAI,EAAE,EAAE;AACRC,EAAAA,IAAI,EAAE,GAAG;AACTC,EAAAA,QAAQ,EAAE,EAAE;AACZC,EAAAA,QAAQ,EAAE,EAAE;AACZC,EAAAA,KAAK,EAAE,EAAE;AACTC,EAAAA,UAAU,EAAE,UAAU;AACtBC,EAAAA,WAAW,EA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B,gEAAgE,GAChE,yDACL;AACDI,YAAAA,MAAM,EAAE;AACNgI,cAAAA,cAAc,EAAEjC,mBAAmB;AACnCkC,cAAAA,cAAc,EAAElE;AAClB;WACD;SACA;AAAC,OACG,CACV,EACAyB,YAAY,iBAAIhF,GAAA,CAACY,OAAO,EAAA;AAACT,QAAAA,KAAK,EAAC,QAAQ;AAAAJ,QAAAA,QAAA,EAAEiF;AAAY,OAAU,CAAC,EAChEE,gBAAgB,iBACflF,GAAA,CAACY,OAAO,EAAA;AAACT,QAAAA,KAAK,EAAC,SAAS;AAAAJ,QAAAA,QAAA,EACrBzB,CAAC,CAAC,gDAAgD,EAAE;AACnDV,UAAAA,KAAK,EAAEqH;SACR;AAAC,OACK,CACV,EACAG,kBAAkB,iBACjBpF,GAAA,CAACY,OAAO,EAAA;AAACT,QAAAA,KAAK,EAAC,SAAS;AAAAJ,QAAAA,QAAA,EACrBzB,CAAC,CACA,gEAAgE,EAChE;AAAEoJ,UAAAA,MAAM,EAAE3C,IAAI,KAAA,IAAA,IAAJA,IAAI,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAJA,IAAI,CAAE2C;SAClB;AAAC,OACM,CACV;KACS,CAAC,EACZ3G,IAAI,KAAKW,iBAAiB,CAACI,IAAI,iBAC9B9B,GAAA,CAACvB,SAAS,EAAA;AACFE,MAAAA,OAAO,EAAPA,OAAO;AACbG,MAAAA,MAAM,EAAEuE,cAAe;MACvBxE,QAAQ,EAAE,SAAVA,QAAQA,GAAA;QAAA,OAAQyE,iBAAiB,CAAC,KAAK,CAAC;OAAC;MACzC1E,MAAM,EAAE,SAARA,MAAMA,GAAA;QAAA,OAAQ0E,iBAAiB,CAAC,KAAK,CAAC;AAAA;AAAC,KACxC,CACF;AAAA,GACD,CAAC;AAEP;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../app/javascript/src/components/Smtp/constants.js","../app/javascript/src/components/Smtp/Setup.jsx","../app/javascript/src/components/IntegrationDetailPage/constants.js","../app/javascript/src/components/IntegrationDetailPage/index.jsx"],"sourcesContent":["import { t } from \"i18next\";\nimport * as yup from \"yup\";\n\nexport const ENCRYPTION_OPTIONS = [\n { label: \"None\", value: \"none\" },\n { label: \"StartTLS\", value: \"starttls\" },\n { label: \"SSL\", value: \"ssl\" },\n];\n\nexport const SMTP_ACCOUNT_INITIAL_VALUES = {\n host: \"\",\n port: 587,\n username: \"\",\n password: \"\",\n email: \"\",\n encryption: \"starttls\",\n displayName: \"\",\n};\n\nexport const SMTP_ACCOUNT_VALIDATION_SCHEMA = yup.object().shape({\n host: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.hostLabel\"),\n })\n ),\n port: yup.number().required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.portLabel\"),\n })\n ),\n username: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.usernameLabel\"),\n })\n ),\n password: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.passwordLabel\"),\n })\n ),\n email: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.emailLabel\"),\n })\n )\n .email(t(\"neetoEmailDelivery.smtp.setup.emailInvalid\")),\n displayName: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.displayNameLabel\"),\n })\n ),\n encryption: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.encryptionLabel\"),\n })\n ),\n});\n","import { Callout, Pane, Typography } from \"neetoui\";\nimport { Form, Input, Radio, ActionBlock } from \"neetoui/formik\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { useCreateSmtp } from \"hooks/reactQuery/integrations/useSmtpIntegrationApi\";\n\nimport {\n SMTP_ACCOUNT_INITIAL_VALUES,\n SMTP_ACCOUNT_VALIDATION_SCHEMA,\n ENCRYPTION_OPTIONS,\n} from \"./constants\";\n\nconst SmtpSetup = ({ ownerId, onDone, onCancel, isOpen }) => {\n const { t } = useTranslation();\n\n const { isPending: isCreating, mutate: createSmtp } = useCreateSmtp({\n ownerId,\n });\n\n const handleSubmit = values => {\n createSmtp({ smtp_account: values }, { onSuccess: onDone });\n };\n\n return (\n <Pane {...{ isOpen }} size=\"lg\" onClose={onCancel}>\n <Pane.Header>\n <Typography style=\"h2\" weight=\"semibold\">\n {t(\"neetoEmailDelivery.smtp.setup.title\")}\n </Typography>\n </Pane.Header>\n <Form\n className=\"w-full\"\n formikProps={{\n initialValues: SMTP_ACCOUNT_INITIAL_VALUES,\n validationSchema: SMTP_ACCOUNT_VALIDATION_SCHEMA,\n onSubmit: handleSubmit,\n }}\n >\n <Pane.Body className=\"space-y-4\">\n <div className=\"flex flex-col gap-6\">\n <Callout style=\"warning\">\n {t(\"neetoEmailDelivery.smtp.setup.note\")}\n </Callout>\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.hostLabel\")}\n name=\"host\"\n />\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.portLabel\")}\n name=\"port\"\n type=\"number\"\n />\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.usernameLabel\")}\n name=\"username\"\n />\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.passwordLabel\")}\n name=\"password\"\n type=\"password\"\n />\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.emailLabel\")}\n name=\"email\"\n type=\"email\"\n />\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.displayNameLabel\")}\n name=\"displayName\"\n />\n <Radio\n label={t(\"neetoEmailDelivery.smtp.setup.encryptionLabel\")}\n name=\"encryption\"\n >\n {ENCRYPTION_OPTIONS.map(option => (\n <Radio.Item\n key={option.value}\n label={option.label}\n value={option.value}\n />\n ))}\n </Radio>\n </div>\n </Pane.Body>\n <Pane.Footer>\n <ActionBlock\n cancelButtonProps={{ onClick: onCancel }}\n isSubmitting={isCreating}\n submitButtonProps={{\n label: t(\"neetoEmailDelivery.smtp.setup.saveAndActivate\"),\n }}\n />\n </Pane.Footer>\n </Form>\n </Pane>\n );\n};\n\nexport default SmtpSetup;\n","import { MailSend } from \"neetoicons\";\nimport { Gmail as GmailIcon, Outlook as OutlookIcon } from \"neetoicons/misc\";\n\nexport const INTEGRATION_TYPES = {\n GMAIL: \"gmail\",\n OUTLOOK: \"outlook\",\n SPARKPOST: \"sparkpost\",\n SMTP: \"smtp\",\n};\n\nexport const PROVIDER_LABELS = {\n [INTEGRATION_TYPES.GMAIL]: \"Gmail\",\n [INTEGRATION_TYPES.OUTLOOK]: \"Outlook\",\n [INTEGRATION_TYPES.SPARKPOST]: \"Custom email provider\",\n [INTEGRATION_TYPES.SMTP]: \"SMTP\",\n};\n\nexport const PROVIDER_ICONS = {\n [INTEGRATION_TYPES.GMAIL]: GmailIcon,\n [INTEGRATION_TYPES.OUTLOOK]: OutlookIcon,\n [INTEGRATION_TYPES.SPARKPOST]: MailSend,\n [INTEGRATION_TYPES.SMTP]: MailSend,\n};\n","import { useState } from \"react\";\n\nimport { buildUrl } from \"neetocommons/utils\";\nimport { Check, Warning } from \"neetoicons\";\nimport CardLayout from \"neetomolecules/CardLayout\";\nimport { Button, Callout, Spinner, Typography } from \"neetoui\";\nimport { Trans, useTranslation } from \"react-i18next\";\nimport { useHistory } from \"react-router-dom\";\n\nimport {\n GMAIL_OAUTH_CONNECT_URL,\n OUTLOOK_OAUTH_CONNECT_URL,\n} from \"apis/integrations/constants\";\nimport SmtpSetup from \"components/Smtp/Setup\";\nimport useGmail from \"hooks/integrations/useGmail\";\nimport useOutlook from \"hooks/integrations/useOutlook\";\nimport useSmtp from \"hooks/integrations/useSmtp\";\nimport useSparkpostDomain from \"hooks/integrations/useSparkpostDomain\";\nimport { useFetchConnectedIntegration } from \"hooks/reactQuery/integrations/useEmailDeliveryIntegrationApi\";\n\nimport {\n INTEGRATION_TYPES,\n PROVIDER_LABELS,\n PROVIDER_ICONS,\n} from \"./constants\";\n\nconst IntegrationDetailPage = ({\n type,\n ownerId,\n canManageIntegrations,\n appName,\n scopeText,\n connectedScopeText,\n helpArticleUrl,\n indexRoute,\n integrationRoutes,\n ownDomainSetupRoute,\n ownDomainVerifyRoute,\n}) => {\n const { t } = useTranslation();\n const history = useHistory();\n const [isSmtpPaneOpen, setIsSmtpPaneOpen] = useState(false);\n\n const providerLabel = PROVIDER_LABELS[type];\n const Icon = PROVIDER_ICONS[type];\n const description = t(`neetoEmailDelivery.${type}.description`);\n\n const gmailIntegration = useGmail({\n ownerId,\n indexRoute,\n canManageIntegrations,\n });\n\n const outlookIntegration = useOutlook({\n ownerId,\n indexRoute,\n canManageIntegrations,\n });\n\n const sparkpostIntegration = useSparkpostDomain({\n ownerId,\n canManageIntegrations,\n });\n\n const smtpIntegration = useSmtp({ ownerId, canManageIntegrations });\n\n const { integration: connectedIntegration, isLoading: isIntegrationLoading } =\n useFetchConnectedIntegration(ownerId);\n\n const integrationMap = {\n [INTEGRATION_TYPES.GMAIL]: gmailIntegration,\n [INTEGRATION_TYPES.OUTLOOK]: outlookIntegration,\n [INTEGRATION_TYPES.SPARKPOST]: sparkpostIntegration,\n [INTEGRATION_TYPES.SMTP]: smtpIntegration,\n };\n\n const currentIntegration = integrationMap[type];\n const {\n isConnected,\n isDestroying,\n onDisconnect,\n data = {},\n errorMessage,\n } = currentIntegration;\n\n const connectedEmail = data?.email;\n\n const isOutlookPending =\n type === INTEGRATION_TYPES.OUTLOOK &&\n outlookIntegration.isWaitingForTestEmail;\n\n const isSparkpostPending =\n type === INTEGRATION_TYPES.SPARKPOST &&\n sparkpostIntegration.exists &&\n !isConnected;\n\n const isPending = isOutlookPending || isSparkpostPending;\n\n const isLoading =\n gmailIntegration.isLoading ||\n outlookIntegration.isLoading ||\n sparkpostIntegration.isLoading ||\n smtpIntegration.isLoading ||\n isIntegrationLoading;\n\n const isBlocked = connectedIntegration && connectedIntegration.type !== type;\n\n const activeProviderLabel = isBlocked\n ? PROVIDER_LABELS[connectedIntegration.type]\n : null;\n\n const activeProviderRoute = isBlocked\n ? integrationRoutes?.[connectedIntegration.type]\n : null;\n\n const handleConnect = () => {\n switch (type) {\n case INTEGRATION_TYPES.GMAIL:\n window.location.href = buildUrl(GMAIL_OAUTH_CONNECT_URL, { ownerId });\n break;\n case INTEGRATION_TYPES.OUTLOOK:\n window.location.href = buildUrl(OUTLOOK_OAUTH_CONNECT_URL, {\n ownerId,\n });\n break;\n case INTEGRATION_TYPES.SPARKPOST:\n history.push(ownDomainSetupRoute);\n break;\n case INTEGRATION_TYPES.SMTP:\n setIsSmtpPaneOpen(true);\n break;\n default:\n break;\n }\n };\n\n const getConnectButtonLabel = () => {\n switch (type) {\n case INTEGRATION_TYPES.GMAIL:\n return t(\"neetoEmailDelivery.integrationDetail.connectGmail\");\n case INTEGRATION_TYPES.OUTLOOK:\n return t(\"neetoEmailDelivery.integrationDetail.connectOutlook\");\n case INTEGRATION_TYPES.SPARKPOST:\n return t(\"neetoEmailDelivery.integrationDetail.setupDomain\");\n case INTEGRATION_TYPES.SMTP:\n return t(\"neetoEmailDelivery.integrationDetail.connectSmtp\");\n default:\n return \"\";\n }\n };\n\n const renderTitle = () => {\n if (isConnected) {\n return (\n <div className=\"flex items-center gap-2\">\n <span>\n {t(\"neetoEmailDelivery.integrationDetail.connectedTitle\", {\n provider: providerLabel,\n })}\n </span>\n <div className=\"neeto-ui-bg-success-500 neeto-ui-text-white neeto-ui-rounded-full flex items-center justify-center p-1\">\n <Check size={24} />\n </div>\n </div>\n );\n }\n\n if (isPending) {\n return (\n <div className=\"flex items-center gap-2\">\n <span>\n {t(\"neetoEmailDelivery.integrationDetail.pendingTitle\", {\n provider: providerLabel,\n })}\n </span>\n <div className=\"neeto-ui-text-warning-500 flex items-center justify-center p-1\">\n <Warning size={24} />\n </div>\n </div>\n );\n }\n\n return t(\"neetoEmailDelivery.integrationDetail.connectTitle\", {\n appName,\n provider: providerLabel,\n });\n };\n\n const renderActionBlock = () => {\n if (isConnected) {\n return (\n <Button\n data-testid=\"disconnect-button\"\n label={t(\"neetoEmailDelivery.integrationDetail.disconnect\")}\n loading={isDestroying}\n style=\"danger\"\n onClick={onDisconnect}\n />\n );\n }\n\n if (isPending) {\n return (\n <div className=\"flex items-center gap-2\">\n {isSparkpostPending && (\n <Button\n data-testid=\"continue-verification-button\"\n to={ownDomainVerifyRoute}\n label={t(\n \"neetoEmailDelivery.sparkpost.emailDelivery.continueVerification\"\n )}\n />\n )}\n <Button\n data-testid=\"disconnect-button\"\n label={t(\"neetoEmailDelivery.integrationDetail.disconnect\")}\n loading={isDestroying}\n style=\"danger\"\n onClick={onDisconnect}\n />\n </div>\n );\n }\n\n if (isBlocked) return null;\n\n return (\n <Button\n data-testid=\"connect-button\"\n label={getConnectButtonLabel()}\n style=\"primary\"\n onClick={handleConnect}\n />\n );\n };\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 <>\n <CardLayout\n actionBlock={renderActionBlock()}\n icon={<Icon size={48} />}\n title={renderTitle()}\n description={\n isConnected ? (\n <Trans\n components={{ bold: <strong /> }}\n i18nKey=\"neetoEmailDelivery.integrationDetail.connectedEmail\"\n values={{ email: connectedEmail }}\n />\n ) : (\n description\n )\n }\n >\n {(isConnected ? connectedScopeText || scopeText : scopeText) && (\n <Typography style=\"body1\">\n {isConnected ? connectedScopeText || scopeText : scopeText}\n </Typography>\n )}\n {!isConnected && helpArticleUrl && (\n <Typography className=\"my-2\" style=\"body2\">\n <Trans\n i18nKey=\"neetoEmailDelivery.integrationDetail.helpArticleText\"\n values={{ provider: providerLabel }}\n components={{\n helpLink: (\n <Button\n data-testid=\"help-doc-link\"\n href={helpArticleUrl}\n style=\"link\"\n target=\"_blank\"\n />\n ),\n }}\n />\n </Typography>\n )}\n {!isConnected && !isPending && isBlocked && (\n <Callout\n style={connectedIntegration.isPending ? \"warning\" : \"danger\"}\n >\n <p>\n <Trans\n components={{\n disconnectLink: (\n <Button\n data-testid=\"disconnect-link\"\n href={activeProviderRoute}\n style=\"link\"\n />\n ),\n }}\n i18nKey={\n connectedIntegration.isPending\n ? \"neetoEmailDelivery.integrationDetail.pendingIntegrationBlocked\"\n : \"neetoEmailDelivery.integrationDetail.onlyOneIntegration\"\n }\n values={{\n activeProvider: activeProviderLabel,\n targetProvider: providerLabel,\n }}\n />\n </p>\n </Callout>\n )}\n {errorMessage && <Callout style=\"danger\">{errorMessage}</Callout>}\n {isOutlookPending && (\n <Callout style=\"warning\">\n {t(\"neetoEmailDelivery.outlook.waitingForTestEmail\", {\n email: connectedEmail,\n })}\n </Callout>\n )}\n {isSparkpostPending && (\n <Callout style=\"warning\">\n {t(\n \"neetoEmailDelivery.sparkpost.emailDelivery.verificationPending\",\n { domain: data?.domain }\n )}\n </Callout>\n )}\n </CardLayout>\n {type === INTEGRATION_TYPES.SMTP && (\n <SmtpSetup\n {...{ ownerId }}\n isOpen={isSmtpPaneOpen}\n onCancel={() => setIsSmtpPaneOpen(false)}\n onDone={() => setIsSmtpPaneOpen(false)}\n />\n )}\n </>\n );\n};\n\nexport default IntegrationDetailPage;\n"],"names":["ENCRYPTION_OPTIONS","label","value","SMTP_ACCOUNT_INITIAL_VALUES","host","port","username","password","email","encryption","displayName","SMTP_ACCOUNT_VALIDATION_SCHEMA","yup","object","shape","string","trim","required","t","field","number","SmtpSetup","_ref","ownerId","onDone","onCancel","isOpen","_useTranslation","useTranslation","_useCreateSmtp","useCreateSmtp","isCreating","isPending","createSmtp","mutate","handleSubmit","values","smtp_account","onSuccess","_jsxs","Pane","size","onClose","children","_jsx","Header","Typography","style","weight","Form","className","formikProps","initialValues","validationSchema","onSubmit","Body","Callout","Input","name","type","Radio","map","option","Item","Footer","ActionBlock","cancelButtonProps","onClick","isSubmitting","submitButtonProps","INTEGRATION_TYPES","GMAIL","OUTLOOK","SPARKPOST","SMTP","PROVIDER_LABELS","_defineProperty","PROVIDER_ICONS","GmailIcon","OutlookIcon","MailSend","IntegrationDetailPage","canManageIntegrations","appName","scopeText","connectedScopeText","helpArticleUrl","indexRoute","integrationRoutes","ownDomainSetupRoute","ownDomainVerifyRoute","history","useHistory","_useState","useState","_useState2","_slicedToArray","isSmtpPaneOpen","setIsSmtpPaneOpen","providerLabel","Icon","description","concat","gmailIntegration","useGmail","outlookIntegration","useOutlook","sparkpostIntegration","useSparkpostDomain","smtpIntegration","useSmtp","_useFetchConnectedInt","useFetchConnectedIntegration","connectedIntegration","integration","isIntegrationLoading","isLoading","integrationMap","currentIntegration","isConnected","isDestroying","onDisconnect","_currentIntegration$d","data","errorMessage","connectedEmail","isOutlookPending","isWaitingForTestEmail","isSparkpostPending","exists","isBlocked","activeProviderLabel","activeProviderRoute","handleConnect","window","location","href","buildUrl","GMAIL_OAUTH_CONNECT_URL","OUTLOOK_OAUTH_CONNECT_URL","push","getConnectButtonLabel","renderTitle","provider","Check","Warning","renderActionBlock","Button","loading","to","Spinner","_Fragment","CardLayout","actionBlock","icon","title","Trans","components","bold","i18nKey","helpLink","target","disconnectLink","activeProvider","targetProvider","domain"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGO,IAAMA,kBAAkB,GAAG,CAChC;AAAEC,EAAAA,KAAK,EAAE,MAAM;AAAEC,EAAAA,KAAK,EAAE;AAAO,CAAC,EAChC;AAAED,EAAAA,KAAK,EAAE,UAAU;AAAEC,EAAAA,KAAK,EAAE;AAAW,CAAC,EACxC;AAAED,EAAAA,KAAK,EAAE,KAAK;AAAEC,EAAAA,KAAK,EAAE;AAAM,CAAC,CAC/B;AAEM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AAJ,QAAAA,QAAA,EACrBzB,CAAC,CAAC,gDAAgD,EAAE;AACnDV,UAAAA,KAAK,EAAEqH;SACR;AAAC,OACK,CACV,EACAG,kBAAkB,iBACjBpF,GAAA,CAACY,OAAO,EAAA;AAACT,QAAAA,KAAK,EAAC,SAAS;AAAAJ,QAAAA,QAAA,EACrBzB,CAAC,CACA,gEAAgE,EAChE;AAAEmJ,UAAAA,MAAM,EAAE1C,IAAI,KAAA,IAAA,IAAJA,IAAI,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAJA,IAAI,CAAE0C;SAClB;AAAC,OACM,CACV;KACS,CAAC,EACZ1G,IAAI,KAAKW,iBAAiB,CAACI,IAAI,iBAC9B9B,GAAA,CAACvB,SAAS,EAAA;AACFE,MAAAA,OAAO,EAAPA,OAAO;AACbG,MAAAA,MAAM,EAAEuE,cAAe;MACvBxE,QAAQ,EAAE,SAAVA,QAAQA,GAAA;QAAA,OAAQyE,iBAAiB,CAAC,KAAK,CAAC;OAAC;MACzC1E,MAAM,EAAE,SAARA,MAAMA,GAAA;QAAA,OAAQ0E,iBAAiB,CAAC,KAAK,CAAC;AAAA;AAAC,KACxC,CACF;AAAA,GACD,CAAC;AAEP;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigbinary/neeto-email-delivery-frontend",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.28",
|
|
4
4
|
"description": "This repo is for implementing custom email delivery functionality for the Neeto platform.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"homepage": "https://github.com/bigbinary/neeto-email-delivery-nano",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"@bigbinary/neeto-commons-frontend": "4.13.108",
|
|
72
72
|
"@bigbinary/neeto-filters-frontend": "4.3.32",
|
|
73
73
|
"@bigbinary/neeto-icons": "1.20.86",
|
|
74
|
-
"@bigbinary/neeto-molecules": "4.1.
|
|
74
|
+
"@bigbinary/neeto-molecules": "4.1.30",
|
|
75
75
|
"@bigbinary/neetoui": "8.3.78",
|
|
76
76
|
"@emotion/is-prop-valid": "1.2.0",
|
|
77
77
|
"@faker-js/faker": "8.2.0",
|
|
@@ -179,7 +179,7 @@
|
|
|
179
179
|
"@bigbinary/neeto-commons-frontend": "4.13.108",
|
|
180
180
|
"@bigbinary/neeto-filters-frontend": "4.3.32",
|
|
181
181
|
"@bigbinary/neeto-icons": "1.20.86",
|
|
182
|
-
"@bigbinary/neeto-molecules": "4.1.
|
|
182
|
+
"@bigbinary/neeto-molecules": "4.1.30",
|
|
183
183
|
"@bigbinary/neetoui": "8.3.78",
|
|
184
184
|
"@honeybadger-io/js": "6.10.1",
|
|
185
185
|
"@honeybadger-io/react": "6.1.25",
|