@comet/brevo-admin 3.0.0-canary-20241029075059 → 3.0.0-canary-20241105083652

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.
Files changed (42) hide show
  1. package/lib/brevoContacts/BrevoContactsGrid.d.ts +1 -1
  2. package/lib/brevoContacts/BrevoContactsGrid.d.ts.map +1 -1
  3. package/lib/brevoContacts/BrevoContactsGrid.js +118 -97
  4. package/lib/brevoContacts/BrevoContactsPage.d.ts +1 -1
  5. package/lib/brevoContacts/BrevoContactsPage.d.ts.map +1 -1
  6. package/lib/brevoContacts/BrevoContactsPage.js +44 -33
  7. package/lib/brevoContacts/form/BrevoContactForm.d.ts.map +1 -1
  8. package/lib/brevoContacts/form/BrevoContactForm.js +73 -51
  9. package/lib/common/BrevoConfigProvider.js +5 -3
  10. package/lib/common/contactImport/useContactImportFromCsv.js +86 -64
  11. package/lib/emailCampaigns/EmailCampaignsGrid.d.ts.map +1 -1
  12. package/lib/emailCampaigns/EmailCampaignsGrid.js +106 -91
  13. package/lib/emailCampaigns/EmailCampaignsPage.d.ts.map +1 -1
  14. package/lib/emailCampaigns/EmailCampaignsPage.js +54 -41
  15. package/lib/emailCampaigns/SendingStateColumn.js +43 -31
  16. package/lib/emailCampaigns/form/ConfigFields.js +22 -19
  17. package/lib/emailCampaigns/form/EmailCampaignForm.d.ts +1 -1
  18. package/lib/emailCampaigns/form/EmailCampaignForm.d.ts.map +1 -1
  19. package/lib/emailCampaigns/form/EmailCampaignForm.js +102 -74
  20. package/lib/emailCampaigns/form/SendEmailCampaignNowDialog.js +25 -16
  21. package/lib/emailCampaigns/form/SendManagerFields.js +103 -92
  22. package/lib/emailCampaigns/form/TestEmailCampaignForm.js +70 -59
  23. package/lib/emailCampaigns/statistics/EmailCampaignStatistics.js +106 -88
  24. package/lib/emailCampaigns/statistics/PercentageCard.js +50 -28
  25. package/lib/emailCampaigns/view/EmailCampaignView.d.ts +1 -1
  26. package/lib/emailCampaigns/view/EmailCampaignView.d.ts.map +1 -1
  27. package/lib/emailCampaigns/view/EmailCampaignView.js +28 -16
  28. package/lib/graphql.generated.d.ts +6 -7
  29. package/lib/graphql.generated.d.ts.map +1 -1
  30. package/lib/targetGroups/TargetGroupDialog.js +15 -13
  31. package/lib/targetGroups/TargetGroupForm.d.ts.map +1 -1
  32. package/lib/targetGroups/TargetGroupForm.js +78 -55
  33. package/lib/targetGroups/TargetGroupsGrid.d.ts.map +1 -1
  34. package/lib/targetGroups/TargetGroupsGrid.js +105 -90
  35. package/lib/targetGroups/TargetGroupsPage.d.ts.map +1 -1
  36. package/lib/targetGroups/TargetGroupsPage.js +31 -21
  37. package/lib/targetGroups/addContacts/AddContactsGridSelect.d.ts.map +1 -1
  38. package/lib/targetGroups/addContacts/AddContactsGridSelect.js +152 -120
  39. package/lib/targetGroups/allAssignedContacts/AllAssignedContactsGrid.d.ts.map +1 -1
  40. package/lib/targetGroups/allAssignedContacts/AllAssignedContactsGrid.js +17 -11
  41. package/lib/temp/CrudMoreActionsMenu.js +133 -111
  42. package/package.json +14 -17
@@ -1,6 +1,6 @@
1
1
  import { DocumentNode } from "@apollo/client";
2
+ import { GridColDef } from "@comet/admin";
2
3
  import { ContentScopeInterface } from "@comet/cms-admin";
3
- import { GridColDef } from "@mui/x-data-grid";
4
4
  import * as React from "react";
