@bigbinary/neeto-commons-frontend 3.4.12 → 3.4.14
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/cjs/configs/babel.js +4 -1
- package/cjs/cypress-utils/commands.js +10 -0
- package/cjs/cypress-utils/commands.js.map +1 -1
- package/cjs/cypress-utils/utils/member.js +1 -1
- package/cjs/cypress-utils/utils/member.js.map +1 -1
- package/cjs/react-utils/HoneybadgerErrorBoundary/FallbackComponent.js +63 -110
- package/cjs/react-utils/HoneybadgerErrorBoundary/FallbackComponent.js.map +1 -1
- package/cjs/react-utils/HoneybadgerErrorBoundary/HoneybadgerErrorBoundary.js +5 -12
- package/cjs/react-utils/HoneybadgerErrorBoundary/HoneybadgerErrorBoundary.js.map +1 -1
- package/cjs/react-utils/PageTitle/PageTitle.js +6 -24
- package/cjs/react-utils/PageTitle/PageTitle.js.map +1 -1
- package/cjs/react-utils/PrivateRoute/PrivateRoute.js +10 -41
- package/cjs/react-utils/PrivateRoute/PrivateRoute.js.map +1 -1
- package/cjs/react-utils/withTitle/withTitle.js +11 -26
- package/cjs/react-utils/withTitle/withTitle.js.map +1 -1
- package/configs/babel.js +4 -1
- package/cypress-utils/commands.js +10 -0
- package/cypress-utils/commands.js.map +1 -1
- package/cypress-utils/utils/member.js +1 -1
- package/cypress-utils/utils/member.js.map +1 -1
- package/package.json +1 -1
- package/react-utils/HoneybadgerErrorBoundary/FallbackComponent.js +64 -109
- package/react-utils/HoneybadgerErrorBoundary/FallbackComponent.js.map +1 -1
- package/react-utils/HoneybadgerErrorBoundary/HoneybadgerErrorBoundary.js +4 -10
- package/react-utils/HoneybadgerErrorBoundary/HoneybadgerErrorBoundary.js.map +1 -1
- package/react-utils/PageTitle/PageTitle.js +6 -24
- package/react-utils/PageTitle/PageTitle.js.map +1 -1
- package/react-utils/PrivateRoute/PrivateRoute.js +10 -41
- package/react-utils/PrivateRoute/PrivateRoute.js.map +1 -1
- package/react-utils/withTitle/withTitle.js +13 -25
- package/react-utils/withTitle/withTitle.js.map +1 -1
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["condition", "redirectRoute", "errorPage", "permissions"];
|
|
4
|
-
var
|
|
5
|
-
|
|
4
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
6
|
import React from "react";
|
|
7
7
|
import ErrorPage from "@bigbinary/neeto-molecules/ErrorPage";
|
|
8
8
|
import { __, includes } from "ramda";
|
|
9
9
|
import { Redirect, Route } from "react-router-dom";
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
11
|
var PrivateRoute = function PrivateRoute(_ref) {
|
|
11
12
|
var _ref$condition = _ref.condition,
|
|
12
13
|
condition = _ref$condition === void 0 ? globalProps.authenticated : _ref$condition,
|
|
@@ -19,53 +20,21 @@ var PrivateRoute = function PrivateRoute(_ref) {
|
|
|
19
20
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
20
21
|
if (condition) {
|
|
21
22
|
if (permissions) {
|
|
22
|
-
return globalProps.permissions.some(includes(__, permissions)) ? /*#__PURE__*/
|
|
23
|
-
|
|
24
|
-
__source: {
|
|
25
|
-
fileName: _jsxFileName,
|
|
26
|
-
lineNumber: 17,
|
|
27
|
-
columnNumber: 9
|
|
28
|
-
}
|
|
29
|
-
})) : errorPage || /*#__PURE__*/React.createElement(ErrorPage, {
|
|
30
|
-
status: 403,
|
|
31
|
-
__self: _this,
|
|
32
|
-
__source: {
|
|
33
|
-
fileName: _jsxFileName,
|
|
34
|
-
lineNumber: 19,
|
|
35
|
-
columnNumber: 22
|
|
36
|
-
}
|
|
23
|
+
return globalProps.permissions.some(includes(__, permissions)) ? /*#__PURE__*/_jsx(Route, _objectSpread({}, props)) : errorPage || /*#__PURE__*/_jsx(ErrorPage, {
|
|
24
|
+
status: 403
|
|
37
25
|
});
|
|
38
26
|
}
|
|
39
|
-
return /*#__PURE__*/
|
|
40
|
-
__self: _this,
|
|
41
|
-
__source: {
|
|
42
|
-
fileName: _jsxFileName,
|
|
43
|
-
lineNumber: 23,
|
|
44
|
-
columnNumber: 12
|
|
45
|
-
}
|
|
46
|
-
}));
|
|
27
|
+
return /*#__PURE__*/_jsx(Route, _objectSpread({}, props));
|
|
47
28
|
}
|
|
48
29
|
if (redirectRoute) {
|
|
49
|
-
return /*#__PURE__*/
|
|
30
|
+
return /*#__PURE__*/_jsx(Redirect, {
|
|
50
31
|
to: {
|
|
51
32
|
pathname: redirectRoute
|
|
52
|
-
},
|
|
53
|
-
__self: _this,
|
|
54
|
-
__source: {
|
|
55
|
-
fileName: _jsxFileName,
|
|
56
|
-
lineNumber: 27,
|
|
57
|
-
columnNumber: 12
|
|
58
33
|
}
|
|
59
34
|
});
|
|
60
35
|
}
|
|
61
|
-
return errorPage || /*#__PURE__*/
|
|
62
|
-
status: 403
|
|
63
|
-
__self: _this,
|
|
64
|
-
__source: {
|
|
65
|
-
fileName: _jsxFileName,
|
|
66
|
-
lineNumber: 30,
|
|
67
|
-
columnNumber: 23
|
|
68
|
-
}
|
|
36
|
+
return errorPage || /*#__PURE__*/_jsx(ErrorPage, {
|
|
37
|
+
status: 403
|
|
69
38
|
});
|
|
70
39
|
};
|
|
71
40
|
export default PrivateRoute;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrivateRoute.js","names":["React","ErrorPage","__","includes","Redirect","Route","PrivateRoute","_ref","_ref$condition","condition","globalProps","authenticated","_ref$redirectRoute","redirectRoute","undefined","_ref$errorPage","errorPage","_ref$permissions","permissions","props","_objectWithoutProperties","_excluded","some","
|
|
1
|
+
{"version":3,"file":"PrivateRoute.js","names":["React","ErrorPage","__","includes","Redirect","Route","jsx","_jsx","PrivateRoute","_ref","_ref$condition","condition","globalProps","authenticated","_ref$redirectRoute","redirectRoute","undefined","_ref$errorPage","errorPage","_ref$permissions","permissions","props","_objectWithoutProperties","_excluded","some","_objectSpread","status","to","pathname"],"sources":["../../../src/react-utils/PrivateRoute/PrivateRoute.jsx"],"sourcesContent":["import React from \"react\";\n\nimport ErrorPage from \"neetomolecules/ErrorPage\";\nimport { __, includes } from \"ramda\";\nimport { Redirect, Route } from \"react-router-dom\";\n\nconst PrivateRoute = ({\n condition = globalProps.authenticated,\n redirectRoute = undefined,\n errorPage = undefined,\n permissions = undefined,\n ...props\n}) => {\n if (condition) {\n if (permissions) {\n return globalProps.permissions.some(includes(__, permissions)) ? (\n <Route {...props} />\n ) : (\n errorPage || <ErrorPage status={403} />\n );\n }\n\n return <Route {...props} />;\n }\n\n if (redirectRoute) {\n return <Redirect to={{ pathname: redirectRoute }} />;\n }\n\n return errorPage || <ErrorPage status={403} />;\n};\n\nexport default PrivateRoute;\n"],"mappings":";;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,OAAOC,SAAS;AAChB,SAASC,EAAE,EAAEC,QAAQ,QAAQ,OAAO;AACpC,SAASC,QAAQ,EAAEC,KAAK,QAAQ,kBAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEnD,IAAMC,YAAY,GAAG,SAAfA,YAAYA,CAAAC,IAAA,EAMZ;EAAA,IAAAC,cAAA,GAAAD,IAAA,CALJE,SAAS;IAATA,SAAS,GAAAD,cAAA,cAAGE,WAAW,CAACC,aAAa,GAAAH,cAAA;IAAAI,kBAAA,GAAAL,IAAA,CACrCM,aAAa;IAAbA,aAAa,GAAAD,kBAAA,cAAGE,SAAS,GAAAF,kBAAA;IAAAG,cAAA,GAAAR,IAAA,CACzBS,SAAS;IAATA,SAAS,GAAAD,cAAA,cAAGD,SAAS,GAAAC,cAAA;IAAAE,gBAAA,GAAAV,IAAA,CACrBW,WAAW;IAAXA,WAAW,GAAAD,gBAAA,cAAGH,SAAS,GAAAG,gBAAA;IACpBE,KAAK,GAAAC,wBAAA,CAAAb,IAAA,EAAAc,SAAA;EAER,IAAIZ,SAAS,EAAE;IACb,IAAIS,WAAW,EAAE;MACf,OAAOR,WAAW,CAACQ,WAAW,CAACI,IAAI,CAACrB,QAAQ,CAACD,EAAE,EAAEkB,WAAW,CAAC,CAAC,gBAC5Db,IAAA,CAACF,KAAK,EAAAoB,aAAA,KAAKJ,KAAK,EAAI,GAEpBH,SAAS,iBAAIX,IAAA,CAACN,SAAS;QAACyB,MAAM,EAAE;MAAI,EACrC;IACH;IAEA,oBAAOnB,IAAA,CAACF,KAAK,EAAAoB,aAAA,KAAKJ,KAAK,EAAI;EAC7B;EAEA,IAAIN,aAAa,EAAE;IACjB,oBAAOR,IAAA,CAACH,QAAQ;MAACuB,EAAE,EAAE;QAAEC,QAAQ,EAAEb;MAAc;IAAE,EAAG;EACtD;EAEA,OAAOG,SAAS,iBAAIX,IAAA,CAACN,SAAS;IAACyB,MAAM,EAAE;EAAI,EAAG;AAChD,CAAC;AAED,eAAelB,YAAY"}
|
|
@@ -1,35 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
var
|
|
3
|
-
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
4
|
/* eslint-disable react/display-name */
|
|
5
5
|
import React from "react";
|
|
6
6
|
import { Helmet } from "react-helmet";
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
9
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
10
|
var withTitle = function withTitle(Component) {
|
|
8
11
|
var title = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
|
|
9
12
|
return function (props) {
|
|
10
13
|
var pageTitle = title ? "".concat(title, " | ").concat(globalProps.appName) : globalProps.appName;
|
|
11
|
-
return /*#__PURE__*/
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}, /*#__PURE__*/React.createElement("title", {
|
|
19
|
-
__self: _this,
|
|
20
|
-
__source: {
|
|
21
|
-
fileName: _jsxFileName,
|
|
22
|
-
lineNumber: 16,
|
|
23
|
-
columnNumber: 11
|
|
24
|
-
}
|
|
25
|
-
}, pageTitle)), /*#__PURE__*/React.createElement(Component, _extends({}, props, {
|
|
26
|
-
__self: _this,
|
|
27
|
-
__source: {
|
|
28
|
-
fileName: _jsxFileName,
|
|
29
|
-
lineNumber: 18,
|
|
30
|
-
columnNumber: 9
|
|
31
|
-
}
|
|
32
|
-
})));
|
|
14
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
15
|
+
children: [/*#__PURE__*/_jsx(Helmet, {
|
|
16
|
+
children: /*#__PURE__*/_jsx("title", {
|
|
17
|
+
children: pageTitle
|
|
18
|
+
})
|
|
19
|
+
}), /*#__PURE__*/_jsx(Component, _objectSpread({}, props))]
|
|
20
|
+
});
|
|
33
21
|
};
|
|
34
22
|
};
|
|
35
23
|
export default withTitle;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withTitle.js","names":["React","Helmet","
|
|
1
|
+
{"version":3,"file":"withTitle.js","names":["React","Helmet","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","withTitle","Component","title","arguments","length","undefined","props","pageTitle","concat","globalProps","appName","children","_objectSpread"],"sources":["../../../src/react-utils/withTitle/withTitle.jsx"],"sourcesContent":["/* eslint-disable react/display-name */\nimport React from \"react\";\n\nimport { Helmet } from \"react-helmet\";\n\nconst withTitle =\n (Component, title = undefined) =>\n props => {\n const pageTitle = title\n ? `${title} | ${globalProps.appName}`\n : globalProps.appName;\n\n return (\n <>\n <Helmet>\n <title>{pageTitle}</title>\n </Helmet>\n <Component {...props} />\n </>\n );\n };\n\nexport default withTitle;\n"],"mappings":";;;AAAA;AACA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,MAAM,QAAQ,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAEtC,IAAMC,SAAS,GACb,SADIA,SAASA,CACZC,SAAS;EAAA,IAAEC,KAAK,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAGE,SAAS;EAAA,OAC7B,UAAAC,KAAK,EAAI;IACP,IAAMC,SAAS,GAAGL,KAAK,MAAAM,MAAA,CAChBN,KAAK,SAAAM,MAAA,CAAMC,WAAW,CAACC,OAAO,IACjCD,WAAW,CAACC,OAAO;IAEvB,oBACEX,KAAA,CAAAF,SAAA;MAAAc,QAAA,gBACEhB,IAAA,CAACF,MAAM;QAAAkB,QAAA,eACLhB,IAAA;UAAAgB,QAAA,EAAQJ;QAAS;MAAS,EACnB,eACTZ,IAAA,CAACM,SAAS,EAAAW,aAAA,KAAKN,KAAK,EAAI;IAAA,EACvB;EAEP,CAAC;AAAA;AAEH,eAAeN,SAAS"}
|