@bigbinary/neeto-message-templates-frontend 0.5.1 → 0.5.3
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 +9 -19
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +10 -20
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import Container from '@bigbinary/neeto-molecules/Container';
|
|
|
5
5
|
import NeetoHeader from '@bigbinary/neeto-molecules/Header';
|
|
6
6
|
import SubHeader from '@bigbinary/neeto-molecules/SubHeader';
|
|
7
7
|
import { Typography, Button, Pane, Table, NoData, Alert, Select, Textarea, Label } from '@bigbinary/neetoui';
|
|
8
|
-
import { isEmpty, equals, prop, includes, pick, omit, assoc, mergeAll, pluck, whereAny, reject,
|
|
8
|
+
import { isEmpty, equals, prop, includes, pick, omit, assoc, mergeAll, pluck, whereAny, reject, modify } from 'ramda';
|
|
9
9
|
import { t } from 'i18next';
|
|
10
10
|
import { DEFAULT_PAGE_SIZE, DEFAULT_PAGE_INDEX } from '@bigbinary/neeto-commons-frontend/constants';
|
|
11
11
|
import MoreDropdown from '@bigbinary/neeto-molecules/MoreDropdown';
|
|
@@ -3224,12 +3224,11 @@ var List = function List(_ref) {
|
|
|
3224
3224
|
}
|
|
3225
3225
|
});
|
|
3226
3226
|
};
|
|
3227
|
-
return /*#__PURE__*/React.createElement(
|
|
3228
|
-
className: "w-full flex-grow"
|
|
3229
|
-
}, !isEmpty(templates) ? /*#__PURE__*/React.createElement(TableWrapper, {
|
|
3227
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, !isEmpty(templates) ? /*#__PURE__*/React.createElement(TableWrapper, {
|
|
3230
3228
|
hasPagination: totalCount > pageSize
|
|
3231
3229
|
}, /*#__PURE__*/React.createElement(Table, {
|
|
3232
3230
|
totalCount: totalCount,
|
|
3231
|
+
fixedHeight: true,
|
|
3233
3232
|
columnData: buildTableColumnData$1(setManageTemplatePane, ownerId),
|
|
3234
3233
|
currentPageNumber: pageIndex,
|
|
3235
3234
|
defaultPageSize: pageSize,
|
|
@@ -3349,6 +3348,7 @@ var MessageTemplates = function MessageTemplates(_ref) {
|
|
|
3349
3348
|
return /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(NeetoHeader, {
|
|
3350
3349
|
breadcrumbs: breadcrumbs,
|
|
3351
3350
|
searchProps: renderSearchProps(label, value),
|
|
3351
|
+
size: "small",
|
|
3352
3352
|
title: label,
|
|
3353
3353
|
actionBlock: /*#__PURE__*/React.createElement(Button, {
|
|
3354
3354
|
"data-cy": "add-".concat(hyphenate(value), "-button"),
|
|
@@ -3821,25 +3821,13 @@ var rejectEmptyKeyValuePairs = reject(whereAny({
|
|
|
3821
3821
|
value: isEmpty
|
|
3822
3822
|
}));
|
|
3823
3823
|
|
|
3824
|
-
/*
|
|
3825
|
-
Usage of transformAdditionalDataToKeyValuePairs:
|
|
3826
|
-
{ a: 'val1', b: 'val2' } -> [{ key: 'a', value: 'val1' }, { key: 'b', value: 'val2' }]
|
|
3827
|
-
*/
|
|
3828
|
-
var transformAdditionalDataToKeyValuePairs = pipe(toPairs, map(zipObj(["key", "value"])));
|
|
3829
|
-
|
|
3830
|
-
/*
|
|
3831
|
-
Usage of buildAdditionalDataFromKeyValuePairs:
|
|
3832
|
-
[{ key: 'a', value: 'val1' }, { key: 'b', value: 'val2' }] -> { a: 'val1', b: 'val2' }
|
|
3833
|
-
*/
|
|
3834
|
-
var buildAdditionalDataFromKeyValuePairs = pipe(rejectEmptyKeyValuePairs, map(values), fromPairs);
|
|
3835
|
-
|
|
3836
3824
|
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; }
|
|
3837
3825
|
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; }
|
|
3838
3826
|
var buildApiTemplatePayload = function buildApiTemplatePayload(values) {
|
|
3839
3827
|
return {
|
|
3840
3828
|
entity: {
|
|
3841
3829
|
endpoint: values.endpoint,
|
|
3842
|
-
additionalData:
|
|
3830
|
+
additionalData: rejectEmptyKeyValuePairs(values.additionalData)
|
|
3843
3831
|
},
|
|
3844
3832
|
templateType: API_TEMPLATE_TYPE,
|
|
3845
3833
|
name: values.name
|
|
@@ -3895,7 +3883,7 @@ var buildTableColumnData = function buildTableColumnData(_ref) {
|
|
|
3895
3883
|
};
|
|
3896
3884
|
var buildApiTemplateInitialValues = function buildApiTemplateInitialValues(isEdit, apiTemplate) {
|
|
3897
3885
|
if (!isEdit) return API_TEMPLATE_INITIAL_VALUES;
|
|
3898
|
-
var additionalData = isEmpty(apiTemplate.additionalData) ? [ADDITIONAL_DATA_INITIAL_VALUE] :
|
|
3886
|
+
var additionalData = isEmpty(apiTemplate.additionalData) ? [ADDITIONAL_DATA_INITIAL_VALUE] : apiTemplate.additionalData;
|
|
3899
3887
|
return _objectSpread$1(_objectSpread$1({}, pick(["name", "endpoint"], apiTemplate)), {}, {
|
|
3900
3888
|
additionalData: additionalData
|
|
3901
3889
|
});
|
|
@@ -4062,6 +4050,7 @@ var ApiTemplates = function ApiTemplates(_ref) {
|
|
|
4062
4050
|
};
|
|
4063
4051
|
return /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(NeetoHeader, {
|
|
4064
4052
|
breadcrumbs: breadcrumbs,
|
|
4053
|
+
size: "small",
|
|
4065
4054
|
title: t("neetoMessageTemplate.template.apiTemplates"),
|
|
4066
4055
|
actionBlock: /*#__PURE__*/React.createElement(Button, {
|
|
4067
4056
|
label: t("neetoMessageTemplate.api.addApiTemplate"),
|
|
@@ -4095,6 +4084,7 @@ var ApiTemplates = function ApiTemplates(_ref) {
|
|
|
4095
4084
|
hasPagination: totalCount > pageParams.size
|
|
4096
4085
|
}, /*#__PURE__*/React.createElement(Table, {
|
|
4097
4086
|
totalCount: totalCount,
|
|
4087
|
+
fixedHeight: true,
|
|
4098
4088
|
currentPageNumber: pageParams.index,
|
|
4099
4089
|
defaultPageSize: pageParams.size,
|
|
4100
4090
|
handlePageChange: function handlePageChange(index, size) {
|
|
@@ -4165,7 +4155,7 @@ var SEND_TO_API_FORM_VALIDATION_SCHEMA = yup.object({
|
|
|
4165
4155
|
|
|
4166
4156
|
var buildSendToApiFormInitialValues = function buildSendToApiFormInitialValues(template) {
|
|
4167
4157
|
if (isEmpty(template)) return SEND_TO_API_FORM_INITIAL_VALUES;
|
|
4168
|
-
var additionalData = isEmpty(template.additionalData) ? [ADDITIONAL_DATA_INITIAL_VALUE] :
|
|
4158
|
+
var additionalData = isEmpty(template.additionalData) ? [ADDITIONAL_DATA_INITIAL_VALUE] : template.additionalData;
|
|
4169
4159
|
return {
|
|
4170
4160
|
endpoint: template.endpoint,
|
|
4171
4161
|
additionalData: additionalData
|
|
@@ -4209,7 +4199,7 @@ var SendToApiForm = function SendToApiForm(_ref) {
|
|
|
4209
4199
|
templates = _useFetchTemplates$da3 === void 0 ? [] : _useFetchTemplates$da3,
|
|
4210
4200
|
isLoadingTemplates = _useFetchTemplates.isLoading;
|
|
4211
4201
|
var handleSubmit = function handleSubmit(formValues) {
|
|
4212
|
-
var additionalDataModifiedFormValues = modify("additionalData",
|
|
4202
|
+
var additionalDataModifiedFormValues = modify("additionalData", rejectEmptyKeyValuePairs, formValues);
|
|
4213
4203
|
onSubmit(additionalDataModifiedFormValues);
|
|
4214
4204
|
};
|
|
4215
4205
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Pane.Header, null, /*#__PURE__*/React.createElement(Typography, {
|