5
5
  export declare function BrevoContactsGrid({ scope, additionalAttributesFragment, additionalGridFields, }: {
6
6
  scope: ContentScopeInterface;
@@ -1 +1 @@
1
- {"version":3,"file":"BrevoContactsGrid.d.ts","sourceRoot":"","sources":["../../src/brevoContacts/BrevoContactsGrid.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAkC,MAAM,gBAAgB,CAAC;AAiB9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,OAAO,EAAY,UAAU,EAA0B,MAAM,kBAAkB,CAAC;AAChF,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAwE/B,wBAAgB,iBAAiB,CAAC,EAC9B,KAAK,EACL,4BAA4B,EAC5B,oBAAyB,GAC5B,EAAE;IACC,KAAK,EAAE,qBAAqB,CAAC;IAC7B,4BAA4B,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,YAAY,CAAA;KAAE,CAAC;IACxE,oBAAoB,CAAC,EAAE,UAAU,EAAE,CAAC;CACvC,GAAG,KAAK,CAAC,YAAY,CAyIrB"}
1
+ {"version":3,"file":"BrevoContactsGrid.d.ts","sourceRoot":"","sources":["../../src/brevoContacts/BrevoContactsGrid.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAkC,MAAM,gBAAgB,CAAC;AAC9E,OAAO,EAEH,UAAU,EAab,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAGzD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAwE/B,wBAAgB,iBAAiB,CAAC,EAC9B,KAAK,EACL,4BAA4B,EAC5B,oBAAyB,GAC5B,EAAE;IACC,KAAK,EAAE,qBAAqB,CAAC;IAC7B,4BAA4B,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,YAAY,CAAA;KAAE,CAAC;IACxE,oBAAoB,CAAC,EAAE,UAAU,EAAE,CAAC;CACvC,GAAG,KAAK,CAAC,YAAY,CAyIrB"}
@@ -15,10 +15,10 @@ var _reactIntl = require("react-intl");
15
15
  var _useContactImportFromCsv = require("../common/contactImport/useContactImportFromCsv");
16
16
  var _CrudMoreActionsMenu = require("../temp/CrudMoreActionsMenu");
17
17
  var _BrevoContactsGrid = require("./BrevoContactsGrid.generated");
18
+ var _jsxRuntime = require("react/jsx-runtime");
18
19
  var _templateObject, _templateObject2, _templateObject3, _templateObject4;
19
20
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
20
21
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
21
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
22
22
  function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
23
23
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
24
24
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
@@ -51,27 +51,38 @@ function BrevoContactsGridToolbar(_ref) {
51
51
  _useContactImportFrom2 = _slicedToArray(_useContactImportFrom, 2),
52
52
  moreActionsMenuItem = _useContactImportFrom2[0],
53
53
  contactImportComponent = _useContactImportFrom2[1];
54
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_admin.Toolbar, null, /*#__PURE__*/React.createElement(_admin.ToolbarTitleItem, null, /*#__PURE__*/React.createElement(_reactIntl.FormattedMessage, {
55
- id: "cometBrevoModule.brevoContact.title",
56
- defaultMessage: "Contacts"
57
- })), /*#__PURE__*/React.createElement(_admin.ToolbarItem, null, /*#__PURE__*/React.createElement(_xDataGrid.GridToolbarQuickFilter, {
58
- placeholder: intl.formatMessage({
59
- id: "cometBrevoModule.brevoContact.searchEmail",
60
- defaultMessage: "Search email address"
61
- })
62
- })), /*#__PURE__*/React.createElement(_admin.ToolbarFillSpace, null), /*#__PURE__*/React.createElement(_admin.ToolbarActions, null, /*#__PURE__*/React.createElement(_CrudMoreActionsMenu.CrudMoreActionsMenu, {
63
- overallItems: [moreActionsMenuItem]
64
- }), /*#__PURE__*/React.createElement(_material.Button, {
65
- startIcon: /*#__PURE__*/React.createElement(_adminIcons.Add, null),
66
- component: _admin.StackLink,
67
- pageName: "add",
68
- payload: "add",
69
- variant: "contained",
70
- color: "primary"
71
- }, /*#__PURE__*/React.createElement(_reactIntl.FormattedMessage, {
72
- id: "cometBrevoModule.brevoContact.newContact",
73
- defaultMessage: "New contact"
74
- })))), contactImportComponent);
54
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
55
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_admin.DataGridToolbar, {
56
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_admin.ToolbarTitleItem, {
57
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
58
+ id: "cometBrevoModule.brevoContact.title",
59
+ defaultMessage: "Contacts"
60
+ })
61
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_admin.ToolbarItem, {
62
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_xDataGrid.GridToolbarQuickFilter, {
63
+ placeholder: intl.formatMessage({
64
+ id: "cometBrevoModule.brevoContact.searchEmail",
65
+ defaultMessage: "Search email address"
66
+ })
67
+ })
68
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_admin.ToolbarFillSpace, {}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_admin.ToolbarActions, {
69
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_CrudMoreActionsMenu.CrudMoreActionsMenu, {
70
+ overallItems: [moreActionsMenuItem]
71
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Button, {
72
+ startIcon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_adminIcons.Add, {}),
73
+ component: _admin.StackLink,
74
+ pageName: "add",
75
+ payload: "add",
76
+ variant: "contained",
77
+ color: "primary",
78
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
79
+ id: "cometBrevoModule.brevoContact.newContact",
80
+ defaultMessage: "New contact"
81
+ })
82
+ })]
83
+ })]
84
+ }), contactImportComponent]
85
+ });
75
86
  }
