@bigbinary/neeto-rules-frontend 2.0.5 → 2.1.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/dist/index.cjs.js +64 -62
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +65 -63
- package/dist/index.js.map +1 -1
- package/package.json +9 -9
package/dist/index.cjs.js
CHANGED
|
@@ -401,7 +401,7 @@ var Header = function Header(_ref) {
|
|
|
401
401
|
})
|
|
402
402
|
}, headerProps));
|
|
403
403
|
};
|
|
404
|
-
var Header$1 = /*#__PURE__*/
|
|
404
|
+
var Header$1 = /*#__PURE__*/React.memo(Header);
|
|
405
405
|
|
|
406
406
|
function _typeof$1(o) {
|
|
407
407
|
"@babel/helpers - typeof";
|
|
@@ -9888,7 +9888,9 @@ var RulesTable = function RulesTable(_ref) {
|
|
|
9888
9888
|
page = _ref.page,
|
|
9889
9889
|
setPage = _ref.setPage,
|
|
9890
9890
|
_ref$allowCloning = _ref.allowCloning,
|
|
9891
|
-
allowCloning = _ref$allowCloning === void 0 ? true : _ref$allowCloning
|
|
9891
|
+
allowCloning = _ref$allowCloning === void 0 ? true : _ref$allowCloning,
|
|
9892
|
+
_ref$hasUnfilteredRul = _ref.hasUnfilteredRules,
|
|
9893
|
+
hasUnfilteredRules = _ref$hasUnfilteredRul === void 0 ? true : _ref$hasUnfilteredRul;
|
|
9892
9894
|
var _useQueryParams = reactUtils.useQueryParams(),
|
|
9893
9895
|
_useQueryParams$searc = _useQueryParams.searchTerm,
|
|
9894
9896
|
searchTerm = _useQueryParams$searc === void 0 ? "" : _useQueryParams$searc;
|
|
@@ -9959,22 +9961,8 @@ var RulesTable = function RulesTable(_ref) {
|
|
|
9959
9961
|
if (isLoading && ramda.isEmpty(rules)) {
|
|
9960
9962
|
return /*#__PURE__*/jsxRuntime.jsx(PageLoader__default["default"], {});
|
|
9961
9963
|
}
|
|
9962
|
-
if (ramda.isEmpty(rules)) {
|
|
9963
|
-
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
9964
|
-
className: "flex h-full w-full items-center justify-center",
|
|
9965
|
-
children: /*#__PURE__*/jsxRuntime.jsx(NoData__default["default"], _objectSpread$n({
|
|
9966
|
-
title: t("neetoRules.noData.title")
|
|
9967
|
-
}, ramda.isEmpty(searchTerm) && {
|
|
9968
|
-
helpText: helpDocUrl ? renderNoDataHelpText(helpDocUrl) : null,
|
|
9969
|
-
primaryButtonProps: {
|
|
9970
|
-
label: t("neetoRules.button.addNew"),
|
|
9971
|
-
to: createRoutes(automationRulesPath)["new"]
|
|
9972
|
-
}
|
|
9973
|
-
}))
|
|
9974
|
-
});
|
|
9975
|
-
}
|
|
9976
9964
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
9977
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(SubHeader__default["default"], {
|
|
9965
|
+
children: [hasUnfilteredRules && /*#__PURE__*/jsxRuntime.jsx(SubHeader__default["default"], {
|
|
9978
9966
|
leftActionBlock: /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
9979
9967
|
className: "mr-4 font-semibold",
|
|
9980
9968
|
style: "h4",
|
|
@@ -9982,50 +9970,63 @@ var RulesTable = function RulesTable(_ref) {
|
|
|
9982
9970
|
count: totalCount
|
|
9983
9971
|
})
|
|
9984
9972
|
})
|
|
9985
|
-
}), /*#__PURE__*/jsxRuntime.
|
|
9986
|
-
|
|
9987
|
-
|
|
9988
|
-
|
|
9989
|
-
|
|
9990
|
-
|
|
9991
|
-
|
|
9992
|
-
|
|
9993
|
-
|
|
9994
|
-
|
|
9995
|
-
|
|
9996
|
-
|
|
9997
|
-
|
|
9998
|
-
|
|
9999
|
-
|
|
9973
|
+
}), neetoCist.isNotEmpty(rules) ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
9974
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(TableWrapper__default["default"], {
|
|
9975
|
+
hasPagination: totalCount > constants.DEFAULT_PAGE_SIZE,
|
|
9976
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Table__default["default"], {
|
|
9977
|
+
columnData: columnData,
|
|
9978
|
+
totalCount: totalCount,
|
|
9979
|
+
fixedHeight: true,
|
|
9980
|
+
allowClick: false,
|
|
9981
|
+
currentPageNumber: page,
|
|
9982
|
+
defaultPageSize: constants.DEFAULT_PAGE_SIZE,
|
|
9983
|
+
handlePageChange: setPage,
|
|
9984
|
+
loading: isUpdating || isCloning || isDeleting || isLoading,
|
|
9985
|
+
rowData: rules.map(function (item) {
|
|
9986
|
+
return _objectSpread$n({
|
|
9987
|
+
key: item.id
|
|
9988
|
+
}, item);
|
|
9989
|
+
}),
|
|
9990
|
+
rowSelection: false,
|
|
9991
|
+
scroll: {
|
|
9992
|
+
x: 0
|
|
9993
|
+
},
|
|
9994
|
+
tableLayout: "fixed"
|
|
9995
|
+
})
|
|
9996
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Alert__default["default"], {
|
|
9997
|
+
isOpen: !!selectedRule,
|
|
9998
|
+
isSubmitting: isDeleting,
|
|
9999
|
+
submitButtonLabel: t("neetoRules.button.delete"),
|
|
10000
|
+
title: t("neetoRules.deleteAlert.title"),
|
|
10001
|
+
message: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
|
|
10002
|
+
i18nKey: "neetoRules.deleteAlert.message",
|
|
10003
|
+
values: {
|
|
10004
|
+
name: selectedRule === null || selectedRule === void 0 ? void 0 : selectedRule.name
|
|
10005
|
+
}
|
|
10000
10006
|
}),
|
|
10001
|
-
|
|
10002
|
-
|
|
10003
|
-
x: 0
|
|
10007
|
+
onClose: function onClose() {
|
|
10008
|
+
return setSelectedRule(null);
|
|
10004
10009
|
},
|
|
10005
|
-
|
|
10006
|
-
|
|
10007
|
-
|
|
10008
|
-
|
|
10009
|
-
|
|
10010
|
-
|
|
10011
|
-
|
|
10012
|
-
message: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
|
|
10013
|
-
i18nKey: "neetoRules.deleteAlert.message",
|
|
10014
|
-
values: {
|
|
10015
|
-
name: selectedRule === null || selectedRule === void 0 ? void 0 : selectedRule.name
|
|
10010
|
+
onSubmit: function onSubmit() {
|
|
10011
|
+
return deleteRule({
|
|
10012
|
+
id: selectedRule === null || selectedRule === void 0 ? void 0 : selectedRule.id,
|
|
10013
|
+
url: url
|
|
10014
|
+
}, {
|
|
10015
|
+
onSuccess: handleDeleteSuccess
|
|
10016
|
+
});
|
|
10016
10017
|
}
|
|
10017
|
-
})
|
|
10018
|
-
|
|
10019
|
-
|
|
10020
|
-
|
|
10021
|
-
|
|
10022
|
-
|
|
10023
|
-
|
|
10024
|
-
|
|
10025
|
-
|
|
10026
|
-
|
|
10027
|
-
}
|
|
10028
|
-
}
|
|
10018
|
+
})]
|
|
10019
|
+
}) : /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
10020
|
+
className: "flex h-full w-full items-center justify-center",
|
|
10021
|
+
children: /*#__PURE__*/jsxRuntime.jsx(NoData__default["default"], _objectSpread$n({
|
|
10022
|
+
title: t("neetoRules.noData.title")
|
|
10023
|
+
}, ramda.isEmpty(searchTerm) && {
|
|
10024
|
+
helpText: helpDocUrl ? renderNoDataHelpText(helpDocUrl) : null,
|
|
10025
|
+
primaryButtonProps: {
|
|
10026
|
+
label: t("neetoRules.button.addNew"),
|
|
10027
|
+
to: createRoutes(automationRulesPath)["new"]
|
|
10028
|
+
}
|
|
10029
|
+
}))
|
|
10029
10030
|
})]
|
|
10030
10031
|
});
|
|
10031
10032
|
};
|
|
@@ -10085,6 +10086,7 @@ var NeetoRules = function NeetoRules(_ref) {
|
|
|
10085
10086
|
setIsReorderPaneOpen: setIsReorderPaneOpen
|
|
10086
10087
|
}), /*#__PURE__*/jsxRuntime.jsx(RulesTable, _objectSpread$m(_objectSpread$m({}, _objectSpread$m({
|
|
10087
10088
|
automationRulesPath: automationRulesPath,
|
|
10089
|
+
hasUnfilteredRules: hasUnfilteredRules,
|
|
10088
10090
|
helpDocUrl: helpDocUrl,
|
|
10089
10091
|
page: page,
|
|
10090
10092
|
rules: rules,
|
|
@@ -11193,7 +11195,7 @@ var SHORTCUTS = {
|
|
|
11193
11195
|
var _excluded$a = ["value", "nullable", "className", "handleSubmit", "handleCancel"];
|
|
11194
11196
|
function ownKeys$i(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; }
|
|
11195
11197
|
function _objectSpread$i(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$i(Object(t), !0).forEach(function (r) { _defineProperty$1(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$i(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
11196
|
-
var InlineInput = /*#__PURE__*/
|
|
11198
|
+
var InlineInput = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
11197
11199
|
var _props$value = props.value,
|
|
11198
11200
|
value = _props$value === void 0 ? "" : _props$value,
|
|
11199
11201
|
_props$nullable = props.nullable,
|
|
@@ -13108,7 +13110,7 @@ var MultiSelect = function MultiSelect(_ref) {
|
|
|
13108
13110
|
className: "flex flex-wrap items-center gap-x-2 gap-y-1",
|
|
13109
13111
|
children: options.map(function (option, idx) {
|
|
13110
13112
|
var _option$label;
|
|
13111
|
-
return /*#__PURE__*/jsxRuntime.jsxs(
|
|
13113
|
+
return /*#__PURE__*/jsxRuntime.jsxs(React.Fragment, {
|
|
13112
13114
|
children: [!!idx && /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
13113
13115
|
className: "neeto-ui-text-gray-700",
|
|
13114
13116
|
style: "h5",
|
|
@@ -13221,7 +13223,7 @@ var MultiSelectCreate = function MultiSelectCreate(_ref) {
|
|
|
13221
13223
|
});
|
|
13222
13224
|
}
|
|
13223
13225
|
}), allOptions.map(function (option, idx) {
|
|
13224
|
-
return /*#__PURE__*/jsxRuntime.jsxs(
|
|
13226
|
+
return /*#__PURE__*/jsxRuntime.jsxs(React.Fragment, {
|
|
13225
13227
|
children: [!!idx && /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
13226
13228
|
className: "neeto-ui-text-gray-700",
|
|
13227
13229
|
style: "h5",
|
|
@@ -15340,7 +15342,7 @@ var MultiSelectValues = function MultiSelectValues(_ref) {
|
|
|
15340
15342
|
values = _ref.values;
|
|
15341
15343
|
return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
15342
15344
|
children: values === null || values === void 0 ? void 0 : values.map(function (value, idx) {
|
|
15343
|
-
return /*#__PURE__*/jsxRuntime.jsxs(
|
|
15345
|
+
return /*#__PURE__*/jsxRuntime.jsxs(React.Fragment, {
|
|
15344
15346
|
children: [!!idx && /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
15345
15347
|
className: "neeto-ui-text-gray-700",
|
|
15346
15348
|
style: "h5",
|