@bigbinary/neeto-message-templates-frontend 0.0.6 → 0.0.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/dist/index.cjs.js +38 -24
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +38 -24
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -5242,6 +5242,9 @@ var template = {
|
|
|
5242
5242
|
addEmailTemplate: "Add new email template",
|
|
5243
5243
|
addSmsTemplate: "Add new sms template",
|
|
5244
5244
|
addWhatsappTemplate: "Add new whatsapp template",
|
|
5245
|
+
editEmailTemplate: "Edit email template",
|
|
5246
|
+
editSmsTemplate: "Edit sms template",
|
|
5247
|
+
editWhatsappTemplate: "Edit whatsapp template",
|
|
5245
5248
|
search: "Search {{what}}",
|
|
5246
5249
|
markAsActive: "Mark as active",
|
|
5247
5250
|
markAsInactive: "Mark as inactive",
|
|
@@ -5282,9 +5285,13 @@ var sendMessage = {
|
|
|
5282
5285
|
sms: "Send sms",
|
|
5283
5286
|
selectTemplate: "Select a template"
|
|
5284
5287
|
};
|
|
5288
|
+
var common = {
|
|
5289
|
+
send: "Send"
|
|
5290
|
+
};
|
|
5285
5291
|
var en = {
|
|
5286
5292
|
template: template,
|
|
5287
|
-
sendMessage: sendMessage
|
|
5293
|
+
sendMessage: sendMessage,
|
|
5294
|
+
common: common
|
|
5288
5295
|
};
|
|
5289
5296
|
|
|
5290
5297
|
instance.use(Browser).use(initReactI18next).init({
|
|
@@ -5342,20 +5349,23 @@ var MESSAGE_TEMPLATES = {
|
|
|
5342
5349
|
email: {
|
|
5343
5350
|
label: t$1("template.emailTemplates"),
|
|
5344
5351
|
value: "email_template",
|
|
5345
|
-
|
|
5346
|
-
labelSingular: t$1("template.emailTemplate")
|
|
5352
|
+
addText: t$1("template.addEmailTemplate"),
|
|
5353
|
+
labelSingular: t$1("template.emailTemplate"),
|
|
5354
|
+
editText: t$1("template.editEmailTemplate")
|
|
5347
5355
|
},
|
|
5348
5356
|
sms: {
|
|
5349
5357
|
label: t$1("template.smsTemplates"),
|
|
5350
5358
|
value: "sms_template",
|
|
5351
|
-
|
|
5352
|
-
labelSingular: t$1("template.smsTemplate")
|
|
5359
|
+
addText: t$1("template.addSmsTemplate"),
|
|
5360
|
+
labelSingular: t$1("template.smsTemplate"),
|
|
5361
|
+
editText: t$1("template.editSmsTemplate")
|
|
5353
5362
|
},
|
|
5354
5363
|
whatsapp: {
|
|
5355
5364
|
label: t$1("template.whatsappTemplates"),
|
|
5356
5365
|
value: "whatsapp_template",
|
|
5357
|
-
|
|
5358
|
-
labelSingular: t$1("template.whatsappTemplate")
|
|
5366
|
+
addText: t$1("template.addWhatsappTemplate"),
|
|
5367
|
+
labelSingular: t$1("template.whatsappTemplate"),
|
|
5368
|
+
editText: t$1("template.editWhatsappTemplate")
|
|
5359
5369
|
}
|
|
5360
5370
|
};
|
|
5361
5371
|
var DEFAULT_EDITOR_ROW_COUNT = 15;
|
|
@@ -6142,12 +6152,13 @@ var Form$1 = function Form(_ref) {
|
|
|
6142
6152
|
|
|
6143
6153
|
var AddEdit = function AddEdit(_ref) {
|
|
6144
6154
|
var onClose = _ref.onClose,
|
|
6145
|
-
label = _ref.label,
|
|
6146
6155
|
createUpdateTemplate = _ref.createUpdateTemplate,
|
|
6147
6156
|
manageTemplatePane = _ref.manageTemplatePane,
|
|
6148
6157
|
isTestMessageLoading = _ref.isTestMessageLoading,
|
|
6149
6158
|
handleSubmitTestTemplate = _ref.handleSubmitTestTemplate,
|
|
6150
|
-
shouldIncludeTestTemplate = _ref.shouldIncludeTestTemplate
|
|
6159
|
+
shouldIncludeTestTemplate = _ref.shouldIncludeTestTemplate,
|
|
6160
|
+
addText = _ref.addText,
|
|
6161
|
+
editText = _ref.editText;
|
|
6151
6162
|
var initialFocusField = useRef();
|
|
6152
6163
|
var setInitialFocusField = function setInitialFocusField(fieldRef) {
|
|
6153
6164
|
return initialFocusField.current = fieldRef;
|
|
@@ -6155,6 +6166,7 @@ var AddEdit = function AddEdit(_ref) {
|
|
|
6155
6166
|
var isOpen = manageTemplatePane.isOpen,
|
|
6156
6167
|
isEdit = manageTemplatePane.isEdit,
|
|
6157
6168
|
template = manageTemplatePane.template;
|
|
6169
|
+
var label = isEdit ? editText : addText;
|
|
6158
6170
|
return /*#__PURE__*/React.createElement(Pane, {
|
|
6159
6171
|
initialFocusRef: initialFocusField,
|
|
6160
6172
|
isOpen: isOpen,
|
|
@@ -6250,7 +6262,7 @@ var List = function List(_ref) {
|
|
|
6250
6262
|
setPageProperties = _ref.setPageProperties,
|
|
6251
6263
|
pageProperties = _ref.pageProperties,
|
|
6252
6264
|
label = _ref.label,
|
|
6253
|
-
|
|
6265
|
+
addText = _ref.addText,
|
|
6254
6266
|
isFilterApplied = _ref.isFilterApplied;
|
|
6255
6267
|
var _useTranslation = useTranslation(),
|
|
6256
6268
|
t = _useTranslation.t;
|
|
@@ -6294,7 +6306,7 @@ var List = function List(_ref) {
|
|
|
6294
6306
|
className: "flex h-full w-full items-center justify-center"
|
|
6295
6307
|
}, /*#__PURE__*/React.createElement(NoData, {
|
|
6296
6308
|
primaryButtonProps: {
|
|
6297
|
-
label:
|
|
6309
|
+
label: addText,
|
|
6298
6310
|
onClick: function onClick() {
|
|
6299
6311
|
return setManageTemplatePane(assoc("isOpen", true));
|
|
6300
6312
|
}
|
|
@@ -6361,8 +6373,9 @@ var MessageTemplates = function MessageTemplates(_ref) {
|
|
|
6361
6373
|
var _MESSAGE_TEMPLATES$ty = MESSAGE_TEMPLATES[type],
|
|
6362
6374
|
label = _MESSAGE_TEMPLATES$ty.label,
|
|
6363
6375
|
value = _MESSAGE_TEMPLATES$ty.value,
|
|
6364
|
-
|
|
6365
|
-
labelSingular = _MESSAGE_TEMPLATES$ty.labelSingular
|
|
6376
|
+
addText = _MESSAGE_TEMPLATES$ty.addText,
|
|
6377
|
+
labelSingular = _MESSAGE_TEMPLATES$ty.labelSingular,
|
|
6378
|
+
editText = _MESSAGE_TEMPLATES$ty.editText;
|
|
6366
6379
|
var isFilterApplied = isNotEmpty(filters) || isNotEmpty(searchTerm);
|
|
6367
6380
|
var handleActionClick = function handleActionClick() {
|
|
6368
6381
|
return setManageTemplatePane(_objectSpread(_objectSpread({}, MESSAGE_TEMPLATE_INITIAL_STATE), {}, {
|
|
@@ -6379,13 +6392,13 @@ var MessageTemplates = function MessageTemplates(_ref) {
|
|
|
6379
6392
|
});
|
|
6380
6393
|
}, [value]);
|
|
6381
6394
|
return /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(NeetoHeader, {
|
|
6382
|
-
breadcrumbs: breadcrumbs,
|
|
6383
|
-
searchProps: renderSearchProps(label, setSearchTerm, searchTerm),
|
|
6384
|
-
title: label,
|
|
6385
6395
|
actionBlock: /*#__PURE__*/React.createElement(Button, {
|
|
6386
|
-
label:
|
|
6396
|
+
label: addText,
|
|
6387
6397
|
onClick: handleActionClick
|
|
6388
|
-
})
|
|
6398
|
+
}),
|
|
6399
|
+
breadcrumbs: breadcrumbs,
|
|
6400
|
+
searchProps: renderSearchProps(label, setSearchTerm, searchTerm),
|
|
6401
|
+
title: label
|
|
6389
6402
|
}), /*#__PURE__*/React.createElement(SubHeader, {
|
|
6390
6403
|
leftActionBlock: /*#__PURE__*/React.createElement(Bar, {
|
|
6391
6404
|
columns: filterColumns,
|
|
@@ -6403,7 +6416,7 @@ var MessageTemplates = function MessageTemplates(_ref) {
|
|
|
6403
6416
|
}
|
|
6404
6417
|
})
|
|
6405
6418
|
}), /*#__PURE__*/React.createElement(List, {
|
|
6406
|
-
|
|
6419
|
+
addText: addText,
|
|
6407
6420
|
isFilterApplied: isFilterApplied,
|
|
6408
6421
|
isLoading: isLoading,
|
|
6409
6422
|
label: label,
|
|
@@ -6414,10 +6427,11 @@ var MessageTemplates = function MessageTemplates(_ref) {
|
|
|
6414
6427
|
setPageProperties: setPageProperties,
|
|
6415
6428
|
templatesData: templatesData
|
|
6416
6429
|
}), /*#__PURE__*/React.createElement(AddEdit, {
|
|
6430
|
+
addText: addText,
|
|
6417
6431
|
createUpdateTemplate: createUpdateTemplate,
|
|
6432
|
+
editText: editText,
|
|
6418
6433
|
handleSubmitTestTemplate: handleSubmitTestTemplate,
|
|
6419
6434
|
isTestMessageLoading: isTestMessageLoading,
|
|
6420
|
-
label: addButtonText,
|
|
6421
6435
|
manageTemplatePane: manageTemplatePane,
|
|
6422
6436
|
shouldIncludeTestTemplate: shouldIncludeTestTemplate,
|
|
6423
6437
|
onClose: function onClose() {
|
|
@@ -6535,13 +6549,13 @@ var SendMessagePane = function SendMessagePane(_ref) {
|
|
|
6535
6549
|
handleSubmit = _ref$handleSubmit === void 0 ? noop$1 : _ref$handleSubmit,
|
|
6536
6550
|
_ref$onClose = _ref.onClose,
|
|
6537
6551
|
onClose = _ref$onClose === void 0 ? noop$1 : _ref$onClose;
|
|
6552
|
+
var _useTranslation = useTranslation(),
|
|
6553
|
+
t = _useTranslation.t;
|
|
6538
6554
|
var initialFocusField = useRef();
|
|
6539
6555
|
var setInitialFocusField = function setInitialFocusField(fieldRef) {
|
|
6540
6556
|
return initialFocusField.current = fieldRef;
|
|
6541
6557
|
};
|
|
6542
|
-
var
|
|
6543
|
-
label = _MESSAGE_TEMPLATES$ty.label,
|
|
6544
|
-
value = _MESSAGE_TEMPLATES$ty.value;
|
|
6558
|
+
var value = MESSAGE_TEMPLATES[type].value;
|
|
6545
6559
|
var templateParams = {
|
|
6546
6560
|
status: "active",
|
|
6547
6561
|
templateType: value
|
|
@@ -6559,7 +6573,7 @@ var SendMessagePane = function SendMessagePane(_ref) {
|
|
|
6559
6573
|
}, /*#__PURE__*/React.createElement(Pane.Header, null, /*#__PURE__*/React.createElement(Typography, {
|
|
6560
6574
|
style: "h2",
|
|
6561
6575
|
weight: "semibold"
|
|
6562
|
-
},
|
|
6576
|
+
}, t("common.send"), " ", type)), /*#__PURE__*/React.createElement(Pane.Body, null, /*#__PURE__*/React.createElement(Form, {
|
|
6563
6577
|
handleSubmit: handleSubmit,
|
|
6564
6578
|
isEmailTemplate: isEmailTemplate,
|
|
6565
6579
|
setInitialFocusField: setInitialFocusField,
|