76
87
  function BrevoContactsGrid(_ref2) {
77
88
  var _additionalAttributes, _dataGridProps$filter, _dataGridProps$filter2, _data$brevoContacts$n;
@@ -136,64 +147,73 @@ function BrevoContactsGrid(_ref2) {
136
147
  filterable: false,
137
148
  type: "actions",
138
149
  renderCell: function renderCell(params) {
139
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_material.IconButton, {
140
- component: _admin.StackLink,
141
- pageName: "edit",
142
- payload: params.row.id.toString()
143
- }, /*#__PURE__*/React.createElement(_adminIcons.Edit, {
144
- color: "primary"
145
- })), /*#__PURE__*/React.createElement(_admin.RowActionsMenu, null, /*#__PURE__*/React.createElement(_admin.RowActionsMenu, null, /*#__PURE__*/React.createElement(_admin.RowActionsItem, {
146
- onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
147
- return _regeneratorRuntime().wrap(function _callee$(_context) {
148
- while (1) switch (_context.prev = _context.next) {
149
- case 0:
150
- _context.next = 2;
151
- return client.mutate({
152
- mutation: updateBrevoContactMutation,
153
- variables: {
154
- id: params.row.id,
155
- input: {
156
- blocked: !params.row.emailBlacklisted
157
- },
158
- scope: scope
159
- },
160
- refetchQueries: [brevoContactsQuery]
161
- });
162
- case 2:
163
- case "end":
164
- return _context.stop();
165
- }
166
- }, _callee);
167
- })),
168
- icon: params.row.emailBlacklisted ? /*#__PURE__*/React.createElement(_adminIcons.Check, null) : /*#__PURE__*/React.createElement(_adminIcons.Block, null)
169
- }, params.row.emailBlacklisted ? /*#__PURE__*/React.createElement(_reactIntl.FormattedMessage, {
170
- id: "cometBrevoModule.brevoContact.actions.unblock",
171
- defaultMessage: "Unblock"
172
- }) : /*#__PURE__*/React.createElement(_reactIntl.FormattedMessage, {
173
- id: "cometBrevoModule.brevoContact.actions.block",
174
- defaultMessage: "Block"
175
- })), /*#__PURE__*/React.createElement(_admin.RowActionsItem, {
176
- onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
177
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
178
- while (1) switch (_context2.prev = _context2.next) {
179
- case 0:
180
- _context2.next = 2;
181
- return client.mutate({
182
- mutation: deleteBrevoContactMutation,
183
- variables: {
184
- id: params.row.id,
185
- scope: scope
186
- },
187
- refetchQueries: [brevoContactsQuery]
188
- });
189
- case 2:
190
- case "end":
191
- return _context2.stop();
192
- }
193
- }, _callee2);
194
- })),
195
- icon: /*#__PURE__*/React.createElement(_adminIcons.Delete, null)
196
- }, /*#__PURE__*/React.createElement(_reactIntl.FormattedMessage, _admin.messages["delete"])))));
150
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
151
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.IconButton, {
152
+ component: _admin.StackLink,
153
+ pageName: "edit",
154
+ payload: params.row.id.toString(),
155
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_adminIcons.Edit, {
156
+ color: "primary"
157
+ })
158
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_admin.RowActionsMenu, {
159
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_admin.RowActionsMenu, {
160
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_admin.RowActionsItem, {
161
+ onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
162
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
163
+ while (1) switch (_context.prev = _context.next) {
164
+ case 0:
165
+ _context.next = 2;
166
+ return client.mutate({
167
+ mutation: updateBrevoContactMutation,
168
+ variables: {
169
+ id: params.row.id,
170
+ input: {
171
+ blocked: !params.row.emailBlacklisted
172
+ },
173
+ scope: scope
174
+ },
175
+ refetchQueries: [brevoContactsQuery]
176
+ });
177
+ case 2:
178
+ case "end":
179
+ return _context.stop();
180
+ }
181
+ }, _callee);
182
+ })),
183
+ icon: params.row.emailBlacklisted ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_adminIcons.Check, {}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_adminIcons.Block, {}),
184
+ children: params.row.emailBlacklisted ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
185
+ id: "cometBrevoModule.brevoContact.actions.unblock",
186
+ defaultMessage: "Unblock"
187
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
188
+ id: "cometBrevoModule.brevoContact.actions.block",
189
+ defaultMessage: "Block"
190
+ })
191
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_admin.RowActionsItem, {
192
+ onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
193
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
194
+ while (1) switch (_context2.prev = _context2.next) {
195
+ case 0:
196
+ _context2.next = 2;
197
+ return client.mutate({
198
+ mutation: deleteBrevoContactMutation,
199
+ variables: {
200
+ id: params.row.id,
201
+ scope: scope
202
+ },
203
+ refetchQueries: [brevoContactsQuery]
204
+ });
205
+ case 2:
206
+ case "end":
207
+ return _context2.stop();
208
+ }
209
+ }, _callee2);
210
+ })),
211
+ icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_adminIcons.Delete, {}),
212
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, _objectSpread({}, _admin.messages["delete"]))
213
+ })]
214
+ })
215
+ })]
216
+ });
197
217
  }
