@dextinity/brevo-admin 2.0.0-canary-20260729062014
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/LICENSE +24 -0
- package/lib/blocks/NewsletterImageBlock.d.ts +8 -0
- package/lib/blocks/NewsletterImageBlock.d.ts.map +1 -0
- package/lib/blocks/NewsletterImageBlock.js +20 -0
- package/lib/blocks.generated.d.ts +206 -0
- package/lib/blocks.generated.d.ts.map +1 -0
- package/lib/blocks.generated.js +1 -0
- 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 +1 -0
- package/lib/brevoConfiguration/BrevoConfigForm.gql.d.ts +6 -0
- package/lib/brevoConfiguration/BrevoConfigForm.gql.d.ts.map +1 -0
- package/lib/brevoConfiguration/BrevoConfigForm.gql.generated.d.ts +102 -0
- package/lib/brevoConfiguration/BrevoConfigForm.gql.generated.d.ts.map +1 -0
- package/lib/brevoConfiguration/BrevoConfigForm.gql.generated.js +14 -0
- package/lib/brevoConfiguration/BrevoConfigForm.gql.js +9 -0
- package/lib/brevoConfiguration/BrevoConfigForm.js +351 -0
- package/lib/brevoConfiguration/BrevoConfigPage.d.ts +3 -0
- package/lib/brevoConfiguration/BrevoConfigPage.d.ts.map +1 -0
- package/lib/brevoConfiguration/BrevoConfigPage.js +17 -0
- package/lib/brevoContacts/BrevoContactsGrid.d.ts +13 -0
- package/lib/brevoContacts/BrevoContactsGrid.d.ts.map +1 -0
- package/lib/brevoContacts/BrevoContactsGrid.generated.d.ts +65 -0
- package/lib/brevoContacts/BrevoContactsGrid.generated.d.ts.map +1 -0
- package/lib/brevoContacts/BrevoContactsGrid.generated.js +12 -0
- package/lib/brevoContacts/BrevoContactsGrid.js +238 -0
- package/lib/brevoContacts/BrevoContactsPage.d.ts +16 -0
- package/lib/brevoContacts/BrevoContactsPage.d.ts.map +1 -0
- package/lib/brevoContacts/BrevoContactsPage.js +77 -0
- package/lib/brevoContacts/form/BrevoContactForm.d.ts +19 -0
- package/lib/brevoContacts/form/BrevoContactForm.d.ts.map +1 -0
- package/lib/brevoContacts/form/BrevoContactForm.generated.d.ts +10 -0
- package/lib/brevoContacts/form/BrevoContactForm.generated.d.ts.map +1 -0
- package/lib/brevoContacts/form/BrevoContactForm.generated.js +5 -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 +58 -0
- package/lib/brevoContacts/form/BrevoContactForm.gql.generated.d.ts.map +1 -0
- package/lib/brevoContacts/form/BrevoContactForm.gql.generated.js +10 -0
- package/lib/brevoContacts/form/BrevoContactForm.gql.js +11 -0
- package/lib/brevoContacts/form/BrevoContactForm.js +346 -0
- package/lib/brevoTestContacts/BrevoTestContactsGrid.d.ts +13 -0
- package/lib/brevoTestContacts/BrevoTestContactsGrid.d.ts.map +1 -0
- package/lib/brevoTestContacts/BrevoTestContactsGrid.generated.d.ts +52 -0
- package/lib/brevoTestContacts/BrevoTestContactsGrid.generated.d.ts.map +1 -0
- package/lib/brevoTestContacts/BrevoTestContactsGrid.generated.js +11 -0
- package/lib/brevoTestContacts/BrevoTestContactsGrid.js +205 -0
- package/lib/brevoTestContacts/BrevoTestContactsPage.d.ts +18 -0
- package/lib/brevoTestContacts/BrevoTestContactsPage.d.ts.map +1 -0
- package/lib/brevoTestContacts/BrevoTestContactsPage.js +78 -0
- package/lib/brevoTestContacts/form/BrevoTestContactForm.d.ts +19 -0
- package/lib/brevoTestContacts/form/BrevoTestContactForm.d.ts.map +1 -0
- package/lib/brevoTestContacts/form/BrevoTestContactForm.generated.d.ts +13 -0
- package/lib/brevoTestContacts/form/BrevoTestContactForm.generated.d.ts.map +1 -0
- package/lib/brevoTestContacts/form/BrevoTestContactForm.generated.js +5 -0
- package/lib/brevoTestContacts/form/BrevoTestContactForm.gql.d.ts +6 -0
- package/lib/brevoTestContacts/form/BrevoTestContactForm.gql.d.ts.map +1 -0
- package/lib/brevoTestContacts/form/BrevoTestContactForm.gql.generated.d.ts +64 -0
- package/lib/brevoTestContacts/form/BrevoTestContactForm.gql.generated.d.ts.map +1 -0
- package/lib/brevoTestContacts/form/BrevoTestContactForm.gql.generated.js +10 -0
- package/lib/brevoTestContacts/form/BrevoTestContactForm.gql.js +11 -0
- package/lib/brevoTestContacts/form/BrevoTestContactForm.js +266 -0
- package/lib/common/BrevoConfigProvider.d.ts +21 -0
- package/lib/common/BrevoConfigProvider.d.ts.map +1 -0
- package/lib/common/BrevoConfigProvider.js +33 -0
- package/lib/common/contactImport/useContactImportFromCsv.d.ts +18 -0
- package/lib/common/contactImport/useContactImportFromCsv.d.ts.map +1 -0
- package/lib/common/contactImport/useContactImportFromCsv.gql.d.ts +2 -0
- package/lib/common/contactImport/useContactImportFromCsv.gql.d.ts.map +1 -0
- package/lib/common/contactImport/useContactImportFromCsv.gql.generated.d.ts +26 -0
- package/lib/common/contactImport/useContactImportFromCsv.gql.generated.d.ts.map +1 -0
- package/lib/common/contactImport/useContactImportFromCsv.gql.generated.js +5 -0
- package/lib/common/contactImport/useContactImportFromCsv.gql.js +4 -0
- package/lib/common/contactImport/useContactImportFromCsv.js +462 -0
- package/lib/configVerification/ConfigVerification.d.ts +8 -0
- package/lib/configVerification/ConfigVerification.d.ts.map +1 -0
- package/lib/configVerification/ConfigVerification.gql.d.ts +2 -0
- package/lib/configVerification/ConfigVerification.gql.d.ts.map +1 -0
- package/lib/configVerification/ConfigVerification.gql.generated.d.ts +17 -0
- package/lib/configVerification/ConfigVerification.gql.generated.d.ts.map +1 -0
- package/lib/configVerification/ConfigVerification.gql.generated.js +5 -0
- package/lib/configVerification/ConfigVerification.gql.js +4 -0
- package/lib/configVerification/ConfigVerification.js +41 -0
- package/lib/dataGrid/DataGrid.d.ts +3 -0
- package/lib/dataGrid/DataGrid.d.ts.map +1 -0
- package/lib/dataGrid/DataGrid.js +19 -0
- package/lib/emailCampaigns/EmailCampaignsGrid.d.ts +7 -0
- package/lib/emailCampaigns/EmailCampaignsGrid.d.ts.map +1 -0
- package/lib/emailCampaigns/EmailCampaignsGrid.generated.d.ts +81 -0
- package/lib/emailCampaigns/EmailCampaignsGrid.generated.d.ts.map +1 -0
- package/lib/emailCampaigns/EmailCampaignsGrid.generated.js +12 -0
- package/lib/emailCampaigns/EmailCampaignsGrid.js +281 -0
- package/lib/emailCampaigns/EmailCampaignsPage.d.ts +8 -0
- package/lib/emailCampaigns/EmailCampaignsPage.d.ts.map +1 -0
- package/lib/emailCampaigns/EmailCampaignsPage.js +85 -0
- package/lib/emailCampaigns/SendingStateColumn.d.ts +7 -0
- package/lib/emailCampaigns/SendingStateColumn.d.ts.map +1 -0
- package/lib/emailCampaigns/SendingStateColumn.js +104 -0
- package/lib/emailCampaigns/form/ConfigFields.d.ts +2 -0
- package/lib/emailCampaigns/form/ConfigFields.d.ts.map +1 -0
- package/lib/emailCampaigns/form/ConfigFields.js +26 -0
- package/lib/emailCampaigns/form/EmailCampaignForm.d.ts +9 -0
- package/lib/emailCampaigns/form/EmailCampaignForm.d.ts.map +1 -0
- package/lib/emailCampaigns/form/EmailCampaignForm.gql.d.ts +4 -0
- package/lib/emailCampaigns/form/EmailCampaignForm.gql.d.ts.map +1 -0
- package/lib/emailCampaigns/form/EmailCampaignForm.gql.generated.d.ts +93 -0
- package/lib/emailCampaigns/form/EmailCampaignForm.gql.generated.d.ts.map +1 -0
- package/lib/emailCampaigns/form/EmailCampaignForm.gql.generated.js +12 -0
- package/lib/emailCampaigns/form/EmailCampaignForm.gql.js +7 -0
- package/lib/emailCampaigns/form/EmailCampaignForm.js +418 -0
- package/lib/emailCampaigns/form/SendEmailCampaignNowDialog.d.ts +8 -0
- package/lib/emailCampaigns/form/SendEmailCampaignNowDialog.d.ts.map +1 -0
- package/lib/emailCampaigns/form/SendEmailCampaignNowDialog.js +35 -0
- package/lib/emailCampaigns/form/SendManagerFields.d.ts +10 -0
- package/lib/emailCampaigns/form/SendManagerFields.d.ts.map +1 -0
- package/lib/emailCampaigns/form/SendManagerFields.gql.d.ts +3 -0
- package/lib/emailCampaigns/form/SendManagerFields.gql.d.ts.map +1 -0
- package/lib/emailCampaigns/form/SendManagerFields.gql.generated.d.ts +39 -0
- package/lib/emailCampaigns/form/SendManagerFields.gql.generated.d.ts.map +1 -0
- package/lib/emailCampaigns/form/SendManagerFields.gql.generated.js +11 -0
- package/lib/emailCampaigns/form/SendManagerFields.gql.js +6 -0
- package/lib/emailCampaigns/form/SendManagerFields.js +171 -0
- 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 +14 -0
- package/lib/emailCampaigns/form/SendManagerWrapper.gql.generated.d.ts.map +1 -0
- package/lib/emailCampaigns/form/SendManagerWrapper.gql.generated.js +5 -0
- package/lib/emailCampaigns/form/SendManagerWrapper.gql.js +4 -0
- package/lib/emailCampaigns/form/SendManagerWrapper.js +39 -0
- package/lib/emailCampaigns/form/TestEmailCampaignForm.d.ts +10 -0
- package/lib/emailCampaigns/form/TestEmailCampaignForm.d.ts.map +1 -0
- package/lib/emailCampaigns/form/TestEmailCampaignForm.generated.d.ts +33 -0
- package/lib/emailCampaigns/form/TestEmailCampaignForm.generated.d.ts.map +1 -0
- package/lib/emailCampaigns/form/TestEmailCampaignForm.generated.js +8 -0
- package/lib/emailCampaigns/form/TestEmailCampaignForm.gql.d.ts +2 -0
- package/lib/emailCampaigns/form/TestEmailCampaignForm.gql.d.ts.map +1 -0
- package/lib/emailCampaigns/form/TestEmailCampaignForm.gql.generated.d.ts +15 -0
- package/lib/emailCampaigns/form/TestEmailCampaignForm.gql.generated.d.ts.map +1 -0
- package/lib/emailCampaigns/form/TestEmailCampaignForm.gql.generated.js +5 -0
- package/lib/emailCampaigns/form/TestEmailCampaignForm.gql.js +4 -0
- package/lib/emailCampaigns/form/TestEmailCampaignForm.js +146 -0
- package/lib/emailCampaigns/statistics/EmailCampaignStatistics.d.ts +7 -0
- package/lib/emailCampaigns/statistics/EmailCampaignStatistics.d.ts.map +1 -0
- package/lib/emailCampaigns/statistics/EmailCampaignStatistics.gql.d.ts +2 -0
- package/lib/emailCampaigns/statistics/EmailCampaignStatistics.gql.d.ts.map +1 -0
- package/lib/emailCampaigns/statistics/EmailCampaignStatistics.gql.generated.d.ts +23 -0
- package/lib/emailCampaigns/statistics/EmailCampaignStatistics.gql.generated.d.ts.map +1 -0
- package/lib/emailCampaigns/statistics/EmailCampaignStatistics.gql.generated.js +5 -0
- package/lib/emailCampaigns/statistics/EmailCampaignStatistics.gql.js +4 -0
- package/lib/emailCampaigns/statistics/EmailCampaignStatistics.js +133 -0
- package/lib/emailCampaigns/statistics/PercentageCard.d.ts +10 -0
- package/lib/emailCampaigns/statistics/PercentageCard.d.ts.map +1 -0
- package/lib/emailCampaigns/statistics/PercentageCard.js +145 -0
- package/lib/emailCampaigns/view/EmailCampaignView.d.ts +8 -0
- package/lib/emailCampaigns/view/EmailCampaignView.d.ts.map +1 -0
- package/lib/emailCampaigns/view/EmailCampaignView.gql.d.ts +2 -0
- package/lib/emailCampaigns/view/EmailCampaignView.gql.d.ts.map +1 -0
- package/lib/emailCampaigns/view/EmailCampaignView.gql.generated.d.ts +18 -0
- package/lib/emailCampaigns/view/EmailCampaignView.gql.generated.d.ts.map +1 -0
- package/lib/emailCampaigns/view/EmailCampaignView.gql.generated.js +5 -0
- package/lib/emailCampaigns/view/EmailCampaignView.gql.js +4 -0
- package/lib/emailCampaigns/view/EmailCampaignView.js +81 -0
- package/lib/graphql.generated.d.ts +596 -0
- package/lib/graphql.generated.d.ts.map +1 -0
- package/lib/graphql.generated.js +1 -0
- package/lib/index.d.ts +10 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +7 -0
- package/lib/targetGroups/TargetGroupDialog.d.ts +8 -0
- package/lib/targetGroups/TargetGroupDialog.d.ts.map +1 -0
- package/lib/targetGroups/TargetGroupDialog.gql.d.ts +2 -0
- package/lib/targetGroups/TargetGroupDialog.gql.d.ts.map +1 -0
- package/lib/targetGroups/TargetGroupDialog.gql.generated.d.ts +18 -0
- package/lib/targetGroups/TargetGroupDialog.gql.generated.d.ts.map +1 -0
- package/lib/targetGroups/TargetGroupDialog.gql.generated.js +5 -0
- package/lib/targetGroups/TargetGroupDialog.gql.js +4 -0
- package/lib/targetGroups/TargetGroupDialog.js +72 -0
- package/lib/targetGroups/TargetGroupForm.d.ts +20 -0
- package/lib/targetGroups/TargetGroupForm.d.ts.map +1 -0
- package/lib/targetGroups/TargetGroupForm.gql.d.ts +4 -0
- package/lib/targetGroups/TargetGroupForm.gql.d.ts.map +1 -0
- package/lib/targetGroups/TargetGroupForm.gql.generated.d.ts +37 -0
- package/lib/targetGroups/TargetGroupForm.gql.generated.d.ts.map +1 -0
- package/lib/targetGroups/TargetGroupForm.gql.generated.js +8 -0
- package/lib/targetGroups/TargetGroupForm.gql.js +9 -0
- package/lib/targetGroups/TargetGroupForm.js +219 -0
- package/lib/targetGroups/TargetGroupsGrid.d.ts +18 -0
- package/lib/targetGroups/TargetGroupsGrid.d.ts.map +1 -0
- package/lib/targetGroups/TargetGroupsGrid.generated.d.ts +90 -0
- package/lib/targetGroups/TargetGroupsGrid.generated.d.ts.map +1 -0
- package/lib/targetGroups/TargetGroupsGrid.generated.js +14 -0
- package/lib/targetGroups/TargetGroupsGrid.js +280 -0
- package/lib/targetGroups/TargetGroupsPage.d.ts +26 -0
- package/lib/targetGroups/TargetGroupsPage.d.ts.map +1 -0
- package/lib/targetGroups/TargetGroupsPage.js +63 -0
- package/lib/targetGroups/addContacts/AddContactsGridSelect.d.ts +10 -0
- package/lib/targetGroups/addContacts/AddContactsGridSelect.d.ts.map +1 -0
- package/lib/targetGroups/addContacts/AddContactsGridSelect.gql.d.ts +5 -0
- package/lib/targetGroups/addContacts/AddContactsGridSelect.gql.d.ts.map +1 -0
- package/lib/targetGroups/addContacts/AddContactsGridSelect.gql.generated.d.ts +84 -0
- package/lib/targetGroups/addContacts/AddContactsGridSelect.gql.generated.d.ts.map +1 -0
- package/lib/targetGroups/addContacts/AddContactsGridSelect.gql.generated.js +13 -0
- package/lib/targetGroups/addContacts/AddContactsGridSelect.gql.js +8 -0
- package/lib/targetGroups/addContacts/AddContactsGridSelect.js +346 -0
- package/lib/targetGroups/allAssignedContacts/AllAssignedContactsGrid.d.ts +10 -0
- package/lib/targetGroups/allAssignedContacts/AllAssignedContactsGrid.d.ts.map +1 -0
- package/lib/targetGroups/allAssignedContacts/AllAssignedContactsGrid.gql.d.ts +2 -0
- package/lib/targetGroups/allAssignedContacts/AllAssignedContactsGrid.gql.d.ts.map +1 -0
- package/lib/targetGroups/allAssignedContacts/AllAssignedContactsGrid.gql.generated.d.ts +42 -0
- package/lib/targetGroups/allAssignedContacts/AllAssignedContactsGrid.gql.generated.d.ts.map +1 -0
- package/lib/targetGroups/allAssignedContacts/AllAssignedContactsGrid.gql.generated.js +8 -0
- package/lib/targetGroups/allAssignedContacts/AllAssignedContactsGrid.gql.js +5 -0
- package/lib/targetGroups/allAssignedContacts/AllAssignedContactsGrid.js +112 -0
- package/package.json +109 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { useQuery } from "@apollo/client";
|
|
2
|
+
import { Alert, Loading, MainContent } from "@dextinity/admin";
|
|
3
|
+
import { FormattedMessage } from "react-intl";
|
|
4
|
+
import { brevoConfigCheckQuery } from "./ConfigVerification.gql";
|
|
5
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
6
|
+
export function ConfigVerification(_ref) {
|
|
7
|
+
var _data$brevoConfig;
|
|
8
|
+
var scope = _ref.scope,
|
|
9
|
+
children = _ref.children;
|
|
10
|
+
var _useQuery = useQuery(brevoConfigCheckQuery, {
|
|
11
|
+
variables: {
|
|
12
|
+
scope: scope
|
|
13
|
+
},
|
|
14
|
+
fetchPolicy: "cache-and-network"
|
|
15
|
+
}),
|
|
16
|
+
data = _useQuery.data,
|
|
17
|
+
error = _useQuery.error,
|
|
18
|
+
loading = _useQuery.loading;
|
|
19
|
+
if (error) {
|
|
20
|
+
throw error;
|
|
21
|
+
}
|
|
22
|
+
if (loading) {
|
|
23
|
+
return /*#__PURE__*/_jsx(Loading, {
|
|
24
|
+
behavior: "fillPageHeight"
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
if (!(data !== null && data !== void 0 && (_data$brevoConfig = data.brevoConfig) !== null && _data$brevoConfig !== void 0 && _data$brevoConfig.id)) {
|
|
28
|
+
return /*#__PURE__*/_jsx(MainContent, {
|
|
29
|
+
children: /*#__PURE__*/_jsx(Alert, {
|
|
30
|
+
severity: "error",
|
|
31
|
+
children: /*#__PURE__*/_jsx(FormattedMessage, {
|
|
32
|
+
id: "cometBrevoModule.missingConfig",
|
|
33
|
+
defaultMessage: "Missing brevo config! Configure brevo via the config page."
|
|
34
|
+
})
|
|
35
|
+
})
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
39
|
+
children: children
|
|
40
|
+
});
|
|
41
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataGrid.d.ts","sourceRoot":"","sources":["../../src/dataGrid/DataGrid.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA2B,KAAK,aAAa,EAAE,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAEvG,wBAAgB,QAAQ,CAAC,CAAC,SAAS,iBAAiB,GAAG,iBAAiB,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,2CAIhG"}
|
|
@@ -0,0 +1,19 @@
|
|
|
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); }
|
|
2
|
+
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; }
|
|
3
|
+
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; }
|
|
4
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
|
+
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); }
|
|
7
|
+
import { useCometConfig } from "@dextinity/cms-admin";
|
|
8
|
+
// eslint-disable-next-line no-restricted-imports
|
|
9
|
+
import { DataGrid as MuiDataGrid } from "@mui/x-data-grid";
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
export function DataGrid(props) {
|
|
12
|
+
var _useCometConfig = useCometConfig(),
|
|
13
|
+
_useCometConfig$dataG = _useCometConfig.dataGrid,
|
|
14
|
+
_useCometConfig$dataG2 = _useCometConfig$dataG === void 0 ? {} : _useCometConfig$dataG,
|
|
15
|
+
_useCometConfig$dataG3 = _useCometConfig$dataG2.component,
|
|
16
|
+
ConfiguredDataGrid = _useCometConfig$dataG3 === void 0 ? MuiDataGrid : _useCometConfig$dataG3;
|
|
17
|
+
var TypedDataGrid = ConfiguredDataGrid;
|
|
18
|
+
return /*#__PURE__*/_jsx(TypedDataGrid, _objectSpread({}, props));
|
|
19
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { BlockInterface, ContentScope } from "@dextinity/cms-admin";
|
|
2
|
+
import type { ReactElement } from "react";
|
|
3
|
+
export declare function EmailCampaignsGrid({ scope, EmailCampaignContentBlock, }: {
|
|
4
|
+
scope: ContentScope;
|
|
5
|
+
EmailCampaignContentBlock: BlockInterface;
|
|
6
|
+
}): ReactElement;
|
|
7
|
+
//# sourceMappingURL=EmailCampaignsGrid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmailCampaignsGrid.d.ts","sourceRoot":"","sources":["../../src/emailCampaigns/EmailCampaignsGrid.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAsF1C,wBAAgB,kBAAkB,CAAC,EAC/B,KAAK,EACL,yBAAyB,GAC5B,EAAE;IACC,KAAK,EAAE,YAAY,CAAC;IACpB,yBAAyB,EAAE,cAAc,CAAC;CAC7C,GAAG,YAAY,CA0Jf"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import * as Types from '../graphql.generated';
|
|
2
|
+
export declare const namedOperations: {
|
|
3
|
+
Query: {
|
|
4
|
+
EmailCampaignsGrid: string;
|
|
5
|
+
};
|
|
6
|
+
Mutation: {
|
|
7
|
+
DeleteEmailCampaign: string;
|
|
8
|
+
CreateEmailCampaign: string;
|
|
9
|
+
};
|
|
10
|
+
Fragment: {
|
|
11
|
+
EmailCampaignsList: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export type GQLEmailCampaignsListFragment = {
|
|
15
|
+
__typename?: 'BrevoEmailCampaign';
|
|
16
|
+
id: string;
|
|
17
|
+
updatedAt: any;
|
|
18
|
+
createdAt: any;
|
|
19
|
+
title: string;
|
|
20
|
+
subject: string;
|
|
21
|
+
sendingState: Types.GQLSendingState;
|
|
22
|
+
scheduledAt: any | null;
|
|
23
|
+
brevoId: number | null;
|
|
24
|
+
content: any;
|
|
25
|
+
brevoTargetGroups: Array<{
|
|
26
|
+
__typename?: 'BrevoTargetGroup';
|
|
27
|
+
id: string;
|
|
28
|
+
title: string;
|
|
29
|
+
}>;
|
|
30
|
+
};
|
|
31
|
+
export type GQLEmailCampaignsGridQueryVariables = Types.Exact<{
|
|
32
|
+
offset?: Types.InputMaybe<Types.Scalars['Int']['input']>;
|
|
33
|
+
limit?: Types.InputMaybe<Types.Scalars['Int']['input']>;
|
|
34
|
+
sort?: Types.InputMaybe<Array<Types.GQLEmailCampaignSort> | Types.GQLEmailCampaignSort>;
|
|
35
|
+
search?: Types.InputMaybe<Types.Scalars['String']['input']>;
|
|
36
|
+
filter?: Types.InputMaybe<Types.GQLEmailCampaignFilter>;
|
|
37
|
+
scope: Types.GQLEmailCampaignContentScopeInput;
|
|
38
|
+
}>;
|
|
39
|
+
export type GQLEmailCampaignsGridQuery = {
|
|
40
|
+
__typename?: 'Query';
|
|
41
|
+
brevoEmailCampaigns: {
|
|
42
|
+
__typename?: 'PaginatedEmailCampaigns';
|
|
43
|
+
totalCount: number;
|
|
44
|
+
nodes: Array<{
|
|
45
|
+
__typename?: 'BrevoEmailCampaign';
|
|
46
|
+
id: string;
|
|
47
|
+
updatedAt: any;
|
|
48
|
+
createdAt: any;
|
|
49
|
+
title: string;
|
|
50
|
+
subject: string;
|
|
51
|
+
sendingState: Types.GQLSendingState;
|
|
52
|
+
scheduledAt: any | null;
|
|
53
|
+
brevoId: number | null;
|
|
54
|
+
content: any;
|
|
55
|
+
brevoTargetGroups: Array<{
|
|
56
|
+
__typename?: 'BrevoTargetGroup';
|
|
57
|
+
id: string;
|
|
58
|
+
title: string;
|
|
59
|
+
}>;
|
|
60
|
+
}>;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
export type GQLDeleteEmailCampaignMutationVariables = Types.Exact<{
|
|
64
|
+
id: Types.Scalars['ID']['input'];
|
|
65
|
+
}>;
|
|
66
|
+
export type GQLDeleteEmailCampaignMutation = {
|
|
67
|
+
__typename?: 'Mutation';
|
|
68
|
+
deleteBrevoEmailCampaign: boolean;
|
|
69
|
+
};
|
|
70
|
+
export type GQLCreateEmailCampaignMutationVariables = Types.Exact<{
|
|
71
|
+
scope: Types.GQLEmailCampaignContentScopeInput;
|
|
72
|
+
input: Types.GQLEmailCampaignInput;
|
|
73
|
+
}>;
|
|
74
|
+
export type GQLCreateEmailCampaignMutation = {
|
|
75
|
+
__typename?: 'Mutation';
|
|
76
|
+
createBrevoEmailCampaign: {
|
|
77
|
+
__typename?: 'BrevoEmailCampaign';
|
|
78
|
+
id: string;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
//# sourceMappingURL=EmailCampaignsGrid.generated.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmailCampaignsGrid.generated.d.ts","sourceRoot":"","sources":["../../src/emailCampaigns/EmailCampaignsGrid.generated.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export var namedOperations = {
|
|
2
|
+
Query: {
|
|
3
|
+
EmailCampaignsGrid: 'EmailCampaignsGrid'
|
|
4
|
+
},
|
|
5
|
+
Mutation: {
|
|
6
|
+
DeleteEmailCampaign: 'DeleteEmailCampaign',
|
|
7
|
+
CreateEmailCampaign: 'CreateEmailCampaign'
|
|
8
|
+
},
|
|
9
|
+
Fragment: {
|
|
10
|
+
EmailCampaignsList: 'EmailCampaignsList'
|
|
11
|
+
}
|
|
12
|
+
};
|
|
@@ -0,0 +1,281 @@
|
|
|
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); }
|
|
2
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
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 }; })(); }
|
|
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); }
|
|
5
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
6
|
+
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
7
|
+
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; }
|
|
8
|
+
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; }
|
|
9
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
10
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
11
|
+
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); }
|
|
12
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
13
|
+
import { gql, useApolloClient, useQuery } from "@apollo/client";
|
|
14
|
+
import { Button, CrudContextMenu, DataGridToolbar, GridFilterButton, GridToolbarQuickFilter, MainContent, muiGridFilterToGql, muiGridSortToGql, StackLink, ToolbarActions, ToolbarAutomaticTitleItem, ToolbarFillSpace, ToolbarItem, useBufferedRowCount, useDataGridRemote, usePersistentColumnState } from "@dextinity/admin";
|
|
15
|
+
import { Add as AddIcon, Edit, Statistics, Visible } from "@dextinity/admin-icons";
|
|
16
|
+
import { IconButton } from "@mui/material";
|
|
17
|
+
import { isBefore } from "date-fns";
|
|
18
|
+
import { FormattedMessage, useIntl } from "react-intl";
|
|
19
|
+
import { DataGrid } from "../dataGrid/DataGrid";
|
|
20
|
+
import { SendingStateColumn } from "./SendingStateColumn";
|
|
21
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
22
|
+
var emailCampaignsFragment = gql(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n fragment EmailCampaignsList on BrevoEmailCampaign {\n id\n updatedAt\n createdAt\n title\n subject\n sendingState\n scheduledAt\n brevoId\n content\n brevoTargetGroups {\n id\n title\n }\n }\n"])));
|
|
23
|
+
var emailCampaignsQuery = gql(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n query EmailCampaignsGrid(\n $offset: Int\n $limit: Int\n $sort: [EmailCampaignSort!]\n $search: String\n $filter: EmailCampaignFilter\n $scope: EmailCampaignContentScopeInput!\n ) {\n brevoEmailCampaigns(offset: $offset, limit: $limit, sort: $sort, search: $search, filter: $filter, scope: $scope) {\n nodes {\n ...EmailCampaignsList\n }\n totalCount\n }\n }\n ", "\n"])), emailCampaignsFragment);
|
|
24
|
+
var deleteEmailCampaignMutation = gql(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n mutation DeleteEmailCampaign($id: ID!) {\n deleteBrevoEmailCampaign(id: $id)\n }\n"])));
|
|
25
|
+
var createEmailCampaignMutation = gql(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n mutation CreateEmailCampaign($scope: EmailCampaignContentScopeInput!, $input: EmailCampaignInput!) {\n createBrevoEmailCampaign(scope: $scope, input: $input) {\n id\n }\n }\n"])));
|
|
26
|
+
function EmailCampaignsGridToolbar() {
|
|
27
|
+
return /*#__PURE__*/_jsxs(DataGridToolbar, {
|
|
28
|
+
children: [/*#__PURE__*/_jsx(ToolbarAutomaticTitleItem, {}), /*#__PURE__*/_jsx(ToolbarItem, {
|
|
29
|
+
children: /*#__PURE__*/_jsx(GridToolbarQuickFilter, {})
|
|
30
|
+
}), /*#__PURE__*/_jsx(ToolbarItem, {
|
|
31
|
+
children: /*#__PURE__*/_jsx(GridFilterButton, {})
|
|
32
|
+
}), /*#__PURE__*/_jsx(ToolbarFillSpace, {}), /*#__PURE__*/_jsx(ToolbarActions, {
|
|
33
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
34
|
+
startIcon: /*#__PURE__*/_jsx(AddIcon, {}),
|
|
35
|
+
component: StackLink,
|
|
36
|
+
pageName: "add",
|
|
37
|
+
payload: "add",
|
|
38
|
+
variant: "primary",
|
|
39
|
+
children: /*#__PURE__*/_jsx(FormattedMessage, {
|
|
40
|
+
id: "cometBrevoModule.emailCampaign.newEmailCampaign",
|
|
41
|
+
defaultMessage: "New email campaign"
|
|
42
|
+
})
|
|
43
|
+
})
|
|
44
|
+
})]
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
export function EmailCampaignsGrid(_ref) {
|
|
48
|
+
var _data$brevoEmailCampa;
|
|
49
|
+
var scope = _ref.scope,
|
|
50
|
+
EmailCampaignContentBlock = _ref.EmailCampaignContentBlock;
|
|
51
|
+
var client = useApolloClient();
|
|
52
|
+
var intl = useIntl();
|
|
53
|
+
var dataGridProps = _objectSpread(_objectSpread({}, useDataGridRemote({
|
|
54
|
+
initialSort: [{
|
|
55
|
+
field: "updatedAt",
|
|
56
|
+
sort: "desc"
|
|
57
|
+
}]
|
|
58
|
+
})), usePersistentColumnState("EmailCampaignsGrid"));
|
|
59
|
+
var sendingStateOptions = [{
|
|
60
|
+
value: "SENT",
|
|
61
|
+
label: intl.formatMessage({
|
|
62
|
+
id: "cometBrevoModule.emailCampaign.sent",
|
|
63
|
+
defaultMessage: "Sent"
|
|
64
|
+
})
|
|
65
|
+
}, {
|
|
66
|
+
value: "DRAFT",
|
|
67
|
+
label: intl.formatMessage({
|
|
68
|
+
id: "cometBrevoModule.emailCampaign.draft",
|
|
69
|
+
defaultMessage: "Draft"
|
|
70
|
+
})
|
|
71
|
+
}, {
|
|
72
|
+
value: "SCHEDULED",
|
|
73
|
+
label: intl.formatMessage({
|
|
74
|
+
id: "cometBrevoModule.emailCampaign.scheduled",
|
|
75
|
+
defaultMessage: "Scheduled"
|
|
76
|
+
})
|
|
77
|
+
}];
|
|
78
|
+
var columns = [{
|
|
79
|
+
field: "updatedAt",
|
|
80
|
+
headerName: intl.formatMessage({
|
|
81
|
+
id: "cometBrevoModule.emailCampaign.updatedAt",
|
|
82
|
+
defaultMessage: "Updated At"
|
|
83
|
+
}),
|
|
84
|
+
type: "dateTime",
|
|
85
|
+
valueGetter: function valueGetter(params, row) {
|
|
86
|
+
return row.updatedAt && new Date(row.updatedAt);
|
|
87
|
+
},
|
|
88
|
+
width: 150,
|
|
89
|
+
filterable: false
|
|
90
|
+
}, {
|
|
91
|
+
field: "createdAt",
|
|
92
|
+
headerName: intl.formatMessage({
|
|
93
|
+
id: "cometBrevoModule.emailCampaign.createdAt",
|
|
94
|
+
defaultMessage: "Created At"
|
|
95
|
+
}),
|
|
96
|
+
type: "dateTime",
|
|
97
|
+
valueGetter: function valueGetter(params, row) {
|
|
98
|
+
return row.updatedAt && new Date(row.updatedAt);
|
|
99
|
+
},
|
|
100
|
+
width: 150,
|
|
101
|
+
filterable: false
|
|
102
|
+
}, {
|
|
103
|
+
field: "title",
|
|
104
|
+
headerName: intl.formatMessage({
|
|
105
|
+
id: "cometBrevoModule.emailCampaign.title",
|
|
106
|
+
defaultMessage: "Title"
|
|
107
|
+
}),
|
|
108
|
+
flex: 2
|
|
109
|
+
}, {
|
|
110
|
+
field: "subject",
|
|
111
|
+
headerName: intl.formatMessage({
|
|
112
|
+
id: "cometBrevoModule.emailCampaign.subject",
|
|
113
|
+
defaultMessage: "Subject"
|
|
114
|
+
}),
|
|
115
|
+
flex: 1
|
|
116
|
+
}, {
|
|
117
|
+
field: "sendingState",
|
|
118
|
+
headerName: intl.formatMessage({
|
|
119
|
+
id: "cometBrevoModule.emailCampaign.sendingState",
|
|
120
|
+
defaultMessage: "Sending State"
|
|
121
|
+
}),
|
|
122
|
+
renderCell: function renderCell(_ref2) {
|
|
123
|
+
var value = _ref2.value;
|
|
124
|
+
return /*#__PURE__*/_jsx(SendingStateColumn, {
|
|
125
|
+
sendingState: value
|
|
126
|
+
});
|
|
127
|
+
},
|
|
128
|
+
width: 150,
|
|
129
|
+
sortable: false,
|
|
130
|
+
type: "singleSelect",
|
|
131
|
+
valueOptions: sendingStateOptions
|
|
132
|
+
}, {
|
|
133
|
+
field: "scheduledAt",
|
|
134
|
+
headerName: intl.formatMessage({
|
|
135
|
+
id: "cometBrevoModule.emailCampaign.scheduledAt",
|
|
136
|
+
defaultMessage: "Scheduled At"
|
|
137
|
+
}),
|
|
138
|
+
type: "dateTime",
|
|
139
|
+
valueGetter: function valueGetter(params, row) {
|
|
140
|
+
return row.updatedAt && new Date(row.updatedAt);
|
|
141
|
+
},
|
|
142
|
+
width: 200
|
|
143
|
+
}, {
|
|
144
|
+
field: "brevoTargetGroups",
|
|
145
|
+
headerName: intl.formatMessage({
|
|
146
|
+
id: "cometBrevoModule.emailCampaign.targetGroups",
|
|
147
|
+
defaultMessage: "Target groups"
|
|
148
|
+
}),
|
|
149
|
+
width: 150,
|
|
150
|
+
renderCell: function renderCell(_ref3) {
|
|
151
|
+
var value = _ref3.value;
|
|
152
|
+
return value.map(function (value) {
|
|
153
|
+
return value.title;
|
|
154
|
+
}).join(", ");
|
|
155
|
+
},
|
|
156
|
+
filterable: false,
|
|
157
|
+
sortable: false
|
|
158
|
+
}, {
|
|
159
|
+
field: "actions",
|
|
160
|
+
headerName: "",
|
|
161
|
+
sortable: false,
|
|
162
|
+
filterable: false,
|
|
163
|
+
align: "right",
|
|
164
|
+
type: "actions",
|
|
165
|
+
renderCell: function renderCell(_ref4) {
|
|
166
|
+
var row = _ref4.row;
|
|
167
|
+
var isScheduledDateInPast = row.scheduledAt != undefined && isBefore(new Date(row.scheduledAt), new Date());
|
|
168
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
169
|
+
children: [row.sendingState !== "SENT" && !isScheduledDateInPast && /*#__PURE__*/_jsx(IconButton, {
|
|
170
|
+
component: StackLink,
|
|
171
|
+
pageName: "edit",
|
|
172
|
+
payload: row.id,
|
|
173
|
+
children: /*#__PURE__*/_jsx(Edit, {
|
|
174
|
+
color: "primary"
|
|
175
|
+
})
|
|
176
|
+
}), row.sendingState === "SENT" && /*#__PURE__*/_jsx(IconButton, {
|
|
177
|
+
component: StackLink,
|
|
178
|
+
pageName: "statistics",
|
|
179
|
+
payload: row.id,
|
|
180
|
+
children: /*#__PURE__*/_jsx(Statistics, {
|
|
181
|
+
color: "primary"
|
|
182
|
+
})
|
|
183
|
+
}), (row.sendingState === "SENT" || row.sendingState == "SCHEDULED" && isScheduledDateInPast) && /*#__PURE__*/_jsx(IconButton, {
|
|
184
|
+
component: StackLink,
|
|
185
|
+
pageName: "view",
|
|
186
|
+
payload: row.id,
|
|
187
|
+
children: /*#__PURE__*/_jsx(Visible, {
|
|
188
|
+
color: "primary"
|
|
189
|
+
})
|
|
190
|
+
}), /*#__PURE__*/_jsx(CrudContextMenu, {
|
|
191
|
+
copyData: function copyData() {
|
|
192
|
+
return {
|
|
193
|
+
title: row.title,
|
|
194
|
+
subject: row.subject,
|
|
195
|
+
content: EmailCampaignContentBlock.state2Output(EmailCampaignContentBlock.input2State(row.content)),
|
|
196
|
+
brevoTargetGroups: row.brevoTargetGroups.map(function (brevoTargetGroup) {
|
|
197
|
+
return brevoTargetGroup.id;
|
|
198
|
+
})
|
|
199
|
+
};
|
|
200
|
+
},
|
|
201
|
+
onPaste: (/*#__PURE__*/function () {
|
|
202
|
+
var _ref6 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(_ref5) {
|
|
203
|
+
var input;
|
|
204
|
+
return _regenerator().w(function (_context) {
|
|
205
|
+
while (1) switch (_context.n) {
|
|
206
|
+
case 0:
|
|
207
|
+
input = _ref5.input;
|
|
208
|
+
_context.n = 1;
|
|
209
|
+
return client.mutate({
|
|
210
|
+
mutation: createEmailCampaignMutation,
|
|
211
|
+
variables: {
|
|
212
|
+
scope: scope,
|
|
213
|
+
input: _objectSpread({}, input)
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
case 1:
|
|
217
|
+
return _context.a(2);
|
|
218
|
+
}
|
|
219
|
+
}, _callee);
|
|
220
|
+
}));
|
|
221
|
+
return function (_x) {
|
|
222
|
+
return _ref6.apply(this, arguments);
|
|
223
|
+
};
|
|
224
|
+
}()),
|
|
225
|
+
onDelete: !row.brevoId ? /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
|
|
226
|
+
return _regenerator().w(function (_context2) {
|
|
227
|
+
while (1) switch (_context2.n) {
|
|
228
|
+
case 0:
|
|
229
|
+
_context2.n = 1;
|
|
230
|
+
return client.mutate({
|
|
231
|
+
mutation: deleteEmailCampaignMutation,
|
|
232
|
+
variables: {
|
|
233
|
+
id: row.id
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
case 1:
|
|
237
|
+
return _context2.a(2);
|
|
238
|
+
}
|
|
239
|
+
}, _callee2);
|
|
240
|
+
})) : undefined,
|
|
241
|
+
refetchQueries: [emailCampaignsQuery]
|
|
242
|
+
})]
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
}];
|
|
246
|
+
var _muiGridFilterToGql = muiGridFilterToGql(columns, dataGridProps.filterModel),
|
|
247
|
+
gqlFilter = _muiGridFilterToGql.filter,
|
|
248
|
+
gqlSearch = _muiGridFilterToGql.search;
|
|
249
|
+
var _useQuery = useQuery(emailCampaignsQuery, {
|
|
250
|
+
variables: {
|
|
251
|
+
scope: scope,
|
|
252
|
+
filter: gqlFilter,
|
|
253
|
+
search: gqlSearch,
|
|
254
|
+
offset: dataGridProps.paginationModel.page * dataGridProps.paginationModel.pageSize,
|
|
255
|
+
limit: dataGridProps.paginationModel.pageSize,
|
|
256
|
+
sort: muiGridSortToGql(dataGridProps.sortModel)
|
|
257
|
+
}
|
|
258
|
+
}),
|
|
259
|
+
data = _useQuery.data,
|
|
260
|
+
loading = _useQuery.loading,
|
|
261
|
+
error = _useQuery.error;
|
|
262
|
+
var rowCount = useBufferedRowCount(data === null || data === void 0 ? void 0 : data.brevoEmailCampaigns.totalCount);
|
|
263
|
+
if (error) {
|
|
264
|
+
throw error;
|
|
265
|
+
}
|
|
266
|
+
var rows = (_data$brevoEmailCampa = data === null || data === void 0 ? void 0 : data.brevoEmailCampaigns.nodes) !== null && _data$brevoEmailCampa !== void 0 ? _data$brevoEmailCampa : [];
|
|
267
|
+
return /*#__PURE__*/_jsx(MainContent, {
|
|
268
|
+
fullHeight: true,
|
|
269
|
+
children: /*#__PURE__*/_jsx(DataGrid, _objectSpread(_objectSpread({}, dataGridProps), {}, {
|
|
270
|
+
disableRowSelectionOnClick: true,
|
|
271
|
+
rows: rows,
|
|
272
|
+
rowCount: rowCount,
|
|
273
|
+
columns: columns,
|
|
274
|
+
loading: loading,
|
|
275
|
+
slots: {
|
|
276
|
+
toolbar: EmailCampaignsGridToolbar
|
|
277
|
+
},
|
|
278
|
+
showToolbar: true
|
|
279
|
+
}))
|
|
280
|
+
});
|
|
281
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type BlockInterface } from "@dextinity/cms-admin";
|
|
2
|
+
import type { JSX } from "react";
|
|
3
|
+
interface CreateEmailCampaignsPageOptions {
|
|
4
|
+
EmailCampaignContentBlock: BlockInterface;
|
|
5
|
+
}
|
|
6
|
+
export declare function createEmailCampaignsPage({ EmailCampaignContentBlock }: CreateEmailCampaignsPageOptions): () => JSX.Element;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=EmailCampaignsPage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmailCampaignsPage.d.ts","sourceRoot":"","sources":["../../src/emailCampaigns/EmailCampaignsPage.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAA0C,MAAM,sBAAsB,CAAC;AACnG,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAUjC,UAAU,+BAA+B;IACrC,yBAAyB,EAAE,cAAc,CAAC;CAC7C;AAED,wBAAgB,wBAAwB,CAAC,EAAE,yBAAyB,EAAE,EAAE,+BAA+B,SACpE,GAAG,CAAC,OAAO,CAsD7C"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { Stack, StackPage, StackSwitch, StackToolbar } from "@dextinity/admin";
|
|
2
|
+
import { ContentScopeIndicator, useContentScope } from "@dextinity/cms-admin";
|
|
3
|
+
import { useIntl } from "react-intl";
|
|
4
|
+
import { useBrevoConfig } from "../common/BrevoConfigProvider";
|
|
5
|
+
import { ConfigVerification } from "../configVerification/ConfigVerification";
|
|
6
|
+
import { EmailCampaignsGrid } from "./EmailCampaignsGrid";
|
|
7
|
+
import { EmailCampaignForm } from "./form/EmailCampaignForm";
|
|
8
|
+
import { EmailCampaignStatistics } from "./statistics/EmailCampaignStatistics";
|
|
9
|
+
import { EmailCampaignView } from "./view/EmailCampaignView";
|
|
10
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
export function createEmailCampaignsPage(_ref) {
|
|
12
|
+
var EmailCampaignContentBlock = _ref.EmailCampaignContentBlock;
|
|
13
|
+
function EmailCampaignsPage() {
|
|
14
|
+
var _useBrevoConfig = useBrevoConfig(),
|
|
15
|
+
scopeParts = _useBrevoConfig.scopeParts;
|
|
16
|
+
var _useContentScope = useContentScope(),
|
|
17
|
+
completeScope = _useContentScope.scope;
|
|
18
|
+
var intl = useIntl();
|
|
19
|
+
var scope = scopeParts.reduce(function (acc, scopePart) {
|
|
20
|
+
acc[scopePart] = completeScope[scopePart];
|
|
21
|
+
return acc;
|
|
22
|
+
}, {});
|
|
23
|
+
return /*#__PURE__*/_jsx(ConfigVerification, {
|
|
24
|
+
scope: scope,
|
|
25
|
+
children: /*#__PURE__*/_jsx(Stack, {
|
|
26
|
+
topLevelTitle: intl.formatMessage({
|
|
27
|
+
id: "cometBrevoModule.emailCampaigns.emailCampaigns",
|
|
28
|
+
defaultMessage: "Email campaigns"
|
|
29
|
+
}),
|
|
30
|
+
children: /*#__PURE__*/_jsxs(StackSwitch, {
|
|
31
|
+
children: [/*#__PURE__*/_jsxs(StackPage, {
|
|
32
|
+
name: "grid",
|
|
33
|
+
children: [/*#__PURE__*/_jsx(StackToolbar, {
|
|
34
|
+
scopeIndicator: /*#__PURE__*/_jsx(ContentScopeIndicator, {
|
|
35
|
+
scope: scope
|
|
36
|
+
})
|
|
37
|
+
}), /*#__PURE__*/_jsx(EmailCampaignsGrid, {
|
|
38
|
+
scope: scope,
|
|
39
|
+
EmailCampaignContentBlock: EmailCampaignContentBlock
|
|
40
|
+
})]
|
|
41
|
+
}), /*#__PURE__*/_jsx(StackPage, {
|
|
42
|
+
name: "statistics",
|
|
43
|
+
children: function children(selectedId) {
|
|
44
|
+
return /*#__PURE__*/_jsx(EmailCampaignStatistics, {
|
|
45
|
+
id: selectedId
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}), /*#__PURE__*/_jsx(StackPage, {
|
|
49
|
+
name: "view",
|
|
50
|
+
children: function children(selectedId) {
|
|
51
|
+
return /*#__PURE__*/_jsx(EmailCampaignView, {
|
|
52
|
+
id: selectedId,
|
|
53
|
+
EmailCampaignContentBlock: EmailCampaignContentBlock
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}), /*#__PURE__*/_jsx(StackPage, {
|
|
57
|
+
name: "edit",
|
|
58
|
+
title: intl.formatMessage({
|
|
59
|
+
id: "cometBrevoModule.emailCampaigns.editEmailCampaign",
|
|
60
|
+
defaultMessage: "Edit email campaign"
|
|
61
|
+
}),
|
|
62
|
+
children: function children(selectedId) {
|
|
63
|
+
return /*#__PURE__*/_jsx(EmailCampaignForm, {
|
|
64
|
+
id: selectedId,
|
|
65
|
+
EmailCampaignContentBlock: EmailCampaignContentBlock,
|
|
66
|
+
scope: scope
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}), /*#__PURE__*/_jsx(StackPage, {
|
|
70
|
+
name: "add",
|
|
71
|
+
title: intl.formatMessage({
|
|
72
|
+
id: "cometBrevoModule.emailCampaigns.addEmailCampaign",
|
|
73
|
+
defaultMessage: "Add email campaign"
|
|
74
|
+
}),
|
|
75
|
+
children: /*#__PURE__*/_jsx(EmailCampaignForm, {
|
|
76
|
+
EmailCampaignContentBlock: EmailCampaignContentBlock,
|
|
77
|
+
scope: scope
|
|
78
|
+
})
|
|
79
|
+
})]
|
|
80
|
+
})
|
|
81
|
+
})
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
return EmailCampaignsPage;
|
|
85
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { GQLSendingState } from "../graphql.generated";
|
|
2
|
+
interface Props {
|
|
3
|
+
sendingState?: GQLSendingState;
|
|
4
|
+
}
|
|
5
|
+
export declare const SendingStateColumn: ({ sendingState }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=SendingStateColumn.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SendingStateColumn.d.ts","sourceRoot":"","sources":["../../src/emailCampaigns/SendingStateColumn.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,UAAU,KAAK;IACX,YAAY,CAAC,EAAE,eAAe,CAAC;CAClC;AAED,eAAO,MAAM,kBAAkB,GAAI,kBAAkB,KAAK,4CAmCzD,CAAC"}
|