@bigbinary/neeto-email-notifications-frontend 2.2.14 → 2.2.16
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/README.md +89 -18
- package/app/javascript/src/translations/ar.json +17 -0
- package/app/javascript/src/translations/bg.json +17 -0
- package/app/javascript/src/translations/ca.json +17 -0
- package/app/javascript/src/translations/cs.json +17 -0
- package/app/javascript/src/translations/da.json +17 -0
- package/app/javascript/src/translations/de.json +2 -2
- package/app/javascript/src/translations/en.json +1 -1
- package/app/javascript/src/translations/es-MX.json +17 -0
- package/app/javascript/src/translations/es.json +2 -2
- package/app/javascript/src/translations/et.json +17 -0
- package/app/javascript/src/translations/fi.json +17 -0
- package/app/javascript/src/translations/fil.json +17 -0
- package/app/javascript/src/translations/fr.json +2 -2
- package/app/javascript/src/translations/hi.json +17 -0
- package/app/javascript/src/translations/hr.json +17 -0
- package/app/javascript/src/translations/id.json +17 -0
- package/app/javascript/src/translations/it.json +17 -0
- package/app/javascript/src/translations/ja.json +17 -0
- package/app/javascript/src/translations/ko.json +17 -0
- package/app/javascript/src/translations/nl.json +17 -0
- package/app/javascript/src/translations/pl.json +17 -0
- package/app/javascript/src/translations/pt-BR.json +17 -0
- package/app/javascript/src/translations/pt.json +17 -0
- package/app/javascript/src/translations/ro.json +17 -0
- package/app/javascript/src/translations/ru.json +17 -0
- package/app/javascript/src/translations/sk.json +17 -0
- package/app/javascript/src/translations/sl.json +17 -0
- package/app/javascript/src/translations/sv.json +17 -0
- package/app/javascript/src/translations/th.json +17 -0
- package/app/javascript/src/translations/tr.json +17 -0
- package/app/javascript/src/translations/uk.json +17 -0
- package/app/javascript/src/translations/vi.json +17 -0
- package/app/javascript/src/translations/zh-CN.json +17 -0
- package/app/javascript/src/translations/zh-TW.json +17 -0
- package/dist/NeetoEmailNotificationForm.js +91 -51
- package/dist/NeetoEmailNotificationForm.js.map +1 -1
- package/dist/cjs/NeetoEmailNotificationForm.js +90 -50
- package/dist/cjs/NeetoEmailNotificationForm.js.map +1 -1
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +16 -15
- package/types.d.ts +18 -15
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
4
4
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
5
|
+
var react = require('react');
|
|
5
6
|
var neetoCist = require('@bigbinary/neeto-cist');
|
|
6
|
-
var
|
|
7
|
+
var EmailForm = require('@bigbinary/neeto-molecules/EmailForm');
|
|
7
8
|
var Spinner = require('@bigbinary/neetoui/Spinner');
|
|
8
9
|
var ramda = require('ramda');
|
|
9
10
|
var reactI18next = require('react-i18next');
|
|
@@ -33,19 +34,24 @@ function _interopNamespaceDefault(e) {
|
|
|
33
34
|
|
|
34
35
|
var yup__namespace = /*#__PURE__*/_interopNamespaceDefault(yup);
|
|
35
36
|
|
|
36
|
-
var
|
|
37
|
+
var EMAIL_NOTIFICATIONS_BASE_URL = "neeto_email_notifications/email_notification";
|
|
38
|
+
var RESET_EMAIL_NOTIFICATIONS_TO_DEFAULT_URL = "".concat(EMAIL_NOTIFICATIONS_BASE_URL, "/reset_to_default");
|
|
37
39
|
|
|
38
40
|
var fetch = function fetch(params) {
|
|
39
|
-
return axios.get(
|
|
41
|
+
return axios.get(EMAIL_NOTIFICATIONS_BASE_URL, {
|
|
40
42
|
params: params
|
|
41
43
|
});
|
|
42
44
|
};
|
|
43
45
|
var update = function update(payload) {
|
|
44
|
-
return axios.put(
|
|
46
|
+
return axios.put(EMAIL_NOTIFICATIONS_BASE_URL, payload);
|
|
47
|
+
};
|
|
48
|
+
var resetToDefault = function resetToDefault(params) {
|
|
49
|
+
return axios.post(RESET_EMAIL_NOTIFICATIONS_TO_DEFAULT_URL, params);
|
|
45
50
|
};
|
|
46
51
|
var emailNotificationsApi = {
|
|
47
52
|
fetch: fetch,
|
|
48
|
-
update: update
|
|
53
|
+
update: update,
|
|
54
|
+
resetToDefault: resetToDefault
|
|
49
55
|
};
|
|
50
56
|
|
|
51
57
|
var QUERY_KEYS = {
|
|
@@ -73,13 +79,29 @@ var useUpdateEmailNotification = function useUpdateEmailNotification() {
|
|
|
73
79
|
}]
|
|
74
80
|
});
|
|
75
81
|
};
|
|
82
|
+
var useResetEmailNotificationToDefault = function useResetEmailNotificationToDefault() {
|
|
83
|
+
return reactUtils.useMutationWithInvalidation(emailNotificationsApi.resetToDefault, {
|
|
84
|
+
keysToInvalidate: [function (_, _ref2) {
|
|
85
|
+
var notificationHolderId = _ref2.notificationHolderId,
|
|
86
|
+
customFields = _ref2.customFields;
|
|
87
|
+
return [QUERY_KEYS.NEETO_EMAIL_NOTIFICATIONS, notificationHolderId, customFields];
|
|
88
|
+
}]
|
|
89
|
+
});
|
|
90
|
+
};
|
|
76
91
|
|
|
77
92
|
var FORM_VALIDATION_SCHEMA = {
|
|
78
93
|
isEnabled: yup__namespace["boolean"]()
|
|
79
94
|
};
|
|
95
|
+
var DEFAULT_FIELDS_VISIBILITY = {
|
|
96
|
+
showSendToField: true,
|
|
97
|
+
showReplyToField: false,
|
|
98
|
+
showSendToAsRadio: false,
|
|
99
|
+
showBccField: false,
|
|
100
|
+
showCcField: false
|
|
101
|
+
};
|
|
80
102
|
|
|
81
103
|
var _excluded$1 = ["notifyEmails", "notifyCcEmails", "notifyBccEmails", "replyToId", "customFields"],
|
|
82
|
-
_excluded2 = ["id", "isEnabled", "sendTo", "sendToCc", "sendToBcc", "showCopyEmails", "replyTo", "message", "subject", "sendFrom", "
|
|
104
|
+
_excluded2 = ["id", "isEnabled", "sendTo", "sendToCc", "sendToBcc", "showCopyEmails", "replyTo", "message", "subject", "sendFrom", "sendToId"];
|
|
83
105
|
function ownKeys$1(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; }
|
|
84
106
|
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
85
107
|
var isValidEmail = function isValidEmail(email) {
|
|
@@ -116,7 +138,7 @@ var parseEmailNotificationData = function parseEmailNotificationData(data, sendT
|
|
|
116
138
|
parsed.showCopyEmails = !!(notifyCcEmails !== null && notifyCcEmails !== void 0 && notifyCcEmails.length || notifyBccEmails !== null && notifyBccEmails !== void 0 && notifyBccEmails.length);
|
|
117
139
|
return parsed;
|
|
118
140
|
};
|
|
119
|
-
var packEmailPayload = function packEmailPayload(values, isReplyToDropdownField) {
|
|
141
|
+
var packEmailPayload = function packEmailPayload(values, isReplyToDropdownField, isDisabledByUser) {
|
|
120
142
|
values.id;
|
|
121
143
|
var isEnabled = values.isEnabled,
|
|
122
144
|
sendTo = values.sendTo,
|
|
@@ -127,7 +149,6 @@ var packEmailPayload = function packEmailPayload(values, isReplyToDropdownField)
|
|
|
127
149
|
message = values.message,
|
|
128
150
|
subject = values.subject,
|
|
129
151
|
sendFrom = values.sendFrom,
|
|
130
|
-
disabledByUser = values.disabledByUser,
|
|
131
152
|
sendToId = values.sendToId,
|
|
132
153
|
rest = _objectWithoutProperties(values, _excluded2);
|
|
133
154
|
var payload = {
|
|
@@ -156,7 +177,7 @@ var packEmailPayload = function packEmailPayload(values, isReplyToDropdownField)
|
|
|
156
177
|
payload.sendFrom = sendFrom;
|
|
157
178
|
} else {
|
|
158
179
|
payload.customFields = {
|
|
159
|
-
disabledByUser:
|
|
180
|
+
disabledByUser: isDisabledByUser
|
|
160
181
|
};
|
|
161
182
|
}
|
|
162
183
|
return payload;
|
|
@@ -164,12 +185,24 @@ var packEmailPayload = function packEmailPayload(values, isReplyToDropdownField)
|
|
|
164
185
|
var renderText = function renderText(text, fallbackTranslation) {
|
|
165
186
|
return ramda.isEmpty(text) ? fallbackTranslation : text;
|
|
166
187
|
};
|
|
188
|
+
var generateDefaultValues = function generateDefaultValues(data) {
|
|
189
|
+
var _data$defaultAttribut, _data$defaultAttribut2;
|
|
190
|
+
if (!(data !== null && data !== void 0 && data.defaultAttributes)) {
|
|
191
|
+
return null;
|
|
192
|
+
}
|
|
193
|
+
var currentDataFields = ["id", "customFields", "notifyCcEmails", "notifyBccEmails", "replyToId"];
|
|
194
|
+
var currentDataOverlay = ramda.pick(currentDataFields, data);
|
|
195
|
+
var normalizedDefaults = _objectSpread$1(_objectSpread$1({}, data.defaultAttributes), {}, {
|
|
196
|
+
message: ((_data$defaultAttribut = data.defaultAttributes.message) === null || _data$defaultAttribut === void 0 || (_data$defaultAttribut2 = _data$defaultAttribut.replaceAll) === null || _data$defaultAttribut2 === void 0 ? void 0 : _data$defaultAttribut2.call(_data$defaultAttribut, "<br />", "<br>")) || data.defaultAttributes.message
|
|
197
|
+
});
|
|
198
|
+
return ramda.mergeLeft(currentDataOverlay, normalizedDefaults);
|
|
199
|
+
};
|
|
167
200
|
|
|
168
|
-
var _excluded = ["validationSchema"
|
|
201
|
+
var _excluded = ["validationSchema"];
|
|
169
202
|
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; }
|
|
170
203
|
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; }
|
|
171
204
|
var NeetoEmailNotificationForm = function NeetoEmailNotificationForm(_ref) {
|
|
172
|
-
var _emailFormProps$sendT;
|
|
205
|
+
var _emailFormProps$sendT, _emailFormProps$sendT2;
|
|
173
206
|
var _ref$emailNotificatio = _ref.emailNotificationParams,
|
|
174
207
|
emailNotificationParams = _ref$emailNotificatio === void 0 ? {} : _ref$emailNotificatio,
|
|
175
208
|
_ref$emailPreviewProp = _ref.emailPreviewProps,
|
|
@@ -180,21 +213,24 @@ var NeetoEmailNotificationForm = function NeetoEmailNotificationForm(_ref) {
|
|
|
180
213
|
emailFormikProps = _ref$emailFormikProps === void 0 ? {} : _ref$emailFormikProps,
|
|
181
214
|
_ref$title = _ref.title,
|
|
182
215
|
title = _ref$title === void 0 ? "" : _ref$title,
|
|
183
|
-
_ref$
|
|
184
|
-
|
|
185
|
-
_ref$
|
|
186
|
-
|
|
216
|
+
_ref$notificationTogg = _ref.notificationToggleLabel,
|
|
217
|
+
notificationToggleLabel = _ref$notificationTogg === void 0 ? "" : _ref$notificationTogg,
|
|
218
|
+
_ref$breadcrumbs = _ref.breadcrumbs,
|
|
219
|
+
breadcrumbs = _ref$breadcrumbs === void 0 ? [] : _ref$breadcrumbs,
|
|
220
|
+
_ref$helpPopoverProps = _ref.helpPopoverProps,
|
|
221
|
+
helpPopoverProps = _ref$helpPopoverProps === void 0 ? {} : _ref$helpPopoverProps,
|
|
187
222
|
_ref$tooltipProps = _ref.tooltipProps,
|
|
188
223
|
tooltipProps = _ref$tooltipProps === void 0 ? {} : _ref$tooltipProps,
|
|
189
|
-
_ref$
|
|
190
|
-
|
|
224
|
+
_ref$disabled = _ref.disabled,
|
|
225
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
226
|
+
_ref$fieldsVisibility = _ref.fieldsVisibility,
|
|
227
|
+
fieldsVisibility = _ref$fieldsVisibility === void 0 ? {} : _ref$fieldsVisibility,
|
|
191
228
|
_ref$blockNavigation = _ref.blockNavigation,
|
|
192
229
|
blockNavigation = _ref$blockNavigation === void 0 ? false : _ref$blockNavigation,
|
|
193
|
-
_ref$
|
|
194
|
-
|
|
195
|
-
children = _ref.children
|
|
196
|
-
|
|
197
|
-
helpPopoverProps = _ref$helpPopoverProps === void 0 ? {} : _ref$helpPopoverProps;
|
|
230
|
+
_ref$onSuccess = _ref.onSuccess,
|
|
231
|
+
onSuccess = _ref$onSuccess === void 0 ? neetoCist.noop : _ref$onSuccess,
|
|
232
|
+
children = _ref.children;
|
|
233
|
+
var editorRef = react.useRef();
|
|
198
234
|
var _useTranslation = reactI18next.useTranslation(),
|
|
199
235
|
t = _useTranslation.t;
|
|
200
236
|
var _useFetchEmailNotific = useFetchEmailNotifications(emailNotificationParams),
|
|
@@ -204,10 +240,14 @@ var NeetoEmailNotificationForm = function NeetoEmailNotificationForm(_ref) {
|
|
|
204
240
|
var _useUpdateEmailNotifi = useUpdateEmailNotification(),
|
|
205
241
|
updateEmailNotification = _useUpdateEmailNotifi.mutate,
|
|
206
242
|
isSubmitting = _useUpdateEmailNotifi.isPending;
|
|
243
|
+
var _useResetEmailNotific = useResetEmailNotificationToDefault(),
|
|
244
|
+
resetToDefault = _useResetEmailNotific.mutate,
|
|
245
|
+
isResetting = _useResetEmailNotific.isPending;
|
|
207
246
|
var handleSubmit = function handleSubmit(values) {
|
|
208
247
|
var _emailFormProps$reply;
|
|
248
|
+
var isDisabledByUser = data.isEnabled && !values.isEnabled;
|
|
209
249
|
var isReplyToDropdownField = (emailFormProps === null || emailFormProps === void 0 || (_emailFormProps$reply = emailFormProps.replyToFieldProps) === null || _emailFormProps$reply === void 0 ? void 0 : _emailFormProps$reply.options) !== undefined;
|
|
210
|
-
var body = ramda.mergeDeepLeft(packEmailPayload(values, isReplyToDropdownField), emailNotificationParams);
|
|
250
|
+
var body = ramda.mergeDeepLeft(packEmailPayload(values, isReplyToDropdownField, isDisabledByUser), emailNotificationParams);
|
|
211
251
|
updateEmailNotification(body, {
|
|
212
252
|
onSuccess: onSuccess
|
|
213
253
|
});
|
|
@@ -218,52 +258,52 @@ var NeetoEmailNotificationForm = function NeetoEmailNotificationForm(_ref) {
|
|
|
218
258
|
children: /*#__PURE__*/jsxRuntime.jsx(Spinner, {})
|
|
219
259
|
});
|
|
220
260
|
}
|
|
261
|
+
var newDefaultAttributes = generateDefaultValues(data);
|
|
262
|
+
var defaultValues = parseEmailNotificationData(newDefaultAttributes, emailFormProps === null || emailFormProps === void 0 || (_emailFormProps$sendT = emailFormProps.sendToFieldProps) === null || _emailFormProps$sendT === void 0 ? void 0 : _emailFormProps$sendT.options);
|
|
263
|
+
defaultValues.defaultAttributes = data.defaultAttributes;
|
|
221
264
|
var formattedTitle = renderText(title, t("neetoEmailNotifications.emailNotification.title"));
|
|
222
|
-
var
|
|
265
|
+
var formattedNotificationToggleLabel = renderText(notificationToggleLabel, t("neetoEmailNotifications.emailNotification.notificationToggleLabel"));
|
|
223
266
|
var customValidationSchema = emailFormikProps.validationSchema,
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
267
|
+
formikProps = _objectWithoutProperties(emailFormikProps, _excluded);
|
|
268
|
+
var handleResetToDefault = function handleResetToDefault() {
|
|
269
|
+
resetToDefault(emailNotificationParams, {
|
|
270
|
+
onSuccess: function onSuccess(_ref2) {
|
|
271
|
+
var _editorRef$current;
|
|
272
|
+
var emailNotification = _ref2.emailNotification;
|
|
273
|
+
return editorRef === null || editorRef === void 0 || (_editorRef$current = editorRef.current) === null || _editorRef$current === void 0 || (_editorRef$current = _editorRef$current.editor) === null || _editorRef$current === void 0 || (_editorRef$current = _editorRef$current.commands) === null || _editorRef$current === void 0 ? void 0 : _editorRef$current.setContent(emailNotification.message);
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
};
|
|
233
277
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
234
278
|
className: "min-w-0 flex-grow overflow-y-auto",
|
|
235
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
279
|
+
children: /*#__PURE__*/jsxRuntime.jsx(EmailForm, _objectSpread(_objectSpread({}, _objectSpread({
|
|
236
280
|
blockNavigation: blockNavigation,
|
|
237
281
|
emailPreviewProps: emailPreviewProps,
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
showSendToAsRadio: showSendToAsRadio,
|
|
242
|
-
tooltipProps: tooltipProps,
|
|
243
|
-
showSendToField: true,
|
|
244
|
-
emailFormProps: _objectSpread({
|
|
245
|
-
showSendToField: true
|
|
246
|
-
}, emailFormProps),
|
|
282
|
+
formikProps: formikProps,
|
|
283
|
+
tooltipProps: tooltipProps
|
|
284
|
+
}, ramda.mergeLeft(fieldsVisibility, DEFAULT_FIELDS_VISIBILITY))), {}, {
|
|
247
285
|
isLoading: isSubmitting,
|
|
248
286
|
validationSchema: customValidationSchema || FORM_VALIDATION_SCHEMA,
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
287
|
+
emailFormProps: _objectSpread({
|
|
288
|
+
editorRef: editorRef,
|
|
289
|
+
handleResetToDefault: handleResetToDefault,
|
|
290
|
+
isResetting: isResetting,
|
|
291
|
+
defaultValues: defaultValues
|
|
292
|
+
}, emailFormProps),
|
|
253
293
|
headerProps: {
|
|
254
294
|
title: formattedTitle,
|
|
255
295
|
titleHelpPopoverProps: helpPopoverProps,
|
|
256
296
|
breadcrumbs: breadcrumbs
|
|
257
297
|
},
|
|
258
|
-
initialValues: parseEmailNotificationData(data,
|
|
298
|
+
initialValues: parseEmailNotificationData(data, emailFormProps === null || emailFormProps === void 0 || (_emailFormProps$sendT2 = emailFormProps.sendToFieldProps) === null || _emailFormProps$sendT2 === void 0 ? void 0 : _emailFormProps$sendT2.options),
|
|
259
299
|
switchProps: {
|
|
260
|
-
label:
|
|
300
|
+
label: formattedNotificationToggleLabel,
|
|
261
301
|
disabled: disabled,
|
|
262
302
|
"data-cy": "receive-email-notification-switch"
|
|
263
303
|
},
|
|
264
304
|
onSubmit: handleSubmit,
|
|
265
305
|
children: children
|
|
266
|
-
})
|
|
306
|
+
}))
|
|
267
307
|
});
|
|
268
308
|
};
|
|
269
309
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NeetoEmailNotificationForm.js","sources":["../../app/javascript/src/constants/index.js","../../app/javascript/src/apis/email_notifications.js","../../app/javascript/src/constants/query.js","../../app/javascript/src/hooks/reactQuery/emailNotificationApi.js","../../app/javascript/src/components/EmailNotificationForm/constants.js","../../app/javascript/src/components/EmailNotificationForm/utils.js","../../app/javascript/src/components/EmailNotificationForm/index.jsx"],"sourcesContent":["export const EMAIL_NOTIFICATIONS_URL =\n \"neeto_email_notifications/email_notification\";\n","import axios from \"axios\";\n\nimport { EMAIL_NOTIFICATIONS_URL } from \"src/constants\";\n\nconst fetch = params => axios.get(EMAIL_NOTIFICATIONS_URL, { params });\n\nconst update = payload => axios.put(EMAIL_NOTIFICATIONS_URL, payload);\n\nconst emailNotificationsApi = { fetch, update };\n\nexport default emailNotificationsApi;\n","export const QUERY_KEYS = {\n NEETO_EMAIL_NOTIFICATIONS: \"neeto-email-notifications\",\n};\n","import { useQuery } from \"@tanstack/react-query\";\nimport { isNotEmpty } from \"neetocist\";\nimport { DEFAULT_STALE_TIME } from \"neetocommons/constants\";\nimport { useMutationWithInvalidation } from \"neetocommons/react-utils\";\nimport { prop } from \"ramda\";\n\nimport emailNotificationsApi from \"src/apis/email_notifications\";\nimport { QUERY_KEYS } from \"src/constants/query\";\n\nexport const useFetchEmailNotifications = params =>\n useQuery({\n queryKey: [\n QUERY_KEYS.NEETO_EMAIL_NOTIFICATIONS,\n params[\"notificationHolderId\"],\n params[\"customFields\"],\n ],\n queryFn: () => emailNotificationsApi.fetch(params),\n staleTime: DEFAULT_STALE_TIME,\n select: prop(\"emailNotification\"),\n enabled: isNotEmpty(params),\n });\n\nexport const useUpdateEmailNotification = () =>\n useMutationWithInvalidation(params => emailNotificationsApi.update(params), {\n keysToInvalidate: [\n (_, { notificationHolderId }) => [\n QUERY_KEYS.NEETO_EMAIL_NOTIFICATIONS,\n notificationHolderId,\n ],\n ],\n });\n","import * as yup from \"yup\";\n\nexport const FORM_VALIDATION_SCHEMA = { isEnabled: yup.boolean() };\n","import { isNotEmpty } from \"neetocist\";\nimport { isEmpty, mergeLeft, prop } from \"ramda\";\nimport { string } from \"yup\";\n\nconst isValidEmail = email => string().email().isValidSync(email);\n\nconst createEmailOptions = (emails = []) =>\n emails.map(email => ({\n label: email,\n value: email,\n valid: isValidEmail(email),\n }));\n\nexport const parseEmailsOptions = (emailOptions = []) =>\n emailOptions.map(prop(\"label\"));\n\nexport const parseEmailNotificationData = (data, sendToOptions) => {\n const {\n notifyEmails,\n notifyCcEmails,\n notifyBccEmails,\n replyToId,\n customFields,\n ...rest\n } = data;\n\n const parsed = { ...customFields, ...rest };\n parsed.sendTo = notifyEmails ? createEmailOptions(notifyEmails) : [];\n parsed.sendToCc = notifyCcEmails ? createEmailOptions(notifyCcEmails) : [];\n parsed.sendToBcc = notifyCcEmails ? createEmailOptions(notifyBccEmails) : [];\n parsed.replyTo = replyToId || customFields[\"replyTo\"];\n parsed.sendToId = customFields[\"sendToId\"] || sendToOptions?.[0]?.value || \"\";\n parsed.showCopyEmails = !!(notifyCcEmails?.length || notifyBccEmails?.length);\n\n return parsed;\n};\n\nexport const packEmailPayload = (values, isReplyToDropdownField) => {\n const {\n // eslint-disable-next-line no-unused-vars\n id: _,\n isEnabled,\n sendTo,\n sendToCc,\n sendToBcc,\n showCopyEmails,\n replyTo,\n message,\n subject,\n sendFrom,\n disabledByUser,\n sendToId,\n ...rest\n } = values;\n let payload = { isEnabled };\n\n if (isEnabled) {\n payload = { ...payload };\n payload.notifyEmails = parseEmailsOptions(sendTo);\n payload.notifyBccEmails = showCopyEmails\n ? parseEmailsOptions(sendToBcc)\n : [];\n\n payload.notifyCcEmails = showCopyEmails ? parseEmailsOptions(sendToCc) : [];\n if (isReplyToDropdownField) {\n payload.replyToId = replyTo;\n } else {\n rest.replyTo = replyTo;\n }\n payload.message = message;\n payload.subject = subject;\n payload.customFields = { ...rest, disabledByUser: false };\n\n if (isNotEmpty(sendToId)) {\n payload.customFields = mergeLeft(payload.customFields, { sendToId });\n }\n payload.sendFrom = sendFrom;\n } else {\n payload.customFields = { disabledByUser };\n }\n\n return payload;\n};\n\nexport const renderText = (text, fallbackTranslation) =>\n isEmpty(text) ? fallbackTranslation : text;\n","import { isNotPresent, noop } from \"neetocist\";\nimport EmailFormComponent from \"neetomolecules/EmailForm\";\nimport { Spinner } from \"neetoui\";\nimport { mergeDeepLeft } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport {\n useFetchEmailNotifications,\n useUpdateEmailNotification,\n} from \"src/hooks/reactQuery/emailNotificationApi\";\n\nimport { FORM_VALIDATION_SCHEMA } from \"./constants\";\nimport {\n packEmailPayload,\n parseEmailNotificationData,\n renderText,\n} from \"./utils\";\n\nconst NeetoEmailNotificationForm = ({\n emailNotificationParams = {},\n emailPreviewProps = {},\n emailFormProps = {},\n emailFormikProps = {},\n title = \"\",\n subTitle = \"\",\n disabled = false,\n tooltipProps = {},\n onSuccess = noop,\n blockNavigation = false,\n breadcrumbs = [],\n children,\n helpPopoverProps = {},\n}) => {\n const { t } = useTranslation();\n\n const { data = {}, isLoading } = useFetchEmailNotifications(\n emailNotificationParams\n );\n\n const { mutate: updateEmailNotification, isPending: isSubmitting } =\n useUpdateEmailNotification();\n\n const handleSubmit = values => {\n const isReplyToDropdownField =\n emailFormProps?.replyToFieldProps?.options !== undefined;\n\n const body = mergeDeepLeft(\n packEmailPayload(values, isReplyToDropdownField),\n emailNotificationParams\n );\n updateEmailNotification(body, { onSuccess });\n };\n\n if (isLoading || isNotPresent(data)) {\n return (\n <div className=\"flex h-full w-full items-center justify-center\">\n <Spinner />\n </div>\n );\n }\n\n const formattedTitle = renderText(\n title,\n t(\"neetoEmailNotifications.emailNotification.title\")\n );\n\n const formattedSubTitle = renderText(\n subTitle,\n t(\"neetoEmailNotifications.emailNotification.subTitle\")\n );\n\n const {\n validationSchema: customValidationSchema,\n showReplyToField = false,\n showSendToAsRadio = false,\n showCcField = false,\n showBccField = false,\n ...pureFormikProps\n } = emailFormikProps;\n\n return (\n <div className=\"min-w-0 flex-grow overflow-y-auto\">\n <EmailFormComponent\n {...{\n blockNavigation,\n emailPreviewProps,\n showBccField,\n showCcField,\n showReplyToField,\n showSendToAsRadio,\n tooltipProps,\n }}\n showSendToField\n emailFormProps={{ showSendToField: true, ...emailFormProps }}\n isLoading={isSubmitting}\n validationSchema={customValidationSchema || FORM_VALIDATION_SCHEMA}\n formikProps={{\n validateOnBlur: true,\n validateOnChange: true,\n ...pureFormikProps,\n }}\n headerProps={{\n title: formattedTitle,\n titleHelpPopoverProps: helpPopoverProps,\n breadcrumbs,\n }}\n initialValues={parseEmailNotificationData(\n data,\n emailFormProps?.sendToFieldProps?.options ||\n emailFormProps?.sendToOptions\n )}\n switchProps={{\n label: formattedSubTitle,\n disabled,\n \"data-cy\": \"receive-email-notification-switch\",\n }}\n onSubmit={handleSubmit}\n >\n {children}\n </EmailFormComponent>\n </div>\n );\n};\n\nexport default NeetoEmailNotificationForm;\n"],"names":["EMAIL_NOTIFICATIONS_URL","fetch","params","axios","get","update","payload","put","emailNotificationsApi","QUERY_KEYS","NEETO_EMAIL_NOTIFICATIONS","useFetchEmailNotifications","useQuery","queryKey","queryFn","staleTime","DEFAULT_STALE_TIME","select","prop","enabled","isNotEmpty","useUpdateEmailNotification","useMutationWithInvalidation","keysToInvalidate","_","_ref","notificationHolderId","FORM_VALIDATION_SCHEMA","isEnabled","yup","isValidEmail","email","string","isValidSync","createEmailOptions","emails","arguments","length","undefined","map","label","value","valid","parseEmailsOptions","emailOptions","parseEmailNotificationData","data","sendToOptions","_sendToOptions$","notifyEmails","notifyCcEmails","notifyBccEmails","replyToId","customFields","rest","_objectWithoutProperties","_excluded","parsed","_objectSpread","sendTo","sendToCc","sendToBcc","replyTo","sendToId","showCopyEmails","packEmailPayload","values","isReplyToDropdownField","id","message","subject","sendFrom","disabledByUser","_excluded2","mergeLeft","renderText","text","fallbackTranslation","isEmpty","NeetoEmailNotificationForm","_emailFormProps$sendT","_ref$emailNotificatio","emailNotificationParams","_ref$emailPreviewProp","emailPreviewProps","_ref$emailFormProps","emailFormProps","_ref$emailFormikProps","emailFormikProps","_ref$title","title","_ref$subTitle","subTitle","_ref$disabled","disabled","_ref$tooltipProps","tooltipProps","_ref$onSuccess","onSuccess","noop","_ref$blockNavigation","blockNavigation","_ref$breadcrumbs","breadcrumbs","children","_ref$helpPopoverProps","helpPopoverProps","_useTranslation","useTranslation","t","_useFetchEmailNotific","_useFetchEmailNotific2","isLoading","_useUpdateEmailNotifi","updateEmailNotification","mutate","isSubmitting","isPending","handleSubmit","_emailFormProps$reply","replyToFieldProps","options","body","mergeDeepLeft","isNotPresent","_jsx","className","Spinner","formattedTitle","formattedSubTitle","customValidationSchema","validationSchema","_emailFormikProps$sho","showReplyToField","_emailFormikProps$sho2","showSendToAsRadio","_emailFormikProps$sho3","showCcField","_emailFormikProps$sho4","showBccField","pureFormikProps","EmailFormComponent","showSendToField","formikProps","validateOnBlur","validateOnChange","headerProps","titleHelpPopoverProps","initialValues","sendToFieldProps","switchProps","onSubmit"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAO,IAAMA,uBAAuB,GAClC,8CAA8C;;ACGhD,IAAMC,KAAK,GAAG,SAARA,KAAKA,CAAGC,MAAM,EAAA;AAAA,EAAA,OAAIC,KAAK,CAACC,GAAG,CAACJ,uBAAuB,EAAE;AAAEE,IAAAA,MAAM,EAANA;AAAO,GAAC,CAAC;AAAA,CAAA;AAEtE,IAAMG,MAAM,GAAG,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AACvCH,QAAAA,WAAW,EAAXA;OACA;AACF6C,MAAAA,aAAa,EAAEvG,0BAA0B,CACvCC,IAAI,EACJ,CAAAwC,cAAc,KAAA,IAAA,IAAdA,cAAc,KAAA,KAAA,CAAA,IAAA,CAAAN,qBAAA,GAAdM,cAAc,CAAE+D,gBAAgB,MAAArE,IAAAA,IAAAA,qBAAA,KAAhCA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,qBAAA,CAAkCyC,OAAO,MACvCnC,cAAc,KAAdA,IAAAA,IAAAA,cAAc,KAAdA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,cAAc,CAAEvC,aAAa,CACjC,CAAE;AACFuG,MAAAA,WAAW,EAAE;AACX9G,QAAAA,KAAK,EAAEyF,iBAAiB;AACxBnC,QAAAA,QAAQ,EAARA,QAAQ;AACR,QAAA,SAAS,EAAE;OACX;AACFyD,MAAAA,QAAQ,EAAEjC,YAAa;AAAAd,MAAAA,QAAA,EAEtBA;KACiB;AAAC,GAClB,CAAC;AAEV;;;;"}
|
|
1
|
+
{"version":3,"file":"NeetoEmailNotificationForm.js","sources":["../../app/javascript/src/constants/index.js","../../app/javascript/src/apis/email_notifications.js","../../app/javascript/src/constants/query.js","../../app/javascript/src/hooks/reactQuery/emailNotificationApi.js","../../app/javascript/src/components/EmailNotificationForm/constants.js","../../app/javascript/src/components/EmailNotificationForm/utils.js","../../app/javascript/src/components/EmailNotificationForm/index.jsx"],"sourcesContent":["export const EMAIL_NOTIFICATIONS_BASE_URL =\n \"neeto_email_notifications/email_notification\";\n\nexport const RESET_EMAIL_NOTIFICATIONS_TO_DEFAULT_URL = `${EMAIL_NOTIFICATIONS_BASE_URL}/reset_to_default`;\n","import axios from \"axios\";\n\nimport {\n RESET_EMAIL_NOTIFICATIONS_TO_DEFAULT_URL,\n EMAIL_NOTIFICATIONS_BASE_URL,\n} from \"src/constants\";\n\nconst fetch = params => axios.get(EMAIL_NOTIFICATIONS_BASE_URL, { params });\n\nconst update = payload => axios.put(EMAIL_NOTIFICATIONS_BASE_URL, payload);\n\nconst resetToDefault = params =>\n axios.post(RESET_EMAIL_NOTIFICATIONS_TO_DEFAULT_URL, params);\n\nconst emailNotificationsApi = { fetch, update, resetToDefault };\n\nexport default emailNotificationsApi;\n","export const QUERY_KEYS = {\n NEETO_EMAIL_NOTIFICATIONS: \"neeto-email-notifications\",\n};\n","import { useQuery } from \"@tanstack/react-query\";\nimport { isNotEmpty } from \"neetocist\";\nimport { DEFAULT_STALE_TIME } from \"neetocommons/constants\";\nimport { useMutationWithInvalidation } from \"neetocommons/react-utils\";\nimport { prop } from \"ramda\";\n\nimport emailNotificationsApi from \"src/apis/email_notifications\";\nimport { QUERY_KEYS } from \"src/constants/query\";\n\nexport const useFetchEmailNotifications = params =>\n useQuery({\n queryKey: [\n QUERY_KEYS.NEETO_EMAIL_NOTIFICATIONS,\n params[\"notificationHolderId\"],\n params[\"customFields\"],\n ],\n queryFn: () => emailNotificationsApi.fetch(params),\n staleTime: DEFAULT_STALE_TIME,\n select: prop(\"emailNotification\"),\n enabled: isNotEmpty(params),\n });\n\nexport const useUpdateEmailNotification = () =>\n useMutationWithInvalidation(params => emailNotificationsApi.update(params), {\n keysToInvalidate: [\n (_, { notificationHolderId }) => [\n QUERY_KEYS.NEETO_EMAIL_NOTIFICATIONS,\n notificationHolderId,\n ],\n ],\n });\n\nexport const useResetEmailNotificationToDefault = () =>\n useMutationWithInvalidation(emailNotificationsApi.resetToDefault, {\n keysToInvalidate: [\n (_, { notificationHolderId, customFields }) => [\n QUERY_KEYS.NEETO_EMAIL_NOTIFICATIONS,\n notificationHolderId,\n customFields,\n ],\n ],\n });\n","import * as yup from \"yup\";\n\nexport const FORM_VALIDATION_SCHEMA = { isEnabled: yup.boolean() };\n\nexport const DEFAULT_FIELDS_VISIBILITY = {\n showSendToField: true,\n showReplyToField: false,\n showSendToAsRadio: false,\n showBccField: false,\n showCcField: false,\n};\n","import { isNotEmpty } from \"neetocist\";\nimport { isEmpty, mergeLeft, prop, pick } from \"ramda\";\nimport { string } from \"yup\";\n\nconst isValidEmail = email => string().email().isValidSync(email);\n\nconst createEmailOptions = (emails = []) =>\n emails.map(email => ({\n label: email,\n value: email,\n valid: isValidEmail(email),\n }));\n\nexport const parseEmailsOptions = (emailOptions = []) =>\n emailOptions.map(prop(\"label\"));\n\nexport const parseEmailNotificationData = (data, sendToOptions) => {\n const {\n notifyEmails,\n notifyCcEmails,\n notifyBccEmails,\n replyToId,\n customFields,\n ...rest\n } = data;\n\n const parsed = { ...customFields, ...rest };\n parsed.sendTo = notifyEmails ? createEmailOptions(notifyEmails) : [];\n parsed.sendToCc = notifyCcEmails ? createEmailOptions(notifyCcEmails) : [];\n parsed.sendToBcc = notifyCcEmails ? createEmailOptions(notifyBccEmails) : [];\n parsed.replyTo = replyToId || customFields[\"replyTo\"];\n parsed.sendToId = customFields[\"sendToId\"] || sendToOptions?.[0]?.value || \"\";\n parsed.showCopyEmails = !!(notifyCcEmails?.length || notifyBccEmails?.length);\n\n return parsed;\n};\n\nexport const packEmailPayload = (\n values,\n isReplyToDropdownField,\n isDisabledByUser\n) => {\n const {\n // eslint-disable-next-line no-unused-vars\n id: _,\n isEnabled,\n sendTo,\n sendToCc,\n sendToBcc,\n showCopyEmails,\n replyTo,\n message,\n subject,\n sendFrom,\n sendToId,\n ...rest\n } = values;\n let payload = { isEnabled };\n\n if (isEnabled) {\n payload = { ...payload };\n payload.notifyEmails = parseEmailsOptions(sendTo);\n payload.notifyBccEmails = showCopyEmails\n ? parseEmailsOptions(sendToBcc)\n : [];\n\n payload.notifyCcEmails = showCopyEmails ? parseEmailsOptions(sendToCc) : [];\n if (isReplyToDropdownField) {\n payload.replyToId = replyTo;\n } else {\n rest.replyTo = replyTo;\n }\n payload.message = message;\n payload.subject = subject;\n payload.customFields = { ...rest, disabledByUser: false };\n\n if (isNotEmpty(sendToId)) {\n payload.customFields = mergeLeft(payload.customFields, { sendToId });\n }\n payload.sendFrom = sendFrom;\n } else {\n payload.customFields = { disabledByUser: isDisabledByUser };\n }\n\n return payload;\n};\n\nexport const renderText = (text, fallbackTranslation) =>\n isEmpty(text) ? fallbackTranslation : text;\n\nexport const generateDefaultValues = data => {\n if (!data?.defaultAttributes) {\n return null;\n }\n\n const currentDataFields = [\n \"id\",\n \"customFields\",\n \"notifyCcEmails\",\n \"notifyBccEmails\",\n \"replyToId\",\n ];\n\n const currentDataOverlay = pick(currentDataFields, data);\n\n const normalizedDefaults = {\n ...data.defaultAttributes,\n message:\n data.defaultAttributes.message?.replaceAll?.(\"<br />\", \"<br>\") ||\n data.defaultAttributes.message,\n };\n\n return mergeLeft(currentDataOverlay, normalizedDefaults);\n};\n","import { useRef } from \"react\";\n\nimport { isNotPresent, noop } from \"neetocist\";\nimport EmailForm from \"neetomolecules/EmailForm\";\nimport { Spinner } from \"neetoui\";\nimport { mergeDeepLeft, mergeLeft } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport {\n useFetchEmailNotifications,\n useUpdateEmailNotification,\n useResetEmailNotificationToDefault,\n} from \"src/hooks/reactQuery/emailNotificationApi\";\n\nimport { DEFAULT_FIELDS_VISIBILITY, FORM_VALIDATION_SCHEMA } from \"./constants\";\nimport {\n packEmailPayload,\n parseEmailNotificationData,\n renderText,\n generateDefaultValues,\n} from \"./utils\";\n\nconst NeetoEmailNotificationForm = ({\n emailNotificationParams = {},\n emailPreviewProps = {},\n emailFormProps = {},\n emailFormikProps = {},\n title = \"\",\n notificationToggleLabel = \"\",\n breadcrumbs = [],\n helpPopoverProps = {},\n tooltipProps = {},\n disabled = false,\n fieldsVisibility = {},\n blockNavigation = false,\n onSuccess = noop,\n children,\n}) => {\n const editorRef = useRef();\n\n const { t } = useTranslation();\n\n const { data = {}, isLoading } = useFetchEmailNotifications(\n emailNotificationParams\n );\n\n const { mutate: updateEmailNotification, isPending: isSubmitting } =\n useUpdateEmailNotification();\n\n const { mutate: resetToDefault, isPending: isResetting } =\n useResetEmailNotificationToDefault();\n\n const handleSubmit = values => {\n const isDisabledByUser = data.isEnabled && !values.isEnabled;\n const isReplyToDropdownField =\n emailFormProps?.replyToFieldProps?.options !== undefined;\n\n const body = mergeDeepLeft(\n packEmailPayload(values, isReplyToDropdownField, isDisabledByUser),\n emailNotificationParams\n );\n updateEmailNotification(body, { onSuccess });\n };\n\n if (isLoading || isNotPresent(data)) {\n return (\n <div className=\"flex h-full w-full items-center justify-center\">\n <Spinner />\n </div>\n );\n }\n\n const newDefaultAttributes = generateDefaultValues(data);\n\n const defaultValues = parseEmailNotificationData(\n newDefaultAttributes,\n emailFormProps?.sendToFieldProps?.options\n );\n\n defaultValues.defaultAttributes = data.defaultAttributes;\n\n const formattedTitle = renderText(\n title,\n t(\"neetoEmailNotifications.emailNotification.title\")\n );\n\n const formattedNotificationToggleLabel = renderText(\n notificationToggleLabel,\n t(\"neetoEmailNotifications.emailNotification.notificationToggleLabel\")\n );\n\n const { validationSchema: customValidationSchema, ...formikProps } =\n emailFormikProps;\n\n const handleResetToDefault = () => {\n resetToDefault(emailNotificationParams, {\n onSuccess: ({ emailNotification }) =>\n editorRef?.current?.editor?.commands?.setContent(\n emailNotification.message\n ),\n });\n };\n\n return (\n <div className=\"min-w-0 flex-grow overflow-y-auto\">\n <EmailForm\n {...{\n blockNavigation,\n emailPreviewProps,\n formikProps,\n tooltipProps,\n ...mergeLeft(fieldsVisibility, DEFAULT_FIELDS_VISIBILITY),\n }}\n isLoading={isSubmitting}\n validationSchema={customValidationSchema || FORM_VALIDATION_SCHEMA}\n emailFormProps={{\n editorRef,\n handleResetToDefault,\n isResetting,\n defaultValues,\n ...emailFormProps,\n }}\n headerProps={{\n title: formattedTitle,\n titleHelpPopoverProps: helpPopoverProps,\n breadcrumbs,\n }}\n initialValues={parseEmailNotificationData(\n data,\n emailFormProps?.sendToFieldProps?.options\n )}\n switchProps={{\n label: formattedNotificationToggleLabel,\n disabled,\n \"data-cy\": \"receive-email-notification-switch\",\n }}\n onSubmit={handleSubmit}\n >\n {children}\n </EmailForm>\n </div>\n );\n};\n\nexport default NeetoEmailNotificationForm;\n"],"names":["EMAIL_NOTIFICATIONS_BASE_URL","RESET_EMAIL_NOTIFICATIONS_TO_DEFAULT_URL","concat","fetch","params","axios","get","update","payload","put","resetToDefault","post","emailNotificationsApi","QUERY_KEYS","NEETO_EMAIL_NOTIFICATIONS","useFetchEmailNotifications","useQuery","queryKey","queryFn","staleTime","DEFAULT_STALE_TIME","select","prop","enabled","isNotEmpty","useUpdateEmailNotification","useMutationWithInvalidation","keysToInvalidate","_","_ref","notificationHolderId","useResetEmailNotificationToDefault","_ref2","customFields","FORM_VALIDATION_SCHEMA","isEnabled","yup","DEFAULT_FIELDS_VISIBILITY","showSendToField","showReplyToField","showSendToAsRadio","showBccField","showCcField","isValidEmail","email","string","isValidSync","createEmailOptions","emails","arguments","length","undefined","map","label","value","valid","parseEmailsOptions","emailOptions","parseEmailNotificationData","data","sendToOptions","_sendToOptions$","notifyEmails","notifyCcEmails","notifyBccEmails","replyToId","rest","_objectWithoutProperties","_excluded","parsed","_objectSpread","sendTo","sendToCc","sendToBcc","replyTo","sendToId","showCopyEmails","packEmailPayload","values","isReplyToDropdownField","isDisabledByUser","id","message","subject","sendFrom","_excluded2","disabledByUser","mergeLeft","renderText","text","fallbackTranslation","isEmpty","generateDefaultValues","_data$defaultAttribut","_data$defaultAttribut2","defaultAttributes","currentDataFields","currentDataOverlay","pick","normalizedDefaults","replaceAll","call","NeetoEmailNotificationForm","_emailFormProps$sendT","_emailFormProps$sendT2","_ref$emailNotificatio","emailNotificationParams","_ref$emailPreviewProp","emailPreviewProps","_ref$emailFormProps","emailFormProps","_ref$emailFormikProps","emailFormikProps","_ref$title","title","_ref$notificationTogg","notificationToggleLabel","_ref$breadcrumbs","breadcrumbs","_ref$helpPopoverProps","helpPopoverProps","_ref$tooltipProps","tooltipProps","_ref$disabled","disabled","_ref$fieldsVisibility","fieldsVisibility","_ref$blockNavigation","blockNavigation","_ref$onSuccess","onSuccess","noop","children","editorRef","useRef","_useTranslation","useTranslation","t","_useFetchEmailNotific","_useFetchEmailNotific2","isLoading","_useUpdateEmailNotifi","updateEmailNotification","mutate","isSubmitting","isPending","_useResetEmailNotific","isResetting","handleSubmit","_emailFormProps$reply","replyToFieldProps","options","body","mergeDeepLeft","isNotPresent","_jsx","className","Spinner","newDefaultAttributes","defaultValues","sendToFieldProps","formattedTitle","formattedNotificationToggleLabel","customValidationSchema","validationSchema","formikProps","handleResetToDefault","_editorRef$current","emailNotification","current","editor","commands","setContent","EmailForm","headerProps","titleHelpPopoverProps","initialValues","switchProps","onSubmit"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAO,IAAMA,4BAA4B,GACvC,8CAA8C;AAEzC,IAAMC,wCAAwC,GAAA,EAAA,CAAAC,MAAA,CAAMF,4BAA4B,EAAmB,mBAAA,CAAA;;ACI1G,IAAMG,KAAK,GAAG,SAARA,KAAKA,CAAGC,MAAM,EAAA;AAAA,EAAA,OAAIC,KAAK,CAACC,GAAG,CAACN,4BAA4B,EAAE;AAAEI,IAAAA,MAAM,EAANA;AAAO,GAAC,CAAC;AAAA,CAAA;AAE3E,IAAMG,MAAM,GAAG,SAATA,MAAMA,CAAGC,OAAO,EAAA;AAAA,EAAA,OAAIH,KAAK,CAACI,GAAG,CAACT,4BAA4B,EAAEQ,OAAO,CAAC;AAAA,CAAA;AAE1E,IAAME,cAAc,GAAG,SAAjBA,cAAcA,CAAGN,MAAM,EAAA;AAAA,EAAA,OAC3BC,KAAK,CAACM,IAAI,CAACV,wCAAwC,EAAEG,MAAM,CAAC;AAAA,CAAA;AAE9D,IAAMQ,qBAAqB,GAAG;AAAET,EAAAA,KAAK,EAALA,KAAK;AAAEI,EAAAA,MAAM,EAANA,MAAM;AAAEG,EAAAA,cAAc,EAAdA;AAAe,CAAC;;ACdxD,IAAMG,UAAU,GAAG;AACxBC,EAAAA,yBAAyB,EAAE;AAC7B,CAAC;;ACOM,IAAMC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,OACpC,CAAE;AACF0B,MAAAA,WAAW,EAAE;AACX5H,QAAAA,KAAK,EAAE6G,gCAAgC;AACvCtC,QAAAA,QAAQ,EAARA,QAAQ;AACR,QAAA,SAAS,EAAE;OACX;AACFsD,MAAAA,QAAQ,EAAE9B,YAAa;AAAAhB,MAAAA,QAAA,EAEtBA;KACQ,CAAA;AAAC,GACT,CAAC;AAEV;;;;"}
|
package/dist/cjs/index.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var NeetoEmailNotificationForm = require('./NeetoEmailNotificationForm.js');
|
|
4
4
|
require('@babel/runtime/helpers/defineProperty');
|
|
5
5
|
require('@babel/runtime/helpers/objectWithoutProperties');
|
|
6
|
+
require('react');
|
|
6
7
|
require('@bigbinary/neeto-cist');
|
|
7
8
|
require('@bigbinary/neeto-molecules/EmailForm');
|
|
8
9
|
require('@bigbinary/neetoui/Spinner');
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { default as NeetoEmailNotificationForm } from './NeetoEmailNotificationForm.js';
|
|
2
2
|
import '@babel/runtime/helpers/defineProperty';
|
|
3
3
|
import '@babel/runtime/helpers/objectWithoutProperties';
|
|
4
|
+
import 'react';
|
|
4
5
|
import '@bigbinary/neeto-cist';
|
|
5
6
|
import '@bigbinary/neeto-molecules/EmailForm';
|
|
6
7
|
import '@bigbinary/neetoui/Spinner';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigbinary/neeto-email-notifications-frontend",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.16",
|
|
4
4
|
"description": "A repo acts as the source of truth for the new nano's structure, configs, data etc.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"homepage": "https://github.com/bigbinary/neeto-email-notifications-nano",
|
|
@@ -61,14 +61,14 @@
|
|
|
61
61
|
"@babel/preset-typescript": "7.26.0",
|
|
62
62
|
"@babel/runtime": "7.26.10",
|
|
63
63
|
"@bigbinary/babel-preset-neeto": "^1.0.3",
|
|
64
|
-
"@bigbinary/eslint-plugin-neeto": "1.6
|
|
64
|
+
"@bigbinary/eslint-plugin-neeto": "1.7.6",
|
|
65
65
|
"@bigbinary/neeto-cist": "1.0.17",
|
|
66
|
-
"@bigbinary/neeto-commons-frontend": "4.13.
|
|
67
|
-
"@bigbinary/neeto-editor": "1.47.
|
|
68
|
-
"@bigbinary/neeto-filters-frontend": "4.3.
|
|
69
|
-
"@bigbinary/neeto-icons": "1.20.
|
|
70
|
-
"@bigbinary/neeto-molecules": "
|
|
71
|
-
"@bigbinary/neetoui": "8.3.
|
|
66
|
+
"@bigbinary/neeto-commons-frontend": "4.13.71",
|
|
67
|
+
"@bigbinary/neeto-editor": "1.47.52",
|
|
68
|
+
"@bigbinary/neeto-filters-frontend": "4.3.24",
|
|
69
|
+
"@bigbinary/neeto-icons": "1.20.59",
|
|
70
|
+
"@bigbinary/neeto-molecules": "4.0.67",
|
|
71
|
+
"@bigbinary/neetoui": "8.3.36",
|
|
72
72
|
"@emotion/is-prop-valid": "1.2.0",
|
|
73
73
|
"@faker-js/faker": "8.2.0",
|
|
74
74
|
"@honeybadger-io/js": "6.10.1",
|
|
@@ -121,6 +121,7 @@
|
|
|
121
121
|
"eslint-plugin-xss": "^0.1.12",
|
|
122
122
|
"formik": "2.4.6",
|
|
123
123
|
"globals": "16.0.0",
|
|
124
|
+
"globby": "^14.1.0",
|
|
124
125
|
"html-webpack-plugin": "5.5.3",
|
|
125
126
|
"https-browserify": "1.0.0",
|
|
126
127
|
"husky": "7.0.4",
|
|
@@ -137,7 +138,7 @@
|
|
|
137
138
|
"postcss-loader": "^7.0.1",
|
|
138
139
|
"postcss-preset-env": "7.8.2",
|
|
139
140
|
"prettier": "3",
|
|
140
|
-
"prettier-plugin-tailwindcss": "0.
|
|
141
|
+
"prettier-plugin-tailwindcss": "0.6.14",
|
|
141
142
|
"process": "0.11.10",
|
|
142
143
|
"qs": "^6.11.2",
|
|
143
144
|
"ramda": "0.29.0",
|
|
@@ -177,12 +178,12 @@
|
|
|
177
178
|
"peerDependencies": {
|
|
178
179
|
"@babel/runtime": "7.26.10",
|
|
179
180
|
"@bigbinary/neeto-cist": "1.0.17",
|
|
180
|
-
"@bigbinary/neeto-commons-frontend": "4.13.
|
|
181
|
-
"@bigbinary/neeto-editor": "1.47.
|
|
182
|
-
"@bigbinary/neeto-filters-frontend": "4.3.
|
|
183
|
-
"@bigbinary/neeto-icons": "1.20.
|
|
184
|
-
"@bigbinary/neeto-molecules": "
|
|
185
|
-
"@bigbinary/neetoui": "8.3.
|
|
181
|
+
"@bigbinary/neeto-commons-frontend": "4.13.71",
|
|
182
|
+
"@bigbinary/neeto-editor": "1.47.52",
|
|
183
|
+
"@bigbinary/neeto-filters-frontend": "4.3.24",
|
|
184
|
+
"@bigbinary/neeto-icons": "1.20.59",
|
|
185
|
+
"@bigbinary/neeto-molecules": "4.0.67",
|
|
186
|
+
"@bigbinary/neetoui": "8.3.36",
|
|
186
187
|
"@honeybadger-io/js": "6.10.1",
|
|
187
188
|
"@honeybadger-io/react": "6.1.25",
|
|
188
189
|
"@tailwindcss/container-queries": "^0.1.1",
|
package/types.d.ts
CHANGED
|
@@ -34,52 +34,54 @@ type EmailFormProps = {
|
|
|
34
34
|
handleResetToDefault?: () => void;
|
|
35
35
|
isLoading?: boolean;
|
|
36
36
|
isUpdating?: boolean;
|
|
37
|
+
isResetting?: boolean;
|
|
37
38
|
showFields?: boolean;
|
|
38
39
|
className?: string;
|
|
39
40
|
sendToFieldProps?: SendToFieldPropsType;
|
|
40
41
|
replyToFieldProps?: ReplyToFieldPropsType;
|
|
41
|
-
replyToOptions?: FieldOptions[];
|
|
42
|
-
sendToOptions?: FieldOptions[];
|
|
43
42
|
showResetToDefaultButton?: boolean;
|
|
44
43
|
editorRef?: any;
|
|
45
44
|
editorAddons?: any[];
|
|
45
|
+
defaultValues?: any;
|
|
46
46
|
};
|
|
47
47
|
|
|
48
48
|
type EmailFormikProps = {
|
|
49
|
-
showSendToField?: boolean;
|
|
50
|
-
showReplyToField?: boolean;
|
|
51
|
-
showSendToAsRadio?: boolean;
|
|
52
|
-
showCcField?: boolean;
|
|
53
|
-
showBccField?: boolean;
|
|
54
49
|
onSubmit?: (values: any) => void;
|
|
55
50
|
initialValues?: any;
|
|
56
51
|
children?: React.ReactNode;
|
|
57
52
|
formikProps?: { [key: string]: any };
|
|
58
|
-
validationSchema?: ValidationMap;
|
|
53
|
+
validationSchema?: AnySchema | ValidationMap;
|
|
59
54
|
};
|
|
60
55
|
|
|
61
56
|
type EmailPreviewProps = {
|
|
62
57
|
to?: string[];
|
|
58
|
+
from?: string;
|
|
63
59
|
subject?: string;
|
|
64
60
|
body?: string;
|
|
65
|
-
from?: string;
|
|
66
61
|
logo?: string;
|
|
67
|
-
productName?: string;
|
|
68
62
|
actionButtonText?: string;
|
|
69
63
|
className?: string;
|
|
70
64
|
customContent?: string;
|
|
71
65
|
formatBody?: (content: string, variables?: any) => string;
|
|
72
66
|
formatSubject?: (content: string, variables?: any) => string;
|
|
73
|
-
bodyVariables?:
|
|
74
|
-
subjectVariables?:
|
|
67
|
+
bodyVariables?: ContentVariables[];
|
|
68
|
+
subjectVariables?: ContentVariables[];
|
|
75
69
|
};
|
|
76
70
|
|
|
77
71
|
type EmailNotificationParams = {
|
|
78
|
-
|
|
79
|
-
|
|
72
|
+
notificationHolderType: string;
|
|
73
|
+
notificationHolderId: string;
|
|
80
74
|
customFields?: { [key: string]: any };
|
|
81
75
|
};
|
|
82
76
|
|
|
77
|
+
type FieldsVisibility = {
|
|
78
|
+
showBccField?: boolean;
|
|
79
|
+
showCcField?: boolean;
|
|
80
|
+
showReplyToField?: boolean;
|
|
81
|
+
showSendToAsRadio?: boolean;
|
|
82
|
+
showSendToField?: boolean;
|
|
83
|
+
};
|
|
84
|
+
|
|
83
85
|
interface EmailNotificationProps {
|
|
84
86
|
emailNotificationParams: EmailNotificationParams;
|
|
85
87
|
emailFormProps?: EmailFormProps;
|
|
@@ -87,13 +89,14 @@ interface EmailNotificationProps {
|
|
|
87
89
|
emailPreviewProps?: EmailPreviewProps;
|
|
88
90
|
tooltipProps?: TooltipProps;
|
|
89
91
|
title?: string;
|
|
90
|
-
|
|
92
|
+
notificationToggleLabel?: string;
|
|
91
93
|
disabled?: boolean;
|
|
92
94
|
blockNavigation?: boolean;
|
|
93
95
|
children?: React.ReactNode;
|
|
94
96
|
onSuccess?: Fn;
|
|
95
97
|
breadcrumbs?: Array<{ text: string; link?: string }>;
|
|
96
98
|
helpPopoverProps?: HelpPopoverProps;
|
|
99
|
+
fieldsVisibility?: FieldsVisibility;
|
|
97
100
|
}
|
|
98
101
|
|
|
99
102
|
export const NeetoEmailNotificationForm: React.FC<EmailNotificationProps>;
|