@bigbinary/neeto-approvals-frontend 1.0.1 → 1.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 +40 -43
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +11 -13
- package/dist/index.js.map +1 -1
- package/package.json +9 -9
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useState, useEffect, memo, useRef, createElement, useMemo } from 'react';
|
|
2
2
|
import { useMutationWithInvalidation, useDebounce, withT, useQueryParams } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
3
3
|
import Container from '@bigbinary/neeto-molecules/Container';
|
|
4
4
|
import { useLocation, useHistory, Switch, Route, Redirect, useParams } from 'react-router-dom';
|
|
@@ -13,8 +13,8 @@ import { isEmpty, keys } from 'ramda';
|
|
|
13
13
|
import { useTranslation, Trans } from 'react-i18next';
|
|
14
14
|
import { useQuery, keepPreviousData } from '@tanstack/react-query';
|
|
15
15
|
import axios from 'axios';
|
|
16
|
-
import Tag from '@bigbinary/neetoui/Tag';
|
|
17
16
|
import DateFormat from '@bigbinary/neeto-molecules/DateFormat';
|
|
17
|
+
import Tag from '@bigbinary/neetoui/Tag';
|
|
18
18
|
import { isEditorEmpty } from '@bigbinary/neeto-editor/utils';
|
|
19
19
|
import * as yup from 'yup';
|
|
20
20
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
@@ -408,7 +408,7 @@ var getApprovalFilter = function getApprovalFilter() {
|
|
|
408
408
|
};
|
|
409
409
|
};
|
|
410
410
|
|
|
411
|
-
var MemoizedEditorContent$1 = /*#__PURE__*/
|
|
411
|
+
var MemoizedEditorContent$1 = /*#__PURE__*/memo(EditorContent);
|
|
412
412
|
var RequestDetailsPane = function RequestDetailsPane(_ref) {
|
|
413
413
|
var _window$globalProps, _window$globalProps2;
|
|
414
414
|
var isOpen = _ref.isOpen,
|
|
@@ -1075,9 +1075,9 @@ var Field = function Field(_ref) {
|
|
|
1075
1075
|
})]
|
|
1076
1076
|
});
|
|
1077
1077
|
};
|
|
1078
|
-
var Field$1 = /*#__PURE__*/
|
|
1078
|
+
var Field$1 = /*#__PURE__*/memo(Field);
|
|
1079
1079
|
|
|
1080
|
-
var MemoizedEditorContent = /*#__PURE__*/
|
|
1080
|
+
var MemoizedEditorContent = /*#__PURE__*/memo(EditorContent);
|
|
1081
1081
|
var TemplateDetails = function TemplateDetails(_ref) {
|
|
1082
1082
|
var isOpen = _ref.isOpen,
|
|
1083
1083
|
onClose = _ref.onClose,
|
|
@@ -1143,7 +1143,6 @@ var _excluded$1 = ["entity", "columnData", "rowData", "totalCount", "filters", "
|
|
|
1143
1143
|
function ownKeys$6(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; }
|
|
1144
1144
|
function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$6(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$6(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1145
1145
|
var Table = function Table(_ref) {
|
|
1146
|
-
var _t;
|
|
1147
1146
|
var entity = _ref.entity,
|
|
1148
1147
|
columnData = _ref.columnData,
|
|
1149
1148
|
rowData = _ref.rowData,
|
|
@@ -1171,7 +1170,7 @@ var Table = function Table(_ref) {
|
|
|
1171
1170
|
var noDataProps = {
|
|
1172
1171
|
primaryButtonProps: {
|
|
1173
1172
|
label: t("neetoApprovals.common.addNew_", {
|
|
1174
|
-
what:
|
|
1173
|
+
what: t("neetoApprovals.common.template", SINGULAR)
|
|
1175
1174
|
}),
|
|
1176
1175
|
onClick: function onClick() {
|
|
1177
1176
|
return setIsPaneOpen(true);
|
|
@@ -1421,11 +1420,10 @@ var createRoutes = function createRoutes(_ref) {
|
|
|
1421
1420
|
},
|
|
1422
1421
|
path: "".concat(config.approvalsPath).concat(routes.templates.index),
|
|
1423
1422
|
actionBlock: function actionBlock() {
|
|
1424
|
-
var _t;
|
|
1425
1423
|
return /*#__PURE__*/jsx(Button, {
|
|
1426
1424
|
"data-cy": "neeto-approvals-templates-add-new-button",
|
|
1427
1425
|
label: t$1("neetoApprovals.common.addNew_", {
|
|
1428
|
-
what:
|
|
1426
|
+
what: t$1("neetoApprovals.common.template", SINGULAR)
|
|
1429
1427
|
}),
|
|
1430
1428
|
onClick: function onClick() {
|
|
1431
1429
|
return setIsNewTemplatePaneOpen(true);
|
|
@@ -1433,7 +1431,7 @@ var createRoutes = function createRoutes(_ref) {
|
|
|
1433
1431
|
});
|
|
1434
1432
|
},
|
|
1435
1433
|
searchPlaceholder: t$1("neetoApprovals.inputs.placeholders.search_", {
|
|
1436
|
-
what: t$1("neetoApprovals.common.template", PLURAL)
|
|
1434
|
+
what: t$1("neetoApprovals.common.template", PLURAL)
|
|
1437
1435
|
})
|
|
1438
1436
|
}, {
|
|
1439
1437
|
component: function component() {
|
|
@@ -1460,12 +1458,12 @@ var Header = function Header(_ref) {
|
|
|
1460
1458
|
path: pathname
|
|
1461
1459
|
}, appRoutes);
|
|
1462
1460
|
return /*#__PURE__*/jsx(NeetoHeader, {
|
|
1461
|
+
breadcrumbs: breadcrumbs,
|
|
1463
1462
|
actionBlock: currentTab === null || currentTab === void 0 || (_currentTab$actionBlo = currentTab.actionBlock) === null || _currentTab$actionBlo === void 0 ? void 0 : _currentTab$actionBlo.call(currentTab),
|
|
1464
1463
|
title: t("neetoApprovals.common.approval", PLURAL),
|
|
1465
1464
|
searchProps: (currentTab === null || currentTab === void 0 ? void 0 : currentTab.searchPlaceholder) && {
|
|
1466
1465
|
placeholder: currentTab === null || currentTab === void 0 ? void 0 : currentTab.searchPlaceholder
|
|
1467
|
-
}
|
|
1468
|
-
breadcrumbs: breadcrumbs
|
|
1466
|
+
}
|
|
1469
1467
|
});
|
|
1470
1468
|
};
|
|
1471
1469
|
|
|
@@ -1553,9 +1551,9 @@ var Approvals = function Approvals(_ref) {
|
|
|
1553
1551
|
var path = _ref2.path,
|
|
1554
1552
|
component = _ref2.component;
|
|
1555
1553
|
return /*#__PURE__*/createElement(Route, {
|
|
1556
|
-
exact: true,
|
|
1557
1554
|
component: component,
|
|
1558
1555
|
path: path,
|
|
1556
|
+
exact: true,
|
|
1559
1557
|
key: path
|
|
1560
1558
|
});
|
|
1561
1559
|
}), /*#__PURE__*/jsx(Redirect, {
|