198
218
  }]);
199
219
  var _useQuery = (0, _client.useQuery)(brevoContactsQuery, {
@@ -210,22 +230,23 @@ function BrevoContactsGrid(_ref2) {
210
230
  var rowCount = (0, _admin.useBufferedRowCount)(data === null || data === void 0 ? void 0 : data.brevoContacts.totalCount);
211
231
  if (error) throw error;
212
232
  var rows = (_data$brevoContacts$n = data === null || data === void 0 ? void 0 : data.brevoContacts.nodes) !== null && _data$brevoContacts$n !== void 0 ? _data$brevoContacts$n : [];
213
- return /*#__PURE__*/React.createElement(_admin.MainContent, {
214
- fullHeight: true
215
- }, /*#__PURE__*/React.createElement(_xDataGrid.DataGrid, _extends({}, dataGridProps, {
216
- disableSelectionOnClick: true,
217
- rows: rows,
218
- rowCount: rowCount,
219
- columns: columns,
220
- loading: loading,
221
- components: {
222
- Toolbar: BrevoContactsGridToolbar
223
- },
224
- componentsProps: {
225
- toolbar: {
226
- intl: intl,
227
- scope: scope
233
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_admin.MainContent, {
234
+ fullHeight: true,
235
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_xDataGrid.DataGrid, _objectSpread(_objectSpread({}, dataGridProps), {}, {
236
+ disableSelectionOnClick: true,
237
+ rows: rows,
238
+ rowCount: rowCount,
239
+ columns: columns,
240
+ loading: loading,
241
+ components: {
242
+ Toolbar: BrevoContactsGridToolbar
243
+ },
244
+ componentsProps: {
245
+ toolbar: {
246
+ intl: intl,
247
+ scope: scope
248
+ }
228
249
  }
229
- }
230
- })));
250
+ }))
251
+ });
231
252
  }
@@ -1,4 +1,4 @@
1
- import { GridColDef } from "@mui/x-data-grid";
1
+ import { GridColDef } from "@comet/admin";
2
2
  import { DocumentNode } from "graphql";
3
3
  import * as React from "react";
4
4
  import { EditBrevoContactFormValues } from "./form/BrevoContactForm";
@@ -1 +1 @@
1
- {"version":3,"file":"BrevoContactsPage.d.ts","sourceRoot":"","sources":["../../src/brevoContacts/BrevoContactsPage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAoB,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAEvF,UAAU,yBAAyB;IAC/B,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,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,KAAK,CAAC,SAAS,CAAC;IACvC,WAAW,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,0BAA0B,KAAK,0BAA0B,CAAC;CACrF;AAED,iBAAS,uBAAuB,CAAC,EAC7B,UAAU,EACV,4BAA4B,EAC5B,oBAAoB,EACpB,oBAAoB,EACpB,WAAW,GACd,EAAE,yBAAyB,SACM,WAAW,CAkD5C;AAED,OAAO,EAAE,uBAAuB,EAAE,CAAC"}
1
+ {"version":3,"file":"BrevoContactsPage.d.ts","sourceRoot":"","sources":["../../src/brevoContacts/BrevoContactsPage.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA+C,MAAM,cAAc,CAAC;AAEvF,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAoB,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAEvF,UAAU,yBAAyB;IAC/B,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,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,KAAK,CAAC,SAAS,CAAC;IACvC,WAAW,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,0BAA0B,KAAK,0BAA0B,CAAC;CACrF;AAED,iBAAS,uBAAuB,CAAC,EAC7B,UAAU,EACV,4BAA4B,EAC5B,oBAAoB,EACpB,oBAAoB,EACpB,WAAW,GACd,EAAE,yBAAyB,SACM,WAAW,CAmD5C;AAED,OAAO,EAAE,uBAAuB,EAAE,CAAC"}
@@ -11,6 +11,7 @@ var React = _interopRequireWildcard(require("react"));
11
11
  var _reactIntl = require("react-intl");
12
12
  var _BrevoContactsGrid = require("./BrevoContactsGrid");
13
13
  var _BrevoContactForm = require("./form/BrevoContactForm");
14
+ var _jsxRuntime = require("react/jsx-runtime");
14
15
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
15
16
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
16
17
  function createBrevoContactsPage(_ref) {
@@ -27,43 +28,53 @@ function createBrevoContactsPage(_ref) {
27
28
  acc[scopePart] = completeScope[scopePart];
28
29
  return acc;
29
30
  }, {});
30
- return /*#__PURE__*/React.createElement(_admin.Stack, {
31
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_admin.Stack, {
31
32
  topLevelTitle: intl.formatMessage({
32
33
  id: "cometBrevoModule.brevoContacts.brevoContacts",
33
34
  defaultMessage: "Contacts"
35
+ }),
36
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_admin.StackSwitch, {
37
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_admin.StackPage, {
38
+ name: "grid",
39
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_admin.StackToolbar, {
40
+ scopeIndicator: /*#__PURE__*/(0, _jsxRuntime.jsx)(_cmsAdmin.ContentScopeIndicator, {
41
+ scope: scope
42
+ })
43
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_BrevoContactsGrid.BrevoContactsGrid, {
44
+ scope: scope,
45
+ additionalAttributesFragment: additionalAttributesFragment,
46
+ additionalGridFields: additionalGridFields
47
+ })]
48
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_admin.StackPage, {
49
+ name: "edit",
50
+ title: intl.formatMessage({
51
+ id: "cometBrevoModule.brevoContacts.editBrevoContact",
52
+ defaultMessage: "Edit contact"
53
+ }),
54
+ children: function children(selectedId) {
55
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_BrevoContactForm.BrevoContactForm, {
56
+ additionalFormFields: additionalFormFields,
57
+ additionalAttributesFragment: additionalAttributesFragment,
58
+ input2State: input2State,
59
+ id: Number(selectedId),
60
+ scope: scope
61
+ });
62
+ }
63
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_admin.StackPage, {
64
+ name: "add",
65
+ title: intl.formatMessage({
66
+ id: "cometBrevoModule.brevoContacts.addBrevoContact",
67
+ defaultMessage: "Add contact"
68
+ }),
69
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_BrevoContactForm.BrevoContactForm, {
70
+ additionalFormFields: additionalFormFields,
71
+ additionalAttributesFragment: additionalAttributesFragment,
72
+ input2State: input2State,
73
+ scope: scope
74
+ })
75
+ })]
34
76
  })
35
- }, /*#__PURE__*/React.createElement(_admin.StackSwitch, null, /*#__PURE__*/React.createElement(_admin.StackPage, {
36
- name: "grid"
37
- }, /*#__PURE__*/React.createElement(_BrevoContactsGrid.BrevoContactsGrid, {
38
- scope: scope,
39
- additionalAttributesFragment: additionalAttributesFragment,
40
- additionalGridFields: additionalGridFields
41
- })), /*#__PURE__*/React.createElement(_admin.StackPage, {
42
- name: "edit",
43
- title: intl.formatMessage({
44
- id: "cometBrevoModule.brevoContacts.editBrevoContact",
45
- defaultMessage: "Edit contact"
46
- })
47
- }, function (selectedId) {
48
- return /*#__PURE__*/React.createElement(_BrevoContactForm.BrevoContactForm, {
49
- additionalFormFields: additionalFormFields,
50
- additionalAttributesFragment: additionalAttributesFragment,
51
- input2State: input2State,
52
- id: Number(selectedId),
53
- scope: scope
54
- });
55
- }), /*#__PURE__*/React.createElement(_admin.StackPage, {
56
- name: "add",
57
- title: intl.formatMessage({
58
- id: "cometBrevoModule.brevoContacts.addBrevoContact",
59
- defaultMessage: "Add contact"
60
- })
61
- }, /*#__PURE__*/React.createElement(_BrevoContactForm.BrevoContactForm, {
62
- additionalFormFields: additionalFormFields,
63
- additionalAttributesFragment: additionalAttributesFragment,
64
- input2State: input2State,
65
- scope: scope
66
- }))));
77
+ });
67
78
  }
