@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.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import React__default, { useState, useRef, useEffect, useContext, useLayoutEffect as useLayoutEffect$1, createElement, useMemo as useMemo$1,
|
|
2
|
+
import React__default, { memo, useState, useRef, useEffect, useContext, useLayoutEffect as useLayoutEffect$1, createElement, forwardRef, useMemo as useMemo$1, Fragment as Fragment$1 } from 'react';
|
|
3
3
|
import { isNotEmpty, isPresent, removeBy, renameKeys, findBy, noop as noop$3, nullSafe, toLabelAndValue } from '@bigbinary/neeto-cist';
|
|
4
4
|
import { DEFAULT_PAGE_SIZE } from '@bigbinary/neeto-commons-frontend/constants';
|
|
5
5
|
import { useMutationWithInvalidation, useQueryParams, withImmutableActions, withT, useStateWithDependency, useDebounce } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
@@ -328,7 +328,7 @@ var Header = function Header(_ref) {
|
|
|
328
328
|
})
|
|
329
329
|
}, headerProps));
|
|
330
330
|
};
|
|
331
|
-
var Header$1 = /*#__PURE__*/
|
|
331
|
+
var Header$1 = /*#__PURE__*/memo(Header);
|
|
332
332
|
|
|
333
333
|
function _typeof$1(o) {
|
|
334
334
|
"@babel/helpers - typeof";
|
|
@@ -9815,7 +9815,9 @@ var RulesTable = function RulesTable(_ref) {
|
|
|
9815
9815
|
page = _ref.page,
|
|
9816
9816
|
setPage = _ref.setPage,
|
|
9817
9817
|
_ref$allowCloning = _ref.allowCloning,
|
|
9818
|
-
allowCloning = _ref$allowCloning === void 0 ? true : _ref$allowCloning
|
|
9818
|
+
allowCloning = _ref$allowCloning === void 0 ? true : _ref$allowCloning,
|
|
9819
|
+
_ref$hasUnfilteredRul = _ref.hasUnfilteredRules,
|
|
9820
|
+
hasUnfilteredRules = _ref$hasUnfilteredRul === void 0 ? true : _ref$hasUnfilteredRul;
|
|
9819
9821
|
var _useQueryParams = useQueryParams(),
|
|
9820
9822
|
_useQueryParams$searc = _useQueryParams.searchTerm,
|
|
9821
9823
|
searchTerm = _useQueryParams$searc === void 0 ? "" : _useQueryParams$searc;
|
|
@@ -9886,22 +9888,8 @@ var RulesTable = function RulesTable(_ref) {
|
|
|
9886
9888
|
if (isLoading && isEmpty(rules)) {
|
|
9887
9889
|
return /*#__PURE__*/jsx(PageLoader, {});
|
|
9888
9890
|
}
|
|
9889
|
-
if (isEmpty(rules)) {
|
|
9890
|
-
return /*#__PURE__*/jsx("div", {
|
|
9891
|
-
className: "flex h-full w-full items-center justify-center",
|
|
9892
|
-
children: /*#__PURE__*/jsx(NoData, _objectSpread$n({
|
|
9893
|
-
title: t("neetoRules.noData.title")
|
|
9894
|
-
}, isEmpty(searchTerm) && {
|
|
9895
|
-
helpText: helpDocUrl ? renderNoDataHelpText(helpDocUrl) : null,
|
|
9896
|
-
primaryButtonProps: {
|
|
9897
|
-
label: t("neetoRules.button.addNew"),
|
|
9898
|
-
to: createRoutes(automationRulesPath)["new"]
|
|
9899
|
-
}
|
|
9900
|
-
}))
|
|
9901
|
-
});
|
|
9902
|
-
}
|
|
9903
9891
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
9904
|
-
children: [/*#__PURE__*/jsx(SubHeader, {
|
|
9892
|
+
children: [hasUnfilteredRules && /*#__PURE__*/jsx(SubHeader, {
|
|
9905
9893
|
leftActionBlock: /*#__PURE__*/jsx(Typography, {
|
|
9906
9894
|
className: "mr-4 font-semibold",
|
|
9907
9895
|
style: "h4",
|
|
@@ -9909,50 +9897,63 @@ var RulesTable = function RulesTable(_ref) {
|
|
|
9909
9897
|
count: totalCount
|
|
9910
9898
|
})
|
|
9911
9899
|
})
|
|
9912
|
-
}), /*#__PURE__*/
|
|
9913
|
-
|
|
9914
|
-
|
|
9915
|
-
|
|
9916
|
-
|
|
9917
|
-
|
|
9918
|
-
|
|
9919
|
-
|
|
9920
|
-
|
|
9921
|
-
|
|
9922
|
-
|
|
9923
|
-
|
|
9924
|
-
|
|
9925
|
-
|
|
9926
|
-
|
|
9900
|
+
}), isNotEmpty(rules) ? /*#__PURE__*/jsxs(Fragment, {
|
|
9901
|
+
children: [/*#__PURE__*/jsx(TableWrapper, {
|
|
9902
|
+
hasPagination: totalCount > DEFAULT_PAGE_SIZE,
|
|
9903
|
+
children: /*#__PURE__*/jsx(Table, {
|
|
9904
|
+
columnData: columnData,
|
|
9905
|
+
totalCount: totalCount,
|
|
9906
|
+
fixedHeight: true,
|
|
9907
|
+
allowClick: false,
|
|
9908
|
+
currentPageNumber: page,
|
|
9909
|
+
defaultPageSize: DEFAULT_PAGE_SIZE,
|
|
9910
|
+
handlePageChange: setPage,
|
|
9911
|
+
loading: isUpdating || isCloning || isDeleting || isLoading,
|
|
9912
|
+
rowData: rules.map(function (item) {
|
|
9913
|
+
return _objectSpread$n({
|
|
9914
|
+
key: item.id
|
|
9915
|
+
}, item);
|
|
9916
|
+
}),
|
|
9917
|
+
rowSelection: false,
|
|
9918
|
+
scroll: {
|
|
9919
|
+
x: 0
|
|
9920
|
+
},
|
|
9921
|
+
tableLayout: "fixed"
|
|
9922
|
+
})
|
|
9923
|
+
}), /*#__PURE__*/jsx(Alert, {
|
|
9924
|
+
isOpen: !!selectedRule,
|
|
9925
|
+
isSubmitting: isDeleting,
|
|
9926
|
+
submitButtonLabel: t("neetoRules.button.delete"),
|
|
9927
|
+
title: t("neetoRules.deleteAlert.title"),
|
|
9928
|
+
message: /*#__PURE__*/jsx(Trans, {
|
|
9929
|
+
i18nKey: "neetoRules.deleteAlert.message",
|
|
9930
|
+
values: {
|
|
9931
|
+
name: selectedRule === null || selectedRule === void 0 ? void 0 : selectedRule.name
|
|
9932
|
+
}
|
|
9927
9933
|
}),
|
|
9928
|
-
|
|
9929
|
-
|
|
9930
|
-
x: 0
|
|
9934
|
+
onClose: function onClose() {
|
|
9935
|
+
return setSelectedRule(null);
|
|
9931
9936
|
},
|
|
9932
|
-
|
|
9933
|
-
|
|
9934
|
-
|
|
9935
|
-
|
|
9936
|
-
|
|
9937
|
-
|
|
9938
|
-
|
|
9939
|
-
message: /*#__PURE__*/jsx(Trans, {
|
|
9940
|
-
i18nKey: "neetoRules.deleteAlert.message",
|
|
9941
|
-
values: {
|
|
9942
|
-
name: selectedRule === null || selectedRule === void 0 ? void 0 : selectedRule.name
|
|
9937
|
+
onSubmit: function onSubmit() {
|
|
9938
|
+
return deleteRule({
|
|
9939
|
+
id: selectedRule === null || selectedRule === void 0 ? void 0 : selectedRule.id,
|
|
9940
|
+
url: url
|
|
9941
|
+
}, {
|
|
9942
|
+
onSuccess: handleDeleteSuccess
|
|
9943
|
+
});
|
|
9943
9944
|
}
|
|
9944
|
-
})
|
|
9945
|
-
|
|
9946
|
-
|
|
9947
|
-
|
|
9948
|
-
|
|
9949
|
-
|
|
9950
|
-
|
|
9951
|
-
|
|
9952
|
-
|
|
9953
|
-
|
|
9954
|
-
}
|
|
9955
|
-
}
|
|
9945
|
+
})]
|
|
9946
|
+
}) : /*#__PURE__*/jsx("div", {
|
|
9947
|
+
className: "flex h-full w-full items-center justify-center",
|
|
9948
|
+
children: /*#__PURE__*/jsx(NoData, _objectSpread$n({
|
|
9949
|
+
title: t("neetoRules.noData.title")
|
|
9950
|
+
}, isEmpty(searchTerm) && {
|
|
9951
|
+
helpText: helpDocUrl ? renderNoDataHelpText(helpDocUrl) : null,
|
|
9952
|
+
primaryButtonProps: {
|
|
9953
|
+
label: t("neetoRules.button.addNew"),
|
|
9954
|
+
to: createRoutes(automationRulesPath)["new"]
|
|
9955
|
+
}
|
|
9956
|
+
}))
|
|
9956
9957
|
})]
|
|
9957
9958
|
});
|
|
9958
9959
|
};
|
|
@@ -10012,6 +10013,7 @@ var NeetoRules = function NeetoRules(_ref) {
|
|
|
10012
10013
|
setIsReorderPaneOpen: setIsReorderPaneOpen
|
|
10013
10014
|
}), /*#__PURE__*/jsx(RulesTable, _objectSpread$m(_objectSpread$m({}, _objectSpread$m({
|
|
10014
10015
|
automationRulesPath: automationRulesPath,
|
|
10016
|
+
hasUnfilteredRules: hasUnfilteredRules,
|
|
10015
10017
|
helpDocUrl: helpDocUrl,
|
|
10016
10018
|
page: page,
|
|
10017
10019
|
rules: rules,
|
|
@@ -11120,7 +11122,7 @@ var SHORTCUTS = {
|
|
|
11120
11122
|
var _excluded$a = ["value", "nullable", "className", "handleSubmit", "handleCancel"];
|
|
11121
11123
|
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; }
|
|
11122
11124
|
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; }
|
|
11123
|
-
var InlineInput = /*#__PURE__*/
|
|
11125
|
+
var InlineInput = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
11124
11126
|
var _props$value = props.value,
|
|
11125
11127
|
value = _props$value === void 0 ? "" : _props$value,
|
|
11126
11128
|
_props$nullable = props.nullable,
|
|
@@ -13035,7 +13037,7 @@ var MultiSelect = function MultiSelect(_ref) {
|
|
|
13035
13037
|
className: "flex flex-wrap items-center gap-x-2 gap-y-1",
|
|
13036
13038
|
children: options.map(function (option, idx) {
|
|
13037
13039
|
var _option$label;
|
|
13038
|
-
return /*#__PURE__*/jsxs(
|
|
13040
|
+
return /*#__PURE__*/jsxs(Fragment$1, {
|
|
13039
13041
|
children: [!!idx && /*#__PURE__*/jsx(Typography, {
|
|
13040
13042
|
className: "neeto-ui-text-gray-700",
|
|
13041
13043
|
style: "h5",
|
|
@@ -13148,7 +13150,7 @@ var MultiSelectCreate = function MultiSelectCreate(_ref) {
|
|
|
13148
13150
|
});
|
|
13149
13151
|
}
|
|
13150
13152
|
}), allOptions.map(function (option, idx) {
|
|
13151
|
-
return /*#__PURE__*/jsxs(
|
|
13153
|
+
return /*#__PURE__*/jsxs(Fragment$1, {
|
|
13152
13154
|
children: [!!idx && /*#__PURE__*/jsx(Typography, {
|
|
13153
13155
|
className: "neeto-ui-text-gray-700",
|
|
13154
13156
|
style: "h5",
|
|
@@ -15267,7 +15269,7 @@ var MultiSelectValues = function MultiSelectValues(_ref) {
|
|
|
15267
15269
|
values = _ref.values;
|
|
15268
15270
|
return /*#__PURE__*/jsx(Fragment, {
|
|
15269
15271
|
children: values === null || values === void 0 ? void 0 : values.map(function (value, idx) {
|
|
15270
|
-
return /*#__PURE__*/jsxs(
|
|
15272
|
+
return /*#__PURE__*/jsxs(Fragment$1, {
|
|
15271
15273
|
children: [!!idx && /*#__PURE__*/jsx(Typography, {
|
|
15272
15274
|
className: "neeto-ui-text-gray-700",
|
|
15273
15275
|
style: "h5",
|