@bigbinary/neeto-message-templates-frontend 0.6.5 → 0.6.7

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 CHANGED
@@ -89,6 +89,7 @@ This component is used to manage message templates in your web application. It p
89
89
  - `breadcrumbs`: An array of objects that specify breadcrumbs for navigation.
90
90
  - `isTestingTemplateDisabled`: A boolean indicating whether the test template button should be enabled or not.
91
91
  - `manageTemplatesPaneCustomFields`: To add custom components to the manage templates pane.
92
+ - `onMutationSuccess`: The callback function which is triggered on the success of mutation functions(create, update & delete).
92
93
 
93
94
  ##### Usage
94
95
  ```jsx
@@ -97,6 +98,8 @@ import React from "react";
97
98
  import { MessageTemplates } from "@bigbinary/neeto-message-templates-frontend";
98
99
 
99
100
  const App = () => {
101
+ const queryClient = useQueryClient();
102
+
100
103
  const breadcrumbs = [
101
104
  {
102
105
  link: "/settings",
@@ -130,6 +133,7 @@ const App = () => {
130
133
  type={type}
131
134
  isTestingTemplateDisabled={isTestingTemplateDisabled}
132
135
  manageTemplatesPaneCustomFields={manageTemplatesPaneCustomFields()}
136
+ onMutationSuccess={() => queryClient.invalidateQueries(["rules"])}
133
137
  />
134
138
  );
135
139
  };
@@ -206,7 +210,8 @@ This component is used to manage the API templates in your application. It provi
206
210
  - `ownerId`: To provide the `ID` of the owner to which the API templates belongs to.
207
211
 
208
212
  ##### Optional props
209
- - `breadcrumbs`: An array of objects that specify breadcrumbs for navigation.
213
+ - `breadcrumbs`: An array of objects that specify breadcrumbs for navigation.
214
+ - `onMutationSuccess`: The callback function which is triggered on the success of mutation functions(create, update & delete).
210
215
 
211
216
  ##### Usage
212
217
  ```js
@@ -215,10 +220,17 @@ import React from "react";
215
220
  import { ApiTemplates } from "neetomessagetemplates";
216
221
 
217
222
  const App = () => {
223
+ const queryClient = useQueryClient();
224
+
218
225
  const breadcrumbs = [{ link: "/settings", text: "Settings" }];
219
226
  const ownerId = "ownerId";
220
227
 
221
- return <ApiTemplates {...{ breadcrumbs, ownerId }} />;
228
+ return (
229
+ <ApiTemplates
230
+ {...{ breadcrumbs, ownerId }}
231
+ onMutationSuccess={() => queryClient.invalidateQueries(["rules"])}
232
+ />
233
+ );
222
234
  };
223
235
  ```
224
236
 
@@ -52,7 +52,9 @@
52
52
  "templateName": "Template name",
53
53
  "emailSubject": "Email subject",
54
54
  "emailBody": "Email body",
55
- "smsBody": "SMS body"
55
+ "smsBody": "SMS body",
56
+ "messageTemplatesWithCount_one": "{{count}} {{type, anyCase}} template",
57
+ "messageTemplatesWithCount_other": "{{count}} {{type, anyCase}} templates"
56
58
  },
57
59
  "sendMessage": {
58
60
  "email": "Send email",
@@ -84,6 +86,7 @@
84
86
  "messageType": {
85
87
  "sms": "SMS",
86
88
  "email": "email",
87
- "whatsapp": "whatsapp"
89
+ "whatsapp": "whatsapp",
90
+ "api": "API"
88
91
  }
89
92
  }