68
79
  return BrevoContactsPage;
69
80
  }
@@ -1 +1 @@
1
- {"version":3,"file":"BrevoContactForm.d.ts","sourceRoot":"","sources":["../../../src/brevoContacts/form/BrevoContactForm.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAkC,MAAM,gBAAgB,CAAC;AAmB9E,OAAO,EAAE,qBAAqB,EAA+D,MAAM,kBAAkB,CAAC;AAItH,OAAO,KAAK,MAAM,OAAO,CAAC;AAoB1B,MAAM,MAAM,0BAA0B,GAAG;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B,CAAC;AAEF,UAAU,SAAS;IACf,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,qBAAqB,CAAC;IAC7B,oBAAoB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvC,4BAA4B,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,YAAY,CAAA;KAAE,CAAC;IACxE,WAAW,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,0BAA0B,KAAK,0BAA0B,CAAC;CACrF;AAED,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,oBAAoB,EAAE,4BAA4B,EAAE,EAAE,SAAS,GAAG,KAAK,CAAC,YAAY,CA0K9I"}
1
+ {"version":3,"file":"BrevoContactForm.d.ts","sourceRoot":"","sources":["../../../src/brevoContacts/form/BrevoContactForm.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAkC,MAAM,gBAAgB,CAAC;AAmB9E,OAAO,EAAyB,qBAAqB,EAA+C,MAAM,kBAAkB,CAAC;AAI7H,OAAO,KAAK,MAAM,OAAO,CAAC;AAoB1B,MAAM,MAAM,0BAA0B,GAAG;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B,CAAC;AAEF,UAAU,SAAS;IACf,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,qBAAqB,CAAC;IAC7B,oBAAoB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvC,4BAA4B,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,YAAY,CAAA;KAAE,CAAC;IACxE,WAAW,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,0BAA0B,KAAK,0BAA0B,CAAC;CACrF;AAED,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,oBAAoB,EAAE,4BAA4B,EAAE,EAAE,SAAS,GAAG,KAAK,CAAC,YAAY,CA0K9I"}
@@ -14,6 +14,7 @@ var _system = require("@mui/system");
14
14
  var _react = _interopRequireDefault(require("react"));
15
15
  var _reactIntl = require("react-intl");
16
16
  var _BrevoContactForm = require("./BrevoContactForm.gql");
17
+ var _jsxRuntime = require("react/jsx-runtime");
17
18
  var _excluded = ["email", "redirectionUrl"];
18
19
  var _templateObject;
19
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -209,62 +210,83 @@ function BrevoContactForm(_ref) {
209
210
  }();
210
211
  if (error) throw error;
211
212
  if (loading) {
212
- return /*#__PURE__*/_react["default"].createElement(_admin.Loading, {
213
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_admin.Loading, {
213
214
  behavior: "fillPageHeight"
214
215
  });
215
216
  }
216
- return /*#__PURE__*/_react["default"].createElement(_admin.FinalForm, {
217
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_admin.FinalForm, {
217
218
  apiRef: formApiRef,
218
219
  onSubmit: handleSubmit,
219
220
  mode: mode,
220
- initialValues: initialValues
221
- }, function (_ref3) {
222
- var values = _ref3.values;
223
- return /*#__PURE__*/_react["default"].createElement(_cmsAdmin.EditPageLayout, null, saveConflict.dialogs, /*#__PURE__*/_react["default"].createElement(_admin.Toolbar, null, /*#__PURE__*/_react["default"].createElement(_admin.ToolbarItem, null, /*#__PURE__*/_react["default"].createElement(_material.IconButton, {
224
- onClick: stackApi === null || stackApi === void 0 ? void 0 : stackApi.goBack
225
- }, /*#__PURE__*/_react["default"].createElement(_adminIcons.ArrowLeft, null))), /*#__PURE__*/_react["default"].createElement(_admin.ToolbarTitleItem, null, /*#__PURE__*/_react["default"].createElement(_reactIntl.FormattedMessage, {
226
- id: "cometBrevoModule.brevoContacts.brevoContact",
227
- defaultMessage: "Contact"
228
- })), /*#__PURE__*/_react["default"].createElement(_admin.ToolbarFillSpace, null), /*#__PURE__*/_react["default"].createElement(_admin.ToolbarActions, null, /*#__PURE__*/_react["default"].createElement(_admin.FinalFormSaveSplitButton, {
229
- hasConflict: saveConflict.hasConflict
230
- }))), /*#__PURE__*/_react["default"].createElement(_admin.MainContent, null, /*#__PURE__*/_react["default"].createElement(_system.Box, {
231
- sx: {
232
- marginBottom: 4
233
- }
234
- }, /*#__PURE__*/_react["default"].createElement(_admin.Alert, {
235
- severity: "warning"
236
- }, mode === "edit" ? /*#__PURE__*/_react["default"].createElement(_reactIntl.FormattedMessage, {
237
- id: "cometBrevoModule.brevoContact.contactEditAlert",
238
- defaultMessage: "Editing a contact will affect all scopes and the target groups within those scopes."
239
- }) : /*#__PURE__*/_react["default"].createElement(_reactIntl.FormattedMessage, {
240
- id: "cometBrevoModule.brevoContact.contactAddAlert",
241
- 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."
242
- }))), /*#__PURE__*/_react["default"].createElement(_admin.TextField, {
243
- required: true,
244
- fullWidth: true,
245
- name: "email",
246
- label: /*#__PURE__*/_react["default"].createElement(_reactIntl.FormattedMessage, {
247
- id: "cometBrevoModule.brevoContact.email",
248
- defaultMessage: "Email"
249
- }),
250
- disabled: mode === "edit"
251
- }), mode === "add" && /*#__PURE__*/_react["default"].createElement(_admin.TextField, {
252
- required: true,
253
- fullWidth: true,
254
- name: "redirectionUrl",
255
- label: /*#__PURE__*/_react["default"].createElement(_reactIntl.FormattedMessage, {
256
- id: "cometBrevoModule.brevoContact.redirectionUrl",
257
- defaultMessage: "Redirection Url (Contact will be redirected to this page after the confirmation in the double opt-in email)"
258
- })
259
- }), additionalFormFields && /*#__PURE__*/_react["default"].createElement(_material.Card, {
260
- sx: {
261
- padding: 4
262
- }
263
- }, /*#__PURE__*/_react["default"].createElement(_admin.FormSection, {
264
- title: /*#__PURE__*/_react["default"].createElement(_reactIntl.FormattedMessage, {
265
- id: "cometBrevoModule.brevoContact.attributes",
266
- defaultMessage: "Attributes"
267
- })
268
- }, additionalFormFields))));
221
+ initialValues: initialValues,
222
+ children: function children(_ref3) {
223
+ var values = _ref3.values;
224
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
225
+ children: [saveConflict.dialogs, /*#__PURE__*/(0, _jsxRuntime.jsxs)(_admin.Toolbar, {
226
+ scopeIndicator: /*#__PURE__*/(0, _jsxRuntime.jsx)(_cmsAdmin.ContentScopeIndicator, {
227
+ scope: scope
228
+ }),
229
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_admin.ToolbarItem, {
230
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.IconButton, {
231
+ onClick: stackApi === null || stackApi === void 0 ? void 0 : stackApi.goBack,
232
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_adminIcons.ArrowLeft, {})
233
+ })
234
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_admin.ToolbarTitleItem, {
235
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
236
+ id: "cometBrevoModule.brevoContacts.brevoContact",
237
+ defaultMessage: "Contact"
238
+ })
239
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_admin.ToolbarFillSpace, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_admin.ToolbarActions, {
240
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_admin.FinalFormSaveButton, {
241
+ hasConflict: saveConflict.hasConflict
242
+ })
243
+ })]
244
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_admin.MainContent, {
245
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_system.Box, {
246
+ sx: {
247
+ marginBottom: 4
248
+ },
249
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_admin.Alert, {
250
+ severity: "warning",
251
+ children: mode === "edit" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
252
+ id: "cometBrevoModule.brevoContact.contactEditAlert",
253
+ defaultMessage: "Editing a contact will affect all scopes and the target groups within those scopes."
254
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
255
+ id: "cometBrevoModule.brevoContact.contactAddAlert",
256
+ 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."
257
+ })
258
+ })
259
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_admin.TextField, {
260
+ required: true,
261
+ fullWidth: true,
262
+ name: "email",
263
+ label: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
264
+ id: "cometBrevoModule.brevoContact.email",
265
+ defaultMessage: "Email"
266
+ }),
267
+ disabled: mode === "edit"
268
+ }), mode === "add" && /*#__PURE__*/(0, _jsxRuntime.jsx)(_admin.TextField, {
269
+ required: true,
270
+ fullWidth: true,
271
+ name: "redirectionUrl",
272
+ label: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
273
+ id: "cometBrevoModule.brevoContact.redirectionUrl",
274
+ defaultMessage: "Redirection Url (Contact will be redirected to this page after the confirmation in the double opt-in email)"
275
+ })
276
+ }), additionalFormFields && /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Card, {
277
+ sx: {
278
+ padding: 4
279
+ },
280
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_admin.FormSection, {
281
+ title: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
282
+ id: "cometBrevoModule.brevoContact.attributes",
283
+ defaultMessage: "Attributes"
284
+ }),
285
+ children: additionalFormFields
286
+ })
287
+ })]
288
+ })]
289
+ });
290
+ }
269
291
  });
270
292
  }
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.useBrevoConfig = exports.BrevoConfigProvider = void 0;
7
7
  var _cmsAdmin = require("@comet/cms-admin");
8
8
  var _react = _interopRequireDefault(require("react"));
9
+ var _jsxRuntime = require("react/jsx-runtime");
9
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
10
11
  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); }
11
12
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
@@ -17,9 +18,10 @@ var BrevoConfigContext = /*#__PURE__*/_react["default"].createContext(undefined)
17
18
  var BrevoConfigProvider = exports.BrevoConfigProvider = function BrevoConfigProvider(_ref) {
18
19
  var children = _ref.children,
19
20
  value = _ref.value;
20
- return /*#__PURE__*/_react["default"].createElement(BrevoConfigContext.Provider, {
21
- value: value
22
- }, children);
21
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(BrevoConfigContext.Provider, {
22
+ value: value,
23
+ children: children
24
+ });
23
25
  };
24
26
  var useBrevoConfig = exports.useBrevoConfig = function useBrevoConfig() {
25
27
  var _useContentScope = (0, _cmsAdmin.useContentScope)(),