@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,21 +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.BrevoContactForm = BrevoContactForm;
|
|
8
|
-
var _client = require("@apollo/client");
|
|
9
|
-
var _admin = require("@comet/admin");
|
|
10
|
-
var _adminIcons = require("@comet/admin-icons");
|
|
11
|
-
var _cmsAdmin = require("@comet/cms-admin");
|
|
12
|
-
var _material = require("@mui/material");
|
|
13
|
-
var _system = require("@mui/system");
|
|
14
|
-
var _react = require("react");
|
|
15
|
-
var _reactIntl = require("react-intl");
|
|
16
|
-
var _BrevoConfigProvider = require("../../common/BrevoConfigProvider");
|
|
17
|
-
var _BrevoContactForm = require("./BrevoContactForm.gql");
|
|
18
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
2
|
var _excluded = ["email", "redirectionUrl"];
|
|
20
3
|
var _templateObject;
|
|
21
4
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
@@ -30,22 +13,33 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
|
|
|
30
13
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
31
14
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
32
15
|
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
33
|
-
|
|
16
|
+
import { gql, useApolloClient, useQuery } from "@apollo/client";
|
|
17
|
+
import { Alert, CheckboxField, FinalForm, FinalFormSaveButton, FormSection, Loading, MainContent, TextField, Toolbar, ToolbarActions, ToolbarFillSpace, ToolbarItem, ToolbarTitleItem, useErrorDialog, useFormApiRef, useStackApi } from "@comet/admin";
|
|
18
|
+
import { ArrowLeft } from "@comet/admin-icons";
|
|
19
|
+
import { ContentScopeIndicator, resolveHasSaveConflict, useFormSaveConflict } from "@comet/cms-admin";
|
|
20
|
+
import { Card, IconButton } from "@mui/material";
|
|
21
|
+
import { Box } from "@mui/system";
|
|
22
|
+
import { useMemo } from "react";
|
|
23
|
+
import { FormattedMessage } from "react-intl";
|
|
24
|
+
import { useBrevoConfig } from "../../common/BrevoConfigProvider";
|
|
25
|
+
import { brevoContactFormCheckForChangesQuery, brevoContactFormQuery, createBrevoContactMutation, updateBrevoContactMutation } from "./BrevoContactForm.gql";
|
|
26
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
27
|
+
export function BrevoContactForm(_ref) {
|
|
34
28
|
var _additionalAttributes;
|
|
35
29
|
var id = _ref.id,
|
|
36
30
|
scope = _ref.scope,
|
|
37
31
|
input2State = _ref.input2State,
|
|
38
32
|
additionalFormFields = _ref.additionalFormFields,
|
|
39
33
|
additionalAttributesFragment = _ref.additionalAttributesFragment;
|
|
40
|
-
var stackApi =
|
|
41
|
-
var client =
|
|
34
|
+
var stackApi = useStackApi();
|
|
35
|
+
var client = useApolloClient();
|
|
42
36
|
var mode = id ? "edit" : "add";
|
|
43
|
-
var formApiRef =
|
|
44
|
-
var _useBrevoConfig =
|
|
37
|
+
var formApiRef = useFormApiRef();
|
|
38
|
+
var _useBrevoConfig = useBrevoConfig(),
|
|
45
39
|
allowAddingContactsWithoutDoi = _useBrevoConfig.allowAddingContactsWithoutDoi;
|
|
46
|
-
var errorDialog =
|
|
47
|
-
var brevoContactFormFragment =
|
|
48
|
-
var _useQuery =
|
|
40
|
+
var errorDialog = useErrorDialog();
|
|
41
|
+
var brevoContactFormFragment = gql(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n fragment BrevoContactForm on BrevoContact {\n email\n ", "\n }\n ", "\n"])), additionalAttributesFragment ? "...".concat(additionalAttributesFragment === null || additionalAttributesFragment === void 0 ? void 0 : additionalAttributesFragment.name) : "", (_additionalAttributes = additionalAttributesFragment === null || additionalAttributesFragment === void 0 ? void 0 : additionalAttributesFragment.fragment) !== null && _additionalAttributes !== void 0 ? _additionalAttributes : "");
|
|
42
|
+
var _useQuery = useQuery(brevoContactFormQuery(brevoContactFormFragment), id ? {
|
|
49
43
|
variables: {
|
|
50
44
|
id: id,
|
|
51
45
|
scope: scope
|
|
@@ -56,7 +50,7 @@ function BrevoContactForm(_ref) {
|
|
|
56
50
|
data = _useQuery.data,
|
|
57
51
|
loading = _useQuery.loading,
|
|
58
52
|
refetch = _useQuery.refetch;
|
|
59
|
-
var initialValues =
|
|
53
|
+
var initialValues = useMemo(function () {
|
|
60
54
|
var _data$brevoContact;
|
|
61
55
|
var baseInitialValues = {
|
|
62
56
|
email: "",
|
|
@@ -70,7 +64,7 @@ function BrevoContactForm(_ref) {
|
|
|
70
64
|
email: data.brevoContact.email
|
|
71
65
|
}) : baseInitialValues;
|
|
72
66
|
}, [data === null || data === void 0 ? void 0 : data.brevoContact, input2State]);
|
|
73
|
-
var saveConflict =
|
|
67
|
+
var saveConflict = useFormSaveConflict({
|
|
74
68
|
checkConflict: function () {
|
|
75
69
|
var _checkConflict = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
76
70
|
var _data$brevoContact2;
|
|
@@ -86,7 +80,7 @@ function BrevoContactForm(_ref) {
|
|
|
86
80
|
case 1:
|
|
87
81
|
_context.n = 2;
|
|
88
82
|
return client.query({
|
|
89
|
-
query:
|
|
83
|
+
query: brevoContactFormCheckForChangesQuery,
|
|
90
84
|
variables: {
|
|
91
85
|
id: id,
|
|
92
86
|
scope: scope
|
|
@@ -96,7 +90,7 @@ function BrevoContactForm(_ref) {
|
|
|
96
90
|
case 2:
|
|
97
91
|
_yield$client$query = _context.v;
|
|
98
92
|
updatedData = _yield$client$query.data;
|
|
99
|
-
return _context.a(2,
|
|
93
|
+
return _context.a(2, resolveHasSaveConflict(data === null || data === void 0 || (_data$brevoContact2 = data.brevoContact) === null || _data$brevoContact2 === void 0 ? void 0 : _data$brevoContact2.modifiedAt, updatedData.brevoContact.modifiedAt));
|
|
100
94
|
}
|
|
101
95
|
}, _callee);
|
|
102
96
|
}));
|
|
@@ -156,7 +150,7 @@ function BrevoContactForm(_ref) {
|
|
|
156
150
|
email = output.email, redirectionUrl = output.redirectionUrl, rest = _objectWithoutProperties(output, _excluded);
|
|
157
151
|
_context3.n = 4;
|
|
158
152
|
return client.mutate({
|
|
159
|
-
mutation:
|
|
153
|
+
mutation: updateBrevoContactMutation(brevoContactFormFragment),
|
|
160
154
|
variables: {
|
|
161
155
|
id: id,
|
|
162
156
|
input: rest,
|
|
@@ -169,7 +163,7 @@ function BrevoContactForm(_ref) {
|
|
|
169
163
|
case 5:
|
|
170
164
|
_context3.n = 6;
|
|
171
165
|
return client.mutate({
|
|
172
|
-
mutation:
|
|
166
|
+
mutation: createBrevoContactMutation,
|
|
173
167
|
variables: {
|
|
174
168
|
scope: scope,
|
|
175
169
|
input: output
|
|
@@ -220,7 +214,7 @@ function BrevoContactForm(_ref) {
|
|
|
220
214
|
_t = _context3.v;
|
|
221
215
|
errorDialog === null || errorDialog === void 0 || errorDialog.showError({
|
|
222
216
|
title: "Error",
|
|
223
|
-
userMessage: /*#__PURE__*/(
|
|
217
|
+
userMessage: /*#__PURE__*/_jsx(Alert, {
|
|
224
218
|
severity: "error",
|
|
225
219
|
children: _t.message
|
|
226
220
|
}),
|
|
@@ -236,109 +230,109 @@ function BrevoContactForm(_ref) {
|
|
|
236
230
|
};
|
|
237
231
|
}();
|
|
238
232
|
if (loading) {
|
|
239
|
-
return /*#__PURE__*/(
|
|
233
|
+
return /*#__PURE__*/_jsx(Loading, {
|
|
240
234
|
behavior: "fillPageHeight"
|
|
241
235
|
});
|
|
242
236
|
}
|
|
243
|
-
return /*#__PURE__*/(
|
|
237
|
+
return /*#__PURE__*/_jsx(FinalForm, {
|
|
244
238
|
apiRef: formApiRef,
|
|
245
239
|
onSubmit: handleSubmit,
|
|
246
240
|
mode: mode,
|
|
247
241
|
initialValues: initialValues,
|
|
248
242
|
children: function children(_ref3) {
|
|
249
243
|
var values = _ref3.values;
|
|
250
|
-
return /*#__PURE__*/(
|
|
251
|
-
children: [saveConflict.dialogs, /*#__PURE__*/(
|
|
252
|
-
scopeIndicator: /*#__PURE__*/(
|
|
244
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
245
|
+
children: [saveConflict.dialogs, /*#__PURE__*/_jsxs(Toolbar, {
|
|
246
|
+
scopeIndicator: /*#__PURE__*/_jsx(ContentScopeIndicator, {
|
|
253
247
|
scope: scope
|
|
254
248
|
}),
|
|
255
|
-
children: [/*#__PURE__*/(
|
|
256
|
-
children: /*#__PURE__*/(
|
|
249
|
+
children: [/*#__PURE__*/_jsx(ToolbarItem, {
|
|
250
|
+
children: /*#__PURE__*/_jsx(IconButton, {
|
|
257
251
|
onClick: stackApi === null || stackApi === void 0 ? void 0 : stackApi.goBack,
|
|
258
|
-
children: /*#__PURE__*/(
|
|
252
|
+
children: /*#__PURE__*/_jsx(ArrowLeft, {})
|
|
259
253
|
})
|
|
260
|
-
}), /*#__PURE__*/(
|
|
261
|
-
children: /*#__PURE__*/(
|
|
254
|
+
}), /*#__PURE__*/_jsx(ToolbarTitleItem, {
|
|
255
|
+
children: /*#__PURE__*/_jsx(FormattedMessage, {
|
|
262
256
|
id: "cometBrevoModule.brevoContacts.brevoContact",
|
|
263
257
|
defaultMessage: "Contact"
|
|
264
258
|
})
|
|
265
|
-
}), /*#__PURE__*/(
|
|
266
|
-
children: /*#__PURE__*/(
|
|
259
|
+
}), /*#__PURE__*/_jsx(ToolbarFillSpace, {}), /*#__PURE__*/_jsx(ToolbarActions, {
|
|
260
|
+
children: /*#__PURE__*/_jsx(FinalFormSaveButton, {
|
|
267
261
|
hasConflict: saveConflict.hasConflict
|
|
268
262
|
})
|
|
269
263
|
})]
|
|
270
|
-
}), /*#__PURE__*/(
|
|
271
|
-
children: [mode === "edit" && /*#__PURE__*/(
|
|
264
|
+
}), /*#__PURE__*/_jsxs(MainContent, {
|
|
265
|
+
children: [mode === "edit" && /*#__PURE__*/_jsx(Box, {
|
|
272
266
|
sx: {
|
|
273
267
|
marginBottom: 4
|
|
274
268
|
},
|
|
275
|
-
children: /*#__PURE__*/(
|
|
269
|
+
children: /*#__PURE__*/_jsx(Alert, {
|
|
276
270
|
severity: "warning",
|
|
277
|
-
children: /*#__PURE__*/(
|
|
271
|
+
children: /*#__PURE__*/_jsx(FormattedMessage, {
|
|
278
272
|
id: "cometBrevoModule.brevoContact.contactEditAlert",
|
|
279
273
|
defaultMessage: "Editing a contact will affect all scopes and the target groups within those scopes."
|
|
280
274
|
})
|
|
281
275
|
})
|
|
282
|
-
}), /*#__PURE__*/(
|
|
276
|
+
}), /*#__PURE__*/_jsx(TextField, {
|
|
283
277
|
required: true,
|
|
284
278
|
fullWidth: true,
|
|
285
279
|
name: "email",
|
|
286
|
-
label: /*#__PURE__*/(
|
|
280
|
+
label: /*#__PURE__*/_jsx(FormattedMessage, {
|
|
287
281
|
id: "cometBrevoModule.brevoContact.email",
|
|
288
282
|
defaultMessage: "Email"
|
|
289
283
|
}),
|
|
290
284
|
disabled: mode === "edit"
|
|
291
|
-
}), mode === "add" && /*#__PURE__*/(
|
|
285
|
+
}), mode === "add" && /*#__PURE__*/_jsx(Card, {
|
|
292
286
|
sx: {
|
|
293
287
|
padding: 4,
|
|
294
288
|
marginBottom: 5
|
|
295
289
|
},
|
|
296
|
-
children: /*#__PURE__*/(
|
|
297
|
-
title: /*#__PURE__*/(
|
|
290
|
+
children: /*#__PURE__*/_jsxs(FormSection, {
|
|
291
|
+
title: /*#__PURE__*/_jsx(FormattedMessage, {
|
|
298
292
|
id: "cometBrevoModule.brevoContact.doubleOptIn",
|
|
299
293
|
defaultMessage: "Double Opt-in"
|
|
300
294
|
}),
|
|
301
|
-
children: [allowAddingContactsWithoutDoi && /*#__PURE__*/(
|
|
295
|
+
children: [allowAddingContactsWithoutDoi && /*#__PURE__*/_jsx(CheckboxField, {
|
|
302
296
|
name: "sendDoubleOptIn",
|
|
303
|
-
label: /*#__PURE__*/(
|
|
297
|
+
label: /*#__PURE__*/_jsx(FormattedMessage, {
|
|
304
298
|
id: "cometBrevoModule.brevoContact.sendDoubleOptInMail",
|
|
305
299
|
defaultMessage: "Send double opt-in email"
|
|
306
300
|
}),
|
|
307
301
|
fullWidth: true
|
|
308
|
-
}), values.sendDoubleOptIn ? /*#__PURE__*/(
|
|
302
|
+
}), values.sendDoubleOptIn ? /*#__PURE__*/_jsx(Alert, {
|
|
309
303
|
severity: "warning",
|
|
310
304
|
sx: {
|
|
311
305
|
marginBottom: 5
|
|
312
306
|
},
|
|
313
|
-
children: /*#__PURE__*/(
|
|
307
|
+
children: /*#__PURE__*/_jsx(FormattedMessage, {
|
|
314
308
|
id: "cometBrevoModule.brevoContact.contactAddAlert",
|
|
315
309
|
defaultMessage: "The contact will get a double opt-in email to confirm the subscription. After the contact's confirmation, the contact will be added to the corresponding target groups in this scope depending on the contact's attributes. Before the confirmation the contact will not be shown on the contacts page."
|
|
316
310
|
})
|
|
317
|
-
}) : /*#__PURE__*/(
|
|
311
|
+
}) : /*#__PURE__*/_jsx(Alert, {
|
|
318
312
|
severity: "error",
|
|
319
313
|
sx: {
|
|
320
314
|
marginBottom: 5
|
|
321
315
|
},
|
|
322
|
-
children: /*#__PURE__*/(
|
|
316
|
+
children: /*#__PURE__*/_jsx(FormattedMessage, {
|
|
323
317
|
id: "cometBrevoModule.brevoContact.contactNoOptInAlert",
|
|
324
318
|
defaultMessage: "No Double Opt-In email will be sent. You are responsible for ensuring that recipients have provided their consent before proceeding. If consent has not been given, sending a Double Opt-In email is legally required. Additionally, the creation of the user will be tracked, and you may need to provide clarification if users report any issues."
|
|
325
319
|
})
|
|
326
|
-
}), /*#__PURE__*/(
|
|
320
|
+
}), /*#__PURE__*/_jsx(TextField, {
|
|
327
321
|
disabled: values.sendDoubleOptIn ? false : true,
|
|
328
322
|
fullWidth: true,
|
|
329
323
|
name: "redirectionUrl",
|
|
330
|
-
label: /*#__PURE__*/(
|
|
324
|
+
label: /*#__PURE__*/_jsx(FormattedMessage, {
|
|
331
325
|
id: "cometBrevoModule.brevoContact.redirectionUrl",
|
|
332
326
|
defaultMessage: "Redirection Url (Contact will be redirected to this page after the confirmation in the double opt-in email)"
|
|
333
327
|
})
|
|
334
328
|
})]
|
|
335
329
|
})
|
|
336
|
-
}), additionalFormFields && /*#__PURE__*/(
|
|
330
|
+
}), additionalFormFields && /*#__PURE__*/_jsx(Card, {
|
|
337
331
|
sx: {
|
|
338
332
|
padding: 4
|
|
339
333
|
},
|
|
340
|
-
children: /*#__PURE__*/(
|
|
341
|
-
title: /*#__PURE__*/(
|
|
334
|
+
children: /*#__PURE__*/_jsx(FormSection, {
|
|
335
|
+
title: /*#__PURE__*/_jsx(FormattedMessage, {
|
|
342
336
|
id: "cometBrevoModule.brevoContact.attributes",
|
|
343
337
|
defaultMessage: "Attributes"
|
|
344
338
|
}),
|
|
@@ -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
|
BrevoTestContactsGrid: 'BrevoTestContactsGrid'
|
|
10
4
|
},
|
|
@@ -1,17 +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.BrevoTestContactsGrid = BrevoTestContactsGrid;
|
|
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 _jsxRuntime = require("react/jsx-runtime");
|
|
15
2
|
var _templateObject, _templateObject2, _templateObject3;
|
|
16
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 }; })(); }
|
|
17
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); }
|
|
@@ -29,8 +16,15 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
|
|
|
29
16
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
30
17
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
31
18
|
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
32
|
-
|
|
33
|
-
|
|
19
|
+
import { gql, useApolloClient, useQuery } from "@apollo/client";
|
|
20
|
+
import { Alert, Button, DataGridToolbar, MainContent, messages, RowActionsItem, RowActionsMenu, StackLink, ToolbarFillSpace, ToolbarTitleItem, Tooltip, useBufferedRowCount, useDataGridRemote, usePersistentColumnState } from "@comet/admin";
|
|
21
|
+
import { Add, Delete, Edit } from "@comet/admin-icons";
|
|
22
|
+
import { Box, IconButton } from "@mui/material";
|
|
23
|
+
import { DataGrid, GridToolbarQuickFilter } from "@mui/x-data-grid";
|
|
24
|
+
import { FormattedMessage, useIntl } from "react-intl";
|
|
25
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
26
|
+
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"])));
|
|
27
|
+
var deleteBrevoTestContactMutation = gql(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n mutation DeleteBrevoTestContact($id: Int!, $scope: EmailCampaignContentScopeInput!) {\n deleteBrevoTestContact(id: $id, scope: $scope)\n }\n"])));
|
|
34
28
|
function BrevoTestContactsGridToolbar(_ref) {
|
|
35
29
|
var intl = _ref.intl,
|
|
36
30
|
totalCount = _ref.totalCount;
|
|
@@ -39,28 +33,28 @@ function BrevoTestContactsGridToolbar(_ref) {
|
|
|
39
33
|
id: "cometBrevoModule.brevoTestContact.contactLimitReached",
|
|
40
34
|
defaultMessage: "Contact limit of 100 reached. You cannot add more contacts."
|
|
41
35
|
});
|
|
42
|
-
return /*#__PURE__*/(
|
|
43
|
-
children: [/*#__PURE__*/(
|
|
44
|
-
children: /*#__PURE__*/(
|
|
36
|
+
return /*#__PURE__*/_jsxs(DataGridToolbar, {
|
|
37
|
+
children: [/*#__PURE__*/_jsx(ToolbarTitleItem, {
|
|
38
|
+
children: /*#__PURE__*/_jsx(FormattedMessage, {
|
|
45
39
|
id: "cometBrevoModule.brevoTestContact.title",
|
|
46
40
|
defaultMessage: "Test contacts"
|
|
47
41
|
})
|
|
48
|
-
}), /*#__PURE__*/(
|
|
42
|
+
}), /*#__PURE__*/_jsx(GridToolbarQuickFilter, {
|
|
49
43
|
placeholder: intl.formatMessage({
|
|
50
44
|
id: "cometBrevoModule.brevoTestContact.searchEmail",
|
|
51
45
|
defaultMessage: "Search email address"
|
|
52
46
|
})
|
|
53
|
-
}), /*#__PURE__*/(
|
|
47
|
+
}), /*#__PURE__*/_jsx(ToolbarFillSpace, {}), /*#__PURE__*/_jsx(Tooltip, {
|
|
54
48
|
title: disableButton ? tooltipMessage : "",
|
|
55
|
-
children: /*#__PURE__*/(
|
|
56
|
-
children: /*#__PURE__*/(
|
|
57
|
-
startIcon: /*#__PURE__*/(
|
|
58
|
-
component:
|
|
49
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
50
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
51
|
+
startIcon: /*#__PURE__*/_jsx(Add, {}),
|
|
52
|
+
component: StackLink,
|
|
59
53
|
pageName: "add",
|
|
60
54
|
payload: "add",
|
|
61
55
|
variant: "primary",
|
|
62
56
|
disabled: disableButton,
|
|
63
|
-
children: /*#__PURE__*/(
|
|
57
|
+
children: /*#__PURE__*/_jsx(FormattedMessage, {
|
|
64
58
|
id: "cometBrevoModule.brevoTestContact.newContact",
|
|
65
59
|
defaultMessage: "New test contact"
|
|
66
60
|
})
|
|
@@ -69,16 +63,16 @@ function BrevoTestContactsGridToolbar(_ref) {
|
|
|
69
63
|
})]
|
|
70
64
|
});
|
|
71
65
|
}
|
|
72
|
-
function BrevoTestContactsGrid(_ref2) {
|
|
66
|
+
export function BrevoTestContactsGrid(_ref2) {
|
|
73
67
|
var _additionalAttributes, _dataGridProps$filter, _dataGridProps$filter2, _data$brevoTestContac;
|
|
74
68
|
var scope = _ref2.scope,
|
|
75
69
|
additionalAttributesFragment = _ref2.additionalAttributesFragment,
|
|
76
70
|
_ref2$additionalGridF = _ref2.additionalGridFields,
|
|
77
71
|
additionalGridFields = _ref2$additionalGridF === void 0 ? [] : _ref2$additionalGridF;
|
|
78
|
-
var brevoTestContactsQuery =
|
|
79
|
-
var client =
|
|
80
|
-
var intl =
|
|
81
|
-
var dataGridProps = _objectSpread(_objectSpread({},
|
|
72
|
+
var brevoTestContactsQuery = gql(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n query BrevoTestContactsGrid($offset: Int, $limit: Int, $email: String, $scope: EmailCampaignContentScopeInput!) {\n brevoTestContacts(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 : "");
|
|
73
|
+
var client = useApolloClient();
|
|
74
|
+
var intl = useIntl();
|
|
75
|
+
var dataGridProps = _objectSpread(_objectSpread({}, useDataGridRemote()), usePersistentColumnState("BrevoContactsGrid"));
|
|
82
76
|
var columns = [{
|
|
83
77
|
field: "createdAt",
|
|
84
78
|
headerName: intl.formatMessage({
|
|
@@ -122,17 +116,17 @@ function BrevoTestContactsGrid(_ref2) {
|
|
|
122
116
|
filterable: false,
|
|
123
117
|
type: "actions",
|
|
124
118
|
renderCell: function renderCell(params) {
|
|
125
|
-
return /*#__PURE__*/(
|
|
126
|
-
children: [/*#__PURE__*/(
|
|
127
|
-
component:
|
|
119
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
120
|
+
children: [/*#__PURE__*/_jsx(IconButton, {
|
|
121
|
+
component: StackLink,
|
|
128
122
|
pageName: "edit",
|
|
129
123
|
payload: params.row.id.toString(),
|
|
130
|
-
children: /*#__PURE__*/(
|
|
124
|
+
children: /*#__PURE__*/_jsx(Edit, {
|
|
131
125
|
color: "primary"
|
|
132
126
|
})
|
|
133
|
-
}), /*#__PURE__*/(
|
|
134
|
-
children: /*#__PURE__*/(
|
|
135
|
-
children: /*#__PURE__*/(
|
|
127
|
+
}), /*#__PURE__*/_jsx(RowActionsMenu, {
|
|
128
|
+
children: /*#__PURE__*/_jsx(RowActionsMenu, {
|
|
129
|
+
children: /*#__PURE__*/_jsx(RowActionsItem, {
|
|
136
130
|
onClick: /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
137
131
|
return _regenerator().w(function (_context) {
|
|
138
132
|
while (1) switch (_context.n) {
|
|
@@ -151,15 +145,15 @@ function BrevoTestContactsGrid(_ref2) {
|
|
|
151
145
|
}
|
|
152
146
|
}, _callee);
|
|
153
147
|
})),
|
|
154
|
-
icon: /*#__PURE__*/(
|
|
155
|
-
children: /*#__PURE__*/(
|
|
148
|
+
icon: /*#__PURE__*/_jsx(Delete, {}),
|
|
149
|
+
children: /*#__PURE__*/_jsx(FormattedMessage, _objectSpread({}, messages["delete"]))
|
|
156
150
|
})
|
|
157
151
|
})
|
|
158
152
|
})]
|
|
159
153
|
});
|
|
160
154
|
}
|
|
161
155
|
}]);
|
|
162
|
-
var _useQuery =
|
|
156
|
+
var _useQuery = useQuery(brevoTestContactsQuery, {
|
|
163
157
|
variables: {
|
|
164
158
|
offset: dataGridProps.paginationModel.page * dataGridProps.paginationModel.pageSize,
|
|
165
159
|
limit: dataGridProps.paginationModel.pageSize,
|
|
@@ -170,24 +164,24 @@ function BrevoTestContactsGrid(_ref2) {
|
|
|
170
164
|
data = _useQuery.data,
|
|
171
165
|
loading = _useQuery.loading,
|
|
172
166
|
error = _useQuery.error;
|
|
173
|
-
var rowCount =
|
|
167
|
+
var rowCount = useBufferedRowCount(data === null || data === void 0 ? void 0 : data.brevoTestContacts.totalCount);
|
|
174
168
|
if (error) throw error;
|
|
175
169
|
var rows = (_data$brevoTestContac = data === null || data === void 0 ? void 0 : data.brevoTestContacts.nodes) !== null && _data$brevoTestContac !== void 0 ? _data$brevoTestContac : [];
|
|
176
170
|
var totalCount = (data === null || data === void 0 ? void 0 : data.brevoTestContacts.totalCount) || 0;
|
|
177
|
-
return /*#__PURE__*/(
|
|
171
|
+
return /*#__PURE__*/_jsxs(MainContent, {
|
|
178
172
|
fullHeight: true,
|
|
179
|
-
children: [/*#__PURE__*/(
|
|
173
|
+
children: [/*#__PURE__*/_jsx(Box, {
|
|
180
174
|
sx: {
|
|
181
175
|
marginBottom: 4
|
|
182
176
|
},
|
|
183
|
-
children: /*#__PURE__*/(
|
|
177
|
+
children: /*#__PURE__*/_jsx(Alert, {
|
|
184
178
|
severity: "warning",
|
|
185
|
-
children: /*#__PURE__*/(
|
|
179
|
+
children: /*#__PURE__*/_jsx(FormattedMessage, {
|
|
186
180
|
id: "cometBrevoModule.brevoTestContact.testContactAlert",
|
|
187
181
|
defaultMessage: "Contacts in this list are only added for testing purposes. Users do not get a double-opt in to confirm their subscription."
|
|
188
182
|
})
|
|
189
183
|
})
|
|
190
|
-
}), /*#__PURE__*/(
|
|
184
|
+
}), /*#__PURE__*/_jsx(DataGrid, _objectSpread(_objectSpread({}, dataGridProps), {}, {
|
|
191
185
|
disableRowSelectionOnClick: true,
|
|
192
186
|
rows: rows,
|
|
193
187
|
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/BrevoTestContactForm";
|
|
5
5
|
interface CreateContactsPageOptions {
|
|
6
6
|
/** @deprecated Pass via BrevoConfigProvider instead */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BrevoTestContactsPage.d.ts","sourceRoot":"","sources":["../../src/brevoTestContacts/BrevoTestContactsPage.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":"BrevoTestContactsPage.d.ts","sourceRoot":"","sources":["../../src/brevoTestContacts/BrevoTestContactsPage.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,EAAwB,KAAK,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AAEpG,UAAU,yBAAyB;IAC/B,uDAAuD;IACvD,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,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,2BAA2B,CAAC,EACjC,UAAU,EAAE,gBAAgB,EAC5B,4BAA4B,EAC5B,oBAAoB,EACpB,oBAAoB,EACpB,WAAW,GACd,EAAE,yBAAyB,SACU,GAAG,CAAC,OAAO,CA4DhD;AAED,OAAO,EAAE,2BAA2B,EAAE,CAAC"}
|
|
@@ -1,17 +1,11 @@
|
|
|
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 _BrevoTestContactsGrid = require("./BrevoTestContactsGrid");
|
|
13
|
-
var _BrevoTestContactForm = require("./form/BrevoTestContactForm");
|
|
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 { BrevoTestContactsGrid } from "./BrevoTestContactsGrid";
|
|
7
|
+
import { BrevoTestContactForm } from "./form/BrevoTestContactForm";
|
|
8
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
9
|
function createBrevoTestContactsPage(_ref) {
|
|
16
10
|
var passedScopeParts = _ref.scopeParts,
|
|
17
11
|
additionalAttributesFragment = _ref.additionalAttributesFragment,
|
|
@@ -19,42 +13,42 @@ function createBrevoTestContactsPage(_ref) {
|
|
|
19
13
|
additionalGridFields = _ref.additionalGridFields,
|
|
20
14
|
input2State = _ref.input2State;
|
|
21
15
|
function BrevoTestContactsPage() {
|
|
22
|
-
var intl =
|
|
23
|
-
var brevoConfig =
|
|
16
|
+
var intl = useIntl();
|
|
17
|
+
var brevoConfig = useBrevoConfig();
|
|
24
18
|
var scopeParts = passedScopeParts !== null && passedScopeParts !== void 0 ? passedScopeParts : brevoConfig.scopeParts;
|
|
25
|
-
var _useContentScope =
|
|
19
|
+
var _useContentScope = useContentScope(),
|
|
26
20
|
completeScope = _useContentScope.scope;
|
|
27
21
|
var scope = scopeParts.reduce(function (acc, scopePart) {
|
|
28
22
|
acc[scopePart] = completeScope[scopePart];
|
|
29
23
|
return acc;
|
|
30
24
|
}, {});
|
|
31
|
-
return /*#__PURE__*/(
|
|
25
|
+
return /*#__PURE__*/_jsx(ConfigVerification, {
|
|
32
26
|
scope: scope,
|
|
33
|
-
children: /*#__PURE__*/(
|
|
27
|
+
children: /*#__PURE__*/_jsx(Stack, {
|
|
34
28
|
topLevelTitle: intl.formatMessage({
|
|
35
29
|
id: "cometBrevoModule.brevoContacts.brevoTestContacts",
|
|
36
30
|
defaultMessage: "Test Contacts"
|
|
37
31
|
}),
|
|
38
|
-
children: /*#__PURE__*/(
|
|
39
|
-
children: [/*#__PURE__*/(
|
|
32
|
+
children: /*#__PURE__*/_jsxs(StackSwitch, {
|
|
33
|
+
children: [/*#__PURE__*/_jsxs(StackPage, {
|
|
40
34
|
name: "grid",
|
|
41
|
-
children: [/*#__PURE__*/(
|
|
42
|
-
scopeIndicator: /*#__PURE__*/(
|
|
35
|
+
children: [/*#__PURE__*/_jsx(StackToolbar, {
|
|
36
|
+
scopeIndicator: /*#__PURE__*/_jsx(ContentScopeIndicator, {
|
|
43
37
|
scope: scope
|
|
44
38
|
})
|
|
45
|
-
}), /*#__PURE__*/(
|
|
39
|
+
}), /*#__PURE__*/_jsx(BrevoTestContactsGrid, {
|
|
46
40
|
scope: scope,
|
|
47
41
|
additionalAttributesFragment: additionalAttributesFragment,
|
|
48
42
|
additionalGridFields: additionalGridFields
|
|
49
43
|
})]
|
|
50
|
-
}), /*#__PURE__*/(
|
|
44
|
+
}), /*#__PURE__*/_jsx(StackPage, {
|
|
51
45
|
name: "edit",
|
|
52
46
|
title: intl.formatMessage({
|
|
53
47
|
id: "cometBrevoModule.brevoContacts.editBrevoContact",
|
|
54
48
|
defaultMessage: "Edit contact"
|
|
55
49
|
}),
|
|
56
50
|
children: function children(selectedId) {
|
|
57
|
-
return /*#__PURE__*/(
|
|
51
|
+
return /*#__PURE__*/_jsx(BrevoTestContactForm, {
|
|
58
52
|
additionalFormFields: additionalFormFields,
|
|
59
53
|
additionalAttributesFragment: additionalAttributesFragment,
|
|
60
54
|
input2State: input2State,
|
|
@@ -62,13 +56,13 @@ function createBrevoTestContactsPage(_ref) {
|
|
|
62
56
|
scope: scope
|
|
63
57
|
});
|
|
64
58
|
}
|
|
65
|
-
}), /*#__PURE__*/(
|
|
59
|
+
}), /*#__PURE__*/_jsx(StackPage, {
|
|
66
60
|
name: "add",
|
|
67
61
|
title: intl.formatMessage({
|
|
68
62
|
id: "cometBrevoModule.brevoContacts.addBrevoContact",
|
|
69
63
|
defaultMessage: "Add contact"
|
|
70
64
|
}),
|
|
71
|
-
children: /*#__PURE__*/(
|
|
65
|
+
children: /*#__PURE__*/_jsx(BrevoTestContactForm, {
|
|
72
66
|
additionalFormFields: additionalFormFields,
|
|
73
67
|
additionalAttributesFragment: additionalAttributesFragment,
|
|
74
68
|
input2State: input2State,
|
|
@@ -80,4 +74,5 @@ function createBrevoTestContactsPage(_ref) {
|
|
|
80
74
|
});
|
|
81
75
|
}
|
|
82
76
|
return BrevoTestContactsPage;
|
|
83
|
-
}
|
|
77
|
+
}
|
|
78
|
+
export { createBrevoTestContactsPage };
|
|
@@ -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
|
BrevoTestContactForm: 'BrevoTestContactForm'
|
|
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'
|