@comet/brevo-admin 2.0.0-canary-20240618072535 → 2.0.0-canary-20240711123618

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/lib/brevoContacts/BrevoContactsGrid.generated.d.ts +2 -0
  2. package/lib/brevoContacts/BrevoContactsGrid.generated.d.ts.map +1 -1
  3. package/lib/brevoContacts/BrevoContactsGrid.js +6 -4
  4. package/lib/brevoContacts/form/BrevoContactForm.d.ts.map +1 -1
  5. package/lib/brevoContacts/form/BrevoContactForm.gql.generated.d.ts +3 -0
  6. package/lib/brevoContacts/form/BrevoContactForm.gql.generated.d.ts.map +1 -1
  7. package/lib/brevoContacts/form/BrevoContactForm.gql.js +3 -3
  8. package/lib/brevoContacts/form/BrevoContactForm.js +6 -3
  9. package/lib/emailCampaigns/form/EmailCampaignForm.d.ts.map +1 -1
  10. package/lib/emailCampaigns/form/EmailCampaignForm.js +1 -4
  11. package/lib/graphql.generated.d.ts +26 -46
  12. package/lib/graphql.generated.d.ts.map +1 -1
  13. package/lib/index.d.ts +0 -1
  14. package/lib/index.d.ts.map +1 -1
  15. package/lib/index.js +0 -7
  16. package/lib/targetGroups/TargetGroupForm.d.ts +1 -1
  17. package/lib/targetGroups/TargetGroupForm.d.ts.map +1 -1
  18. package/lib/targetGroups/TargetGroupForm.gql.d.ts.map +1 -1
  19. package/lib/targetGroups/TargetGroupForm.gql.generated.d.ts +2 -3
  20. package/lib/targetGroups/TargetGroupForm.gql.generated.d.ts.map +1 -1
  21. package/lib/targetGroups/TargetGroupForm.gql.js +1 -1
  22. package/lib/targetGroups/TargetGroupForm.js +29 -8
  23. package/lib/targetGroups/TargetGroupsGrid.generated.d.ts +1 -1
  24. package/lib/targetGroups/TargetGroupsGrid.generated.d.ts.map +1 -1
  25. package/lib/targetGroups/TargetGroupsGrid.js +3 -3
  26. package/lib/targetGroups/addContacts/AddContactsGridSelect.d.ts +10 -0
  27. package/lib/targetGroups/addContacts/AddContactsGridSelect.d.ts.map +1 -0
  28. package/lib/targetGroups/addContacts/AddContactsGridSelect.gql.d.ts +5 -0
  29. package/lib/targetGroups/addContacts/AddContactsGridSelect.gql.d.ts.map +1 -0
  30. package/lib/targetGroups/addContacts/AddContactsGridSelect.gql.generated.d.ts +84 -0
  31. package/lib/targetGroups/addContacts/AddContactsGridSelect.gql.generated.d.ts.map +1 -0
  32. package/lib/targetGroups/addContacts/AddContactsGridSelect.gql.generated.js +19 -0
  33. package/lib/targetGroups/addContacts/AddContactsGridSelect.gql.js +14 -0
  34. package/lib/targetGroups/addContacts/AddContactsGridSelect.js +301 -0
  35. package/package.json +1 -1
  36. package/lib/brevoConfiguration/BrevoConfigForm.d.ts +0 -8
  37. package/lib/brevoConfiguration/BrevoConfigForm.d.ts.map +0 -1
  38. package/lib/brevoConfiguration/BrevoConfigForm.generated.d.ts +0 -12
  39. package/lib/brevoConfiguration/BrevoConfigForm.generated.d.ts.map +0 -1
  40. package/lib/brevoConfiguration/BrevoConfigForm.generated.js +0 -5
  41. package/lib/brevoConfiguration/BrevoConfigForm.gql.d.ts +0 -7
  42. package/lib/brevoConfiguration/BrevoConfigForm.gql.d.ts.map +0 -1
  43. package/lib/brevoConfiguration/BrevoConfigForm.gql.generated.d.ts +0 -85
  44. package/lib/brevoConfiguration/BrevoConfigForm.gql.generated.d.ts.map +0 -1
  45. package/lib/brevoConfiguration/BrevoConfigForm.gql.generated.js +0 -20
  46. package/lib/brevoConfiguration/BrevoConfigForm.gql.js +0 -15
  47. package/lib/brevoConfiguration/BrevoConfigForm.js +0 -228
  48. package/lib/brevoConfiguration/BrevoConfigPage.d.ts +0 -7
  49. package/lib/brevoConfiguration/BrevoConfigPage.d.ts.map +0 -1
  50. package/lib/brevoConfiguration/BrevoConfigPage.js +0 -27
  51. package/lib/emailCampaigns/form/SendManagerWrapper.d.ts +0 -8
  52. package/lib/emailCampaigns/form/SendManagerWrapper.d.ts.map +0 -1
  53. package/lib/emailCampaigns/form/SendManagerWrapper.gql.d.ts +0 -2
  54. package/lib/emailCampaigns/form/SendManagerWrapper.gql.d.ts.map +0 -1
  55. package/lib/emailCampaigns/form/SendManagerWrapper.gql.generated.d.ts +0 -17
  56. package/lib/emailCampaigns/form/SendManagerWrapper.gql.generated.d.ts.map +0 -1
  57. package/lib/emailCampaigns/form/SendManagerWrapper.gql.generated.js +0 -11
  58. package/lib/emailCampaigns/form/SendManagerWrapper.gql.js +0 -10
  59. package/lib/emailCampaigns/form/SendManagerWrapper.js +0 -40
  60. package/lib/targetGroups/TargetGroupForm.generated.d.ts +0 -10
  61. package/lib/targetGroups/TargetGroupForm.generated.d.ts.map +0 -1
  62. package/lib/targetGroups/TargetGroupForm.generated.js +0 -11
