@comet/brevo-admin 2.0.0-canary-20240527130411 → 2.0.0-canary-20240611123948
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/brevoConfiguration/BrevoConfigForm.d.ts +8 -0
- package/lib/brevoConfiguration/BrevoConfigForm.d.ts.map +1 -0
- package/lib/brevoConfiguration/BrevoConfigForm.generated.d.ts +12 -0
- package/lib/brevoConfiguration/BrevoConfigForm.generated.d.ts.map +1 -0
- package/lib/brevoConfiguration/BrevoConfigForm.generated.js +5 -0
- package/lib/brevoConfiguration/BrevoConfigForm.gql.d.ts +7 -0
- package/lib/brevoConfiguration/BrevoConfigForm.gql.d.ts.map +1 -0
- package/lib/brevoConfiguration/BrevoConfigForm.gql.generated.d.ts +85 -0
- package/lib/brevoConfiguration/BrevoConfigForm.gql.generated.d.ts.map +1 -0
- package/lib/brevoConfiguration/BrevoConfigForm.gql.generated.js +20 -0
- package/lib/brevoConfiguration/BrevoConfigForm.gql.js +15 -0
- package/lib/brevoConfiguration/BrevoConfigForm.js +228 -0
- package/lib/brevoConfiguration/BrevoConfigPage.d.ts +7 -0
- package/lib/brevoConfiguration/BrevoConfigPage.d.ts.map +1 -0
- package/lib/brevoConfiguration/BrevoConfigPage.js +27 -0
- package/lib/brevoContacts/BrevoContactsGrid.d.ts.map +1 -1
- package/lib/brevoContacts/BrevoContactsGrid.js +9 -2
- package/lib/brevoContacts/BrevoContactsPage.d.ts +5 -2
- package/lib/brevoContacts/BrevoContactsPage.d.ts.map +1 -1
- package/lib/brevoContacts/BrevoContactsPage.js +30 -3
- package/lib/brevoContacts/form/BrevoContactForm.d.ts +20 -0
- package/lib/brevoContacts/form/BrevoContactForm.d.ts.map +1 -0
- package/lib/brevoContacts/form/BrevoContactForm.generated.d.ts +13 -0
- package/lib/brevoContacts/form/BrevoContactForm.generated.d.ts.map +1 -0
- package/lib/brevoContacts/form/BrevoContactForm.generated.js +11 -0
- package/lib/brevoContacts/form/BrevoContactForm.gql.d.ts +6 -0
- package/lib/brevoContacts/form/BrevoContactForm.gql.d.ts.map +1 -0
- package/lib/brevoContacts/form/BrevoContactForm.gql.generated.d.ts +69 -0
- package/lib/brevoContacts/form/BrevoContactForm.gql.generated.d.ts.map +1 -0
- package/lib/brevoContacts/form/BrevoContactForm.gql.generated.js +16 -0
- package/lib/brevoContacts/form/BrevoContactForm.gql.js +19 -0
- package/lib/brevoContacts/form/BrevoContactForm.js +236 -0
- package/lib/emailCampaigns/form/EmailCampaignForm.d.ts.map +1 -1
- package/lib/emailCampaigns/form/EmailCampaignForm.js +4 -1
- package/lib/emailCampaigns/form/SendManagerWrapper.d.ts +8 -0
- package/lib/emailCampaigns/form/SendManagerWrapper.d.ts.map +1 -0
- package/lib/emailCampaigns/form/SendManagerWrapper.gql.d.ts +2 -0
- package/lib/emailCampaigns/form/SendManagerWrapper.gql.d.ts.map +1 -0
- package/lib/emailCampaigns/form/SendManagerWrapper.gql.generated.d.ts +17 -0
- package/lib/emailCampaigns/form/SendManagerWrapper.gql.generated.d.ts.map +1 -0
- package/lib/emailCampaigns/form/SendManagerWrapper.gql.generated.js +11 -0
- package/lib/emailCampaigns/form/SendManagerWrapper.gql.js +10 -0
- package/lib/emailCampaigns/form/SendManagerWrapper.js +40 -0
- package/lib/graphql.generated.d.ts +54 -1
- package/lib/graphql.generated.d.ts.map +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +14 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BrevoContactForm.generated.d.ts","sourceRoot":"","sources":["../../../src/brevoContacts/form/BrevoContactForm.generated.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe;;;;CAI3B,CAAA;AACD,MAAM,MAAM,2BAA2B,GAAG;IAAE,UAAU,CAAC,EAAE,cAAc,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,gBAAgB,EAAE,OAAO,CAAC;IAAC,cAAc,EAAE,OAAO,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DocumentNode } from "@apollo/client";
|
|
2
|
+
export declare const brevoContactFormQuery: (brevoContactFormFragment: DocumentNode) => DocumentNode;
|
|
3
|
+
export declare const brevoContactFormCheckForChangesQuery: DocumentNode;
|
|
4
|
+
export declare const createBrevoContactMutation: (brevoContactFormFragment: DocumentNode) => DocumentNode;
|
|
5
|
+
export declare const updateBrevoContactMutation: (brevoContactFormFragment: DocumentNode) => DocumentNode;
|
|
6
|
+
//# sourceMappingURL=BrevoContactForm.gql.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BrevoContactForm.gql.d.ts","sourceRoot":"","sources":["../../../src/brevoContacts/form/BrevoContactForm.gql.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAO,MAAM,gBAAgB,CAAC;AAEnD,eAAO,MAAM,qBAAqB,6BAA8B,YAAY,iBAS3E,CAAC;AAEF,eAAO,MAAM,oCAAoC,cAMhD,CAAC;AAEF,eAAO,MAAM,0BAA0B,6BAA8B,YAAY,iBAShF,CAAC;AAEF,eAAO,MAAM,0BAA0B,6BAA8B,YAAY,iBAShF,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import * as Types from '../../graphql.generated';
|
|
2
|
+
export declare const namedOperations: {
|
|
3
|
+
Query: {
|
|
4
|
+
BrevoContactForm: string;
|
|
5
|
+
BrevoContactFormCheckForChanges: string;
|
|
6
|
+
};
|
|
7
|
+
Mutation: {
|
|
8
|
+
CreateBrevoContact: string;
|
|
9
|
+
UpdateBrevoContact: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export type GQLBrevoContactFormQueryVariables = Types.Exact<{
|
|
13
|
+
id: Types.Scalars['Int'];
|
|
14
|
+
}>;
|
|
15
|
+
export type GQLBrevoContactFormQuery = {
|
|
16
|
+
__typename?: 'Query';
|
|
17
|
+
brevoContact: {
|
|
18
|
+
__typename?: 'BrevoContact';
|
|
19
|
+
id: number;
|
|
20
|
+
modifiedAt: string;
|
|
21
|
+
email: string;
|
|
22
|
+
createdAt: string;
|
|
23
|
+
emailBlacklisted: boolean;
|
|
24
|
+
smsBlacklisted: boolean;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export type GQLBrevoContactFormCheckForChangesQueryVariables = Types.Exact<{
|
|
28
|
+
id: Types.Scalars['Int'];
|
|
29
|
+
}>;
|
|
30
|
+
export type GQLBrevoContactFormCheckForChangesQuery = {
|
|
31
|
+
__typename?: 'Query';
|
|
32
|
+
brevoContact: {
|
|
33
|
+
__typename?: 'BrevoContact';
|
|
34
|
+
modifiedAt: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
export type GQLCreateBrevoContactMutationVariables = Types.Exact<{
|
|
38
|
+
scope: Types.GQLEmailCampaignContentScopeInput;
|
|
39
|
+
input: Types.GQLBrevoContactUpdateInput;
|
|
40
|
+
}>;
|
|
41
|
+
export type GQLCreateBrevoContactMutation = {
|
|
42
|
+
__typename?: 'Mutation';
|
|
43
|
+
createBrevoContact: {
|
|
44
|
+
__typename?: 'BrevoContact';
|
|
45
|
+
id: number;
|
|
46
|
+
modifiedAt: string;
|
|
47
|
+
email: string;
|
|
48
|
+
createdAt: string;
|
|
49
|
+
emailBlacklisted: boolean;
|
|
50
|
+
smsBlacklisted: boolean;
|
|
51
|
+
} | null;
|
|
52
|
+
};
|
|
53
|
+
export type GQLUpdateBrevoContactMutationVariables = Types.Exact<{
|
|
54
|
+
id: Types.Scalars['Int'];
|
|
55
|
+
input: Types.GQLBrevoContactUpdateInput;
|
|
56
|
+
}>;
|
|
57
|
+
export type GQLUpdateBrevoContactMutation = {
|
|
58
|
+
__typename?: 'Mutation';
|
|
59
|
+
updateBrevoContact: {
|
|
60
|
+
__typename?: 'BrevoContact';
|
|
61
|
+
id: number;
|
|
62
|
+
modifiedAt: string;
|
|
63
|
+
email: string;
|
|
64
|
+
createdAt: string;
|
|
65
|
+
emailBlacklisted: boolean;
|
|
66
|
+
smsBlacklisted: boolean;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=BrevoContactForm.gql.generated.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BrevoContactForm.gql.generated.d.ts","sourceRoot":"","sources":["../../../src/brevoContacts/form/BrevoContactForm.gql.generated.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,yBAAyB,CAAC;AAEjD,eAAO,MAAM,eAAe;;;;;;;;;CAS3B,CAAA;AACD,MAAM,MAAM,iCAAiC,GAAG,KAAK,CAAC,KAAK,CAAC;IAC1D,EAAE,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;CAC1B,CAAC,CAAC;AAGH,MAAM,MAAM,wBAAwB,GAAG;IAAE,UAAU,CAAC,EAAE,OAAO,CAAC;IAAC,YAAY,EAAE;QAAE,UAAU,CAAC,EAAE,cAAc,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,gBAAgB,EAAE,OAAO,CAAC;QAAC,cAAc,EAAE,OAAO,CAAA;KAAE,CAAA;CAAE,CAAC;AAErO,MAAM,MAAM,gDAAgD,GAAG,KAAK,CAAC,KAAK,CAAC;IACzE,EAAE,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;CAC1B,CAAC,CAAC;AAGH,MAAM,MAAM,uCAAuC,GAAG;IAAE,UAAU,CAAC,EAAE,OAAO,CAAC;IAAC,YAAY,EAAE;QAAE,UAAU,CAAC,EAAE,cAAc,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAAC;AAElJ,MAAM,MAAM,sCAAsC,GAAG,KAAK,CAAC,KAAK,CAAC;IAC/D,KAAK,EAAE,KAAK,CAAC,iCAAiC,CAAC;IAC/C,KAAK,EAAE,KAAK,CAAC,0BAA0B,CAAC;CACzC,CAAC,CAAC;AAGH,MAAM,MAAM,6BAA6B,GAAG;IAAE,UAAU,CAAC,EAAE,UAAU,CAAC;IAAC,kBAAkB,EAAE;QAAE,UAAU,CAAC,EAAE,cAAc,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,gBAAgB,EAAE,OAAO,CAAC;QAAC,cAAc,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI,CAAA;CAAE,CAAC;AAE1P,MAAM,MAAM,sCAAsC,GAAG,KAAK,CAAC,KAAK,CAAC;IAC/D,EAAE,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACzB,KAAK,EAAE,KAAK,CAAC,0BAA0B,CAAC;CACzC,CAAC,CAAC;AAGH,MAAM,MAAM,6BAA6B,GAAG;IAAE,UAAU,CAAC,EAAE,UAAU,CAAC;IAAC,kBAAkB,EAAE;QAAE,UAAU,CAAC,EAAE,cAAc,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,gBAAgB,EAAE,OAAO,CAAC;QAAC,cAAc,EAAE,OAAO,CAAA;KAAE,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.namedOperations = void 0;
|
|
7
|
+
var namedOperations = exports.namedOperations = {
|
|
8
|
+
Query: {
|
|
9
|
+
BrevoContactForm: 'BrevoContactForm',
|
|
10
|
+
BrevoContactFormCheckForChanges: 'BrevoContactFormCheckForChanges'
|
|
11
|
+
},
|
|
12
|
+
Mutation: {
|
|
13
|
+
CreateBrevoContact: 'CreateBrevoContact',
|
|
14
|
+
UpdateBrevoContact: 'UpdateBrevoContact'
|
|
15
|
+
}
|
|
16
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
9
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
10
|
+
var brevoContactFormQuery = exports.brevoContactFormQuery = function brevoContactFormQuery(brevoContactFormFragment) {
|
|
11
|
+
return (0, _client.gql)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n query BrevoContactForm($id: Int!) {\n brevoContact(id: $id) {\n id\n modifiedAt\n ...BrevoContactForm\n }\n }\n ", "\n"])), brevoContactFormFragment);
|
|
12
|
+
};
|
|
13
|
+
var brevoContactFormCheckForChangesQuery = exports.brevoContactFormCheckForChangesQuery = (0, _client.gql)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n query BrevoContactFormCheckForChanges($id: Int!) {\n brevoContact(id: $id) {\n modifiedAt\n }\n }\n"])));
|
|
14
|
+
var createBrevoContactMutation = exports.createBrevoContactMutation = function createBrevoContactMutation(brevoContactFormFragment) {
|
|
15
|
+
return (0, _client.gql)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n mutation CreateBrevoContact($scope: EmailCampaignContentScopeInput!, $input: BrevoContactUpdateInput!) {\n createBrevoContact(scope: $scope, input: $input) {\n id\n modifiedAt\n ...BrevoContactForm\n }\n }\n ", "\n"])), brevoContactFormFragment);
|
|
16
|
+
};
|
|
17
|
+
var updateBrevoContactMutation = exports.updateBrevoContactMutation = function updateBrevoContactMutation(brevoContactFormFragment) {
|
|
18
|
+
return (0, _client.gql)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n mutation UpdateBrevoContact($id: Int!, $input: BrevoContactUpdateInput!) {\n updateBrevoContact(id: $id, input: $input) {\n id\n modifiedAt\n ...BrevoContactForm\n }\n }\n ", "\n"])), brevoContactFormFragment);
|
|
19
|
+
};
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
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 = _interopRequireDefault(require("react"));
|
|
15
|
+
var _reactIntl = require("react-intl");
|
|
16
|
+
var _BrevoContactForm = require("./BrevoContactForm.gql");
|
|
17
|
+
var _templateObject;
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
|
+
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; }
|
|
20
|
+
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); } }
|
|
21
|
+
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); }); }; }
|
|
22
|
+
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; }
|
|
23
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
24
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
25
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
26
|
+
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); }
|
|
27
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
28
|
+
function BrevoContactForm(_ref) {
|
|
29
|
+
var _additionalAttributes;
|
|
30
|
+
var id = _ref.id,
|
|
31
|
+
scope = _ref.scope,
|
|
32
|
+
input2State = _ref.input2State,
|
|
33
|
+
additionalFormFields = _ref.additionalFormFields,
|
|
34
|
+
additionalAttributesFragment = _ref.additionalAttributesFragment;
|
|
35
|
+
var stackApi = (0, _admin.useStackApi)();
|
|
36
|
+
var client = (0, _client.useApolloClient)();
|
|
37
|
+
var mode = id ? "edit" : "add";
|
|
38
|
+
var formApiRef = (0, _admin.useFormApiRef)();
|
|
39
|
+
var stackSwitchApi = (0, _admin.useStackSwitchApi)();
|
|
40
|
+
var brevoContactFormFragment = (0, _client.gql)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n fragment BrevoContactForm on BrevoContact {\n email\n createdAt\n emailBlacklisted\n smsBlacklisted\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 : "");
|
|
41
|
+
var _useQuery = (0, _client.useQuery)((0, _BrevoContactForm.brevoContactFormQuery)(brevoContactFormFragment), id ? {
|
|
42
|
+
variables: {
|
|
43
|
+
id: id
|
|
44
|
+
}
|
|
45
|
+
} : {
|
|
46
|
+
skip: true
|
|
47
|
+
}),
|
|
48
|
+
data = _useQuery.data,
|
|
49
|
+
error = _useQuery.error,
|
|
50
|
+
loading = _useQuery.loading,
|
|
51
|
+
refetch = _useQuery.refetch;
|
|
52
|
+
var initialValues = _react["default"].useMemo(function () {
|
|
53
|
+
var additionalInitialValues = {};
|
|
54
|
+
if (input2State) {
|
|
55
|
+
additionalInitialValues = input2State(data === null || data === void 0 ? void 0 : data.brevoContact);
|
|
56
|
+
}
|
|
57
|
+
return data !== null && data !== void 0 && data.brevoContact ? _objectSpread({
|
|
58
|
+
email: data.brevoContact.email
|
|
59
|
+
}, additionalInitialValues) : additionalInitialValues;
|
|
60
|
+
}, [data === null || data === void 0 ? void 0 : data.brevoContact, input2State]);
|
|
61
|
+
var saveConflict = (0, _cmsAdmin.useFormSaveConflict)({
|
|
62
|
+
checkConflict: function () {
|
|
63
|
+
var _checkConflict = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
64
|
+
var _data$brevoContact;
|
|
65
|
+
var _yield$client$query, updatedData;
|
|
66
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
67
|
+
while (1) switch (_context.prev = _context.next) {
|
|
68
|
+
case 0:
|
|
69
|
+
if (id) {
|
|
70
|
+
_context.next = 2;
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
return _context.abrupt("return", false);
|
|
74
|
+
case 2:
|
|
75
|
+
_context.next = 4;
|
|
76
|
+
return client.query({
|
|
77
|
+
query: _BrevoContactForm.brevoContactFormCheckForChangesQuery,
|
|
78
|
+
variables: {
|
|
79
|
+
id: id
|
|
80
|
+
},
|
|
81
|
+
fetchPolicy: "no-cache"
|
|
82
|
+
});
|
|
83
|
+
case 4:
|
|
84
|
+
_yield$client$query = _context.sent;
|
|
85
|
+
updatedData = _yield$client$query.data;
|
|
86
|
+
return _context.abrupt("return", (0, _cmsAdmin.resolveHasSaveConflict)(data === null || data === void 0 || (_data$brevoContact = data.brevoContact) === null || _data$brevoContact === void 0 ? void 0 : _data$brevoContact.modifiedAt, updatedData.brevoContact.modifiedAt));
|
|
87
|
+
case 7:
|
|
88
|
+
case "end":
|
|
89
|
+
return _context.stop();
|
|
90
|
+
}
|
|
91
|
+
}, _callee);
|
|
92
|
+
}));
|
|
93
|
+
function checkConflict() {
|
|
94
|
+
return _checkConflict.apply(this, arguments);
|
|
95
|
+
}
|
|
96
|
+
return checkConflict;
|
|
97
|
+
}(),
|
|
98
|
+
formApiRef: formApiRef,
|
|
99
|
+
loadLatestVersion: function () {
|
|
100
|
+
var _loadLatestVersion = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
101
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
102
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
103
|
+
case 0:
|
|
104
|
+
_context2.next = 2;
|
|
105
|
+
return refetch();
|
|
106
|
+
case 2:
|
|
107
|
+
case "end":
|
|
108
|
+
return _context2.stop();
|
|
109
|
+
}
|
|
110
|
+
}, _callee2);
|
|
111
|
+
}));
|
|
112
|
+
function loadLatestVersion() {
|
|
113
|
+
return _loadLatestVersion.apply(this, arguments);
|
|
114
|
+
}
|
|
115
|
+
return loadLatestVersion;
|
|
116
|
+
}()
|
|
117
|
+
});
|
|
118
|
+
var handleSubmit = /*#__PURE__*/function () {
|
|
119
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(state, form, event) {
|
|
120
|
+
var output, _yield$client$mutate, mutationResponse, _mutationResponse$cre, _id;
|
|
121
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
122
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
123
|
+
case 0:
|
|
124
|
+
_context3.next = 2;
|
|
125
|
+
return saveConflict.checkForConflicts();
|
|
126
|
+
case 2:
|
|
127
|
+
if (!_context3.sent) {
|
|
128
|
+
_context3.next = 4;
|
|
129
|
+
break;
|
|
130
|
+
}
|
|
131
|
+
throw new Error("Conflicts detected");
|
|
132
|
+
case 4:
|
|
133
|
+
output = _objectSpread(_objectSpread({}, state), {}, {
|
|
134
|
+
blocked: false
|
|
135
|
+
});
|
|
136
|
+
if (!(mode === "edit")) {
|
|
137
|
+
_context3.next = 12;
|
|
138
|
+
break;
|
|
139
|
+
}
|
|
140
|
+
if (id) {
|
|
141
|
+
_context3.next = 8;
|
|
142
|
+
break;
|
|
143
|
+
}
|
|
144
|
+
throw new Error("Missing id in edit mode");
|
|
145
|
+
case 8:
|
|
146
|
+
_context3.next = 10;
|
|
147
|
+
return client.mutate({
|
|
148
|
+
mutation: (0, _BrevoContactForm.updateBrevoContactMutation)(brevoContactFormFragment),
|
|
149
|
+
variables: {
|
|
150
|
+
id: id,
|
|
151
|
+
input: output
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
case 10:
|
|
155
|
+
_context3.next = 17;
|
|
156
|
+
break;
|
|
157
|
+
case 12:
|
|
158
|
+
_context3.next = 14;
|
|
159
|
+
return client.mutate({
|
|
160
|
+
mutation: (0, _BrevoContactForm.createBrevoContactMutation)(brevoContactFormFragment),
|
|
161
|
+
variables: {
|
|
162
|
+
scope: scope,
|
|
163
|
+
input: output
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
case 14:
|
|
167
|
+
_yield$client$mutate = _context3.sent;
|
|
168
|
+
mutationResponse = _yield$client$mutate.data;
|
|
169
|
+
if (!event.navigatingBack) {
|
|
170
|
+
_id = mutationResponse === null || mutationResponse === void 0 || (_mutationResponse$cre = mutationResponse.createBrevoContact) === null || _mutationResponse$cre === void 0 ? void 0 : _mutationResponse$cre.id;
|
|
171
|
+
if (_id) {
|
|
172
|
+
setTimeout(function () {
|
|
173
|
+
stackSwitchApi.activatePage("edit", _id.toString());
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
case 17:
|
|
178
|
+
case "end":
|
|
179
|
+
return _context3.stop();
|
|
180
|
+
}
|
|
181
|
+
}, _callee3);
|
|
182
|
+
}));
|
|
183
|
+
return function handleSubmit(_x, _x2, _x3) {
|
|
184
|
+
return _ref2.apply(this, arguments);
|
|
185
|
+
};
|
|
186
|
+
}();
|
|
187
|
+
if (error) throw error;
|
|
188
|
+
if (loading) {
|
|
189
|
+
return /*#__PURE__*/_react["default"].createElement(_admin.Loading, {
|
|
190
|
+
behavior: "fillPageHeight"
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
return /*#__PURE__*/_react["default"].createElement(_admin.FinalForm, {
|
|
194
|
+
apiRef: formApiRef,
|
|
195
|
+
onSubmit: handleSubmit,
|
|
196
|
+
mode: mode,
|
|
197
|
+
initialValues: initialValues
|
|
198
|
+
}, function (_ref3) {
|
|
199
|
+
var values = _ref3.values;
|
|
200
|
+
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, {
|
|
201
|
+
onClick: stackApi === null || stackApi === void 0 ? void 0 : stackApi.goBack
|
|
202
|
+
}, /*#__PURE__*/_react["default"].createElement(_adminIcons.ArrowLeft, null))), /*#__PURE__*/_react["default"].createElement(_admin.ToolbarTitleItem, null, /*#__PURE__*/_react["default"].createElement(_reactIntl.FormattedMessage, {
|
|
203
|
+
id: "cometBrevoModule.brevoContacts.brevoContact",
|
|
204
|
+
defaultMessage: "Contact"
|
|
205
|
+
})), /*#__PURE__*/_react["default"].createElement(_admin.ToolbarFillSpace, null), /*#__PURE__*/_react["default"].createElement(_admin.ToolbarActions, null, /*#__PURE__*/_react["default"].createElement(_admin.FinalFormSaveSplitButton, {
|
|
206
|
+
hasConflict: saveConflict.hasConflict
|
|
207
|
+
}))), /*#__PURE__*/_react["default"].createElement(_admin.MainContent, null, /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
208
|
+
sx: {
|
|
209
|
+
marginBottom: 4
|
|
210
|
+
}
|
|
211
|
+
}, /*#__PURE__*/_react["default"].createElement(_admin.Alert, {
|
|
212
|
+
severity: "warning"
|
|
213
|
+
}, /*#__PURE__*/_react["default"].createElement(_reactIntl.FormattedMessage, {
|
|
214
|
+
id: "cometBrevoModule.brevoContact.contactEditAlert",
|
|
215
|
+
defaultMessage: "Editing a contact will affect all scopes and the target groups within those scopes."
|
|
216
|
+
}))), /*#__PURE__*/_react["default"].createElement(_admin.TextField, {
|
|
217
|
+
required: true,
|
|
218
|
+
fullWidth: true,
|
|
219
|
+
name: "email",
|
|
220
|
+
label: /*#__PURE__*/_react["default"].createElement(_reactIntl.FormattedMessage, {
|
|
221
|
+
id: "cometBrevoModule.brevoContact.email",
|
|
222
|
+
defaultMessage: "Email"
|
|
223
|
+
}),
|
|
224
|
+
disabled: mode === "edit"
|
|
225
|
+
}), additionalFormFields && /*#__PURE__*/_react["default"].createElement(_material.Card, {
|
|
226
|
+
sx: {
|
|
227
|
+
padding: 4
|
|
228
|
+
}
|
|
229
|
+
}, /*#__PURE__*/_react["default"].createElement(_admin.FormSection, {
|
|
230
|
+
title: /*#__PURE__*/_react["default"].createElement(_reactIntl.FormattedMessage, {
|
|
231
|
+
id: "cometBrevoModule.brevoContact.attributes",
|
|
232
|
+
defaultMessage: "Attributes"
|
|
233
|
+
})
|
|
234
|
+
}, additionalFormFields))));
|
|
235
|
+
});
|
|
236
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmailCampaignForm.d.ts","sourceRoot":"","sources":["../../../src/emailCampaigns/form/EmailCampaignForm.tsx"],"names":[],"mappings":"AAeA,OAAO,EAGH,cAAc,EAKjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAEH,qBAAqB,EASxB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAkB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"EmailCampaignForm.d.ts","sourceRoot":"","sources":["../../../src/emailCampaigns/form/EmailCampaignForm.tsx"],"names":[],"mappings":"AAeA,OAAO,EAGH,cAAc,EAKjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAEH,qBAAqB,EASxB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAkB,MAAM,OAAO,CAAC;AAoBvC,UAAU,SAAS;IACf,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,yBAAyB,EAAE,cAAc,CAAC;IAC1C,KAAK,EAAE,qBAAqB,CAAC;IAC7B,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,EAAE,yBAAyB,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,SAAS,GAAG,KAAK,CAAC,YAAY,CAkPrH"}
|
|
@@ -16,6 +16,7 @@ var _reactRouter = require("react-router");
|
|
|
16
16
|
var _ConfigFields = require("./ConfigFields");
|
|
17
17
|
var _EmailCampaignForm = require("./EmailCampaignForm.gql");
|
|
18
18
|
var _SendManagerFields = require("./SendManagerFields");
|
|
19
|
+
var _SendManagerWrapper = require("./SendManagerWrapper");
|
|
19
20
|
var _TestEmailCampaignForm = require("./TestEmailCampaignForm");
|
|
20
21
|
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); }
|
|
21
22
|
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; }
|
|
@@ -381,6 +382,8 @@ function EmailCampaignForm(_ref) {
|
|
|
381
382
|
targetGroup: state.targetGroup,
|
|
382
383
|
scheduledAt: state.scheduledAt
|
|
383
384
|
}
|
|
385
|
+
}, /*#__PURE__*/_react["default"].createElement(_SendManagerWrapper.SendManagerWrapper, {
|
|
386
|
+
scope: scope
|
|
384
387
|
}, /*#__PURE__*/_react["default"].createElement(_SendManagerFields.SendManagerFields, {
|
|
385
388
|
scope: scope,
|
|
386
389
|
disableScheduling: isScheduleDateDisabled,
|
|
@@ -389,6 +392,6 @@ function EmailCampaignForm(_ref) {
|
|
|
389
392
|
}), /*#__PURE__*/_react["default"].createElement(_TestEmailCampaignForm.TestEmailCampaignForm, {
|
|
390
393
|
id: id,
|
|
391
394
|
isSendable: !hasChanges && state.targetGroup != undefined
|
|
392
|
-
}))
|
|
395
|
+
})))
|
|
393
396
|
}])));
|
|
394
397
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ContentScopeInterface } from "@comet/cms-admin";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
interface SendManagerWrapperProps {
|
|
4
|
+
scope: ContentScopeInterface;
|
|
5
|
+
}
|
|
6
|
+
export declare const SendManagerWrapper: ({ scope, children }: React.PropsWithChildren<SendManagerWrapperProps>) => React.JSX.Element;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=SendManagerWrapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SendManagerWrapper.d.ts","sourceRoot":"","sources":["../../../src/emailCampaigns/form/SendManagerWrapper.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,UAAU,uBAAuB;IAC7B,KAAK,EAAE,qBAAqB,CAAC;CAChC;AAED,eAAO,MAAM,kBAAkB,wBAAyB,MAAM,iBAAiB,CAAC,uBAAuB,CAAC,sBA4BvG,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SendManagerWrapper.gql.d.ts","sourceRoot":"","sources":["../../../src/emailCampaigns/form/SendManagerWrapper.gql.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB,uCAM5B,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as Types from '../../graphql.generated';
|
|
2
|
+
export declare const namedOperations: {
|
|
3
|
+
Query: {
|
|
4
|
+
BrevoConfig: string;
|
|
5
|
+
};
|
|
6
|
+
};
|
|
7
|
+
export type GQLBrevoConfigQueryVariables = Types.Exact<{
|
|
8
|
+
scope: Types.GQLEmailCampaignContentScopeInput;
|
|
9
|
+
}>;
|
|
10
|
+
export type GQLBrevoConfigQuery = {
|
|
11
|
+
__typename?: 'Query';
|
|
12
|
+
brevoConfig: {
|
|
13
|
+
__typename?: 'BrevoConfig';
|
|
14
|
+
id: string;
|
|
15
|
+
} | null;
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=SendManagerWrapper.gql.generated.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SendManagerWrapper.gql.generated.d.ts","sourceRoot":"","sources":["../../../src/emailCampaigns/form/SendManagerWrapper.gql.generated.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,yBAAyB,CAAC;AAEjD,eAAO,MAAM,eAAe;;;;CAI3B,CAAA;AACD,MAAM,MAAM,4BAA4B,GAAG,KAAK,CAAC,KAAK,CAAC;IACrD,KAAK,EAAE,KAAK,CAAC,iCAAiC,CAAC;CAChD,CAAC,CAAC;AAGH,MAAM,MAAM,mBAAmB,GAAG;IAAE,UAAU,CAAC,EAAE,OAAO,CAAC;IAAC,WAAW,EAAE;QAAE,UAAU,CAAC,EAAE,aAAa,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.brevoConfigQuery = void 0;
|
|
7
|
+
var _client = require("@apollo/client");
|
|
8
|
+
var _templateObject;
|
|
9
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
10
|
+
var brevoConfigQuery = exports.brevoConfigQuery = (0, _client.gql)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n query BrevoConfig($scope: EmailCampaignContentScopeInput!) {\n brevoConfig(scope: $scope) {\n id\n }\n }\n"])));
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
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.SendManagerWrapper = void 0;
|
|
8
|
+
var _client = require("@apollo/client");
|
|
9
|
+
var _admin = require("@comet/admin");
|
|
10
|
+
var _material = require("@mui/material");
|
|
11
|
+
var React = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _reactIntl = require("react-intl");
|
|
13
|
+
var _SendManagerWrapper = require("./SendManagerWrapper.gql");
|
|
14
|
+
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
|
+
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
|
+
var SendManagerWrapper = exports.SendManagerWrapper = function SendManagerWrapper(_ref) {
|
|
17
|
+
var _brevoConfig$brevoCon;
|
|
18
|
+
var scope = _ref.scope,
|
|
19
|
+
children = _ref.children;
|
|
20
|
+
var _useQuery = (0, _client.useQuery)(_SendManagerWrapper.brevoConfigQuery, {
|
|
21
|
+
variables: {
|
|
22
|
+
scope: scope
|
|
23
|
+
},
|
|
24
|
+
fetchPolicy: "network-only"
|
|
25
|
+
}),
|
|
26
|
+
brevoConfig = _useQuery.data,
|
|
27
|
+
loading = _useQuery.loading,
|
|
28
|
+
error = _useQuery.error;
|
|
29
|
+
if (loading) {
|
|
30
|
+
return /*#__PURE__*/React.createElement(_admin.Loading, null);
|
|
31
|
+
}
|
|
32
|
+
if (error) throw error;
|
|
33
|
+
if ((brevoConfig === null || brevoConfig === void 0 || (_brevoConfig$brevoCon = brevoConfig.brevoConfig) === null || _brevoConfig$brevoCon === void 0 ? void 0 : _brevoConfig$brevoCon.id) == undefined) {
|
|
34
|
+
return /*#__PURE__*/React.createElement(_material.Typography, null, /*#__PURE__*/React.createElement(_reactIntl.FormattedMessage, {
|
|
35
|
+
id: "cometBrevoModule.emailCampaigns.missingConfig",
|
|
36
|
+
defaultMessage: "Missing brevo config! Configure brevo via the brevo config page."
|
|
37
|
+
}));
|
|
38
|
+
}
|
|
39
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, " ", children, " ");
|
|
40
|
+
};
|
|
@@ -54,6 +54,31 @@ export type GQLBrevoApiCampaignStatistics = {
|
|
|
54
54
|
/** Number of openings for the campaign */
|
|
55
55
|
viewed: Scalars['Int'];
|
|
56
56
|
};
|
|
57
|
+
export type GQLBrevoApiSender = {
|
|
58
|
+
__typename?: 'BrevoApiSender';
|
|
59
|
+
active: Scalars['Boolean'];
|
|
60
|
+
email: Scalars['String'];
|
|
61
|
+
id: Scalars['ID'];
|
|
62
|
+
ips: Maybe<Array<GQLBrevoIp>>;
|
|
63
|
+
name: Scalars['String'];
|
|
64
|
+
};
|
|
65
|
+
export type GQLBrevoConfig = GQLDocumentInterface & {
|
|
66
|
+
__typename?: 'BrevoConfig';
|
|
67
|
+
createdAt: Scalars['DateTime'];
|
|
68
|
+
id: Scalars['ID'];
|
|
69
|
+
scope: GQLEmailCampaignContentScope;
|
|
70
|
+
senderMail: Scalars['String'];
|
|
71
|
+
senderName: Scalars['String'];
|
|
72
|
+
updatedAt: Scalars['DateTime'];
|
|
73
|
+
};
|
|
74
|
+
export type GQLBrevoConfigInput = {
|
|
75
|
+
senderMail: Scalars['String'];
|
|
76
|
+
senderName: Scalars['String'];
|
|
77
|
+
};
|
|
78
|
+
export type GQLBrevoConfigUpdateInput = {
|
|
79
|
+
senderMail: Scalars['String'];
|
|
80
|
+
senderName: Scalars['String'];
|
|
81
|
+
};
|
|
57
82
|
export type GQLBrevoContact = {
|
|
58
83
|
__typename?: 'BrevoContact';
|
|
59
84
|
createdAt: Scalars['String'];
|
|
@@ -69,7 +94,14 @@ export type GQLBrevoContactFilterAttributesInput = {
|
|
|
69
94
|
thisFilterHasNoFields____?: InputMaybe<Array<Scalars['String']>>;
|
|
70
95
|
};
|
|
71
96
|
export type GQLBrevoContactUpdateInput = {
|
|
72
|
-
blocked
|
|
97
|
+
blocked?: InputMaybe<Scalars['Boolean']>;
|
|
98
|
+
email?: InputMaybe<Scalars['String']>;
|
|
99
|
+
};
|
|
100
|
+
export type GQLBrevoIp = {
|
|
101
|
+
__typename?: 'BrevoIp';
|
|
102
|
+
domain: Scalars['String'];
|
|
103
|
+
ip: Scalars['String'];
|
|
104
|
+
weight: Scalars['Int'];
|
|
73
105
|
};
|
|
74
106
|
export type GQLCurrentUserPermission = {
|
|
75
107
|
__typename?: 'CurrentUserPermission';
|
|
@@ -160,6 +192,8 @@ export type GQLImageCropArea = {
|
|
|
160
192
|
};
|
|
161
193
|
export type GQLMutation = {
|
|
162
194
|
__typename?: 'Mutation';
|
|
195
|
+
createBrevoConfig: GQLBrevoConfig;
|
|
196
|
+
createBrevoContact: Maybe<GQLBrevoContact>;
|
|
163
197
|
createEmailCampaign: GQLEmailCampaign;
|
|
164
198
|
createTargetGroup: GQLTargetGroup;
|
|
165
199
|
deleteBrevoContact: Scalars['Boolean'];
|
|
@@ -168,10 +202,19 @@ export type GQLMutation = {
|
|
|
168
202
|
sendEmailCampaignNow: Scalars['Boolean'];
|
|
169
203
|
sendEmailCampaignToTestEmails: Scalars['Boolean'];
|
|
170
204
|
subscribeBrevoContact: GQLSubscribeResponse;
|
|
205
|
+
updateBrevoConfig: GQLBrevoConfig;
|
|
171
206
|
updateBrevoContact: GQLBrevoContact;
|
|
172
207
|
updateEmailCampaign: GQLEmailCampaign;
|
|
173
208
|
updateTargetGroup: GQLTargetGroup;
|
|
174
209
|
};
|
|
210
|
+
export type GQLMutationcreateBrevoConfigArgs = {
|
|
211
|
+
input: GQLBrevoConfigInput;
|
|
212
|
+
scope: GQLEmailCampaignContentScopeInput;
|
|
213
|
+
};
|
|
214
|
+
export type GQLMutationcreateBrevoContactArgs = {
|
|
215
|
+
input: GQLBrevoContactUpdateInput;
|
|
216
|
+
scope: GQLEmailCampaignContentScopeInput;
|
|
217
|
+
};
|
|
175
218
|
export type GQLMutationcreateEmailCampaignArgs = {
|
|
176
219
|
input: GQLEmailCampaignInput;
|
|
177
220
|
scope: GQLEmailCampaignContentScopeInput;
|
|
@@ -200,6 +243,11 @@ export type GQLMutationsubscribeBrevoContactArgs = {
|
|
|
200
243
|
input: GQLSubscribeInput;
|
|
201
244
|
scope: GQLEmailCampaignContentScopeInput;
|
|
202
245
|
};
|
|
246
|
+
export type GQLMutationupdateBrevoConfigArgs = {
|
|
247
|
+
id: Scalars['ID'];
|
|
248
|
+
input: GQLBrevoConfigUpdateInput;
|
|
249
|
+
lastUpdatedAt?: InputMaybe<Scalars['DateTime']>;
|
|
250
|
+
};
|
|
203
251
|
export type GQLMutationupdateBrevoContactArgs = {
|
|
204
252
|
id: Scalars['Int'];
|
|
205
253
|
input: GQLBrevoContactUpdateInput;
|
|
@@ -231,14 +279,19 @@ export type GQLPaginatedTargetGroups = {
|
|
|
231
279
|
};
|
|
232
280
|
export type GQLQuery = {
|
|
233
281
|
__typename?: 'Query';
|
|
282
|
+
brevoConfig: Maybe<GQLBrevoConfig>;
|
|
234
283
|
brevoContact: GQLBrevoContact;
|
|
235
284
|
brevoContacts: GQLPaginatedBrevoContacts;
|
|
236
285
|
emailCampaign: GQLEmailCampaign;
|
|
237
286
|
emailCampaignStatistics: Maybe<GQLBrevoApiCampaignStatistics>;
|
|
238
287
|
emailCampaigns: GQLPaginatedEmailCampaigns;
|
|
288
|
+
senders: Maybe<Array<GQLBrevoApiSender>>;
|
|
239
289
|
targetGroup: GQLTargetGroup;
|
|
240
290
|
targetGroups: GQLPaginatedTargetGroups;
|
|
241
291
|
};
|
|
292
|
+
export type GQLQuerybrevoConfigArgs = {
|
|
293
|
+
scope: GQLEmailCampaignContentScopeInput;
|
|
294
|
+
};
|
|
242
295
|
export type GQLQuerybrevoContactArgs = {
|
|
243
296
|
id: Scalars['Int'];
|
|
244
297
|
};
|