@bigbinary/neeto-email-notifications-frontend 1.3.2 → 1.4.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/README.md +12 -11
- package/dist/index.cjs.js +9 -5
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +9 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/types.d.ts +2 -0
package/README.md
CHANGED
|
@@ -65,17 +65,18 @@ across neeto products
|
|
|
65
65
|
|
|
66
66
|
<img width="1318" alt="NeetoEmailNotificationForm component" src="https://github.com/bigbinary/neeto-email-notifications-nano/assets/89389135/bbe89fce-98ad-4974-9617-2a69d9baa61a">
|
|
67
67
|
|
|
68
|
-
| Prop | Type
|
|
69
|
-
| ----------------------- |
|
|
70
|
-
| title | String
|
|
71
|
-
| subtitle | String
|
|
72
|
-
| disabled | Boolean
|
|
73
|
-
| emailFormikProps | Object
|
|
74
|
-
| emailFormProps | Object
|
|
75
|
-
| emailPreviewProps | Object
|
|
76
|
-
| emailNotificationParams | Object
|
|
77
|
-
|
|
|
78
|
-
|
|
|
68
|
+
| Prop | Type | Default Value | Description |
|
|
69
|
+
| ----------------------- | -------- | ------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------- |
|
|
70
|
+
| title | String | "Email notification" | The title of the component. |
|
|
71
|
+
| subtitle | String | "Send an email notification when a new event occurred" | The subtitle of the component. |
|
|
72
|
+
| disabled | Boolean | false | Disables the component |
|
|
73
|
+
| emailFormikProps | Object | {} | Props for [`<EmailFormProvider />`](https://github.com/bigbinary/neeto-molecules/blob/main/docs/components.md#emailformprovider) |
|
|
74
|
+
| emailFormProps | Object | {} | Props for [`<EmailForm />`](https://github.com/bigbinary/neeto-molecules/blob/main/docs/components.md#emailform) |
|
|
75
|
+
| emailPreviewProps | Object | {} | Props for [`<EmailPreview />`](https://github.com/bigbinary/neeto-molecules/blob/main/docs/components.md#emailpreview) |
|
|
76
|
+
| emailNotificationParams | Object | {} | Contains params required for fetching email notification |
|
|
77
|
+
| onSuccess | Function | noop | Function that will be called when the email notification is updated successfully |
|
|
78
|
+
| tooltipProps | Object | {} | Props for `<Tooltip>` for showing toolTip content when disabled |
|
|
79
|
+
| children | Node | undefined | Additional content to be displayed inside the component |
|
|
79
80
|
|
|
80
81
|
<!-- TODO: Add references -->
|
|
81
82
|
|
package/dist/index.cjs.js
CHANGED
|
@@ -4,13 +4,13 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var classNames = require('classnames');
|
|
7
|
+
var pure = require('@bigbinary/neeto-commons-frontend/pure');
|
|
7
8
|
var EmailForm = require('@bigbinary/neeto-molecules/EmailForm');
|
|
8
9
|
var PageLoader = require('@bigbinary/neeto-molecules/PageLoader');
|
|
9
10
|
var neetoui = require('@bigbinary/neetoui');
|
|
10
11
|
var formik = require('@bigbinary/neetoui/formik');
|
|
11
12
|
var ramda = require('ramda');
|
|
12
13
|
var constants = require('@bigbinary/neeto-commons-frontend/constants');
|
|
13
|
-
var pure = require('@bigbinary/neeto-commons-frontend/pure');
|
|
14
14
|
var reactQuery = require('react-query');
|
|
15
15
|
var axios = require('axios');
|
|
16
16
|
var yup = require('yup');
|
|
@@ -2669,11 +2669,11 @@ var emailNotificationsApi = {
|
|
|
2669
2669
|
};
|
|
2670
2670
|
|
|
2671
2671
|
var QUERY_KEYS = {
|
|
2672
|
-
|
|
2672
|
+
NEETO_EMAIL_NOTIFICATIONS: "neeto-email-notifications"
|
|
2673
2673
|
};
|
|
2674
2674
|
|
|
2675
2675
|
var useFetchEmailNotifications = function useFetchEmailNotifications(params) {
|
|
2676
|
-
return reactQuery.useQuery([QUERY_KEYS.
|
|
2676
|
+
return reactQuery.useQuery([QUERY_KEYS.NEETO_EMAIL_NOTIFICATIONS, params["notificationHolderId"], params["customFields"]], function () {
|
|
2677
2677
|
return emailNotificationsApi.fetch(params);
|
|
2678
2678
|
}, {
|
|
2679
2679
|
staleTime: constants.DEFAULT_STALE_TIME,
|
|
@@ -2688,7 +2688,7 @@ var useUpdateEmailNotification = function useUpdateEmailNotification() {
|
|
|
2688
2688
|
}, {
|
|
2689
2689
|
onSuccess: function onSuccess(_, _ref) {
|
|
2690
2690
|
var notificationHolderId = _ref.notificationHolderId;
|
|
2691
|
-
return queryClient.invalidateQueries([QUERY_KEYS.
|
|
2691
|
+
return queryClient.invalidateQueries([QUERY_KEYS.NEETO_EMAIL_NOTIFICATIONS, notificationHolderId]);
|
|
2692
2692
|
}
|
|
2693
2693
|
});
|
|
2694
2694
|
};
|
|
@@ -2817,6 +2817,8 @@ var NeetoEmailNotificationForm = function NeetoEmailNotificationForm(_ref) {
|
|
|
2817
2817
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
2818
2818
|
_ref$tooltipProps = _ref.tooltipProps,
|
|
2819
2819
|
tooltipProps = _ref$tooltipProps === void 0 ? {} : _ref$tooltipProps,
|
|
2820
|
+
_ref$onSuccess = _ref.onSuccess,
|
|
2821
|
+
onSuccess = _ref$onSuccess === void 0 ? pure.noop : _ref$onSuccess,
|
|
2820
2822
|
children = _ref.children;
|
|
2821
2823
|
var _useTranslation = useTranslation(),
|
|
2822
2824
|
t = _useTranslation.t;
|
|
@@ -2830,7 +2832,9 @@ var NeetoEmailNotificationForm = function NeetoEmailNotificationForm(_ref) {
|
|
|
2830
2832
|
var emailNotification = packEmailPayload(values);
|
|
2831
2833
|
updateEmailNotification(_objectSpread({
|
|
2832
2834
|
emailNotification: emailNotification
|
|
2833
|
-
}, emailNotificationParams)
|
|
2835
|
+
}, emailNotificationParams), {
|
|
2836
|
+
onSuccess: onSuccess
|
|
2837
|
+
});
|
|
2834
2838
|
};
|
|
2835
2839
|
if (isLoading) {
|
|
2836
2840
|
return /*#__PURE__*/React__default["default"].createElement(PageLoader__default["default"], null);
|