@carlonicora/nextjs-jsonapi 6.32.1 → 6.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{BlockNoteEditor-XIEMUQCO.mjs → BlockNoteEditor-DCVT7YHE.mjs} +4 -4
- package/dist/{BlockNoteEditor-RD3JNEV5.js → BlockNoteEditor-ZVK5MD34.js} +24 -24
- package/dist/{BlockNoteEditor-RD3JNEV5.js.map → BlockNoteEditor-ZVK5MD34.js.map} +1 -1
- package/dist/{BlockNoteViewer-RQBYHBQL.js → BlockNoteViewer-2KPGZSTJ.js} +3 -3
- package/dist/{BlockNoteViewer-RQBYHBQL.js.map → BlockNoteViewer-2KPGZSTJ.js.map} +1 -1
- package/dist/{BlockNoteViewer-NVSR67X5.mjs → BlockNoteViewer-XDAC6AL7.mjs} +2 -2
- package/dist/billing/index.js +477 -469
- package/dist/billing/index.js.map +1 -1
- package/dist/billing/index.mjs +15 -7
- package/dist/billing/index.mjs.map +1 -1
- package/dist/{chunk-5H25LM2Z.js → chunk-576XHOYH.js} +5 -5
- package/dist/{chunk-5H25LM2Z.js.map → chunk-576XHOYH.js.map} +1 -1
- package/dist/{chunk-NPGX2GJD.js → chunk-CI64OTRX.js} +98 -75
- package/dist/chunk-CI64OTRX.js.map +1 -0
- package/dist/{chunk-AEBZ67JJ.mjs → chunk-ETU3AW2X.mjs} +2 -2
- package/dist/{chunk-4JVLLBRS.mjs → chunk-GUNH3THR.mjs} +24 -1
- package/dist/chunk-GUNH3THR.mjs.map +1 -0
- package/dist/{chunk-SQNFYMYE.js → chunk-KH4Y4FU4.js} +1532 -1288
- package/dist/chunk-KH4Y4FU4.js.map +1 -0
- package/dist/{chunk-PNCO3HMJ.js → chunk-TCAOU6NH.js} +3 -3
- package/dist/{chunk-PNCO3HMJ.js.map → chunk-TCAOU6NH.js.map} +1 -1
- package/dist/{chunk-F25BVBEH.mjs → chunk-V4NPMUZ2.mjs} +2663 -2419
- package/dist/chunk-V4NPMUZ2.mjs.map +1 -0
- package/dist/{chunk-AMQFKCAX.mjs → chunk-WPFEPIKP.mjs} +2 -2
- package/dist/client/index.js +6 -4
- package/dist/client/index.js.map +1 -1
- package/dist/client/index.mjs +5 -3
- package/dist/components/index.js +12 -4
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +11 -3
- package/dist/components/tables/ContentListTable.d.ts +14 -0
- package/dist/components/tables/ContentListTable.d.ts.map +1 -1
- package/dist/components/tables/SortableHeader.d.ts +17 -0
- package/dist/components/tables/SortableHeader.d.ts.map +1 -0
- package/dist/components/tables/cells/cell.date.d.ts +4 -0
- package/dist/components/tables/cells/cell.date.d.ts.map +1 -1
- package/dist/components/tables/cells/cell.dateTime.d.ts +4 -0
- package/dist/components/tables/cells/cell.dateTime.d.ts.map +1 -1
- package/dist/components/tables/cells/cell.link.d.ts +4 -0
- package/dist/components/tables/cells/cell.link.d.ts.map +1 -1
- package/dist/components/tables/cells/cell.text.d.ts +4 -0
- package/dist/components/tables/cells/cell.text.d.ts.map +1 -1
- package/dist/components/tables/index.d.ts +2 -0
- package/dist/components/tables/index.d.ts.map +1 -1
- package/dist/components/tables/sorting.d.ts +24 -0
- package/dist/components/tables/sorting.d.ts.map +1 -0
- package/dist/contexts/index.js +4 -4
- package/dist/contexts/index.mjs +3 -3
- package/dist/core/index.js +2 -2
- package/dist/core/index.mjs +1 -1
- package/dist/email-automations/index.js +120 -115
- package/dist/email-automations/index.js.map +1 -1
- package/dist/email-automations/index.mjs +18 -13
- package/dist/email-automations/index.mjs.map +1 -1
- package/dist/features/analytics/index.js +114 -114
- package/dist/features/analytics/index.mjs +3 -3
- package/dist/features/analytics/server.js +4 -4
- package/dist/features/analytics/server.mjs +2 -2
- package/dist/features/billing/stripe-coupon/components/lists/CouponCodesList.d.ts.map +1 -1
- package/dist/features/billing/stripe-coupon/components/lists/CouponsList.d.ts.map +1 -1
- package/dist/features/billing/stripe-coupon/data/stripe-coupon-code.service.d.ts +2 -0
- package/dist/features/billing/stripe-coupon/data/stripe-coupon-code.service.d.ts.map +1 -1
- package/dist/features/billing/stripe-coupon/data/stripe-coupon.service.d.ts +1 -0
- package/dist/features/billing/stripe-coupon/data/stripe-coupon.service.d.ts.map +1 -1
- package/dist/features/billing/stripe-coupon/hooks/useStripeCouponCodeTableStructure.d.ts.map +1 -1
- package/dist/features/billing/stripe-coupon/hooks/useStripeCouponTableStructure.d.ts.map +1 -1
- package/dist/features/billing/stripe-price/components/lists/PricesList.d.ts.map +1 -1
- package/dist/features/billing/stripe-price/data/stripe-price.service.d.ts +2 -0
- package/dist/features/billing/stripe-price/data/stripe-price.service.d.ts.map +1 -1
- package/dist/features/billing/stripe-price/hooks/useStripePriceTableStructure.d.ts.map +1 -1
- package/dist/features/billing/stripe-product/components/lists/ProductsList.d.ts.map +1 -1
- package/dist/features/billing/stripe-product/data/stripe-product.service.d.ts +2 -0
- package/dist/features/billing/stripe-product/data/stripe-product.service.d.ts.map +1 -1
- package/dist/features/billing/stripe-product/hooks/useStripeProductTableStructure.d.ts.map +1 -1
- package/dist/features/blog/components/admin/BlogPostsList.d.ts.map +1 -1
- package/dist/features/blog/data/BlogPostService.d.ts +1 -0
- package/dist/features/blog/data/BlogPostService.d.ts.map +1 -1
- package/dist/features/blog/index.js +134 -132
- package/dist/features/blog/index.js.map +1 -1
- package/dist/features/blog/index.mjs +8 -6
- package/dist/features/blog/index.mjs.map +1 -1
- package/dist/features/blog/server.js +7 -7
- package/dist/features/blog/server.mjs +1 -1
- package/dist/features/company/components/lists/CompaniesList.d.ts.map +1 -1
- package/dist/features/company/data/company.service.d.ts +1 -0
- package/dist/features/company/data/company.service.d.ts.map +1 -1
- package/dist/features/content/data/content.service.d.ts +3 -0
- package/dist/features/content/data/content.service.d.ts.map +1 -1
- package/dist/features/email-automation/components/lists/EmailAutomationRecipientsList.d.ts.map +1 -1
- package/dist/features/email-automation/components/lists/EmailAutomationsList.d.ts.map +1 -1
- package/dist/features/email-automation/data/EmailAutomationService.d.ts +3 -0
- package/dist/features/email-automation/data/EmailAutomationService.d.ts.map +1 -1
- package/dist/features/email-automation/hooks/useEmailAutomationTableStructure.d.ts.map +1 -1
- package/dist/features/email-blast/components/lists/EmailBlastsList.d.ts.map +1 -1
- package/dist/features/email-blast/data/EmailBlastService.d.ts +1 -0
- package/dist/features/email-blast/data/EmailBlastService.d.ts.map +1 -1
- package/dist/features/email-blast/hooks/useEmailBlastTableStructure.d.ts.map +1 -1
- package/dist/features/help/index.js +37 -37
- package/dist/features/help/index.mjs +3 -3
- package/dist/features/how-to/components/lists/HowToList.d.ts.map +1 -1
- package/dist/features/how-to/data/HowToService.d.ts +2 -0
- package/dist/features/how-to/data/HowToService.d.ts.map +1 -1
- package/dist/features/notification/components/lists/NotificationsList.d.ts.map +1 -1
- package/dist/features/notification/data/notification.service.d.ts +2 -0
- package/dist/features/notification/data/notification.service.d.ts.map +1 -1
- package/dist/features/referral/components/containers/ReferralsAdminContainer.d.ts.map +1 -1
- package/dist/features/referral/data/ReferralAdminService.d.ts +1 -0
- package/dist/features/referral/data/ReferralAdminService.d.ts.map +1 -1
- package/dist/features/referral/hooks/useReferralAdminReferralTableStructure.d.ts.map +1 -1
- package/dist/features/role/components/lists/RolesList.d.ts.map +1 -1
- package/dist/features/role/components/lists/UserRolesList.d.ts.map +1 -1
- package/dist/features/role/data/role.service.d.ts +3 -0
- package/dist/features/role/data/role.service.d.ts.map +1 -1
- package/dist/features/tokenusage/index.js +114 -114
- package/dist/features/tokenusage/index.mjs +3 -3
- package/dist/features/user/components/lists/AdminUsersList.d.ts.map +1 -1
- package/dist/features/user/components/lists/CompanyUsersList.d.ts.map +1 -1
- package/dist/features/user/components/lists/PlatformUsersList.d.ts.map +1 -1
- package/dist/features/user/components/lists/RoleUsersList.d.ts.map +1 -1
- package/dist/features/user/components/lists/UsersListByContentIds.d.ts.map +1 -1
- package/dist/features/user/data/user.service.d.ts +11 -0
- package/dist/features/user/data/user.service.d.ts.map +1 -1
- package/dist/features/waitlist/components/lists/WaitlistList.d.ts.map +1 -1
- package/dist/features/waitlist/data/WaitlistService.d.ts +2 -0
- package/dist/features/waitlist/data/WaitlistService.d.ts.map +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/useDataListRetriever.d.ts +13 -0
- package/dist/hooks/useDataListRetriever.d.ts.map +1 -1
- package/dist/hooks/useListSortParam.d.ts +23 -0
- package/dist/hooks/useListSortParam.d.ts.map +1 -0
- package/dist/index.js +3 -3
- package/dist/index.mjs +2 -2
- package/dist/server/index.js +3 -3
- package/dist/server/index.mjs +2 -2
- package/dist/shadcnui/ui/calendar.d.ts +1 -1
- package/dist/shadcnui/ui/calendar.d.ts.map +1 -1
- package/messages/en.json +11 -0
- package/messages/it.json +11 -0
- package/package.json +1 -1
- package/src/components/tables/ContentListTable.tsx +108 -10
- package/src/components/tables/SortableHeader.tsx +43 -0
- package/src/components/tables/__tests__/ContentListTable.rendering.spec.tsx +1 -0
- package/src/components/tables/__tests__/ContentListTable.sort.spec.tsx +273 -0
- package/src/components/tables/__tests__/sorting.spec.ts +61 -0
- package/src/components/tables/cells/cell.date.tsx +10 -2
- package/src/components/tables/cells/cell.dateTime.tsx +10 -2
- package/src/components/tables/cells/cell.link.tsx +6 -1
- package/src/components/tables/cells/cell.text.tsx +11 -2
- package/src/components/tables/index.ts +2 -0
- package/src/components/tables/sorting.ts +41 -0
- package/src/features/billing/stripe-coupon/components/lists/CouponCodesList.tsx +2 -0
- package/src/features/billing/stripe-coupon/components/lists/CouponsList.tsx +2 -0
- package/src/features/billing/stripe-coupon/data/stripe-coupon-code.service.ts +4 -0
- package/src/features/billing/stripe-coupon/data/stripe-coupon.service.ts +7 -1
- package/src/features/billing/stripe-coupon/hooks/__tests__/useStripeCouponCodeTableStructure.sort.spec.tsx +30 -0
- package/src/features/billing/stripe-coupon/hooks/__tests__/useStripeCouponTableStructure.sort.spec.tsx +33 -0
- package/src/features/billing/stripe-coupon/hooks/useStripeCouponCodeTableStructure.tsx +5 -4
- package/src/features/billing/stripe-coupon/hooks/useStripeCouponTableStructure.tsx +7 -4
- package/src/features/billing/stripe-price/components/lists/PricesList.tsx +2 -0
- package/src/features/billing/stripe-price/data/stripe-price.service.ts +4 -0
- package/src/features/billing/stripe-price/hooks/__tests__/useStripePriceTableStructure.sort.spec.tsx +29 -0
- package/src/features/billing/stripe-price/hooks/useStripePriceTableStructure.tsx +8 -5
- package/src/features/billing/stripe-product/components/lists/ProductsList.tsx +2 -0
- package/src/features/billing/stripe-product/data/stripe-product.service.ts +4 -0
- package/src/features/billing/stripe-product/hooks/__tests__/useStripeProductTableStructure.sort.spec.tsx +29 -0
- package/src/features/billing/stripe-product/hooks/useStripeProductTableStructure.tsx +3 -2
- package/src/features/blog/components/admin/BlogPostsList.tsx +2 -0
- package/src/features/blog/data/BlogPostService.ts +3 -1
- package/src/features/blog/hooks/__tests__/useBlogPostTableStructure.sort.spec.tsx +19 -0
- package/src/features/blog/hooks/useBlogPostTableStructure.tsx +2 -2
- package/src/features/company/components/lists/CompaniesList.tsx +2 -0
- package/src/features/company/data/company.service.ts +3 -1
- package/src/features/company/hooks/__tests__/useCompanyTableStructure.sort.spec.tsx +19 -0
- package/src/features/company/hooks/useCompanyTableStructure.tsx +1 -1
- package/src/features/content/data/content.service.ts +12 -1
- package/src/features/content/hooks/__tests__/useContentTableStructure.sort.spec.tsx +21 -0
- package/src/features/content/hooks/useContentTableStructure.tsx +1 -1
- package/src/features/email-automation/components/lists/EmailAutomationRecipientsList.tsx +2 -0
- package/src/features/email-automation/components/lists/EmailAutomationsList.tsx +2 -0
- package/src/features/email-automation/data/EmailAutomationService.ts +9 -1
- package/src/features/email-automation/hooks/__tests__/useEmailAutomationEnrollmentTableStructure.sort.spec.tsx +21 -0
- package/src/features/email-automation/hooks/__tests__/useEmailAutomationTableStructure.sort.spec.tsx +29 -0
- package/src/features/email-automation/hooks/useEmailAutomationEnrollmentTableStructure.tsx +4 -4
- package/src/features/email-automation/hooks/useEmailAutomationTableStructure.tsx +5 -4
- package/src/features/email-blast/components/lists/EmailBlastsList.tsx +2 -0
- package/src/features/email-blast/data/EmailBlastService.ts +5 -1
- package/src/features/email-blast/hooks/__tests__/useEmailBlastTableStructure.sort.spec.tsx +29 -0
- package/src/features/email-blast/hooks/useEmailBlastTableStructure.tsx +16 -8
- package/src/features/how-to/components/lists/HowToList.tsx +2 -0
- package/src/features/how-to/data/HowToService.ts +4 -0
- package/src/features/how-to/hooks/__tests__/useHowToTableStructure.sort.spec.tsx +18 -0
- package/src/features/how-to/hooks/useHowToTableStructure.tsx +1 -1
- package/src/features/notification/components/lists/NotificationsList.tsx +2 -0
- package/src/features/notification/data/notification.service.ts +4 -0
- package/src/features/notification/hooks/__tests__/useNotificationTableStructure.sort.spec.tsx +19 -0
- package/src/features/notification/hooks/useNotificationTableStructure.tsx +1 -1
- package/src/features/referral/components/containers/ReferralsAdminContainer.tsx +4 -2
- package/src/features/referral/data/ReferralAdminService.ts +6 -1
- package/src/features/referral/hooks/__tests__/useReferralAdminReferralTableStructure.sort.spec.tsx +35 -0
- package/src/features/referral/hooks/useReferralAdminReferralTableStructure.tsx +10 -5
- package/src/features/role/components/lists/RolesList.tsx +2 -0
- package/src/features/role/components/lists/UserRolesList.tsx +2 -0
- package/src/features/role/data/role.service.ts +7 -1
- package/src/features/role/hooks/__tests__/useRoleTableStructure.sort.spec.tsx +16 -0
- package/src/features/role/hooks/useRoleTableStructure.tsx +2 -2
- package/src/features/user/components/lists/AdminUsersList.tsx +2 -0
- package/src/features/user/components/lists/CompanyUsersList.tsx +4 -0
- package/src/features/user/components/lists/PlatformUsersList.tsx +2 -0
- package/src/features/user/components/lists/RoleUsersList.tsx +2 -0
- package/src/features/user/components/lists/UsersListByContentIds.tsx +2 -0
- package/src/features/user/data/user.service.ts +28 -1
- package/src/features/user/hooks/__tests__/useUserTableStructure.sort.spec.tsx +16 -0
- package/src/features/user/hooks/useUserTableStructure.tsx +2 -2
- package/src/features/waitlist/components/lists/WaitlistList.tsx +2 -0
- package/src/features/waitlist/data/WaitlistService.ts +4 -0
- package/src/features/waitlist/hooks/__tests__/useWaitlistTableStructure.sort.spec.tsx +17 -0
- package/src/features/waitlist/hooks/useWaitlistTableStructure.tsx +3 -3
- package/src/hooks/__tests__/useDataListRetriever.sort.spec.tsx +114 -0
- package/src/hooks/__tests__/useListSortParam.spec.tsx +91 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useDataListRetriever.ts +44 -4
- package/src/hooks/useListSortParam.ts +53 -0
- package/src/shadcnui/ui/__tests__/calendar.spec.tsx +222 -0
- package/src/shadcnui/ui/calendar.tsx +28 -1
- package/dist/chunk-4JVLLBRS.mjs.map +0 -1
- package/dist/chunk-F25BVBEH.mjs.map +0 -1
- package/dist/chunk-NPGX2GJD.js.map +0 -1
- package/dist/chunk-SQNFYMYE.js.map +0 -1
- /package/dist/{BlockNoteEditor-XIEMUQCO.mjs.map → BlockNoteEditor-DCVT7YHE.mjs.map} +0 -0
- /package/dist/{BlockNoteViewer-NVSR67X5.mjs.map → BlockNoteViewer-XDAC6AL7.mjs.map} +0 -0
- /package/dist/{chunk-AEBZ67JJ.mjs.map → chunk-ETU3AW2X.mjs.map} +0 -0
- /package/dist/{chunk-AMQFKCAX.mjs.map → chunk-WPFEPIKP.mjs.map} +0 -0
|
@@ -45,13 +45,13 @@
|
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
|
|
48
|
-
var
|
|
48
|
+
var _chunkKH4Y4FU4js = require('../chunk-KH4Y4FU4.js');
|
|
49
49
|
|
|
50
50
|
|
|
51
51
|
|
|
52
52
|
var _chunkSYMI4IDWjs = require('../chunk-SYMI4IDW.js');
|
|
53
53
|
require('../chunk-3EPNHTMH.js');
|
|
54
|
-
require('../chunk-
|
|
54
|
+
require('../chunk-TCAOU6NH.js');
|
|
55
55
|
require('../chunk-G4JR3SFV.js');
|
|
56
56
|
|
|
57
57
|
|
|
@@ -62,7 +62,7 @@ require('../chunk-G4JR3SFV.js');
|
|
|
62
62
|
|
|
63
63
|
|
|
64
64
|
|
|
65
|
-
var
|
|
65
|
+
var _chunkCI64OTRXjs = require('../chunk-CI64OTRX.js');
|
|
66
66
|
|
|
67
67
|
|
|
68
68
|
var _chunkHROKKUBQjs = require('../chunk-HROKKUBQ.js');
|
|
@@ -114,7 +114,7 @@ function EmailAutomationEditorInternal({
|
|
|
114
114
|
const [triggers, setTriggers] = _react.useState.call(void 0, []);
|
|
115
115
|
_react.useEffect.call(void 0, () => {
|
|
116
116
|
let active = true;
|
|
117
|
-
|
|
117
|
+
_chunkCI64OTRXjs.EmailAutomationService.findTriggers().then((list) => {
|
|
118
118
|
if (active) setTriggers(list);
|
|
119
119
|
}).catch(() => {
|
|
120
120
|
});
|
|
@@ -163,7 +163,7 @@ function EmailAutomationEditorInternal({
|
|
|
163
163
|
[t]
|
|
164
164
|
);
|
|
165
165
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
166
|
-
|
|
166
|
+
_chunkKH4Y4FU4js.EditorSheet,
|
|
167
167
|
{
|
|
168
168
|
form,
|
|
169
169
|
entityType: t("emailAutomations.admin.title"),
|
|
@@ -185,7 +185,7 @@ function EmailAutomationEditorInternal({
|
|
|
185
185
|
isActive: values.isActive,
|
|
186
186
|
purpose: values.purpose
|
|
187
187
|
};
|
|
188
|
-
return isEdit ? await
|
|
188
|
+
return isEdit ? await _chunkCI64OTRXjs.EmailAutomationService.update(payload) : await _chunkCI64OTRXjs.EmailAutomationService.create(payload);
|
|
189
189
|
},
|
|
190
190
|
onReset: getDefaultValues,
|
|
191
191
|
trigger,
|
|
@@ -194,9 +194,9 @@ function EmailAutomationEditorInternal({
|
|
|
194
194
|
dialogOpen,
|
|
195
195
|
onDialogOpenChange,
|
|
196
196
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
197
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
197
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.FormInput, { form, id: "name", name: t("emailAutomations.fields.name.label"), isRequired: true }),
|
|
198
198
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
199
|
-
|
|
199
|
+
_chunkKH4Y4FU4js.FormSelect,
|
|
200
200
|
{
|
|
201
201
|
form,
|
|
202
202
|
id: "purpose",
|
|
@@ -208,7 +208,7 @@ function EmailAutomationEditorInternal({
|
|
|
208
208
|
}
|
|
209
209
|
),
|
|
210
210
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
211
|
-
|
|
211
|
+
_chunkKH4Y4FU4js.FormSelect,
|
|
212
212
|
{
|
|
213
213
|
form,
|
|
214
214
|
id: "trigger",
|
|
@@ -219,7 +219,7 @@ function EmailAutomationEditorInternal({
|
|
|
219
219
|
}
|
|
220
220
|
),
|
|
221
221
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
222
|
-
|
|
222
|
+
_chunkKH4Y4FU4js.FormSelect,
|
|
223
223
|
{
|
|
224
224
|
form,
|
|
225
225
|
id: "exitTrigger",
|
|
@@ -229,9 +229,9 @@ function EmailAutomationEditorInternal({
|
|
|
229
229
|
allowEmpty: true
|
|
230
230
|
}
|
|
231
231
|
),
|
|
232
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
232
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.FormInput, { form, id: "replyTo", name: t("emailAutomations.fields.replyTo.label") }),
|
|
233
233
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
234
|
-
|
|
234
|
+
_chunkKH4Y4FU4js.FormSwitch,
|
|
235
235
|
{
|
|
236
236
|
form,
|
|
237
237
|
id: "isActive",
|
|
@@ -255,14 +255,16 @@ var EmailAutomationEditor_default = EmailAutomationEditor;
|
|
|
255
255
|
function EmailAutomationsList({ fullWidth } = {}) {
|
|
256
256
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
257
257
|
const [triggers, setTriggers] = _react.useState.call(void 0, []);
|
|
258
|
-
const data =
|
|
259
|
-
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) =>
|
|
258
|
+
const data = _chunkKH4Y4FU4js.useDataListRetriever.call(void 0, {
|
|
259
|
+
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkCI64OTRXjs.EmailAutomationService.findMany(params), "retriever"),
|
|
260
260
|
retrieverParams: {},
|
|
261
|
-
module: _chunkZ6T2575Ajs.Modules.EmailAutomation
|
|
261
|
+
module: _chunkZ6T2575Ajs.Modules.EmailAutomation,
|
|
262
|
+
// Display only (call C8): the server's own order when no sort is chosen.
|
|
263
|
+
defaultSort: "-updatedAt"
|
|
262
264
|
});
|
|
263
265
|
_react.useEffect.call(void 0, () => {
|
|
264
266
|
let active = true;
|
|
265
|
-
|
|
267
|
+
_chunkCI64OTRXjs.EmailAutomationService.findTriggers().then((list) => {
|
|
266
268
|
if (active) setTriggers(list);
|
|
267
269
|
}).catch(() => {
|
|
268
270
|
});
|
|
@@ -276,7 +278,7 @@ function EmailAutomationsList({ fullWidth } = {}) {
|
|
|
276
278
|
);
|
|
277
279
|
const functions = [/* @__PURE__ */ _jsxruntime.jsx.call(void 0, EmailAutomationEditor_default, {}, "create-email-automation")];
|
|
278
280
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
279
|
-
|
|
281
|
+
_chunkKH4Y4FU4js.ContentListTable,
|
|
280
282
|
{
|
|
281
283
|
data,
|
|
282
284
|
fields: [
|
|
@@ -294,7 +296,7 @@ function EmailAutomationsList({ fullWidth } = {}) {
|
|
|
294
296
|
fullWidth,
|
|
295
297
|
title: t("emailAutomations.admin.title"),
|
|
296
298
|
context: { triggerLabels },
|
|
297
|
-
emptyState: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
299
|
+
emptyState: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.EmptyState, { icon: _lucidereact.MailIcon, title: t("emailAutomations.admin.empty") })
|
|
298
300
|
}
|
|
299
301
|
);
|
|
300
302
|
}
|
|
@@ -305,7 +307,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, EmailAutomationsList, "EmailAutomationsList
|
|
|
305
307
|
function EmailAutomationsListContainer() {
|
|
306
308
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
307
309
|
const breadcrumbs = [{ name: t("emailAutomations.admin.title") }];
|
|
308
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
310
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.SharedProvider, { value: { breadcrumbs, title: { type: t("emailAutomations.admin.title") } }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.RoundPageContainer, { module: _chunkZ6T2575Ajs.Modules.EmailAutomation, fullWidth: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, EmailAutomationsList, { fullWidth: true }) }) });
|
|
309
311
|
}
|
|
310
312
|
_chunk7QVYU63Ejs.__name.call(void 0, EmailAutomationsListContainer, "EmailAutomationsListContainer");
|
|
311
313
|
|
|
@@ -324,8 +326,8 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
324
326
|
const [selectedStepId, setSelectedStepId] = _react.useState.call(void 0, null);
|
|
325
327
|
const reload = _react.useCallback.call(void 0, async () => {
|
|
326
328
|
const [loadedAutomation, loadedSteps] = await Promise.all([
|
|
327
|
-
|
|
328
|
-
|
|
329
|
+
_chunkCI64OTRXjs.EmailAutomationService.findOne({ id: automationId }),
|
|
330
|
+
_chunkCI64OTRXjs.EmailAutomationStepService.findByAutomation({ automationId })
|
|
329
331
|
]);
|
|
330
332
|
setAutomation(loadedAutomation);
|
|
331
333
|
setSteps(loadedSteps);
|
|
@@ -335,7 +337,7 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
335
337
|
}, [reload]);
|
|
336
338
|
_react.useEffect.call(void 0, () => {
|
|
337
339
|
let active = true;
|
|
338
|
-
|
|
340
|
+
_chunkCI64OTRXjs.EmailAutomationService.findTriggers().then((list) => {
|
|
339
341
|
if (active) setTriggers(list);
|
|
340
342
|
}).catch(() => {
|
|
341
343
|
});
|
|
@@ -346,7 +348,7 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
346
348
|
const select = _react.useCallback.call(void 0, (id) => setSelectedStepId(id), []);
|
|
347
349
|
const createStep = _react.useCallback.call(void 0,
|
|
348
350
|
async (input) => {
|
|
349
|
-
const saved = await
|
|
351
|
+
const saved = await _chunkCI64OTRXjs.EmailAutomationStepService.create({ ...input, id: _nullishCoalesce(input.id, () => ( _uuid.v4.call(void 0, ))), automationId });
|
|
350
352
|
await reload();
|
|
351
353
|
return saved;
|
|
352
354
|
},
|
|
@@ -354,7 +356,7 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
354
356
|
);
|
|
355
357
|
const updateStep = _react.useCallback.call(void 0,
|
|
356
358
|
async (input) => {
|
|
357
|
-
const saved = await
|
|
359
|
+
const saved = await _chunkCI64OTRXjs.EmailAutomationStepService.update({ ...input, automationId });
|
|
358
360
|
await reload();
|
|
359
361
|
return saved;
|
|
360
362
|
},
|
|
@@ -362,7 +364,7 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
362
364
|
);
|
|
363
365
|
const deleteStep = _react.useCallback.call(void 0,
|
|
364
366
|
async (id) => {
|
|
365
|
-
await
|
|
367
|
+
await _chunkCI64OTRXjs.EmailAutomationStepService.delete({ id });
|
|
366
368
|
if (selectedStepId === id) setSelectedStepId(null);
|
|
367
369
|
await reload();
|
|
368
370
|
},
|
|
@@ -370,8 +372,8 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
370
372
|
);
|
|
371
373
|
const setNext = _react.useCallback.call(void 0,
|
|
372
374
|
async (stepId, nextStepId) => {
|
|
373
|
-
if (nextStepId) await
|
|
374
|
-
else await
|
|
375
|
+
if (nextStepId) await _chunkCI64OTRXjs.EmailAutomationStepService.setNext({ stepId, nextStepId });
|
|
376
|
+
else await _chunkCI64OTRXjs.EmailAutomationStepService.clearNext({ stepId });
|
|
375
377
|
await reload();
|
|
376
378
|
},
|
|
377
379
|
[reload]
|
|
@@ -380,7 +382,7 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
380
382
|
async (stepId, x, y) => {
|
|
381
383
|
const step = steps.find((candidate) => candidate.id === stepId);
|
|
382
384
|
if (!step) return;
|
|
383
|
-
await
|
|
385
|
+
await _chunkCI64OTRXjs.EmailAutomationStepService.update({
|
|
384
386
|
id: step.id,
|
|
385
387
|
automationId,
|
|
386
388
|
subject: step.subject,
|
|
@@ -394,7 +396,7 @@ var EmailAutomationProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
394
396
|
[automationId, reload, steps]
|
|
395
397
|
);
|
|
396
398
|
const tidy = _react.useCallback.call(void 0, async () => {
|
|
397
|
-
await
|
|
399
|
+
await _chunkCI64OTRXjs.EmailAutomationService.tidy({ id: automationId });
|
|
398
400
|
await reload();
|
|
399
401
|
}, [automationId, reload]);
|
|
400
402
|
const value = _react.useMemo.call(void 0,
|
|
@@ -449,7 +451,7 @@ function EmailAutomationActiveSwitch() {
|
|
|
449
451
|
const toggle = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async (checked) => {
|
|
450
452
|
setSaving(true);
|
|
451
453
|
try {
|
|
452
|
-
await
|
|
454
|
+
await _chunkCI64OTRXjs.EmailAutomationService.update({
|
|
453
455
|
id: automation.id,
|
|
454
456
|
name: automation.name,
|
|
455
457
|
trigger: automation.trigger,
|
|
@@ -459,17 +461,17 @@ function EmailAutomationActiveSwitch() {
|
|
|
459
461
|
});
|
|
460
462
|
await reload();
|
|
461
463
|
} catch (error) {
|
|
462
|
-
|
|
464
|
+
_chunkKH4Y4FU4js.errorToast.call(void 0, { title: t("common.errors.error"), error });
|
|
463
465
|
} finally {
|
|
464
466
|
setSaving(false);
|
|
465
467
|
}
|
|
466
468
|
}, "toggle");
|
|
467
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
468
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
469
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
469
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkKH4Y4FU4js.Tooltip, { children: [
|
|
470
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkKH4Y4FU4js.TooltipTrigger, { render: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "label", { className: "flex items-center gap-x-2" }), children: [
|
|
471
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.Switch, { checked: automation.isActive, onCheckedChange: (checked) => void toggle(checked), disabled: saving }),
|
|
470
472
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-xs", children: t("emailAutomations.fields.isActive.label") })
|
|
471
473
|
] }),
|
|
472
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
474
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.TooltipContent, { className: "max-w-xs", children: t("emailAutomations.fields.isActive.help") })
|
|
473
475
|
] });
|
|
474
476
|
}
|
|
475
477
|
_chunk7QVYU63Ejs.__name.call(void 0, EmailAutomationActiveSwitch, "EmailAutomationActiveSwitch");
|
|
@@ -502,7 +504,7 @@ function CanvasToolbar({ onTidy }) {
|
|
|
502
504
|
const { zoomIn, zoomOut, fitView } = _react3.useReactFlow.call(void 0, );
|
|
503
505
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { "data-help": "canvas.toolbar", className: "absolute end-2 top-2 z-10 flex flex-col gap-1 max-md:top-14", children: [
|
|
504
506
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
505
|
-
|
|
507
|
+
_chunkKH4Y4FU4js.Button,
|
|
506
508
|
{
|
|
507
509
|
type: "button",
|
|
508
510
|
variant: "outline",
|
|
@@ -513,7 +515,7 @@ function CanvasToolbar({ onTidy }) {
|
|
|
513
515
|
}
|
|
514
516
|
),
|
|
515
517
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
516
|
-
|
|
518
|
+
_chunkKH4Y4FU4js.Button,
|
|
517
519
|
{
|
|
518
520
|
type: "button",
|
|
519
521
|
variant: "outline",
|
|
@@ -524,7 +526,7 @@ function CanvasToolbar({ onTidy }) {
|
|
|
524
526
|
}
|
|
525
527
|
),
|
|
526
528
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
527
|
-
|
|
529
|
+
_chunkKH4Y4FU4js.Button,
|
|
528
530
|
{
|
|
529
531
|
type: "button",
|
|
530
532
|
variant: "outline",
|
|
@@ -535,7 +537,7 @@ function CanvasToolbar({ onTidy }) {
|
|
|
535
537
|
}
|
|
536
538
|
),
|
|
537
539
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
538
|
-
|
|
540
|
+
_chunkKH4Y4FU4js.Button,
|
|
539
541
|
{
|
|
540
542
|
type: "button",
|
|
541
543
|
variant: "outline",
|
|
@@ -828,7 +830,7 @@ function EmailStepEditorInternal({
|
|
|
828
830
|
defaultValues: getDefaultValues()
|
|
829
831
|
});
|
|
830
832
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
831
|
-
|
|
833
|
+
_chunkKH4Y4FU4js.EditorSheet,
|
|
832
834
|
{
|
|
833
835
|
form,
|
|
834
836
|
entityType: t("emailAutomations.step.title"),
|
|
@@ -847,7 +849,7 @@ function EmailStepEditorInternal({
|
|
|
847
849
|
positionX: step ? step.positionX : _optionalChain([initialPosition, 'optionalAccess', _21 => _21.x]),
|
|
848
850
|
positionY: step ? step.positionY : _optionalChain([initialPosition, 'optionalAccess', _22 => _22.y])
|
|
849
851
|
};
|
|
850
|
-
return isEdit ? await
|
|
852
|
+
return isEdit ? await _chunkCI64OTRXjs.EmailAutomationStepService.update(payload) : await _chunkCI64OTRXjs.EmailAutomationStepService.create(payload);
|
|
851
853
|
},
|
|
852
854
|
onSuccess: async () => {
|
|
853
855
|
await reload();
|
|
@@ -860,9 +862,9 @@ function EmailStepEditorInternal({
|
|
|
860
862
|
dialogOpen,
|
|
861
863
|
onDialogOpenChange,
|
|
862
864
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
863
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
865
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.FormInput, { form, id: "subject", name: t("emailAutomations.step.fields.subject.label"), isRequired: true }),
|
|
864
866
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
865
|
-
|
|
867
|
+
_chunkKH4Y4FU4js.FormInput,
|
|
866
868
|
{
|
|
867
869
|
form,
|
|
868
870
|
id: "delayHours",
|
|
@@ -872,7 +874,7 @@ function EmailStepEditorInternal({
|
|
|
872
874
|
}
|
|
873
875
|
),
|
|
874
876
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
875
|
-
|
|
877
|
+
_chunkKH4Y4FU4js.FormTextarea,
|
|
876
878
|
{
|
|
877
879
|
form,
|
|
878
880
|
id: "body",
|
|
@@ -1012,7 +1014,7 @@ var stepIdOf = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (nodeId) =>
|
|
|
1012
1014
|
function EmailAutomationCanvas() {
|
|
1013
1015
|
const { automation, steps, triggers, select, reload, createStep, deleteStep, setNext, updatePosition, tidy } = useEmailAutomation();
|
|
1014
1016
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1015
|
-
const isMobile =
|
|
1017
|
+
const isMobile = _chunkCI64OTRXjs.useIsMobile.call(void 0, );
|
|
1016
1018
|
const [nodes, setNodes] = _react.useState.call(void 0, []);
|
|
1017
1019
|
const [edges, setEdges] = _react.useState.call(void 0, []);
|
|
1018
1020
|
const { screenToFlowPosition } = _react3.useReactFlow.call(void 0, );
|
|
@@ -1051,7 +1053,7 @@ function EmailAutomationCanvas() {
|
|
|
1051
1053
|
try {
|
|
1052
1054
|
await setNext(stepId, nextStepId);
|
|
1053
1055
|
} catch (error) {
|
|
1054
|
-
|
|
1056
|
+
_chunkKH4Y4FU4js.errorToast.call(void 0, { title: t("emailAutomations.canvas.chainError"), error });
|
|
1055
1057
|
await reload();
|
|
1056
1058
|
}
|
|
1057
1059
|
},
|
|
@@ -1065,7 +1067,7 @@ function EmailAutomationCanvas() {
|
|
|
1065
1067
|
if (!_optionalChain([conn, 'access', _31 => _31.targetHandle, 'optionalAccess', _32 => _32.startsWith, 'call', _33 => _33(STEP_TARGET_HANDLE_PREFIX)])) return;
|
|
1066
1068
|
const targetStepId = conn.targetHandle.slice(STEP_TARGET_HANDLE_PREFIX.length);
|
|
1067
1069
|
if (from.handleId === TRIGGER_SOURCE_HANDLE) {
|
|
1068
|
-
|
|
1070
|
+
_chunkCI64OTRXjs.showError.call(void 0, t("emailAutomations.canvas.chainError"));
|
|
1069
1071
|
return;
|
|
1070
1072
|
}
|
|
1071
1073
|
if (!from.handleId.startsWith(STEP_SOURCE_HANDLE_PREFIX)) return;
|
|
@@ -1183,7 +1185,7 @@ function EmailAutomationCanvas() {
|
|
|
1183
1185
|
try {
|
|
1184
1186
|
await deleteStep(stepId);
|
|
1185
1187
|
} catch (error) {
|
|
1186
|
-
|
|
1188
|
+
_chunkKH4Y4FU4js.errorToast.call(void 0, { title: t("emailAutomations.canvas.deleteEmail"), error });
|
|
1187
1189
|
throw error;
|
|
1188
1190
|
}
|
|
1189
1191
|
}, [pendingDeleteStepId, deleteStep, t]);
|
|
@@ -1246,7 +1248,7 @@ function EmailAutomationCanvas() {
|
|
|
1246
1248
|
}
|
|
1247
1249
|
),
|
|
1248
1250
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1249
|
-
|
|
1251
|
+
_chunkKH4Y4FU4js.ConfirmDialog,
|
|
1250
1252
|
{
|
|
1251
1253
|
open: pendingDeleteStepId !== null,
|
|
1252
1254
|
onOpenChange: (open) => {
|
|
@@ -1261,20 +1263,20 @@ function EmailAutomationCanvas() {
|
|
|
1261
1263
|
}
|
|
1262
1264
|
),
|
|
1263
1265
|
paneMenu && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1264
|
-
|
|
1266
|
+
_chunkKH4Y4FU4js.ContextMenu,
|
|
1265
1267
|
{
|
|
1266
1268
|
open: true,
|
|
1267
1269
|
onOpenChange: (open) => {
|
|
1268
1270
|
if (!open) setPaneMenu(null);
|
|
1269
1271
|
},
|
|
1270
1272
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1271
|
-
|
|
1273
|
+
_chunkKH4Y4FU4js.ContextMenuContent,
|
|
1272
1274
|
{
|
|
1273
1275
|
anchor: pointAnchor(paneMenu.screenX, paneMenu.screenY),
|
|
1274
1276
|
side: "bottom",
|
|
1275
1277
|
align: "start",
|
|
1276
1278
|
sideOffset: 4,
|
|
1277
|
-
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1279
|
+
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkKH4Y4FU4js.ContextMenuItem, { onClick: handleCreateStepFromPane, children: [
|
|
1278
1280
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.PlusIcon, {}),
|
|
1279
1281
|
t("emailAutomations.canvas.addEmail")
|
|
1280
1282
|
] })
|
|
@@ -1283,21 +1285,21 @@ function EmailAutomationCanvas() {
|
|
|
1283
1285
|
}
|
|
1284
1286
|
),
|
|
1285
1287
|
nodeMenu && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1286
|
-
|
|
1288
|
+
_chunkKH4Y4FU4js.ContextMenu,
|
|
1287
1289
|
{
|
|
1288
1290
|
open: true,
|
|
1289
1291
|
onOpenChange: (open) => {
|
|
1290
1292
|
if (!open) setNodeMenu(null);
|
|
1291
1293
|
},
|
|
1292
1294
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1293
|
-
|
|
1295
|
+
_chunkKH4Y4FU4js.ContextMenuContent,
|
|
1294
1296
|
{
|
|
1295
1297
|
anchor: pointAnchor(nodeMenu.screenX, nodeMenu.screenY),
|
|
1296
1298
|
side: "bottom",
|
|
1297
1299
|
align: "start",
|
|
1298
1300
|
sideOffset: 4,
|
|
1299
1301
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1300
|
-
|
|
1302
|
+
_chunkKH4Y4FU4js.ContextMenuItem,
|
|
1301
1303
|
{
|
|
1302
1304
|
onClick: () => {
|
|
1303
1305
|
const menu = nodeMenu;
|
|
@@ -1338,7 +1340,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, TriggerAutomationEditor, "TriggerAutomation
|
|
|
1338
1340
|
// src/features/email-automation/components/canvas/EmailAutomationCanvasTab.tsx
|
|
1339
1341
|
|
|
1340
1342
|
function EmailAutomationCanvasTab() {
|
|
1341
|
-
const { open, setOpen } =
|
|
1343
|
+
const { open, setOpen } = _chunkKH4Y4FU4js.useSidebar.call(void 0, );
|
|
1342
1344
|
_react.useEffect.call(void 0, () => {
|
|
1343
1345
|
const prev = open;
|
|
1344
1346
|
if (prev) setOpen(false);
|
|
@@ -1371,9 +1373,9 @@ function EmailAutomationAddPersonDialog({
|
|
|
1371
1373
|
const searchTermRef = _react.useRef.call(void 0, "");
|
|
1372
1374
|
const [searchTerm, setSearchTerm] = _react.useState.call(void 0, "");
|
|
1373
1375
|
const sentinelRef = _react.useRef.call(void 0, null);
|
|
1374
|
-
const data =
|
|
1376
|
+
const data = _chunkKH4Y4FU4js.useDataListRetriever.call(void 0, {
|
|
1375
1377
|
ready: open,
|
|
1376
|
-
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) =>
|
|
1378
|
+
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkCI64OTRXjs.EmailAutomationService.findCandidates(params), "retriever"),
|
|
1377
1379
|
retrieverParams: { automationId },
|
|
1378
1380
|
module: _chunkZ6T2575Ajs.Modules.EmailAutomationCandidate
|
|
1379
1381
|
});
|
|
@@ -1388,7 +1390,7 @@ function EmailAutomationAddPersonDialog({
|
|
|
1388
1390
|
},
|
|
1389
1391
|
[data]
|
|
1390
1392
|
);
|
|
1391
|
-
const updateSearchTerm =
|
|
1393
|
+
const updateSearchTerm = _chunkKH4Y4FU4js.useDebounce.call(void 0, refreshList, 500);
|
|
1392
1394
|
_react.useEffect.call(void 0, () => {
|
|
1393
1395
|
if (open) updateSearchTerm(searchTerm);
|
|
1394
1396
|
}, [open, searchTerm]);
|
|
@@ -1423,22 +1425,22 @@ function EmailAutomationAddPersonDialog({
|
|
|
1423
1425
|
const add = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async (candidate) => {
|
|
1424
1426
|
if (!candidate.addable) return;
|
|
1425
1427
|
try {
|
|
1426
|
-
await
|
|
1428
|
+
await _chunkCI64OTRXjs.EmailAutomationService.addEnrollment({
|
|
1427
1429
|
automationId,
|
|
1428
1430
|
input: { id: _uuid.v4.call(void 0, ), recipientType: candidate.recipientType, recipientId: candidate.recipientId }
|
|
1429
1431
|
});
|
|
1430
1432
|
setOpen(false);
|
|
1431
|
-
|
|
1433
|
+
_chunkCI64OTRXjs.showToast.call(void 0, t("emailAutomations.recipients.addDialog.added", { email: candidate.email }));
|
|
1432
1434
|
onAdded();
|
|
1433
1435
|
} catch (error) {
|
|
1434
|
-
|
|
1436
|
+
_chunkKH4Y4FU4js.errorToast.call(void 0, { title: t("common.errors.error"), error });
|
|
1435
1437
|
}
|
|
1436
1438
|
}, "add");
|
|
1437
1439
|
const candidates = _nullishCoalesce(data.data, () => ( []));
|
|
1438
1440
|
const addable = candidates.filter((candidate) => candidate.addable);
|
|
1439
1441
|
const blocked = candidates.filter((candidate) => !candidate.addable);
|
|
1440
1442
|
const renderCandidate = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (candidate) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1441
|
-
|
|
1443
|
+
_chunkKH4Y4FU4js.CommandItem,
|
|
1442
1444
|
{
|
|
1443
1445
|
className: "cursor-pointer hover:bg-muted data-selected:hover:bg-muted bg-transparent data-selected:bg-transparent",
|
|
1444
1446
|
value: candidate.id,
|
|
@@ -1447,20 +1449,20 @@ function EmailAutomationAddPersonDialog({
|
|
|
1447
1449
|
"data-addable": candidate.addable ? "true" : "false",
|
|
1448
1450
|
onSelect: () => void add(candidate),
|
|
1449
1451
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex min-w-0 flex-1 flex-row items-center px-4 py-1", children: [
|
|
1450
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "*:ring-border *:ring-1", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1452
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "*:ring-border *:ring-1", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.Avatar, { className: "h-6 w-6", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.AvatarFallback, { children: _chunkCI64OTRXjs.getInitials.call(void 0, candidate.name || candidate.email) }) }) }),
|
|
1451
1453
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "ms-5 me-3 flex min-w-0 flex-1 flex-col", children: candidate.name ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1452
1454
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "truncate text-sm font-medium", children: candidate.name }),
|
|
1453
1455
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "truncate text-xs font-normal", children: candidate.email })
|
|
1454
1456
|
] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "truncate text-sm font-medium", children: candidate.email }) }),
|
|
1455
1457
|
candidate.addable ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1456
|
-
|
|
1458
|
+
_chunkKH4Y4FU4js.Badge,
|
|
1457
1459
|
{
|
|
1458
1460
|
variant: candidate.recipientType === "waitlist" ? "softBlue" : "softGray",
|
|
1459
1461
|
className: "ms-auto shrink-0",
|
|
1460
1462
|
children: t(`emailAutomations.recipients.addDialog.kind.${candidate.recipientType}`)
|
|
1461
1463
|
}
|
|
1462
1464
|
) : candidate.reason && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1463
|
-
|
|
1465
|
+
_chunkKH4Y4FU4js.Badge,
|
|
1464
1466
|
{
|
|
1465
1467
|
variant: "softAmber",
|
|
1466
1468
|
className: "ms-auto shrink-0",
|
|
@@ -1473,11 +1475,11 @@ function EmailAutomationAddPersonDialog({
|
|
|
1473
1475
|
candidate.id
|
|
1474
1476
|
), "renderCandidate");
|
|
1475
1477
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2", children: [
|
|
1476
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1478
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkKH4Y4FU4js.Dialog, { open, onOpenChange: handleOpenChange, children: [
|
|
1477
1479
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1478
|
-
|
|
1480
|
+
_chunkKH4Y4FU4js.DialogTrigger,
|
|
1479
1481
|
{
|
|
1480
|
-
render: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1482
|
+
render: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.Button, { variant: "outline", size: "sm", "data-testid": "email-automation-add-person" }),
|
|
1481
1483
|
disabled,
|
|
1482
1484
|
children: [
|
|
1483
1485
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.UserPlusIcon, { className: "h-3.5 w-3.5" }),
|
|
@@ -1485,11 +1487,11 @@ function EmailAutomationAddPersonDialog({
|
|
|
1485
1487
|
]
|
|
1486
1488
|
}
|
|
1487
1489
|
),
|
|
1488
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1489
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1490
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1490
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkKH4Y4FU4js.DialogContent, { className: "sm:max-w-2xl", "data-testid": "email-automation-add-person-dialog", children: [
|
|
1491
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.DialogHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.DialogTitle, { children: t("emailAutomations.recipients.addDialog.title") }) }),
|
|
1492
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkKH4Y4FU4js.Command, { shouldFilter: false, children: [
|
|
1491
1493
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1492
|
-
|
|
1494
|
+
_chunkKH4Y4FU4js.CommandInput,
|
|
1493
1495
|
{
|
|
1494
1496
|
"data-testid": "email-automation-add-person-search",
|
|
1495
1497
|
placeholder: t("emailAutomations.recipients.addDialog.search"),
|
|
@@ -1497,10 +1499,10 @@ function EmailAutomationAddPersonDialog({
|
|
|
1497
1499
|
onValueChange: setSearchTerm
|
|
1498
1500
|
}
|
|
1499
1501
|
),
|
|
1500
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1501
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1502
|
-
addable.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1503
|
-
blocked.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1502
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkKH4Y4FU4js.CommandList, { className: "mt-2", children: [
|
|
1503
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.CommandEmpty, { children: t("emailAutomations.recipients.addDialog.empty") }),
|
|
1504
|
+
addable.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.CommandGroup, { heading: t("emailAutomations.recipients.addDialog.groups.addable"), children: addable.map(renderCandidate) }),
|
|
1505
|
+
blocked.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.CommandGroup, { heading: t("emailAutomations.recipients.addDialog.groups.blocked"), children: blocked.map(renderCandidate) }),
|
|
1504
1506
|
data.next && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { ref: sentinelRef, style: { height: 1 } })
|
|
1505
1507
|
] })
|
|
1506
1508
|
] })
|
|
@@ -1517,10 +1519,12 @@ function EmailAutomationRecipientsList() {
|
|
|
1517
1519
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1518
1520
|
const { automation, reload } = useEmailAutomation();
|
|
1519
1521
|
const [statusFilter, setStatusFilter] = _react.useState.call(void 0, "all");
|
|
1520
|
-
const data =
|
|
1521
|
-
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) =>
|
|
1522
|
+
const data = _chunkKH4Y4FU4js.useDataListRetriever.call(void 0, {
|
|
1523
|
+
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkCI64OTRXjs.EmailAutomationService.findEnrollments(params), "retriever"),
|
|
1522
1524
|
retrieverParams: { automationId: _optionalChain([automation, 'optionalAccess', _50 => _50.id]) },
|
|
1523
|
-
module: _chunkZ6T2575Ajs.Modules.EmailAutomationEnrollment
|
|
1525
|
+
module: _chunkZ6T2575Ajs.Modules.EmailAutomationEnrollment,
|
|
1526
|
+
// Display only (call C8): the server's own order when no sort is chosen.
|
|
1527
|
+
defaultSort: "-enrolledAt"
|
|
1524
1528
|
});
|
|
1525
1529
|
const handleStatusChange = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (value) => {
|
|
1526
1530
|
const status = _nullishCoalesce(value, () => ( "all"));
|
|
@@ -1550,21 +1554,21 @@ function EmailAutomationRecipientsList() {
|
|
|
1550
1554
|
}
|
|
1551
1555
|
}
|
|
1552
1556
|
),
|
|
1553
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1554
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1555
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1556
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1557
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1558
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1559
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1560
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1561
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1557
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkKH4Y4FU4js.Select, { items: statusItems, value: statusFilter, onValueChange: handleStatusChange, children: [
|
|
1558
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.SelectTrigger, { className: "w-40", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.SelectValue, {}) }),
|
|
1559
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkKH4Y4FU4js.SelectContent, { children: [
|
|
1560
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.SelectItem, { value: "all", children: t("emailAutomations.recipients.status.all") }),
|
|
1561
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.SelectItem, { value: "active", children: t("emailAutomations.recipients.status.active") }),
|
|
1562
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.SelectItem, { value: "completed", children: t("emailAutomations.recipients.status.completed") }),
|
|
1563
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.SelectItem, { value: "unsubscribed", children: t("emailAutomations.recipients.status.unsubscribed") }),
|
|
1564
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.SelectItem, { value: "exited", children: t("emailAutomations.recipients.status.exited") }),
|
|
1565
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.SelectItem, { value: "failed", children: t("emailAutomations.recipients.status.failed") })
|
|
1562
1566
|
] })
|
|
1563
1567
|
] }),
|
|
1564
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1568
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.Button, { variant: "outline", size: "icon", onClick: () => void data.refresh(), disabled: !data.isLoaded, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.RefreshCw, { className: `h-4 w-4 ${!data.isLoaded ? "animate-spin" : ""}` }) })
|
|
1565
1569
|
] });
|
|
1566
1570
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { "data-testid": "email-automation-recipients", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1567
|
-
|
|
1571
|
+
_chunkKH4Y4FU4js.ContentListTable,
|
|
1568
1572
|
{
|
|
1569
1573
|
data,
|
|
1570
1574
|
fields: [
|
|
@@ -1593,7 +1597,7 @@ function EmailAutomationContainer({ automationId }) {
|
|
|
1593
1597
|
_chunk7QVYU63Ejs.__name.call(void 0, EmailAutomationContainer, "EmailAutomationContainer");
|
|
1594
1598
|
function EmailAutomationShell() {
|
|
1595
1599
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1596
|
-
const generateUrl =
|
|
1600
|
+
const generateUrl = _chunkKH4Y4FU4js.usePageUrlGenerator.call(void 0, );
|
|
1597
1601
|
const { automation, reload } = useEmailAutomation();
|
|
1598
1602
|
if (!automation) return null;
|
|
1599
1603
|
const breadcrumbs = [
|
|
@@ -1601,7 +1605,7 @@ function EmailAutomationShell() {
|
|
|
1601
1605
|
{ name: automation.name }
|
|
1602
1606
|
];
|
|
1603
1607
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1604
|
-
|
|
1608
|
+
_chunkKH4Y4FU4js.SharedProvider,
|
|
1605
1609
|
{
|
|
1606
1610
|
value: {
|
|
1607
1611
|
breadcrumbs,
|
|
@@ -1615,7 +1619,7 @@ function EmailAutomationShell() {
|
|
|
1615
1619
|
}
|
|
1616
1620
|
},
|
|
1617
1621
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1618
|
-
|
|
1622
|
+
_chunkKH4Y4FU4js.RoundPageContainer,
|
|
1619
1623
|
{
|
|
1620
1624
|
module: _chunkZ6T2575Ajs.Modules.EmailAutomation,
|
|
1621
1625
|
id: automation.id,
|
|
@@ -1658,12 +1662,12 @@ function EmailUnsubscribe({ token, scope, source = "automation" }) {
|
|
|
1658
1662
|
async function unsubscribe() {
|
|
1659
1663
|
try {
|
|
1660
1664
|
if (source === "blast") {
|
|
1661
|
-
await
|
|
1665
|
+
await _chunkCI64OTRXjs.EmailBlastDeliveryService.unsubscribe({ token });
|
|
1662
1666
|
setStoppedScope("all");
|
|
1663
1667
|
setState("success");
|
|
1664
1668
|
return;
|
|
1665
1669
|
}
|
|
1666
|
-
const enrollment = await
|
|
1670
|
+
const enrollment = await _chunkCI64OTRXjs.EmailAutomationEnrollmentService.unsubscribe({ token, scope });
|
|
1667
1671
|
setAutomationName(_nullishCoalesce(_optionalChain([enrollment, 'optionalAccess', _51 => _51.automation, 'optionalAccess', _52 => _52.name]), () => ( "")));
|
|
1668
1672
|
setIsServiceAutomation(_optionalChain([enrollment, 'optionalAccess', _53 => _53.automation, 'optionalAccess', _54 => _54.purpose]) === "service");
|
|
1669
1673
|
setStoppedScope(scope);
|
|
@@ -1678,7 +1682,7 @@ function EmailUnsubscribe({ token, scope, source = "automation" }) {
|
|
|
1678
1682
|
const stopAll = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
|
|
1679
1683
|
setIsStoppingAll(true);
|
|
1680
1684
|
try {
|
|
1681
|
-
await
|
|
1685
|
+
await _chunkCI64OTRXjs.EmailAutomationEnrollmentService.unsubscribe({ token, scope: "all" });
|
|
1682
1686
|
setStoppedScope("all");
|
|
1683
1687
|
} catch (e3) {
|
|
1684
1688
|
setState("error");
|
|
@@ -1695,16 +1699,16 @@ function EmailUnsubscribe({ token, scope, source = "automation" }) {
|
|
|
1695
1699
|
if (state === "error") {
|
|
1696
1700
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col items-center justify-center space-y-4 py-16 text-center", children: [
|
|
1697
1701
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "bg-destructive/10 rounded-full p-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.XCircle, { className: "text-destructive h-12 w-12" }) }),
|
|
1698
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1702
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.SectionHeader, { level: 2, children: t("emailAutomations.unsubscribe.invalidTitle") }),
|
|
1699
1703
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground max-w-md text-sm leading-relaxed", children: t("emailAutomations.unsubscribe.invalidBody") })
|
|
1700
1704
|
] });
|
|
1701
1705
|
}
|
|
1702
1706
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col items-center justify-center space-y-4 py-16 text-center", children: [
|
|
1703
1707
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "bg-primary/10 rounded-full p-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CheckCircle, { className: "text-primary h-12 w-12" }) }),
|
|
1704
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1708
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.SectionHeader, { level: 2, children: t("emailAutomations.unsubscribe.title") }),
|
|
1705
1709
|
stoppedScope === "all" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground max-w-md text-sm leading-relaxed", children: t("emailAutomations.unsubscribe.stoppedAll") }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1706
1710
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground max-w-md text-sm leading-relaxed", children: t("emailAutomations.unsubscribe.stoppedAutomation", { name: automationName }) }),
|
|
1707
|
-
!isServiceAutomation && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1711
|
+
!isServiceAutomation && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkKH4Y4FU4js.Button, { variant: "secondary", onClick: stopAll, disabled: isStoppingAll, children: [
|
|
1708
1712
|
isStoppingAll && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Loader2, { className: "h-4 w-4 animate-spin" }),
|
|
1709
1713
|
t("emailAutomations.unsubscribe.alsoStopAll")
|
|
1710
1714
|
] })
|
|
@@ -1719,7 +1723,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, EmailUnsubscribe, "EmailUnsubscribe");
|
|
|
1719
1723
|
|
|
1720
1724
|
var useEmailAutomationTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => {
|
|
1721
1725
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1722
|
-
const generateUrl =
|
|
1726
|
+
const generateUrl = _chunkKH4Y4FU4js.usePageUrlGenerator.call(void 0, );
|
|
1723
1727
|
const triggerLabels = _nullishCoalesce(_optionalChain([params, 'access', _55 => _55.context, 'optionalAccess', _56 => _56.triggerLabels]), () => ( {}));
|
|
1724
1728
|
const tableData = _react.useMemo.call(void 0, () => {
|
|
1725
1729
|
return params.data.map((automation) => {
|
|
@@ -1748,9 +1752,9 @@ var useEmailAutomationTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.c
|
|
|
1748
1752
|
header: t("emailAutomations.list.columns.name"),
|
|
1749
1753
|
cell: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ row }) => {
|
|
1750
1754
|
const automation = row.original.jsonApiData;
|
|
1751
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1755
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.Link, { href: generateUrl({ page: _chunkZ6T2575Ajs.Modules.EmailAutomation, id: automation.id }), children: automation.name });
|
|
1752
1756
|
}, "cell"),
|
|
1753
|
-
enableSorting:
|
|
1757
|
+
enableSorting: true,
|
|
1754
1758
|
enableHiding: false
|
|
1755
1759
|
}),
|
|
1756
1760
|
["purpose" /* purpose */]: () => ({
|
|
@@ -1759,9 +1763,9 @@ var useEmailAutomationTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.c
|
|
|
1759
1763
|
header: t("emailAutomations.list.columns.purpose"),
|
|
1760
1764
|
cell: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ row }) => {
|
|
1761
1765
|
const automation = row.original.jsonApiData;
|
|
1762
|
-
return automation.purpose === "service" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1766
|
+
return automation.purpose === "service" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.Badge, { variant: "softBlue", "data-testid": "email-automation-purpose-badge", children: t("emailPurpose.service") }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.Badge, { variant: "softGray", "data-testid": "email-automation-purpose-badge", children: t("emailPurpose.marketing") });
|
|
1763
1767
|
}, "cell"),
|
|
1764
|
-
enableSorting:
|
|
1768
|
+
enableSorting: true,
|
|
1765
1769
|
enableHiding: false
|
|
1766
1770
|
}),
|
|
1767
1771
|
["trigger" /* trigger */]: () => ({
|
|
@@ -1773,7 +1777,7 @@ var useEmailAutomationTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.c
|
|
|
1773
1777
|
if (!automation.trigger) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: "\u2014" });
|
|
1774
1778
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm", children: _nullishCoalesce(triggerLabels[automation.trigger], () => ( automation.trigger)) });
|
|
1775
1779
|
}, "cell"),
|
|
1776
|
-
enableSorting:
|
|
1780
|
+
enableSorting: true,
|
|
1777
1781
|
enableHiding: false
|
|
1778
1782
|
}),
|
|
1779
1783
|
["status" /* status */]: () => ({
|
|
@@ -1782,9 +1786,10 @@ var useEmailAutomationTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.c
|
|
|
1782
1786
|
header: t("emailAutomations.list.columns.status"),
|
|
1783
1787
|
cell: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ row }) => {
|
|
1784
1788
|
const automation = row.original.jsonApiData;
|
|
1785
|
-
return automation.isActive ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1789
|
+
return automation.isActive ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.Badge, { variant: "softGreen", children: t("emailAutomations.list.status.on") }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.Badge, { variant: "softGray", children: t("emailAutomations.list.status.off") });
|
|
1786
1790
|
}, "cell"),
|
|
1787
|
-
|
|
1791
|
+
meta: { sortFields: ["isActive"] },
|
|
1792
|
+
enableSorting: true,
|
|
1788
1793
|
enableHiding: false
|
|
1789
1794
|
}),
|
|
1790
1795
|
["steps" /* steps */]: () => numericColumn("steps" /* steps */, t("emailAutomations.list.columns.steps"), (a) => a.stepCount),
|
|
@@ -1805,7 +1810,7 @@ var useEmailAutomationTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.c
|
|
|
1805
1810
|
}, [params.fields, fieldColumnMap, t, generateUrl]);
|
|
1806
1811
|
return _react.useMemo.call(void 0, () => ({ data: tableData, columns }), [tableData, columns]);
|
|
1807
1812
|
}, "useEmailAutomationTableStructure");
|
|
1808
|
-
|
|
1813
|
+
_chunkKH4Y4FU4js.registerTableGenerator.call(void 0, "email-automations", useEmailAutomationTableStructure);
|
|
1809
1814
|
|
|
1810
1815
|
// src/features/email-automation/hooks/useEmailAutomationEnrollmentTableStructure.tsx
|
|
1811
1816
|
|
|
@@ -1841,7 +1846,7 @@ var useEmailAutomationEnrollmentTableStructure = /* @__PURE__ */ _chunk7QVYU63Ej
|
|
|
1841
1846
|
const enrollment = row.original.jsonApiData;
|
|
1842
1847
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm", children: enrollment.email });
|
|
1843
1848
|
}, "cell"),
|
|
1844
|
-
enableSorting:
|
|
1849
|
+
enableSorting: true,
|
|
1845
1850
|
enableHiding: false
|
|
1846
1851
|
}),
|
|
1847
1852
|
["name" /* name */]: () => ({
|
|
@@ -1852,7 +1857,7 @@ var useEmailAutomationEnrollmentTableStructure = /* @__PURE__ */ _chunk7QVYU63Ej
|
|
|
1852
1857
|
const enrollment = row.original.jsonApiData;
|
|
1853
1858
|
return enrollment.name ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm", children: enrollment.name }) : empty;
|
|
1854
1859
|
}, "cell"),
|
|
1855
|
-
enableSorting:
|
|
1860
|
+
enableSorting: true,
|
|
1856
1861
|
enableHiding: false
|
|
1857
1862
|
}),
|
|
1858
1863
|
["status" /* status */]: () => ({
|
|
@@ -1862,7 +1867,7 @@ var useEmailAutomationEnrollmentTableStructure = /* @__PURE__ */ _chunk7QVYU63Ej
|
|
|
1862
1867
|
cell: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ row }) => {
|
|
1863
1868
|
const enrollment = row.original.jsonApiData;
|
|
1864
1869
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1865
|
-
|
|
1870
|
+
_chunkKH4Y4FU4js.Badge,
|
|
1866
1871
|
{
|
|
1867
1872
|
variant: _nullishCoalesce(STATUS_VARIANTS[enrollment.status], () => ( "softGray")),
|
|
1868
1873
|
title: enrollment.status === "failed" ? enrollment.lastError : void 0,
|
|
@@ -1870,7 +1875,7 @@ var useEmailAutomationEnrollmentTableStructure = /* @__PURE__ */ _chunk7QVYU63Ej
|
|
|
1870
1875
|
}
|
|
1871
1876
|
);
|
|
1872
1877
|
}, "cell"),
|
|
1873
|
-
enableSorting:
|
|
1878
|
+
enableSorting: true,
|
|
1874
1879
|
enableHiding: false
|
|
1875
1880
|
}),
|
|
1876
1881
|
["currentStep" /* currentStep */]: () => ({
|
|
@@ -1893,7 +1898,7 @@ var useEmailAutomationEnrollmentTableStructure = /* @__PURE__ */ _chunk7QVYU63Ej
|
|
|
1893
1898
|
if (!enrollment.nextSendAt) return empty;
|
|
1894
1899
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-xs tabular-nums", children: now ? _chunkHROKKUBQjs.formatDate.call(void 0, enrollment.nextSendAt, "dateTime", locale, now) : "" });
|
|
1895
1900
|
}, "cell"),
|
|
1896
|
-
enableSorting:
|
|
1901
|
+
enableSorting: true,
|
|
1897
1902
|
enableHiding: false
|
|
1898
1903
|
}),
|
|
1899
1904
|
["sentCount" /* sentCount */]: () => ({
|
|
@@ -1913,7 +1918,7 @@ var useEmailAutomationEnrollmentTableStructure = /* @__PURE__ */ _chunk7QVYU63Ej
|
|
|
1913
1918
|
}, [params.fields, fieldColumnMap, t, locale, now]);
|
|
1914
1919
|
return _react.useMemo.call(void 0, () => ({ data: tableData, columns }), [tableData, columns]);
|
|
1915
1920
|
}, "useEmailAutomationEnrollmentTableStructure");
|
|
1916
|
-
|
|
1921
|
+
_chunkKH4Y4FU4js.registerTableGenerator.call(void 0, "email-automation-enrollments", useEmailAutomationEnrollmentTableStructure);
|
|
1917
1922
|
|
|
1918
1923
|
|
|
1919
1924
|
|