@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,4 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.BrevoContactsGrid = BrevoContactsGrid;
|
|
8
|
-
var _client = require("@apollo/client");
|
|
9
|
-
var _admin = require("@comet/admin");
|
|
10
|
-
var _adminIcons = require("@comet/admin-icons");
|
|
11
|
-
var _material = require("@mui/material");
|
|
12
|
-
var _xDataGrid = require("@mui/x-data-grid");
|
|
13
|
-
var _reactIntl = require("react-intl");
|
|
14
|
-
var _useContactImportFromCsv = require("../common/contactImport/useContactImportFromCsv");
|
|
15
|
-
var _BrevoContactsGrid = require("./BrevoContactsGrid.generated");
|
|
16
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
2
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
18
3
|
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 }; })(); }
|
|
19
4
|
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); }
|
|
@@ -35,39 +20,48 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
|
|
|
35
20
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
36
21
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
37
22
|
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
23
|
+
import { gql, useApolloClient, useQuery } from "@apollo/client";
|
|
24
|
+
import { Button, CrudMoreActionsMenu, DataGridToolbar, MainContent, messages, RowActionsItem, RowActionsMenu, StackLink, ToolbarFillSpace, useBufferedRowCount, useDataGridRemote, usePersistentColumnState } from "@comet/admin";
|
|
25
|
+
import { Add, Block, Check, Delete, Edit } from "@comet/admin-icons";
|
|
26
|
+
import { IconButton } from "@mui/material";
|
|
27
|
+
import { DataGrid, GridToolbarQuickFilter } from "@mui/x-data-grid";
|
|
28
|
+
import { FormattedMessage, useIntl } from "react-intl";
|
|
29
|
+
import { useContactImportFromCsv } from "../common/contactImport/useContactImportFromCsv";
|
|
30
|
+
import { namedOperations } from "./BrevoContactsGrid.generated";
|
|
31
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
32
|
+
var brevoContactsFragment = gql(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n fragment BrevoContactsList on BrevoContact {\n id\n createdAt\n modifiedAt\n email\n emailBlacklisted\n smsBlacklisted\n }\n"])));
|
|
33
|
+
var deleteBrevoContactMutation = gql(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n mutation DeleteBrevoContact($id: Int!, $scope: EmailCampaignContentScopeInput!) {\n deleteBrevoContact(id: $id, scope: $scope)\n }\n"])));
|
|
34
|
+
var updateBrevoContactMutation = gql(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n mutation UpdateBrevoContact($id: Int!, $input: BrevoContactUpdateInput!, $scope: EmailCampaignContentScopeInput!) {\n updateBrevoContact(id: $id, input: $input, scope: $scope) {\n id\n }\n }\n"])));
|
|
41
35
|
function BrevoContactsGridToolbar(_ref) {
|
|
42
36
|
var intl = _ref.intl,
|
|
43
37
|
scope = _ref.scope;
|
|
44
|
-
var _useContactImportFrom =
|
|
38
|
+
var _useContactImportFrom = useContactImportFromCsv({
|
|
45
39
|
scope: scope,
|
|
46
40
|
sendDoubleOptIn: true,
|
|
47
|
-
refetchQueries: [
|
|
41
|
+
refetchQueries: [namedOperations.Query.BrevoContactsGrid]
|
|
48
42
|
}),
|
|
49
43
|
_useContactImportFrom2 = _slicedToArray(_useContactImportFrom, 2),
|
|
50
44
|
moreActionsMenuItem = _useContactImportFrom2[0],
|
|
51
45
|
contactImportComponent = _useContactImportFrom2[1];
|
|
52
|
-
return /*#__PURE__*/(
|
|
53
|
-
children: [/*#__PURE__*/(
|
|
54
|
-
children: [/*#__PURE__*/(
|
|
46
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
47
|
+
children: [/*#__PURE__*/_jsxs(DataGridToolbar, {
|
|
48
|
+
children: [/*#__PURE__*/_jsx(FormattedMessage, {
|
|
55
49
|
id: "cometBrevoModule.brevoContact.title",
|
|
56
50
|
defaultMessage: "Contacts"
|
|
57
|
-
}), /*#__PURE__*/(
|
|
51
|
+
}), /*#__PURE__*/_jsx(GridToolbarQuickFilter, {
|
|
58
52
|
placeholder: intl.formatMessage({
|
|
59
53
|
id: "cometBrevoModule.brevoContact.searchEmail",
|
|
60
54
|
defaultMessage: "Search email address"
|
|
61
55
|
})
|
|
62
|
-
}), /*#__PURE__*/(
|
|
56
|
+
}), /*#__PURE__*/_jsx(ToolbarFillSpace, {}), /*#__PURE__*/_jsx(CrudMoreActionsMenu, {
|
|
63
57
|
overallActions: [moreActionsMenuItem]
|
|
64
|
-
}), /*#__PURE__*/(
|
|
65
|
-
startIcon: /*#__PURE__*/(
|
|
66
|
-
component:
|
|
58
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
59
|
+
startIcon: /*#__PURE__*/_jsx(Add, {}),
|
|
60
|
+
component: StackLink,
|
|
67
61
|
pageName: "add",
|
|
68
62
|
payload: "add",
|
|
69
63
|
variant: "primary",
|
|
70
|
-
children: /*#__PURE__*/(
|
|
64
|
+
children: /*#__PURE__*/_jsx(FormattedMessage, {
|
|
71
65
|
id: "cometBrevoModule.brevoContact.newContact",
|
|
72
66
|
defaultMessage: "New contact"
|
|
73
67
|
})
|
|
@@ -75,16 +69,16 @@ function BrevoContactsGridToolbar(_ref) {
|
|
|
75
69
|
}), contactImportComponent]
|
|
76
70
|
});
|
|
77
71
|
}
|
|
78
|
-
function BrevoContactsGrid(_ref2) {
|
|
72
|
+
export function BrevoContactsGrid(_ref2) {
|
|
79
73
|
var _additionalAttributes, _dataGridProps$filter, _dataGridProps$filter2, _data$brevoContacts$n;
|
|
80
74
|
var scope = _ref2.scope,
|
|
81
75
|
additionalAttributesFragment = _ref2.additionalAttributesFragment,
|
|
82
76
|
_ref2$additionalGridF = _ref2.additionalGridFields,
|
|
83
77
|
additionalGridFields = _ref2$additionalGridF === void 0 ? [] : _ref2$additionalGridF;
|
|
84
|
-
var brevoContactsQuery =
|
|
85
|
-
var client =
|
|
86
|
-
var intl =
|
|
87
|
-
var dataGridProps = _objectSpread(_objectSpread({},
|
|
78
|
+
var brevoContactsQuery = gql(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n query BrevoContactsGrid($offset: Int!, $limit: Int!, $email: String, $scope: EmailCampaignContentScopeInput!) {\n brevoContacts(offset: $offset, limit: $limit, email: $email, scope: $scope) {\n nodes {\n ...BrevoContactsList\n ", "\n }\n totalCount\n }\n }\n ", "\n ", "\n "])), additionalAttributesFragment ? "...".concat(additionalAttributesFragment === null || additionalAttributesFragment === void 0 ? void 0 : additionalAttributesFragment.name) : "", brevoContactsFragment, (_additionalAttributes = additionalAttributesFragment === null || additionalAttributesFragment === void 0 ? void 0 : additionalAttributesFragment.fragment) !== null && _additionalAttributes !== void 0 ? _additionalAttributes : "");
|
|
79
|
+
var client = useApolloClient();
|
|
80
|
+
var intl = useIntl();
|
|
81
|
+
var dataGridProps = _objectSpread(_objectSpread({}, useDataGridRemote()), usePersistentColumnState("BrevoContactsGrid"));
|
|
88
82
|
var columns = [{
|
|
89
83
|
field: "createdAt",
|
|
90
84
|
headerName: intl.formatMessage({
|
|
@@ -138,17 +132,17 @@ function BrevoContactsGrid(_ref2) {
|
|
|
138
132
|
filterable: false,
|
|
139
133
|
type: "actions",
|
|
140
134
|
renderCell: function renderCell(params) {
|
|
141
|
-
return /*#__PURE__*/(
|
|
142
|
-
children: [/*#__PURE__*/(
|
|
143
|
-
component:
|
|
135
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
136
|
+
children: [/*#__PURE__*/_jsx(IconButton, {
|
|
137
|
+
component: StackLink,
|
|
144
138
|
pageName: "edit",
|
|
145
139
|
payload: params.row.id.toString(),
|
|
146
|
-
children: /*#__PURE__*/(
|
|
140
|
+
children: /*#__PURE__*/_jsx(Edit, {
|
|
147
141
|
color: "primary"
|
|
148
142
|
})
|
|
149
|
-
}), /*#__PURE__*/(
|
|
150
|
-
children: /*#__PURE__*/(
|
|
151
|
-
children: [/*#__PURE__*/(
|
|
143
|
+
}), /*#__PURE__*/_jsx(RowActionsMenu, {
|
|
144
|
+
children: /*#__PURE__*/_jsxs(RowActionsMenu, {
|
|
145
|
+
children: [/*#__PURE__*/_jsx(RowActionsItem, {
|
|
152
146
|
onClick: /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
153
147
|
return _regenerator().w(function (_context) {
|
|
154
148
|
while (1) switch (_context.n) {
|
|
@@ -170,15 +164,15 @@ function BrevoContactsGrid(_ref2) {
|
|
|
170
164
|
}
|
|
171
165
|
}, _callee);
|
|
172
166
|
})),
|
|
173
|
-
icon: params.row.emailBlacklisted ? /*#__PURE__*/(
|
|
174
|
-
children: params.row.emailBlacklisted ? /*#__PURE__*/(
|
|
167
|
+
icon: params.row.emailBlacklisted ? /*#__PURE__*/_jsx(Check, {}) : /*#__PURE__*/_jsx(Block, {}),
|
|
168
|
+
children: params.row.emailBlacklisted ? /*#__PURE__*/_jsx(FormattedMessage, {
|
|
175
169
|
id: "cometBrevoModule.brevoContact.actions.unblock",
|
|
176
170
|
defaultMessage: "Unblock"
|
|
177
|
-
}) : /*#__PURE__*/(
|
|
171
|
+
}) : /*#__PURE__*/_jsx(FormattedMessage, {
|
|
178
172
|
id: "cometBrevoModule.brevoContact.actions.block",
|
|
179
173
|
defaultMessage: "Block"
|
|
180
174
|
})
|
|
181
|
-
}), /*#__PURE__*/(
|
|
175
|
+
}), /*#__PURE__*/_jsx(RowActionsItem, {
|
|
182
176
|
onClick: /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
|
|
183
177
|
return _regenerator().w(function (_context2) {
|
|
184
178
|
while (1) switch (_context2.n) {
|
|
@@ -197,15 +191,15 @@ function BrevoContactsGrid(_ref2) {
|
|
|
197
191
|
}
|
|
198
192
|
}, _callee2);
|
|
199
193
|
})),
|
|
200
|
-
icon: /*#__PURE__*/(
|
|
201
|
-
children: /*#__PURE__*/(
|
|
194
|
+
icon: /*#__PURE__*/_jsx(Delete, {}),
|
|
195
|
+
children: /*#__PURE__*/_jsx(FormattedMessage, _objectSpread({}, messages["delete"]))
|
|
202
196
|
})]
|
|
203
197
|
})
|
|
204
198
|
})]
|
|
205
199
|
});
|
|
206
200
|
}
|
|
207
201
|
}]);
|
|
208
|
-
var _useQuery =
|
|
202
|
+
var _useQuery = useQuery(brevoContactsQuery, {
|
|
209
203
|
variables: {
|
|
210
204
|
offset: dataGridProps.paginationModel.page * dataGridProps.paginationModel.pageSize,
|
|
211
205
|
limit: dataGridProps.paginationModel.pageSize,
|
|
@@ -216,12 +210,12 @@ function BrevoContactsGrid(_ref2) {
|
|
|
216
210
|
data = _useQuery.data,
|
|
217
211
|
loading = _useQuery.loading,
|
|
218
212
|
error = _useQuery.error;
|
|
219
|
-
var rowCount =
|
|
213
|
+
var rowCount = useBufferedRowCount(data === null || data === void 0 ? void 0 : data.brevoContacts.totalCount);
|
|
220
214
|
if (error) throw error;
|
|
221
215
|
var rows = (_data$brevoContacts$n = data === null || data === void 0 ? void 0 : data.brevoContacts.nodes) !== null && _data$brevoContacts$n !== void 0 ? _data$brevoContacts$n : [];
|
|
222
|
-
return /*#__PURE__*/(
|
|
216
|
+
return /*#__PURE__*/_jsx(MainContent, {
|
|
223
217
|
fullHeight: true,
|
|
224
|
-
children: /*#__PURE__*/(
|
|
218
|
+
children: /*#__PURE__*/_jsx(DataGrid, _objectSpread(_objectSpread({}, dataGridProps), {}, {
|
|
225
219
|
disableRowSelectionOnClick: true,
|
|
226
220
|
rows: rows,
|
|
227
221
|
rowCount: rowCount,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type GridColDef } from "@comet/admin";
|
|
2
2
|
import { type DocumentNode } from "graphql";
|
|
3
|
-
import { type ReactNode } from "react";
|
|
3
|
+
import { type JSX, type ReactNode } from "react";
|
|
4
4
|
import { type EditBrevoContactFormValues } from "./form/BrevoContactForm";
|
|
5
5
|
interface CreateContactsPageOptions {
|
|
6
6
|
additionalAttributesFragment?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BrevoContactsPage.d.ts","sourceRoot":"","sources":["../../src/brevoContacts/BrevoContactsPage.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAA+C,MAAM,cAAc,CAAC;AAE5F,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"BrevoContactsPage.d.ts","sourceRoot":"","sources":["../../src/brevoContacts/BrevoContactsPage.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAA+C,MAAM,cAAc,CAAC;AAE5F,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAMjD,OAAO,EAAoB,KAAK,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAE5F,UAAU,yBAAyB;IAC/B,4BAA4B,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,YAAY,CAAA;KAAE,CAAC;IACxE,oBAAoB,CAAC,EAAE,UAAU,EAAE,CAAC;IACpC,oBAAoB,CAAC,EAAE,SAAS,CAAC;IACjC,WAAW,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,0BAA0B,KAAK,0BAA0B,CAAC;CACrF;AAED,iBAAS,uBAAuB,CAAC,EAC7B,4BAA4B,EAC5B,oBAAoB,EACpB,oBAAoB,EACpB,WAAW,GACd,EAAE,yBAAyB,SACM,GAAG,CAAC,OAAO,CAyD5C;AAED,OAAO,EAAE,uBAAuB,EAAE,CAAC"}
|
|
@@ -1,59 +1,53 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _reactIntl = require("react-intl");
|
|
10
|
-
var _BrevoConfigProvider = require("../common/BrevoConfigProvider");
|
|
11
|
-
var _ConfigVerification = require("../configVerification/ConfigVerification");
|
|
12
|
-
var _BrevoContactsGrid = require("./BrevoContactsGrid");
|
|
13
|
-
var _BrevoContactForm = require("./form/BrevoContactForm");
|
|
14
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
1
|
+
import { Stack, StackPage, StackSwitch, StackToolbar } from "@comet/admin";
|
|
2
|
+
import { ContentScopeIndicator, useContentScope } from "@comet/cms-admin";
|
|
3
|
+
import { useIntl } from "react-intl";
|
|
4
|
+
import { useBrevoConfig } from "../common/BrevoConfigProvider";
|
|
5
|
+
import { ConfigVerification } from "../configVerification/ConfigVerification";
|
|
6
|
+
import { BrevoContactsGrid } from "./BrevoContactsGrid";
|
|
7
|
+
import { BrevoContactForm } from "./form/BrevoContactForm";
|
|
8
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
9
|
function createBrevoContactsPage(_ref) {
|
|
16
10
|
var additionalAttributesFragment = _ref.additionalAttributesFragment,
|
|
17
11
|
additionalFormFields = _ref.additionalFormFields,
|
|
18
12
|
additionalGridFields = _ref.additionalGridFields,
|
|
19
13
|
input2State = _ref.input2State;
|
|
20
14
|
function BrevoContactsPage() {
|
|
21
|
-
var intl =
|
|
22
|
-
var _useBrevoConfig =
|
|
15
|
+
var intl = useIntl();
|
|
16
|
+
var _useBrevoConfig = useBrevoConfig(),
|
|
23
17
|
scopeParts = _useBrevoConfig.scopeParts;
|
|
24
|
-
var _useContentScope =
|
|
18
|
+
var _useContentScope = useContentScope(),
|
|
25
19
|
completeScope = _useContentScope.scope;
|
|
26
20
|
var scope = scopeParts.reduce(function (acc, scopePart) {
|
|
27
21
|
acc[scopePart] = completeScope[scopePart];
|
|
28
22
|
return acc;
|
|
29
23
|
}, {});
|
|
30
|
-
return /*#__PURE__*/(
|
|
24
|
+
return /*#__PURE__*/_jsx(ConfigVerification, {
|
|
31
25
|
scope: scope,
|
|
32
|
-
children: /*#__PURE__*/(
|
|
26
|
+
children: /*#__PURE__*/_jsx(Stack, {
|
|
33
27
|
topLevelTitle: intl.formatMessage({
|
|
34
28
|
id: "cometBrevoModule.brevoContacts.brevoContacts",
|
|
35
29
|
defaultMessage: "Contacts"
|
|
36
30
|
}),
|
|
37
|
-
children: /*#__PURE__*/(
|
|
38
|
-
children: [/*#__PURE__*/(
|
|
31
|
+
children: /*#__PURE__*/_jsxs(StackSwitch, {
|
|
32
|
+
children: [/*#__PURE__*/_jsxs(StackPage, {
|
|
39
33
|
name: "grid",
|
|
40
|
-
children: [/*#__PURE__*/(
|
|
41
|
-
scopeIndicator: /*#__PURE__*/(
|
|
34
|
+
children: [/*#__PURE__*/_jsx(StackToolbar, {
|
|
35
|
+
scopeIndicator: /*#__PURE__*/_jsx(ContentScopeIndicator, {
|
|
42
36
|
scope: scope
|
|
43
37
|
})
|
|
44
|
-
}), /*#__PURE__*/(
|
|
38
|
+
}), /*#__PURE__*/_jsx(BrevoContactsGrid, {
|
|
45
39
|
scope: scope,
|
|
46
40
|
additionalAttributesFragment: additionalAttributesFragment,
|
|
47
41
|
additionalGridFields: additionalGridFields
|
|
48
42
|
})]
|
|
49
|
-
}), /*#__PURE__*/(
|
|
43
|
+
}), /*#__PURE__*/_jsx(StackPage, {
|
|
50
44
|
name: "edit",
|
|
51
45
|
title: intl.formatMessage({
|
|
52
46
|
id: "cometBrevoModule.brevoContacts.editBrevoContact",
|
|
53
47
|
defaultMessage: "Edit contact"
|
|
54
48
|
}),
|
|
55
49
|
children: function children(selectedId) {
|
|
56
|
-
return /*#__PURE__*/(
|
|
50
|
+
return /*#__PURE__*/_jsx(BrevoContactForm, {
|
|
57
51
|
additionalFormFields: additionalFormFields,
|
|
58
52
|
additionalAttributesFragment: additionalAttributesFragment,
|
|
59
53
|
input2State: input2State,
|
|
@@ -61,13 +55,13 @@ function createBrevoContactsPage(_ref) {
|
|
|
61
55
|
scope: scope
|
|
62
56
|
});
|
|
63
57
|
}
|
|
64
|
-
}), /*#__PURE__*/(
|
|
58
|
+
}), /*#__PURE__*/_jsx(StackPage, {
|
|
65
59
|
name: "add",
|
|
66
60
|
title: intl.formatMessage({
|
|
67
61
|
id: "cometBrevoModule.brevoContacts.addBrevoContact",
|
|
68
62
|
defaultMessage: "Add contact"
|
|
69
63
|
}),
|
|
70
|
-
children: /*#__PURE__*/(
|
|
64
|
+
children: /*#__PURE__*/_jsx(BrevoContactForm, {
|
|
71
65
|
additionalFormFields: additionalFormFields,
|
|
72
66
|
additionalAttributesFragment: additionalAttributesFragment,
|
|
73
67
|
input2State: input2State,
|
|
@@ -79,4 +73,5 @@ function createBrevoContactsPage(_ref) {
|
|
|
79
73
|
});
|
|
80
74
|
}
|
|
81
75
|
return BrevoContactsPage;
|
|
82
|
-
}
|
|
76
|
+
}
|
|
77
|
+
export { createBrevoContactsPage };
|
|
@@ -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
|
Fragment: {
|
|
9
3
|
BrevoContactForm: 'BrevoContactForm'
|
|
10
4
|
}
|
|
@@ -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
|
BrevoContactForm: 'BrevoContactForm',
|
|
10
4
|
BrevoContactFormCheckForChanges: 'BrevoContactFormCheckForChanges'
|
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.updateBrevoContactMutation = exports.createBrevoContactMutation = exports.brevoContactFormQuery = exports.brevoContactFormCheckForChangesQuery = void 0;
|
|
7
|
-
var _client = require("@apollo/client");
|
|
8
1
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
9
2
|
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
import { gql } from "@apollo/client";
|
|
4
|
+
export var brevoContactFormQuery = function brevoContactFormQuery(brevoContactFormFragment) {
|
|
5
|
+
return gql(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n query BrevoContactForm($id: Int!, $scope: EmailCampaignContentScopeInput!) {\n brevoContact(id: $id, scope: $scope) {\n id\n modifiedAt\n ...BrevoContactForm\n }\n }\n ", "\n"])), brevoContactFormFragment);
|
|
12
6
|
};
|
|
13
|
-
var brevoContactFormCheckForChangesQuery =
|
|
14
|
-
var createBrevoContactMutation =
|
|
15
|
-
var updateBrevoContactMutation =
|
|
16
|
-
return
|
|
7
|
+
export var brevoContactFormCheckForChangesQuery = gql(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n query BrevoContactFormCheckForChanges($id: Int!, $scope: EmailCampaignContentScopeInput!) {\n brevoContact(id: $id, scope: $scope) {\n modifiedAt\n }\n }\n"])));
|
|
8
|
+
export var createBrevoContactMutation = gql(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n mutation CreateBrevoContact($scope: EmailCampaignContentScopeInput!, $input: BrevoContactInput!) {\n createBrevoContact(scope: $scope, input: $input)\n }\n"])));
|
|
9
|
+
export var updateBrevoContactMutation = function updateBrevoContactMutation(brevoContactFormFragment) {
|
|
10
|
+
return gql(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n mutation UpdateBrevoContact($id: Int!, $input: BrevoContactUpdateInput!, $scope: EmailCampaignContentScopeInput!) {\n updateBrevoContact(id: $id, input: $input, scope: $scope) {\n id\n modifiedAt\n ...BrevoContactForm\n }\n }\n ", "\n"])), brevoContactFormFragment);
|
|
17
11
|
};
|