@comet/brevo-admin 8.17.1 → 9.0.0-beta.0
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/lib/blocks/NewsletterImageBlock.d.ts +7 -3
- package/lib/blocks/NewsletterImageBlock.d.ts.map +1 -1
- package/lib/blocks/NewsletterImageBlock.js +8 -14
- package/lib/blocks.generated.js +1 -5
- package/lib/brevoConfiguration/BrevoConfigForm.generated.js +1 -5
- package/lib/brevoConfiguration/BrevoConfigForm.gql.d.ts +7 -7
- package/lib/brevoConfiguration/BrevoConfigForm.gql.d.ts.map +1 -1
- package/lib/brevoConfiguration/BrevoConfigForm.gql.generated.js +1 -7
- package/lib/brevoConfiguration/BrevoConfigForm.gql.js +8 -14
- package/lib/brevoConfiguration/BrevoConfigForm.js +53 -59
- package/lib/brevoConfiguration/BrevoConfigPage.d.ts +1 -0
- package/lib/brevoConfiguration/BrevoConfigPage.d.ts.map +1 -1
- package/lib/brevoConfiguration/BrevoConfigPage.js +8 -14
- package/lib/brevoContacts/BrevoContactsGrid.generated.js +1 -7
- package/lib/brevoContacts/BrevoContactsGrid.js +45 -51
- package/lib/brevoContacts/BrevoContactsPage.d.ts +1 -1
- package/lib/brevoContacts/BrevoContactsPage.d.ts.map +1 -1
- package/lib/brevoContacts/BrevoContactsPage.js +24 -29
- package/lib/brevoContacts/form/BrevoContactForm.generated.js +1 -7
- package/lib/brevoContacts/form/BrevoContactForm.gql.generated.js +1 -7
- package/lib/brevoContacts/form/BrevoContactForm.gql.js +7 -13
- package/lib/brevoContacts/form/BrevoContactForm.js +58 -64
- package/lib/brevoTestContacts/BrevoTestContactsGrid.generated.js +1 -7
- package/lib/brevoTestContacts/BrevoTestContactsGrid.js +40 -46
- package/lib/brevoTestContacts/BrevoTestContactsPage.d.ts +1 -1
- package/lib/brevoTestContacts/BrevoTestContactsPage.d.ts.map +1 -1
- package/lib/brevoTestContacts/BrevoTestContactsPage.js +24 -29
- package/lib/brevoTestContacts/form/BrevoTestContactForm.generated.js +1 -7
- package/lib/brevoTestContacts/form/BrevoTestContactForm.gql.generated.js +1 -7
- package/lib/brevoTestContacts/form/BrevoTestContactForm.gql.js +7 -13
- package/lib/brevoTestContacts/form/BrevoTestContactForm.js +42 -48
- package/lib/common/BrevoConfigProvider.js +9 -15
- package/lib/common/contactImport/useContactImportFromCsv.gql.d.ts +1 -1
- package/lib/common/contactImport/useContactImportFromCsv.gql.d.ts.map +1 -1
- package/lib/common/contactImport/useContactImportFromCsv.gql.generated.js +1 -7
- package/lib/common/contactImport/useContactImportFromCsv.gql.js +2 -8
- package/lib/common/contactImport/useContactImportFromCsv.js +80 -87
- package/lib/configVerification/ConfigVerification.d.ts +1 -1
- package/lib/configVerification/ConfigVerification.d.ts.map +1 -1
- package/lib/configVerification/ConfigVerification.gql.d.ts +1 -1
- package/lib/configVerification/ConfigVerification.gql.d.ts.map +1 -1
- package/lib/configVerification/ConfigVerification.gql.generated.js +1 -7
- package/lib/configVerification/ConfigVerification.gql.js +2 -8
- package/lib/configVerification/ConfigVerification.js +12 -18
- package/lib/emailCampaigns/EmailCampaignsGrid.generated.js +1 -7
- package/lib/emailCampaigns/EmailCampaignsGrid.js +47 -53
- package/lib/emailCampaigns/EmailCampaignsPage.d.ts +1 -0
- package/lib/emailCampaigns/EmailCampaignsPage.d.ts.map +1 -1
- package/lib/emailCampaigns/EmailCampaignsPage.js +29 -35
- package/lib/emailCampaigns/SendingStateColumn.js +24 -30
- package/lib/emailCampaigns/form/ConfigFields.js +11 -17
- package/lib/emailCampaigns/form/EmailCampaignForm.gql.d.ts +5 -5
- package/lib/emailCampaigns/form/EmailCampaignForm.gql.d.ts.map +1 -1
- package/lib/emailCampaigns/form/EmailCampaignForm.gql.generated.js +1 -7
- package/lib/emailCampaigns/form/EmailCampaignForm.gql.js +6 -12
- package/lib/emailCampaigns/form/EmailCampaignForm.js +65 -71
- package/lib/emailCampaigns/form/SendEmailCampaignNowDialog.js +16 -21
- package/lib/emailCampaigns/form/SendManagerFields.gql.d.ts +2 -2
- package/lib/emailCampaigns/form/SendManagerFields.gql.d.ts.map +1 -1
- package/lib/emailCampaigns/form/SendManagerFields.gql.generated.js +1 -7
- package/lib/emailCampaigns/form/SendManagerFields.gql.js +4 -10
- package/lib/emailCampaigns/form/SendManagerFields.js +37 -43
- package/lib/emailCampaigns/form/SendManagerWrapper.gql.d.ts +1 -1
- package/lib/emailCampaigns/form/SendManagerWrapper.gql.d.ts.map +1 -1
- package/lib/emailCampaigns/form/SendManagerWrapper.gql.generated.js +1 -7
- package/lib/emailCampaigns/form/SendManagerWrapper.gql.js +2 -8
- package/lib/emailCampaigns/form/SendManagerWrapper.js +13 -19
- package/lib/emailCampaigns/form/TestEmailCampaignForm.generated.js +1 -7
- package/lib/emailCampaigns/form/TestEmailCampaignForm.gql.d.ts +1 -1
- package/lib/emailCampaigns/form/TestEmailCampaignForm.gql.d.ts.map +1 -1
- package/lib/emailCampaigns/form/TestEmailCampaignForm.gql.generated.js +1 -7
- package/lib/emailCampaigns/form/TestEmailCampaignForm.gql.js +2 -8
- package/lib/emailCampaigns/form/TestEmailCampaignForm.js +33 -39
- package/lib/emailCampaigns/statistics/EmailCampaignStatistics.gql.d.ts +1 -1
- package/lib/emailCampaigns/statistics/EmailCampaignStatistics.gql.d.ts.map +1 -1
- package/lib/emailCampaigns/statistics/EmailCampaignStatistics.gql.generated.js +1 -7
- package/lib/emailCampaigns/statistics/EmailCampaignStatistics.gql.js +2 -8
- package/lib/emailCampaigns/statistics/EmailCampaignStatistics.js +40 -46
- package/lib/emailCampaigns/statistics/PercentageCard.js +29 -35
- package/lib/emailCampaigns/view/EmailCampaignView.gql.d.ts +1 -1
- package/lib/emailCampaigns/view/EmailCampaignView.gql.d.ts.map +1 -1
- package/lib/emailCampaigns/view/EmailCampaignView.gql.generated.js +1 -7
- package/lib/emailCampaigns/view/EmailCampaignView.gql.js +2 -8
- package/lib/emailCampaigns/view/EmailCampaignView.js +31 -37
- package/lib/graphql.generated.js +1 -5
- package/lib/index.js +7 -60
- package/lib/targetGroups/TargetGroupDialog.gql.d.ts +1 -1
- package/lib/targetGroups/TargetGroupDialog.gql.d.ts.map +1 -1
- package/lib/targetGroups/TargetGroupDialog.gql.generated.js +1 -7
- package/lib/targetGroups/TargetGroupDialog.gql.js +2 -8
- package/lib/targetGroups/TargetGroupDialog.js +13 -19
- package/lib/targetGroups/TargetGroupForm.gql.generated.js +1 -7
- package/lib/targetGroups/TargetGroupForm.gql.js +8 -14
- package/lib/targetGroups/TargetGroupForm.js +49 -61
- package/lib/targetGroups/TargetGroupsGrid.generated.js +1 -7
- package/lib/targetGroups/TargetGroupsGrid.js +41 -48
- package/lib/targetGroups/TargetGroupsPage.d.ts +1 -1
- package/lib/targetGroups/TargetGroupsPage.d.ts.map +1 -1
- package/lib/targetGroups/TargetGroupsPage.js +21 -27
- package/lib/targetGroups/addContacts/AddContactsGridSelect.gql.d.ts +4 -4
- package/lib/targetGroups/addContacts/AddContactsGridSelect.gql.d.ts.map +1 -1
- package/lib/targetGroups/addContacts/AddContactsGridSelect.gql.generated.js +1 -7
- package/lib/targetGroups/addContacts/AddContactsGridSelect.gql.js +6 -12
- package/lib/targetGroups/addContacts/AddContactsGridSelect.js +64 -70
- package/lib/targetGroups/allAssignedContacts/AllAssignedContactsGrid.gql.d.ts +1 -1
- package/lib/targetGroups/allAssignedContacts/AllAssignedContactsGrid.gql.d.ts.map +1 -1
- package/lib/targetGroups/allAssignedContacts/AllAssignedContactsGrid.gql.generated.js +1 -7
- package/lib/targetGroups/allAssignedContacts/AllAssignedContactsGrid.gql.js +3 -9
- package/lib/targetGroups/allAssignedContacts/AllAssignedContactsGrid.js +17 -23
- package/package.json +20 -15
|
@@ -1,19 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
var _admin = require("@comet/admin");
|
|
9
|
-
var _material = require("@mui/material");
|
|
10
|
-
var _reactIntl = require("react-intl");
|
|
11
|
-
var _SendManagerWrapper = require("./SendManagerWrapper.gql");
|
|
12
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
var SendManagerWrapper = exports.SendManagerWrapper = function SendManagerWrapper(_ref) {
|
|
1
|
+
import { useQuery } from "@apollo/client";
|
|
2
|
+
import { Alert, Loading } from "@comet/admin";
|
|
3
|
+
import { Typography } from "@mui/material";
|
|
4
|
+
import { FormattedMessage } from "react-intl";
|
|
5
|
+
import { brevoConfigQuery } from "./SendManagerWrapper.gql";
|
|
6
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
export var SendManagerWrapper = function SendManagerWrapper(_ref) {
|
|
14
8
|
var scope = _ref.scope,
|
|
15
9
|
children = _ref.children;
|
|
16
|
-
var _useQuery =
|
|
10
|
+
var _useQuery = useQuery(brevoConfigQuery, {
|
|
17
11
|
variables: {
|
|
18
12
|
scope: scope
|
|
19
13
|
},
|
|
@@ -23,21 +17,21 @@ var SendManagerWrapper = exports.SendManagerWrapper = function SendManagerWrappe
|
|
|
23
17
|
loading = _useQuery.loading,
|
|
24
18
|
error = _useQuery.error;
|
|
25
19
|
if (loading) {
|
|
26
|
-
return /*#__PURE__*/(
|
|
20
|
+
return /*#__PURE__*/_jsx(Loading, {});
|
|
27
21
|
}
|
|
28
22
|
if (error) throw error;
|
|
29
23
|
if ((brevoConfig === null || brevoConfig === void 0 ? void 0 : brevoConfig.isBrevoConfigDefined) === false) {
|
|
30
|
-
return /*#__PURE__*/(
|
|
31
|
-
children: /*#__PURE__*/(
|
|
24
|
+
return /*#__PURE__*/_jsx(Typography, {
|
|
25
|
+
children: /*#__PURE__*/_jsx(Alert, {
|
|
32
26
|
severity: "error",
|
|
33
|
-
children: /*#__PURE__*/(
|
|
27
|
+
children: /*#__PURE__*/_jsx(FormattedMessage, {
|
|
34
28
|
id: "cometBrevoModule.emailCampaigns.configNotDefined",
|
|
35
29
|
defaultMessage: "Brevo configuration is not defined. Please ask an administrator to set it up before sending email campaigns."
|
|
36
30
|
})
|
|
37
31
|
})
|
|
38
32
|
});
|
|
39
33
|
}
|
|
40
|
-
return /*#__PURE__*/(
|
|
34
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
41
35
|
children: [" ", children, " "]
|
|
42
36
|
});
|
|
43
37
|
};
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.namedOperations = void 0;
|
|
7
|
-
var namedOperations = exports.namedOperations = {
|
|
1
|
+
export var namedOperations = {
|
|
8
2
|
Query: {
|
|
9
3
|
BrevoTestContactsGridSelect: 'BrevoTestContactsGridSelect'
|
|
10
4
|
},
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const SendEmailCampaignToTestEmailsMutation: import("
|
|
1
|
+
export declare const SendEmailCampaignToTestEmailsMutation: import("graphql").DocumentNode;
|
|
2
2
|
//# sourceMappingURL=TestEmailCampaignForm.gql.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TestEmailCampaignForm.gql.d.ts","sourceRoot":"","sources":["../../../src/emailCampaigns/form/TestEmailCampaignForm.gql.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,qCAAqC,
|
|
1
|
+
{"version":3,"file":"TestEmailCampaignForm.gql.d.ts","sourceRoot":"","sources":["../../../src/emailCampaigns/form/TestEmailCampaignForm.gql.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,qCAAqC,gCAIjD,CAAC"}
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.namedOperations = void 0;
|
|
7
|
-
var namedOperations = exports.namedOperations = {
|
|
1
|
+
export var namedOperations = {
|
|
8
2
|
Mutation: {
|
|
9
3
|
SendEmailCampaignToTestEmails: 'SendEmailCampaignToTestEmails'
|
|
10
4
|
}
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.SendEmailCampaignToTestEmailsMutation = void 0;
|
|
7
|
-
var _client = require("@apollo/client");
|
|
8
1
|
var _templateObject;
|
|
9
2
|
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
10
|
-
|
|
3
|
+
import { gql } from "@apollo/client";
|
|
4
|
+
export var SendEmailCampaignToTestEmailsMutation = gql(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n mutation SendEmailCampaignToTestEmails($id: ID!, $data: SendTestEmailCampaignArgs!) {\n sendBrevoEmailCampaignToTestEmails(id: $id, data: $data)\n }\n"])));
|
|
@@ -1,36 +1,30 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.TestEmailCampaignForm = void 0;
|
|
7
|
-
var _client = require("@apollo/client");
|
|
8
|
-
var _admin = require("@comet/admin");
|
|
9
|
-
var _adminIcons = require("@comet/admin-icons");
|
|
10
|
-
var _cmsAdmin = require("@comet/cms-admin");
|
|
11
|
-
var _material = require("@mui/material");
|
|
12
|
-
var _reactIntl = require("react-intl");
|
|
13
|
-
var _BrevoConfigProvider = require("../../common/BrevoConfigProvider");
|
|
14
|
-
var _TestEmailCampaignForm = require("./TestEmailCampaignForm.gql");
|
|
15
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
1
|
var _templateObject, _templateObject2;
|
|
17
2
|
function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
|
|
18
3
|
function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
|
|
19
4
|
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
20
5
|
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
21
6
|
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
7
|
+
import { gql, useApolloClient, useQuery } from "@apollo/client";
|
|
8
|
+
import { Field, FinalForm, FinalFormSelect, SaveButton, Tooltip } from "@comet/admin";
|
|
9
|
+
import { Info, Newsletter } from "@comet/admin-icons";
|
|
10
|
+
import { BlockAdminComponentPaper, BlockAdminComponentSectionGroup, useContentScope } from "@comet/cms-admin";
|
|
11
|
+
import { Card } from "@mui/material";
|
|
12
|
+
import { FormattedMessage } from "react-intl";
|
|
13
|
+
import { useBrevoConfig } from "../../common/BrevoConfigProvider";
|
|
14
|
+
import { SendEmailCampaignToTestEmailsMutation } from "./TestEmailCampaignForm.gql";
|
|
15
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
|
+
var brevoTestContactsSelectFragment = gql(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n fragment BrevoTestContactsSelectList on BrevoContact {\n id\n email\n }\n"])));
|
|
17
|
+
var brevoTestContactsSelectQuery = gql(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n query BrevoTestContactsGridSelect($offset: Int, $limit: Int, $email: String, $scope: EmailCampaignContentScopeInput!) {\n brevoTestContacts(offset: $offset, limit: $limit, email: $email, scope: $scope) {\n nodes {\n ...BrevoTestContactsSelectList\n }\n totalCount\n }\n }\n ", "\n"])), brevoTestContactsSelectFragment);
|
|
18
|
+
export var TestEmailCampaignForm = function TestEmailCampaignForm(_ref) {
|
|
25
19
|
var _data$brevoTestContac;
|
|
26
20
|
var id = _ref.id,
|
|
27
21
|
_ref$isSendable = _ref.isSendable,
|
|
28
22
|
isSendable = _ref$isSendable === void 0 ? false : _ref$isSendable,
|
|
29
23
|
isCampaignCreated = _ref.isCampaignCreated;
|
|
30
|
-
var client =
|
|
31
|
-
var _useBrevoConfig =
|
|
24
|
+
var client = useApolloClient();
|
|
25
|
+
var _useBrevoConfig = useBrevoConfig(),
|
|
32
26
|
scopeParts = _useBrevoConfig.scopeParts;
|
|
33
|
-
var _useContentScope =
|
|
27
|
+
var _useContentScope = useContentScope(),
|
|
34
28
|
completeScope = _useContentScope.scope;
|
|
35
29
|
var scope = scopeParts.reduce(function (acc, scopePart) {
|
|
36
30
|
acc[scopePart] = completeScope[scopePart];
|
|
@@ -38,7 +32,7 @@ var TestEmailCampaignForm = exports.TestEmailCampaignForm = function TestEmailCa
|
|
|
38
32
|
}, {});
|
|
39
33
|
|
|
40
34
|
// Contact creation is limited to 100 at a time. Therefore, 100 contacts are queried without using pagination.
|
|
41
|
-
var _useQuery =
|
|
35
|
+
var _useQuery = useQuery(brevoTestContactsSelectQuery, {
|
|
42
36
|
variables: {
|
|
43
37
|
offset: 0,
|
|
44
38
|
limit: 100,
|
|
@@ -64,7 +58,7 @@ var TestEmailCampaignForm = exports.TestEmailCampaignForm = function TestEmailCa
|
|
|
64
58
|
}
|
|
65
59
|
_context.n = 1;
|
|
66
60
|
return client.mutate({
|
|
67
|
-
mutation:
|
|
61
|
+
mutation: SendEmailCampaignToTestEmailsMutation,
|
|
68
62
|
variables: {
|
|
69
63
|
id: id,
|
|
70
64
|
data: {
|
|
@@ -86,17 +80,17 @@ var TestEmailCampaignForm = exports.TestEmailCampaignForm = function TestEmailCa
|
|
|
86
80
|
var emailOptions = (data === null || data === void 0 || (_data$brevoTestContac = data.brevoTestContacts) === null || _data$brevoTestContac === void 0 || (_data$brevoTestContac = _data$brevoTestContac.nodes) === null || _data$brevoTestContac === void 0 ? void 0 : _data$brevoTestContac.map(function (contact) {
|
|
87
81
|
return contact.email;
|
|
88
82
|
})) || [];
|
|
89
|
-
return /*#__PURE__*/(
|
|
83
|
+
return /*#__PURE__*/_jsx(Card, {
|
|
90
84
|
sx: {
|
|
91
85
|
mt: 4
|
|
92
86
|
},
|
|
93
|
-
children: /*#__PURE__*/(
|
|
94
|
-
children: /*#__PURE__*/(
|
|
95
|
-
title: /*#__PURE__*/(
|
|
87
|
+
children: /*#__PURE__*/_jsx(BlockAdminComponentPaper, {
|
|
88
|
+
children: /*#__PURE__*/_jsx(BlockAdminComponentSectionGroup, {
|
|
89
|
+
title: /*#__PURE__*/_jsx(FormattedMessage, {
|
|
96
90
|
id: "cometBrevoModule.emailCampaigns.testEmailCampaign.title",
|
|
97
91
|
defaultMessage: "Send test email campaign"
|
|
98
92
|
}),
|
|
99
|
-
children: /*#__PURE__*/(
|
|
93
|
+
children: /*#__PURE__*/_jsx(FinalForm, {
|
|
100
94
|
mode: "edit",
|
|
101
95
|
onSubmit: submitTestEmails,
|
|
102
96
|
initialValues: {
|
|
@@ -106,20 +100,20 @@ var TestEmailCampaignForm = exports.TestEmailCampaignForm = function TestEmailCa
|
|
|
106
100
|
var handleSubmit = _ref3.handleSubmit,
|
|
107
101
|
submitting = _ref3.submitting,
|
|
108
102
|
values = _ref3.values;
|
|
109
|
-
return /*#__PURE__*/(
|
|
110
|
-
children: [/*#__PURE__*/(
|
|
111
|
-
component:
|
|
103
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
104
|
+
children: [/*#__PURE__*/_jsx(Field, {
|
|
105
|
+
component: FinalFormSelect,
|
|
112
106
|
name: "testEmails",
|
|
113
|
-
label: /*#__PURE__*/(
|
|
114
|
-
children: [/*#__PURE__*/(
|
|
107
|
+
label: /*#__PURE__*/_jsxs(_Fragment, {
|
|
108
|
+
children: [/*#__PURE__*/_jsx(FormattedMessage, {
|
|
115
109
|
id: "cometBrevoModule.emailCampaigns.testEmailCampaign.testEmails",
|
|
116
110
|
defaultMessage: "Email addresses"
|
|
117
|
-
}), " ", isCampaignCreated && /*#__PURE__*/(
|
|
118
|
-
title: /*#__PURE__*/(
|
|
111
|
+
}), " ", isCampaignCreated && /*#__PURE__*/_jsx(Tooltip, {
|
|
112
|
+
title: /*#__PURE__*/_jsx(FormattedMessage, {
|
|
119
113
|
id: "cometBrevoModule.emailCampaigns.testEmails.info",
|
|
120
114
|
defaultMessage: "Please select a target group and save the campaign before you can send test emails."
|
|
121
115
|
}),
|
|
122
|
-
children: /*#__PURE__*/(
|
|
116
|
+
children: /*#__PURE__*/_jsx(Info, {})
|
|
123
117
|
})]
|
|
124
118
|
}),
|
|
125
119
|
fullWidth: true,
|
|
@@ -131,14 +125,14 @@ var TestEmailCampaignForm = exports.TestEmailCampaignForm = function TestEmailCa
|
|
|
131
125
|
return option;
|
|
132
126
|
},
|
|
133
127
|
disabled: isCampaignCreated
|
|
134
|
-
}), /*#__PURE__*/(
|
|
128
|
+
}), /*#__PURE__*/_jsx(SaveButton, {
|
|
135
129
|
disabled: !values.testEmails || !isSendable || !id || isCampaignCreated,
|
|
136
|
-
startIcon: /*#__PURE__*/(
|
|
130
|
+
startIcon: /*#__PURE__*/_jsx(Newsletter, {}),
|
|
137
131
|
loading: submitting,
|
|
138
132
|
onClick: function onClick() {
|
|
139
133
|
handleSubmit();
|
|
140
134
|
},
|
|
141
|
-
children: /*#__PURE__*/(
|
|
135
|
+
children: /*#__PURE__*/_jsx(FormattedMessage, {
|
|
142
136
|
id: "cometBrevoModule.emailCampaigns.testEmailCampaign.sendText",
|
|
143
137
|
defaultMessage: "Send test email campaign"
|
|
144
138
|
})
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const emailCampaignStatistics: import("
|
|
1
|
+
export declare const emailCampaignStatistics: import("graphql").DocumentNode;
|
|
2
2
|
//# sourceMappingURL=EmailCampaignStatistics.gql.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmailCampaignStatistics.gql.d.ts","sourceRoot":"","sources":["../../../src/emailCampaigns/statistics/EmailCampaignStatistics.gql.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,uBAAuB,
|
|
1
|
+
{"version":3,"file":"EmailCampaignStatistics.gql.d.ts","sourceRoot":"","sources":["../../../src/emailCampaigns/statistics/EmailCampaignStatistics.gql.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,uBAAuB,gCAYnC,CAAC"}
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.namedOperations = void 0;
|
|
7
|
-
var namedOperations = exports.namedOperations = {
|
|
1
|
+
export var namedOperations = {
|
|
8
2
|
Query: {
|
|
9
3
|
EmailCampaignStatistics: 'EmailCampaignStatistics'
|
|
10
4
|
}
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.emailCampaignStatistics = void 0;
|
|
7
|
-
var _client = require("@apollo/client");
|
|
8
1
|
var _templateObject;
|
|
9
2
|
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
10
|
-
|
|
3
|
+
import { gql } from "@apollo/client";
|
|
4
|
+
export var emailCampaignStatistics = gql(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n query EmailCampaignStatistics($id: ID!) {\n brevoEmailCampaignStatistics(id: $id) {\n uniqueClicks\n unsubscriptions\n delivered\n sent\n softBounces\n hardBounces\n uniqueViews\n }\n }\n"])));
|
|
@@ -1,85 +1,79 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var
|
|
11
|
-
var _material = require("@mui/material");
|
|
12
|
-
var _reactIntl = require("react-intl");
|
|
13
|
-
var _EmailCampaignStatistics = require("./EmailCampaignStatistics.gql");
|
|
14
|
-
var _PercentageCard = require("./PercentageCard");
|
|
15
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
-
var EmailCampaignStatistics = exports.EmailCampaignStatistics = function EmailCampaignStatistics(_ref) {
|
|
1
|
+
import { useQuery } from "@apollo/client";
|
|
2
|
+
import { Button, MainContent, StackLink, Toolbar, ToolbarActions, ToolbarBackButton, ToolbarFillSpace } from "@comet/admin";
|
|
3
|
+
import { Add as AddIcon } from "@comet/admin-icons";
|
|
4
|
+
import { ContentScopeIndicator, useContentScopeConfig } from "@comet/cms-admin";
|
|
5
|
+
import { Grid } from "@mui/material";
|
|
6
|
+
import { FormattedMessage } from "react-intl";
|
|
7
|
+
import { emailCampaignStatistics } from "./EmailCampaignStatistics.gql";
|
|
8
|
+
import { PercentageCard } from "./PercentageCard";
|
|
9
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
10
|
+
export var EmailCampaignStatistics = function EmailCampaignStatistics(_ref) {
|
|
17
11
|
var _campaignStatistics$b, _campaignStatistics$b2, _campaignStatistics$b3, _campaignStatistics$b4, _campaignStatistics$b5, _campaignStatistics$b6, _campaignStatistics$b7, _campaignStatistics$b8, _campaignStatistics$b9, _campaignStatistics$b0, _campaignStatistics$b1, _campaignStatistics$b10;
|
|
18
12
|
var id = _ref.id;
|
|
19
|
-
|
|
13
|
+
useContentScopeConfig({
|
|
20
14
|
redirectPathAfterChange: "/newsletter/email-campaigns"
|
|
21
15
|
});
|
|
22
|
-
var _useQuery =
|
|
16
|
+
var _useQuery = useQuery(emailCampaignStatistics, {
|
|
23
17
|
variables: {
|
|
24
18
|
id: id
|
|
25
19
|
},
|
|
26
20
|
fetchPolicy: "network-only"
|
|
27
21
|
}),
|
|
28
22
|
campaignStatistics = _useQuery.data;
|
|
29
|
-
return /*#__PURE__*/(
|
|
30
|
-
children: [/*#__PURE__*/(
|
|
31
|
-
scopeIndicator: /*#__PURE__*/(
|
|
32
|
-
children: [/*#__PURE__*/(
|
|
33
|
-
children: /*#__PURE__*/(
|
|
34
|
-
startIcon: /*#__PURE__*/(
|
|
35
|
-
component:
|
|
23
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
24
|
+
children: [/*#__PURE__*/_jsxs(Toolbar, {
|
|
25
|
+
scopeIndicator: /*#__PURE__*/_jsx(ContentScopeIndicator, {}),
|
|
26
|
+
children: [/*#__PURE__*/_jsx(ToolbarBackButton, {}), /*#__PURE__*/_jsx(ToolbarFillSpace, {}), /*#__PURE__*/_jsx(ToolbarActions, {
|
|
27
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
28
|
+
startIcon: /*#__PURE__*/_jsx(AddIcon, {}),
|
|
29
|
+
component: StackLink,
|
|
36
30
|
pageName: "add",
|
|
37
31
|
payload: "add",
|
|
38
32
|
variant: "primary",
|
|
39
|
-
children: /*#__PURE__*/(
|
|
33
|
+
children: /*#__PURE__*/_jsx(FormattedMessage, {
|
|
40
34
|
id: "cometBrevoModule.emailCampaign.newEmailCampaign",
|
|
41
35
|
defaultMessage: "New email campaign"
|
|
42
36
|
})
|
|
43
37
|
})
|
|
44
38
|
})]
|
|
45
|
-
}), /*#__PURE__*/(
|
|
46
|
-
children: /*#__PURE__*/(
|
|
39
|
+
}), /*#__PURE__*/_jsx(MainContent, {
|
|
40
|
+
children: /*#__PURE__*/_jsxs(Grid, {
|
|
47
41
|
container: true,
|
|
48
42
|
spacing: 4,
|
|
49
|
-
children: [/*#__PURE__*/(
|
|
43
|
+
children: [/*#__PURE__*/_jsx(Grid, {
|
|
50
44
|
size: {
|
|
51
45
|
xs: 12,
|
|
52
46
|
md: 6
|
|
53
47
|
},
|
|
54
|
-
children: /*#__PURE__*/(
|
|
55
|
-
title: /*#__PURE__*/(
|
|
48
|
+
children: /*#__PURE__*/_jsx(PercentageCard, {
|
|
49
|
+
title: /*#__PURE__*/_jsx(FormattedMessage, {
|
|
56
50
|
id: "cometBrevoModule.emailCampaignStatistics.overallDelivery",
|
|
57
51
|
defaultMessage: "Overall delivery"
|
|
58
52
|
}),
|
|
59
53
|
currentNumber: campaignStatistics === null || campaignStatistics === void 0 || (_campaignStatistics$b = campaignStatistics.brevoEmailCampaignStatistics) === null || _campaignStatistics$b === void 0 ? void 0 : _campaignStatistics$b.delivered,
|
|
60
54
|
targetNumber: campaignStatistics === null || campaignStatistics === void 0 || (_campaignStatistics$b2 = campaignStatistics.brevoEmailCampaignStatistics) === null || _campaignStatistics$b2 === void 0 ? void 0 : _campaignStatistics$b2.sent
|
|
61
55
|
})
|
|
62
|
-
}), /*#__PURE__*/(
|
|
56
|
+
}), /*#__PURE__*/_jsx(Grid, {
|
|
63
57
|
size: {
|
|
64
58
|
xs: 12,
|
|
65
59
|
md: 6
|
|
66
60
|
},
|
|
67
|
-
children: /*#__PURE__*/(
|
|
68
|
-
title: /*#__PURE__*/(
|
|
61
|
+
children: /*#__PURE__*/_jsx(PercentageCard, {
|
|
62
|
+
title: /*#__PURE__*/_jsx(FormattedMessage, {
|
|
69
63
|
id: "cometBrevoModule.emailCampaignStatistics.overallFailedDelivery",
|
|
70
64
|
defaultMessage: "Overall failed delivery"
|
|
71
65
|
}),
|
|
72
66
|
currentNumber: campaignStatistics !== null && campaignStatistics !== void 0 && campaignStatistics.brevoEmailCampaignStatistics ? ((_campaignStatistics$b3 = campaignStatistics.brevoEmailCampaignStatistics) === null || _campaignStatistics$b3 === void 0 ? void 0 : _campaignStatistics$b3.sent) - ((_campaignStatistics$b4 = campaignStatistics.brevoEmailCampaignStatistics) === null || _campaignStatistics$b4 === void 0 ? void 0 : _campaignStatistics$b4.delivered) : undefined,
|
|
73
67
|
targetNumber: campaignStatistics === null || campaignStatistics === void 0 || (_campaignStatistics$b5 = campaignStatistics.brevoEmailCampaignStatistics) === null || _campaignStatistics$b5 === void 0 ? void 0 : _campaignStatistics$b5.sent
|
|
74
68
|
})
|
|
75
|
-
}), /*#__PURE__*/(
|
|
69
|
+
}), /*#__PURE__*/_jsx(Grid, {
|
|
76
70
|
size: {
|
|
77
71
|
xs: 12,
|
|
78
72
|
sm: 6,
|
|
79
73
|
lg: 3
|
|
80
74
|
},
|
|
81
|
-
children: /*#__PURE__*/(
|
|
82
|
-
title: /*#__PURE__*/(
|
|
75
|
+
children: /*#__PURE__*/_jsx(PercentageCard, {
|
|
76
|
+
title: /*#__PURE__*/_jsx(FormattedMessage, {
|
|
83
77
|
id: "cometBrevoModule.emailCampaignStatistics.uniqueViews",
|
|
84
78
|
defaultMessage: "Unique views"
|
|
85
79
|
}),
|
|
@@ -87,14 +81,14 @@ var EmailCampaignStatistics = exports.EmailCampaignStatistics = function EmailCa
|
|
|
87
81
|
currentNumber: campaignStatistics === null || campaignStatistics === void 0 || (_campaignStatistics$b6 = campaignStatistics.brevoEmailCampaignStatistics) === null || _campaignStatistics$b6 === void 0 ? void 0 : _campaignStatistics$b6.uniqueViews,
|
|
88
82
|
targetNumber: campaignStatistics === null || campaignStatistics === void 0 || (_campaignStatistics$b7 = campaignStatistics.brevoEmailCampaignStatistics) === null || _campaignStatistics$b7 === void 0 ? void 0 : _campaignStatistics$b7.sent
|
|
89
83
|
})
|
|
90
|
-
}), /*#__PURE__*/(
|
|
84
|
+
}), /*#__PURE__*/_jsx(Grid, {
|
|
91
85
|
size: {
|
|
92
86
|
xs: 12,
|
|
93
87
|
sm: 6,
|
|
94
88
|
lg: 3
|
|
95
89
|
},
|
|
96
|
-
children: /*#__PURE__*/(
|
|
97
|
-
title: /*#__PURE__*/(
|
|
90
|
+
children: /*#__PURE__*/_jsx(PercentageCard, {
|
|
91
|
+
title: /*#__PURE__*/_jsx(FormattedMessage, {
|
|
98
92
|
id: "cometBrevoModule.emailCampaignStatistics.overallClicked",
|
|
99
93
|
defaultMessage: "Overall clicked"
|
|
100
94
|
}),
|
|
@@ -102,14 +96,14 @@ var EmailCampaignStatistics = exports.EmailCampaignStatistics = function EmailCa
|
|
|
102
96
|
currentNumber: campaignStatistics === null || campaignStatistics === void 0 || (_campaignStatistics$b8 = campaignStatistics.brevoEmailCampaignStatistics) === null || _campaignStatistics$b8 === void 0 ? void 0 : _campaignStatistics$b8.uniqueClicks,
|
|
103
97
|
targetNumber: campaignStatistics === null || campaignStatistics === void 0 || (_campaignStatistics$b9 = campaignStatistics.brevoEmailCampaignStatistics) === null || _campaignStatistics$b9 === void 0 ? void 0 : _campaignStatistics$b9.sent
|
|
104
98
|
})
|
|
105
|
-
}), /*#__PURE__*/(
|
|
99
|
+
}), /*#__PURE__*/_jsx(Grid, {
|
|
106
100
|
size: {
|
|
107
101
|
xs: 12,
|
|
108
102
|
sm: 6,
|
|
109
103
|
lg: 3
|
|
110
104
|
},
|
|
111
|
-
children: /*#__PURE__*/(
|
|
112
|
-
title: /*#__PURE__*/(
|
|
105
|
+
children: /*#__PURE__*/_jsx(PercentageCard, {
|
|
106
|
+
title: /*#__PURE__*/_jsx(FormattedMessage, {
|
|
113
107
|
id: "cometBrevoModule.emailCampaignStatistics.overallBounce",
|
|
114
108
|
defaultMessage: "Overall bounce"
|
|
115
109
|
}),
|
|
@@ -117,14 +111,14 @@ var EmailCampaignStatistics = exports.EmailCampaignStatistics = function EmailCa
|
|
|
117
111
|
targetNumber: campaignStatistics === null || campaignStatistics === void 0 || (_campaignStatistics$b0 = campaignStatistics.brevoEmailCampaignStatistics) === null || _campaignStatistics$b0 === void 0 ? void 0 : _campaignStatistics$b0.sent,
|
|
118
112
|
variant: "circle"
|
|
119
113
|
})
|
|
120
|
-
}), /*#__PURE__*/(
|
|
114
|
+
}), /*#__PURE__*/_jsx(Grid, {
|
|
121
115
|
size: {
|
|
122
116
|
xs: 12,
|
|
123
117
|
sm: 6,
|
|
124
118
|
lg: 3
|
|
125
119
|
},
|
|
126
|
-
children: /*#__PURE__*/(
|
|
127
|
-
title: /*#__PURE__*/(
|
|
120
|
+
children: /*#__PURE__*/_jsx(PercentageCard, {
|
|
121
|
+
title: /*#__PURE__*/_jsx(FormattedMessage, {
|
|
128
122
|
id: "cometBrevoModule.emailCampaignStatistics.unsubscriptions",
|
|
129
123
|
defaultMessage: "Unsubscriptions"
|
|
130
124
|
}),
|