@@ -1 +1 @@
1
- {"version":3,"file":"TargetGroupsGrid.generated.d.ts","sourceRoot":"","sources":["../../src/targetGroups/TargetGroupsGrid.generated.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,sBAAsB,CAAC;AAE9C,eAAO,MAAM,eAAe;;;;;;;;;;;;;CAa3B,CAAA;AACD,MAAM,MAAM,2BAA2B,GAAG;IAAE,UAAU,CAAC,EAAE,aAAa,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,gBAAgB,EAAE,MAAM,CAAC;IAAC,oBAAoB,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,OAAO,CAAA;CAAE,CAAC;AAEjL,MAAM,MAAM,iCAAiC,GAAG;IAAE,UAAU,CAAC,EAAE,cAAc,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,gBAAgB,EAAE,OAAO,CAAC;IAAC,cAAc,EAAE,OAAO,CAAA;CAAE,CAAC;AAE/J,MAAM,MAAM,iCAAiC,GAAG,KAAK,CAAC,KAAK,CAAC;IAC1D,MAAM,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,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iCAAiC,CAAC;CAChD,CAAC,CAAC;AAGH,MAAM,MAAM,2BAA2B,GAAG;IAAE,UAAU,CAAC,EAAE,OAAO,CAAC;IAAC,aAAa,EAAE;QAAE,UAAU,CAAC,EAAE,wBAAwB,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,KAAK,CAAC;YAAE,UAAU,CAAC,EAAE,cAAc,CAAC;YAAC,EAAE,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAC;YAAC,gBAAgB,EAAE,OAAO,CAAC;YAAC,cAAc,EAAE,OAAO,CAAA;SAAE,CAAC,CAAA;KAAE,CAAA;CAAE,CAAC"}
@@ -52,7 +52,7 @@ function TargetGroupsGrid(_ref) {
52
52
  var client = (0, _client.useApolloClient)();
53
53
  var intl = (0, _reactIntl.useIntl)();
54
54
  var dataGridProps = _objectSpread(_objectSpread({}, (0, _admin.useDataGridRemote)()), (0, _admin.usePersistentColumnState)("TargetGroupsGrid"));
55
- var targetGroupContactsQuery = (0, _client.gql)(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n query TargetGroupContacts($targetGroupId: ID, $offset: Int, $limit: Int, $scope: EmailCampaignContentScopeInput!) {\n brevoContacts(targetGroupId: $targetGroupId, offset: $offset, limit: $limit, scope: $scope) {\n nodes {\n ...TargetGroupContactItem\n ", "\n }\n totalCount\n }\n }\n ", "\n ", "\n "])), exportTargetGroupOptions !== null && exportTargetGroupOptions !== void 0 && exportTargetGroupOptions.additionalAttributesFragment ? "...".concat((_exportTargetGroupOpt = exportTargetGroupOptions.additionalAttributesFragment) === null || _exportTargetGroupOpt === void 0 ? void 0 : _exportTargetGroupOpt.name) : "", targetGroupContactItemFragment, (_exportTargetGroupOpt2 = exportTargetGroupOptions === null || exportTargetGroupOptions === void 0 || (_exportTargetGroupOpt3 = exportTargetGroupOptions.additionalAttributesFragment) === null || _exportTargetGroupOpt3 === void 0 ? void 0 : _exportTargetGroupOpt3.fragment) !== null && _exportTargetGroupOpt2 !== void 0 ? _exportTargetGroupOpt2 : "");
55
+ var targetGroupContactsQuery = (0, _client.gql)(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n query TargetGroupContacts($targetGroupId: ID!, $offset: Int, $limit: Int, $scope: EmailCampaignContentScopeInput!) {\n brevoContacts(targetGroupId: $targetGroupId, offset: $offset, limit: $limit, scope: $scope) { \n nodes {\n ...TargetGroupContactItem\n ", "\n }\n totalCount\n }\n }\n ", "\n ", "\n "])), exportTargetGroupOptions !== null && exportTargetGroupOptions !== void 0 && exportTargetGroupOptions.additionalAttributesFragment ? "...".concat((_exportTargetGroupOpt = exportTargetGroupOptions.additionalAttributesFragment) === null || _exportTargetGroupOpt === void 0 ? void 0 : _exportTargetGroupOpt.name) : "", targetGroupContactItemFragment, (_exportTargetGroupOpt2 = exportTargetGroupOptions === null || exportTargetGroupOptions === void 0 || (_exportTargetGroupOpt3 = exportTargetGroupOptions.additionalAttributesFragment) === null || _exportTargetGroupOpt3 === void 0 ? void 0 : _exportTargetGroupOpt3.fragment) !== null && _exportTargetGroupOpt2 !== void 0 ? _exportTargetGroupOpt2 : "");
56
56
  var convertToCsv = function convertToCsv(data) {
57
57
  var _exportTargetGroupOpt4;
58
58
  var header = [intl.formatMessage({
@@ -104,9 +104,9 @@ function TargetGroupsGrid(_ref) {
104
104
  query: targetGroupContactsQuery,
105
105
  variables: {
106
106
  targetGroupId: id,
107
- scope: scope,
108
107
  offset: offset,
109
- limit: 100
108
+ limit: 100,
109
+ scope: scope
110
110
  }
111
111
  });
112
112
  case 7:
@@ -0,0 +1,10 @@
1
+ import { ContentScopeInterface } from "@comet/cms-admin";
2
+ import * as React from "react";
3
+ interface AddContactsGridSelectProps {
4
+ scope: ContentScopeInterface;
5
+ id: string;
6
+ assignedContactsTargetGroupBrevoId?: number;
7
+ }
8
+ export declare function AddContactsGridSelect({ id, scope, assignedContactsTargetGroupBrevoId }: AddContactsGridSelectProps): React.ReactElement;
9
+ export {};
10
+ //# sourceMappingURL=AddContactsGridSelect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AddContactsGridSelect.d.ts","sourceRoot":"","sources":["../../../src/targetGroups/addContacts/AddContactsGridSelect.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAIzD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA6F/B,UAAU,0BAA0B;IAChC,KAAK,EAAE,qBAAqB,CAAC;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,kCAAkC,CAAC,EAAE,MAAM,CAAC;CAC/C;AAED,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,kCAAkC,EAAE,EAAE,0BAA0B,GAAG,KAAK,CAAC,YAAY,CA4LvI"}
@@ -0,0 +1,5 @@
1
+ export declare const manuallyAssignedBrevoContactsGridQuery: import("@apollo/client").DocumentNode;
2
+ export declare const allBrevoContactsQuery: import("@apollo/client").DocumentNode;
3
+ export declare const addBrevoContactsToTargetGroupMutation: import("@apollo/client").DocumentNode;
4
+ export declare const removeBrevoContactFromTargetGroupMutation: import("@apollo/client").DocumentNode;
5
+ //# sourceMappingURL=AddContactsGridSelect.gql.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AddContactsGridSelect.gql.d.ts","sourceRoot":"","sources":["../../../src/targetGroups/addContacts/AddContactsGridSelect.gql.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,sCAAsC,uCAUlD,CAAC;AAEF,eAAO,MAAM,qBAAqB,uCAUjC,CAAC;AAEF,eAAO,MAAM,qCAAqC,uCAIjD,CAAC;AAEF,eAAO,MAAM,yCAAyC,uCAIrD,CAAC"}
@@ -0,0 +1,84 @@
1
+ import * as Types from '../../graphql.generated';
2
+ export declare const namedOperations: {
3
+ Query: {
4
+ ManuallyAssignedBrevoContactsGrid: string;
5
+ AllBrevoContactsGrid: string;
6
+ };
7
+ Mutation: {
8
+ AddBrevoContactsToTargetGroup: string;
9
+ RemoveBrevoContactFromTargetGroup: string;
10
+ };
11
+ Fragment: {
12
+ TargetGroupBrevoContactsList: string;
13
+ };
14
+ };
15
+ export type GQLTargetGroupBrevoContactsListFragment = {
16
+ __typename?: 'BrevoContact';
17
+ id: number;
18
+ createdAt: string;
19
+ modifiedAt: string;
20
+ email: string;
21
+ emailBlacklisted: boolean;
22
+ smsBlacklisted: boolean;
23
+ };
24
+ export type GQLManuallyAssignedBrevoContactsGridQueryVariables = Types.Exact<{
25
+ offset?: Types.InputMaybe<Types.Scalars['Int']>;
26
+ limit?: Types.InputMaybe<Types.Scalars['Int']>;
27
+ email?: Types.InputMaybe<Types.Scalars['String']>;
28
+ targetGroupId: Types.Scalars['ID'];
29
+ }>;
30
+ export type GQLManuallyAssignedBrevoContactsGridQuery = {
31
+ __typename?: 'Query';
32
+ manuallyAssignedBrevoContacts: {
33
+ __typename?: 'PaginatedBrevoContacts';
34
+ totalCount: number;
35
+ nodes: Array<{
36
+ __typename?: 'BrevoContact';
37
+ id: number;
38
+ createdAt: string;
39
+ modifiedAt: string;
40
+ email: string;
41
+ emailBlacklisted: boolean;
42
+ smsBlacklisted: boolean;
43
+ }>;
44
+ };
45
+ };
46
+ export type GQLAllBrevoContactsGridQueryVariables = Types.Exact<{
47
+ offset?: Types.InputMaybe<Types.Scalars['Int']>;
48
+ limit?: Types.InputMaybe<Types.Scalars['Int']>;
49
+ email?: Types.InputMaybe<Types.Scalars['String']>;
50
+ scope: Types.GQLEmailCampaignContentScopeInput;
51
+ }>;
52
+ export type GQLAllBrevoContactsGridQuery = {
53
+ __typename?: 'Query';
54
+ brevoContacts: {
55
+ __typename?: 'PaginatedBrevoContacts';
56
+ totalCount: number;
57
+ nodes: Array<{
58
+ __typename?: 'BrevoContact';
59
+ id: number;
60
+ createdAt: string;
61
+ modifiedAt: string;
62
+ email: string;
63
+ emailBlacklisted: boolean;
64
+ smsBlacklisted: boolean;
65
+ }>;
66
+ };
67
+ };
68
+ export type GQLAddBrevoContactsToTargetGroupMutationVariables = Types.Exact<{
69
+ id: Types.Scalars['ID'];
70
+ input: Types.GQLAddBrevoContactsInput;
71
+ }>;
72
+ export type GQLAddBrevoContactsToTargetGroupMutation = {
73
+ __typename?: 'Mutation';
74
+ addBrevoContactsToTargetGroup: boolean;
75
+ };
76
+ export type GQLRemoveBrevoContactFromTargetGroupMutationVariables = Types.Exact<{
77
+ id: Types.Scalars['ID'];
78
+ input: Types.GQLRemoveBrevoContactInput;
79
+ }>;
80
+ export type GQLRemoveBrevoContactFromTargetGroupMutation = {
81
+ __typename?: 'Mutation';
82
+ removeBrevoContactFromTargetGroup: boolean;
83
+ };
84
+ //# sourceMappingURL=AddContactsGridSelect.gql.generated.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AddContactsGridSelect.gql.generated.d.ts","sourceRoot":"","sources":["../../../src/targetGroups/addContacts/AddContactsGridSelect.gql.generated.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,yBAAyB,CAAC;AAEjD,eAAO,MAAM,eAAe;;;;;;;;;;;;CAY3B,CAAA;AACD,MAAM,MAAM,uCAAuC,GAAG;IAAE,UAAU,CAAC,EAAE,cAAc,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,gBAAgB,EAAE,OAAO,CAAC;IAAC,cAAc,EAAE,OAAO,CAAA;CAAE,CAAC;AAE5M,MAAM,MAAM,kDAAkD,GAAG,KAAK,CAAC,KAAK,CAAC;IAC3E,MAAM,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;IAChD,KAAK,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;IAC/C,KAAK,CAAC,EAAE,K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;YAAC,EAAE,EAAE,MAAM,CAAC;YAAC,SAAS,EAAE,MAAM,CAAC;YAAC,UAAU,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAC;YAAC,gBAAgB,EAAE,OAAO,CAAC;YAAC,cAAc,EAAE,OAAO,CAAA;SAAE,CAAC,CAAA;KAAE,CAAA;CAAE,CAAC;AAEvT,MAAM,MAAM,iDAAiD,GAAG,KAAK,CAAC,KAAK,CAAC;IAC1E,EAAE,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACxB,KAAK,EAAE,KAAK,CAAC,wBAAwB,CAAC;CACvC,CAAC,CAAC;AAGH,MAAM,MAAM,wCAAwC,GAAG;IAAE,UAAU,CAAC,EAAE,UAAU,CAAC;IAAC,6BAA6B,EAAE,OAAO,CAAA;CAAE,CAAC;AAE3H,MAAM,MAAM,qDAAqD,GAAG,KAAK,CAAC,KAAK,CAAC;IAC9E,EAAE,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACxB,KAAK,EAAE,KAAK,CAAC,0BAA0B,CAAC;CACzC,CAAC,CAAC;AAGH,MAAM,MAAM,4CAA4C,GAAG;IAAE,UAAU,CAAC,EAAE,UAAU,CAAC;IAAC,iCAAiC,EAAE,OAAO,CAAA;CAAE,CAAC"}
@@ -0,0 +1,19 @@
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
+ ManuallyAssignedBrevoContactsGrid: 'ManuallyAssignedBrevoContactsGrid',
10
+ AllBrevoContactsGrid: 'AllBrevoContactsGrid'
11
+ },
12
+ Mutation: {
13
+ AddBrevoContactsToTargetGroup: 'AddBrevoContactsToTargetGroup',
14
+ RemoveBrevoContactFromTargetGroup: 'RemoveBrevoContactFromTargetGroup'
15
+ },
16
+ Fragment: {
17
+ TargetGroupBrevoContactsList: 'TargetGroupBrevoContactsList'
18
+ }
19
+ };
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.removeBrevoContactFromTargetGroupMutation = exports.manuallyAssignedBrevoContactsGridQuery = exports.allBrevoContactsQuery = exports.addBrevoContactsToTargetGroupMutation = void 0;
7
+ var _client = require("@apollo/client");
8
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
9
+ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
10
+ var targetGroupBrevoContactsFragment = (0, _client.gql)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n fragment TargetGroupBrevoContactsList on BrevoContact {\n id\n createdAt\n modifiedAt\n email\n emailBlacklisted\n smsBlacklisted\n }\n"])));
11
+ var manuallyAssignedBrevoContactsGridQuery = exports.manuallyAssignedBrevoContactsGridQuery = (0, _client.gql)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n query ManuallyAssignedBrevoContactsGrid($offset: Int, $limit: Int, $email: String, $targetGroupId: ID!) {\n manuallyAssignedBrevoContacts(offset: $offset, limit: $limit, email: $email, targetGroupId: $targetGroupId) {\n nodes {\n ...TargetGroupBrevoContactsList\n }\n totalCount\n }\n }\n ", "\n"])), targetGroupBrevoContactsFragment);
12
+ var allBrevoContactsQuery = exports.allBrevoContactsQuery = (0, _client.gql)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n query AllBrevoContactsGrid($offset: Int, $limit: Int, $email: String, $scope: EmailCampaignContentScopeInput!) {\n brevoContacts(offset: $offset, limit: $limit, email: $email, scope: $scope) {\n nodes {\n ...TargetGroupBrevoContactsList\n }\n totalCount\n }\n }\n ", "\n"])), targetGroupBrevoContactsFragment);
13
+ var addBrevoContactsToTargetGroupMutation = exports.addBrevoContactsToTargetGroupMutation = (0, _client.gql)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n mutation AddBrevoContactsToTargetGroup($id: ID!, $input: AddBrevoContactsInput!) {\n addBrevoContactsToTargetGroup(id: $id, input: $input)\n }\n"])));
14
+ var removeBrevoContactFromTargetGroupMutation = exports.removeBrevoContactFromTargetGroupMutation = (0, _client.gql)(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n mutation RemoveBrevoContactFromTargetGroup($id: ID!, $input: RemoveBrevoContactInput!) {\n removeBrevoContactFromTargetGroup(id: $id, input: $input)\n }\n"])));
@@ -0,0 +1,301 @@
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.AddContactsGridSelect = AddContactsGridSelect;
8
+ var _client = require("@apollo/client");
9
+ var _admin = require("@comet/admin");
10
+ var _adminIcons = require("@comet/admin-icons");
11
+ var _material = require("@mui/material");
12
+ var _system = require("@mui/system");
13
+ var _xDataGrid = require("@mui/x-data-grid");
14
+ var React = _interopRequireWildcard(require("react"));
15
+ var _reactIntl = require("react-intl");
16
+ var _reactRouter = require("react-router");
17
+ var _TargetGroupForm = require("../TargetGroupForm");
18
+ var _AddContactsGridSelect = require("./AddContactsGridSelect.gql");
19
+ var _AddContactsGridSelectGql = require("./AddContactsGridSelect.gql.generated");
20
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
21
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
22
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
23
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
24
+ 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); }); }; }
25
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
26
+ 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; }
27
+ 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; }
28
+ 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; }
29
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
30
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
31
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
32
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
33
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
34
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
35
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
36
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
37
+ var AssignedContactsGridToolbar = function AssignedContactsGridToolbar(_ref) {
38
+ var onOpenDialog = _ref.onOpenDialog;
39
+ var intl = (0, _reactIntl.useIntl)();
40
+ return /*#__PURE__*/React.createElement(_admin.Toolbar, null, /*#__PURE__*/React.createElement(_admin.ToolbarTitleItem, null, /*#__PURE__*/React.createElement(_reactIntl.FormattedMessage, {
41
+ id: "cometBrevoModule.targetGroup.assignedContacts.title",
42
+ defaultMessage: "Assigned contacts"
43
+ })), /*#__PURE__*/React.createElement(_admin.ToolbarItem, null, /*#__PURE__*/React.createElement(_xDataGrid.GridToolbarQuickFilter, {
44
+ placeholder: intl.formatMessage({
45
+ id: "cometBrevoModule.targetGroup.assignedContacts.searchEmail",
46
+ defaultMessage: "Search email address"
47
+ })
48
+ })), /*#__PURE__*/React.createElement(_admin.ToolbarFillSpace, null), /*#__PURE__*/React.createElement(_admin.ToolbarActions, null, /*#__PURE__*/React.createElement(_material.Button, {
49
+ startIcon: /*#__PURE__*/React.createElement(_adminIcons.Add, null),
50
+ variant: "contained",
51
+ color: "primary",
52
+ onClick: onOpenDialog
53
+ }, /*#__PURE__*/React.createElement(_reactIntl.FormattedMessage, {
54
+ id: "cometBrevoModule.targetGroup.assignedContacts.addContact",
55
+ defaultMessage: "Add contacts"
56
+ }))));
57
+ };
58
+ var AssignableContactsGridToolbar = function AssignableContactsGridToolbar() {
59
+ var intl = (0, _reactIntl.useIntl)();
60
+ return /*#__PURE__*/React.createElement(_admin.Toolbar, null, /*#__PURE__*/React.createElement(_admin.ToolbarTitleItem, null, /*#__PURE__*/React.createElement(_reactIntl.FormattedMessage, {
61
+ id: "cometBrevoModule.targetGroup.assignableContacts.title",
62
+ defaultMessage: "Assignable contacts"
63
+ })), /*#__PURE__*/React.createElement(_admin.ToolbarItem, null, /*#__PURE__*/React.createElement(_xDataGrid.GridToolbarQuickFilter, {
64
+ placeholder: intl.formatMessage({
65
+ id: "cometBrevoModule.targetGroup.assignableContacts.searchEmail",
66
+ defaultMessage: "Search email address"
67
+ })
68
+ })));
69
+ };
70
+ var useSubmitMutation = function useSubmitMutation(id) {
71
+ var _useMutation = (0, _client.useMutation)(_AddContactsGridSelect.addBrevoContactsToTargetGroupMutation, {
72
+ refetchQueries: [_AddContactsGridSelectGql.namedOperations.Query.ManuallyAssignedBrevoContactsGrid, _TargetGroupForm.targetGroupFormNamedOperations.Query.TargetGroupForm]
73
+ }),
74
+ _useMutation2 = _slicedToArray(_useMutation, 1),
75
+ addContactsToTargetGroup = _useMutation2[0];
76
+ return function (_ref2) {
77
+ var brevoContactIds = _ref2.brevoContactIds;
78
+ return addContactsToTargetGroup({
79
+ variables: {
80
+ id: id,
81
+ input: {
82
+ brevoContactIds: brevoContactIds
83
+ }
84
+ }
85
+ });
86
+ };
87
+ };
88
+ function AddContactsGridSelect(_ref3) {
89
+ var _dataGridAssignableCo, _dataGridAssignableCo2, _dataGridAssignedCont, _dataGridAssignedCont2, _assignedContactsData;
90
+ var id = _ref3.id,
91
+ scope = _ref3.scope,
92
+ assignedContactsTargetGroupBrevoId = _ref3.assignedContactsTargetGroupBrevoId;
93
+ var intl = (0, _reactIntl.useIntl)();
94
+ var submit = useSubmitMutation(id);
95
+ var theme = (0, _material.useTheme)();
96
+ var dataGridAssignedContactsProps = _objectSpread(_objectSpread({}, (0, _admin.useDataGridRemote)()), (0, _admin.usePersistentColumnState)("TargetGroupAssignedBrevoContactsGrid"));
97
+ var dataGridAssignableContactsProps = _objectSpread(_objectSpread({}, (0, _admin.useDataGridRemote)()), (0, _admin.usePersistentColumnState)("TargetGroupAssignableBrevoContactsGrid"));
98
+ var _React$useState = React.useState(false),
99
+ _React$useState2 = _slicedToArray(_React$useState, 2),
100
+ isDialogOpen = _React$useState2[0],
101
+ setIsDialogOpen = _React$useState2[1];
102
+ var _useMutation3 = (0, _client.useMutation)(_AddContactsGridSelect.removeBrevoContactFromTargetGroupMutation, {
103
+ refetchQueries: [_AddContactsGridSelectGql.namedOperations.Query.ManuallyAssignedBrevoContactsGrid],
104
+ awaitRefetchQueries: true
105
+ }),
106
+ _useMutation4 = _slicedToArray(_useMutation3, 2),
107
+ removeContacts = _useMutation4[0],
108
+ removeLoading = _useMutation4[1].loading;
109
+ var onDeleteClick = function onDeleteClick(contactId) {
110
+ if (!id) return;
111
+ removeContacts({
112
+ variables: {
113
+ id: id,
114
+ input: {
115
+ brevoContactId: contactId
116
+ }
117
+ }
118
+ });
119
+ };
120
+ var _useQuery = (0, _client.useQuery)(_AddContactsGridSelect.allBrevoContactsQuery, {
121
+ variables: {
122
+ offset: dataGridAssignableContactsProps.page * dataGridAssignableContactsProps.pageSize,
123
+ limit: dataGridAssignableContactsProps.pageSize,
124
+ email: (_dataGridAssignableCo = dataGridAssignableContactsProps.filterModel) !== null && _dataGridAssignableCo !== void 0 && _dataGridAssignableCo.quickFilterValues ? (_dataGridAssignableCo2 = dataGridAssignableContactsProps.filterModel) === null || _dataGridAssignableCo2 === void 0 ? void 0 : _dataGridAssignableCo2.quickFilterValues[0] : undefined,
125
+ scope: scope
126
+ }
127
+ }),
128
+ assignableContactsData = _useQuery.data,
129
+ assignableContactsLoading = _useQuery.loading,
130
+ assignableContactsError = _useQuery.error;
131
+ var _useQuery2 = (0, _client.useQuery)(_AddContactsGridSelect.manuallyAssignedBrevoContactsGridQuery, {
132
+ variables: {
133
+ offset: dataGridAssignedContactsProps.page * dataGridAssignedContactsProps.pageSize,
134
+ limit: dataGridAssignedContactsProps.pageSize,
135
+ email: (_dataGridAssignedCont = dataGridAssignedContactsProps.filterModel) !== null && _dataGridAssignedCont !== void 0 && _dataGridAssignedCont.quickFilterValues ? (_dataGridAssignedCont2 = dataGridAssignedContactsProps.filterModel) === null || _dataGridAssignedCont2 === void 0 ? void 0 : _dataGridAssignedCont2.quickFilterValues[0] : undefined,
136
+ targetGroupId: id
137
+ },
138
+ skip: !assignedContactsTargetGroupBrevoId
139
+ }),
140
+ assignedContactsData = _useQuery2.data,
141
+ assignedContactsLoading = _useQuery2.loading,
142
+ assignedContactsError = _useQuery2.error;
143
+ var assignableContactsColumns = [{
144
+ field: "createdAt",
145
+ headerName: intl.formatMessage({
146
+ id: "cometBrevoModule.brevoContact.subscribedAt",
147
+ defaultMessage: "Subscribed At"
148
+ }),
149
+ filterable: false,
150
+ sortable: false,
151
+ width: 150,
152
+ renderCell: function renderCell(_ref4) {
153
+ var row = _ref4.row;
154
+ return intl.formatDate(new Date(row.createdAt));
155
+ }
156
+ }, {
157
+ field: "modifiedAt",
158
+ headerName: intl.formatMessage({
159
+ id: "cometBrevoModule.brevoContact.modifiedAt",
160
+ defaultMessage: "Modified At"
161
+ }),
162
+ filterable: false,
163
+ sortable: false,
164
+ width: 150,
165
+ renderCell: function renderCell(_ref5) {
166
+ var row = _ref5.row;
167
+ return intl.formatDate(new Date(row.modifiedAt));
168
+ }
169
+ }, {
170
+ field: "email",
171
+ headerName: intl.formatMessage({
172
+ id: "cometBrevoModule.brevoContact.email",
173
+ defaultMessage: "Email"
174
+ }),
175
+ filterable: false,
176
+ sortable: false,
177
+ width: 150,
178
+ flex: 1
179
+ }, {
180
+ field: "emailBlacklisted",
181
+ headerName: intl.formatMessage({
182
+ id: "cometBrevoModule.brevoContact.emailBlocked",
183
+ defaultMessage: "Email blocked"
184
+ }),
185
+ type: "boolean",
186
+ filterable: false,
187
+ sortable: false,
188
+ width: 150
189
+ }];
190
+ var assignedContactsColumns = assignableContactsColumns.concat([{
191
+ field: "actions",
192
+ width: 50,
193
+ disableColumnMenu: true,
194
+ resizable: false,
195
+ filterable: false,
196
+ sortable: false,
197
+ renderHeader: function renderHeader() {
198
+ return null;
199
+ },
200
+ renderCell: function renderCell(_ref6) {
201
+ var id = _ref6.id;
202
+ return /*#__PURE__*/React.createElement(_material.IconButton, {
203
+ onClick: function onClick() {
204
+ return onDeleteClick(Number(id));
205
+ },
206
+ disabled: removeLoading
207
+ }, /*#__PURE__*/React.createElement(_adminIcons.Remove, null));
208
+ }
209
+ }]);
210
+ var assignedContactsRowCount = (0, _admin.useBufferedRowCount)(assignedContactsData === null || assignedContactsData === void 0 ? void 0 : assignedContactsData.manuallyAssignedBrevoContacts.totalCount);
211
+ var assignableContactsRowCount = (0, _admin.useBufferedRowCount)(assignableContactsData === null || assignableContactsData === void 0 ? void 0 : assignableContactsData.brevoContacts.totalCount);
212
+ if (assignedContactsError || assignableContactsError) throw assignedContactsError !== null && assignedContactsError !== void 0 ? assignedContactsError : assignableContactsError;
213
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_xDataGrid.DataGrid, _extends({}, dataGridAssignedContactsProps, {
214
+ disableSelectionOnClick: true,
215
+ rows: (_assignedContactsData = assignedContactsData === null || assignedContactsData === void 0 ? void 0 : assignedContactsData.manuallyAssignedBrevoContacts.nodes) !== null && _assignedContactsData !== void 0 ? _assignedContactsData : [],
216
+ rowCount: assignedContactsRowCount,
217
+ columns: assignedContactsColumns,
218
+ autoHeight: true,
219
+ loading: assignedContactsLoading,
220
+ components: {
221
+ Toolbar: AssignedContactsGridToolbar
222
+ },
223
+ componentsProps: {
224
+ toolbar: {
225
+ onOpenDialog: function onOpenDialog() {
226
+ return setIsDialogOpen(true);
227
+ }
228
+ }
229
+ }
230
+ })), /*#__PURE__*/React.createElement(_admin.FinalForm, {
231
+ mode: "edit",
232
+ onSubmit: submit
233
+ }, function (_ref7) {
234
+ var handleSubmit = _ref7.handleSubmit,
235
+ submitting = _ref7.submitting;
236
+ return /*#__PURE__*/React.createElement(_reactRouter.MemoryRouter, null, /*#__PURE__*/React.createElement(_material.Dialog, {
237
+ open: isDialogOpen,
238
+ maxWidth: "lg",
239
+ onClose: function onClose() {
240
+ return setIsDialogOpen(false);
241
+ }
242
+ }, /*#__PURE__*/React.createElement(_material.DialogTitle, {
243
+ display: "flex",
244
+ flexDirection: "row",
245
+ alignItems: "center",
246
+ justifyContent: "space-between"
247
+ }, /*#__PURE__*/React.createElement(_admin.ToolbarFillSpace, null), /*#__PURE__*/React.createElement(_material.IconButton, {
248
+ onClick: function onClick() {
249
+ return setIsDialogOpen(false);
250
+ }
251
+ }, /*#__PURE__*/React.createElement(_adminIcons.Close, {
252
+ htmlColor: theme.palette.common.white
253
+ }))), /*#__PURE__*/React.createElement(_system.Box, null, /*#__PURE__*/React.createElement(_admin.Field, {
254
+ name: "brevoContactIds",
255
+ fullWidth: true
256
+ }, function (props) {
257
+ var _assignableContactsDa;
258
+ return /*#__PURE__*/React.createElement(_xDataGrid.DataGrid, _extends({}, dataGridAssignableContactsProps, {
259
+ rows: (_assignableContactsDa = assignableContactsData === null || assignableContactsData === void 0 ? void 0 : assignableContactsData.brevoContacts.nodes) !== null && _assignableContactsDa !== void 0 ? _assignableContactsDa : [],
260
+ rowCount: assignableContactsRowCount,
261
+ columns: assignableContactsColumns,
262
+ autoHeight: true,
263
+ loading: assignableContactsLoading || submitting,
264
+ components: {
265
+ Toolbar: AssignableContactsGridToolbar
266
+ },
267
+ selectionModel: props.value,
268
+ onSelectionModelChange: function onSelectionModelChange(newSelectionModel) {
269
+ props.input.onChange(newSelectionModel);
270
+ },
271
+ checkboxSelection: true,
272
+ keepNonExistentRowsSelected: true
273
+ }));
274
+ })), /*#__PURE__*/React.createElement(_material.DialogActions, null, /*#__PURE__*/React.createElement(_admin.CancelButton, {
275
+ onClick: function onClick() {
276
+ return setIsDialogOpen(false);
277
+ }
278
+ }), /*#__PURE__*/React.createElement(_material.Button, {
279
+ startIcon: /*#__PURE__*/React.createElement(_adminIcons.Save, null),
280
+ onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
281
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
282
+ while (1) switch (_context.prev = _context.next) {
283
+ case 0:
284
+ _context.next = 2;
285
+ return handleSubmit();
286
+ case 2:
287
+ setIsDialogOpen(false);
288
+ case 3:
289
+ case "end":
290
+ return _context.stop();
291
+ }
292
+ }, _callee);
293
+ })),
294
+ variant: "contained",
295
+ color: "primary"
296
+ }, /*#__PURE__*/React.createElement(_reactIntl.FormattedMessage, {
297
+ id: "cometBrevoModule.targetGroup.addBrevoContacts.dialog.save",
298
+ defaultMessage: "Save"
299
+ })))));
300
+ }));
301
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@comet/brevo-admin",
3
- "version": "2.0.0-canary-20240618072535",
3
+ "version": "2.0.0-canary-20240711123618",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/vivid-planet/comet-brevo-module/",
@@ -1,8 +0,0 @@
1
- import { ContentScopeInterface } from "@comet/cms-admin";
2
- import React from "react";
3
- interface FormProps {
4
- scope: ContentScopeInterface;
5
- }
6
- export declare function BrevoConfigForm({ scope }: FormProps): React.ReactElement;
7
- export {};
8
- //# sourceMappingURL=BrevoConfigForm.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BrevoConfigForm.d.ts","sourceRoot":"","sources":["../../src/brevoConfiguration/BrevoConfigForm.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAE,qBAAqB,EAA+D,MAAM,kBAAkB,CAAC;AAEtH,OAAO,KAAK,MAAM,OAAO,CAAC;AAuB1B,UAAU,SAAS;IACf,KAAK,EAAE,qBAAqB,CAAC;CAChC;AAED,wBAAgB,eAAe,CAAC,EAAE,KAAK,EAAE,EAAE,SAAS,GAAG,KAAK,CAAC,YAAY,CAwIxE"}
@@ -1,12 +0,0 @@
1
- import * as Types from '../graphql.generated';
2
- export type GQLUnnamed_1_QueryVariables = Types.Exact<{
3
- scope: Types.GQLEmailCampaignContentScopeInput;
4
- }>;
5
- export type GQLUnnamed_1_Query = {
6
- __typename?: 'Query';
7
- brevoConfig: {
8
- __typename?: 'BrevoConfig';
9
- updatedAt: any;
10
- } | null;
11
- };
12
- //# sourceMappingURL=BrevoConfigForm.generated.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BrevoConfigForm.generated.d.ts","sourceRoot":"","sources":["../../src/brevoConfiguration/BrevoConfigForm.generated.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,sBAAsB,CAAC;AAE9C,MAAM,MAAM,2BAA2B,GAAG,KAAK,CAAC,KAAK,CAAC;IACpD,KAAK,EAAE,KAAK,CAAC,iCAAiC,CAAC;CAChD,CAAC,CAAC;AAGH,MAAM,MAAM,kBAAkB,GAAG;IAAE,UAAU,CAAC,EAAE,OAAO,CAAC;IAAC,WAAW,EAAE;QAAE,UAAU,CAAC,EAAE,aAAa,CAAC;QAAC,SAAS,EAAE,GAAG,CAAA;KAAE,GAAG,IAAI,CAAA;CAAE,CAAC"}
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
@@ -1,7 +0,0 @@
1
- export declare const brevoConfigFormFragment: import("@apollo/client").DocumentNode;
2
- export declare const brevoConfigFormQuery: import("@apollo/client").DocumentNode;
3
- export declare const brevoConfigFormCheckForChangesQuery: import("@apollo/client").DocumentNode;
4
- export declare const createBrevoConfigMutation: import("@apollo/client").DocumentNode;
5
- export declare const updateBrevoConfigMutation: import("@apollo/client").DocumentNode;
6
- export declare const sendersSelectQuery: import("@apollo/client").DocumentNode;
7
- //# sourceMappingURL=BrevoConfigForm.gql.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BrevoConfigForm.gql.d.ts","sourceRoot":"","sources":["../../src/brevoConfiguration/BrevoConfigForm.gql.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,uBAAuB,uCAKnC,CAAC;AAEF,eAAO,MAAM,oBAAoB,uCAShC,CAAC;AAEF,eAAO,MAAM,mCAAmC,uCAM/C,CAAC;AAEF,eAAO,MAAM,yBAAyB,uCASrC,CAAC;AAEF,eAAO,MAAM,yBAAyB,uCASrC,CAAC;AAEF,eAAO,MAAM,kBAAkB,uCAQ9B,CAAC"}