tenjin-ui-kit 0.3.70 → 0.3.72-dev
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/common/hooks/apiHooks.js +155 -0
- package/common/hooks/newApiHook.js +188 -0
- package/{dist/common → common}/utils/security/index.js +2 -2
- package/{dist/common → common}/utils/security/securityConfig.js +1 -2
- package/components/Canvas.js +330 -0
- package/components/DragBox/index.js +40 -0
- package/components/InputWithChip/index.js +294 -0
- package/{dist/components → components}/RightContext/index.js +19 -28
- package/components/WorkFlow.js +42 -0
- package/components/WorkFlowBuilder.js +115 -0
- package/components/alert/Style.js +20 -0
- package/components/alert/index.js +67 -0
- package/{dist/components → components}/attachment/index.js +21 -28
- package/{dist/components → components}/authenticationProvider/AuthError.js +3 -4
- package/{dist/components → components}/authenticationProvider/AuthLoader.js +3 -4
- package/components/authenticationProvider/index.js +110 -0
- package/{dist/components → components}/avatar/index.js +13 -14
- package/components/avatar/styles.js +91 -0
- package/components/breadCrumbs/index.js +169 -0
- package/{dist/components → components}/breadCrumbs/style.js +1 -4
- package/{dist/components → components}/browsingTestCaseLayout/DetailsViewLayout/DetailsViewContent/index.js +5 -6
- package/{dist/components → components}/browsingTestCaseLayout/DetailsViewLayout/DetailsViewContent/style.js +5 -8
- package/{dist/components → components}/browsingTestCaseLayout/DetailsViewLayout/DetailsViewHeader/index.js +4 -5
- package/{dist/components → components}/browsingTestCaseLayout/TreeViewLayout/TreeViewContent/Index.js +4 -5
- package/{dist/components → components}/browsingTestCaseLayout/TreeViewLayout/TreeViewHeader/Index.js +5 -6
- package/components/browsingTestCaseLayout/TreeViewLayout/TreeViewHeader/style.js +23 -0
- package/{dist/components → components}/browsingTestCaseLayout/index.js +25 -30
- package/components/button/index.js +133 -0
- package/{dist/components → components}/chatBotModal/index.js +36 -45
- package/components/checkBox/index.js +29 -0
- package/{dist/components → components}/combobox/index.js +51 -72
- package/components/divider/index.js +37 -0
- package/{dist/components → components}/editableField/index.js +19 -28
- package/{dist/components → components}/error/index.js +6 -12
- package/components/errorBoundary/index.js +140 -0
- package/components/fileUploader/index.js +151 -0
- package/components/fileUploader/style.js +57 -0
- package/components/filter/ValueSelector.js +333 -0
- package/{dist/components → components}/filter/index.js +26 -33
- package/{dist/components → components}/iconButton/index.js +3 -4
- package/components/input/index.js +167 -0
- package/components/layout/index.js +94 -0
- package/components/layout/main/index.js +24 -0
- package/components/layout/main/style.js +19 -0
- package/{dist/components → components}/layout/pageContent/index.js +6 -7
- package/components/layout/sidebar/FlatMenu.js +64 -0
- package/components/layout/sidebar/GroupedIconMenu.js +233 -0
- package/components/layout/sidebar/GroupedMenu.js +57 -0
- package/components/layout/sidebar/ProjectMenu.js +223 -0
- package/components/layout/sidebar/index.js +88 -0
- package/components/layout/sidebar/style.js +149 -0
- package/components/layout/topBar/ProjectTopbar.js +388 -0
- package/components/layout/topBar/UserAvatar.js +138 -0
- package/components/layout/topBar/index.js +121 -0
- package/{dist/components → components}/loader/index.js +9 -12
- package/components/menu/index.js +71 -0
- package/{dist/components → components}/modal/Modal.js +5 -6
- package/components/modal/index.js +88 -0
- package/components/modal/style.js +65 -0
- package/components/optionMenu/index.js +105 -0
- package/components/pagination/index.js +114 -0
- package/components/pagination/style.js +33 -0
- package/components/paginationUpdated/index.js +74 -0
- package/components/paper/index.js +43 -0
- package/components/paper/style.js +31 -0
- package/components/reactSelect/index.js +195 -0
- package/components/reactSelect/style.js +130 -0
- package/components/richTextEditor/index.js +64 -0
- package/components/select/GroupedSelect.js +167 -0
- package/components/select/SimpleSelect.js +184 -0
- package/{dist/components → components}/select/index.js +38 -54
- package/components/simpleSelect/index.js +53 -0
- package/{dist/components → components}/sort/index.js +19 -22
- package/{dist/components → components}/switch/index.js +10 -11
- package/components/switch/style.js +39 -0
- package/{dist/components → components}/switch/switch.js +17 -23
- package/components/table/ReactTable.js +101 -0
- package/components/table/SimpleTable.js +117 -0
- package/components/table/index.js +381 -0
- package/components/text/index.js +65 -0
- package/{dist/components → components}/timeStamp/index.js +4 -6
- package/components/timeStamp/style.js +20 -0
- package/components/topBar/index.js +169 -0
- package/{dist/components → components}/tree/index.js +29 -47
- package/components/tree/style.js +29 -0
- package/components/valuePicker/ValueSelector.js +205 -0
- package/{dist/components → components}/valuePicker/index.js +19 -26
- package/{dist/components → components}/wrapperLayout/layout/index.js +4 -5
- package/{dist/components → components}/wrapperLayout/main/index.js +4 -5
- package/{dist/components → components}/wrapperLayout/main/pageContainer/index.js +4 -5
- package/components/wrapperLayout/main/sideBar/index.js +272 -0
- package/components/wrapperLayout/main/sideBar/style.js +190 -0
- package/{dist/components → components}/wrapperLayout/topBar/UserAvatar.js +4 -5
- package/components/wrapperLayout/topBar/avatar.js +55 -0
- package/components/wrapperLayout/topBar/index.js +196 -0
- package/{dist/components → components}/wrapperLayout/topBar/menuIcon.js +4 -5
- package/components/wrapperLayout/topBar/style.js +74 -0
- package/http/index.js +133 -0
- package/{dist/index.js → index.js} +53 -55
- package/package.json +5 -3
- package/{dist/templates → templates}/listPage/index.js +36 -57
- package/{dist/themes → themes}/default.js +5 -7
- package/{dist/themes → themes}/defaultSmall.js +2 -3
- package/{dist/themes → themes}/responsiveTheme.js +6 -8
- package/.dockerignore +0 -6
- package/.storybook/main.js +0 -16
- package/.storybook/preview.js +0 -11
- package/Dockerfile +0 -17
- package/Jenkinsfile +0 -66
- package/build/asset-manifest.json +0 -16
- package/build/favicon.ico +0 -0
- package/build/index.html +0 -1
- package/build/logo192.png +0 -0
- package/build/logo512.png +0 -0
- package/build/manifest.json +0 -25
- package/build/robots.txt +0 -3
- package/build/static/css/main.522396f6.css +0 -2
- package/build/static/css/main.522396f6.css.map +0 -1
- package/build/static/js/787.18cf14d0.chunk.js +0 -2
- package/build/static/js/787.18cf14d0.chunk.js.map +0 -1
- package/build/static/js/main.d71fecac.js +0 -3
- package/build/static/js/main.d71fecac.js.LICENSE.txt +0 -50
- package/build/static/js/main.d71fecac.js.map +0 -1
- package/build/static/media/logo.6ce24c58023cc2f8fd88fe9d219db6c6.svg +0 -1
- package/build/tenjinLogo.png +0 -0
- package/dist/common/hooks/apiHooks.js +0 -223
- package/dist/common/hooks/newApiHook.js +0 -270
- package/dist/components/Canvas.js +0 -254
- package/dist/components/DragBox/index.js +0 -45
- package/dist/components/InputWithChip/index.js +0 -187
- package/dist/components/WorkFlow.js +0 -47
- package/dist/components/WorkFlowBuilder.js +0 -130
- package/dist/components/alert/Style.js +0 -23
- package/dist/components/alert/index.js +0 -69
- package/dist/components/authenticationProvider/index.js +0 -166
- package/dist/components/avatar/styles.js +0 -94
- package/dist/components/breadCrumbs/index.js +0 -180
- package/dist/components/browsingTestCaseLayout/TreeViewLayout/TreeViewHeader/style.js +0 -26
- package/dist/components/button/index.js +0 -140
- package/dist/components/checkBox/index.js +0 -30
- package/dist/components/divider/index.js +0 -41
- package/dist/components/errorBoundary/index.js +0 -160
- package/dist/components/fileUploader/index.js +0 -156
- package/dist/components/fileUploader/style.js +0 -60
- package/dist/components/filter/ValueSelector.js +0 -405
- package/dist/components/input/index.js +0 -174
- package/dist/components/layout/index.js +0 -98
- package/dist/components/layout/main/index.js +0 -27
- package/dist/components/layout/main/style.js +0 -22
- package/dist/components/layout/sidebar/FlatMenu.js +0 -64
- package/dist/components/layout/sidebar/GroupedIconMenu.js +0 -246
- package/dist/components/layout/sidebar/GroupedMenu.js +0 -67
- package/dist/components/layout/sidebar/ProjectMenu.js +0 -230
- package/dist/components/layout/sidebar/index.js +0 -91
- package/dist/components/layout/sidebar/style.js +0 -154
- package/dist/components/layout/topBar/ProjectTopbar.js +0 -338
- package/dist/components/layout/topBar/UserAvatar.js +0 -145
- package/dist/components/layout/topBar/index.js +0 -132
- package/dist/components/menu/index.js +0 -80
- package/dist/components/modal/index.js +0 -91
- package/dist/components/modal/style.js +0 -68
- package/dist/components/optionMenu/index.js +0 -112
- package/dist/components/pagination/index.js +0 -129
- package/dist/components/pagination/style.js +0 -36
- package/dist/components/paginationUpdated/index.js +0 -75
- package/dist/components/paper/index.js +0 -44
- package/dist/components/paper/style.js +0 -34
- package/dist/components/reactSelect/index.js +0 -212
- package/dist/components/reactSelect/style.js +0 -163
- package/dist/components/richTextEditor/index.js +0 -83
- package/dist/components/select/GroupedSelect.js +0 -183
- package/dist/components/select/SimpleSelect.js +0 -212
- package/dist/components/simpleSelect/index.js +0 -56
- package/dist/components/switch/style.js +0 -42
- package/dist/components/table/ReactTable.js +0 -118
- package/dist/components/table/SimpleTable.js +0 -136
- package/dist/components/table/index.js +0 -256
- package/dist/components/text/index.js +0 -67
- package/dist/components/timeStamp/style.js +0 -23
- package/dist/components/topBar/index.js +0 -176
- package/dist/components/tree/style.js +0 -32
- package/dist/components/valuePicker/ValueSelector.js +0 -273
- package/dist/components/wrapperLayout/main/sideBar/index.js +0 -262
- package/dist/components/wrapperLayout/main/sideBar/style.js +0 -196
- package/dist/components/wrapperLayout/topBar/avatar.js +0 -57
- package/dist/components/wrapperLayout/topBar/index.js +0 -182
- package/dist/components/wrapperLayout/topBar/style.js +0 -77
- package/dist/http/index.js +0 -226
- package/public/favicon.ico +0 -0
- package/public/index.html +0 -43
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/public/manifest.json +0 -25
- package/public/robots.txt +0 -3
- package/public/tenjinLogo.png +0 -0
- /package/{dist/assets → assets}/images/MicrosoftTeams-image (1).png +0 -0
- /package/{dist/assets → assets}/images/tenjin-4.0-logo.png +0 -0
- /package/{dist/components → components}/RightContext/index.css +0 -0
- /package/{dist/components → components}/browsingTestCaseLayout/style.css +0 -0
- /package/{dist/components → components}/errorBoundary/Error.jpg +0 -0
- /package/{dist/components → components}/iconButton/style.js +0 -0
- /package/{dist/components → components}/richTextEditor/style.js +0 -0
- /package/{dist/components → components}/wrapperLayout/layout/style.js +0 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = Avatar;
|
|
7
|
+
var React = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _material = require("@mui/material");
|
|
9
|
+
var _Stack = _interopRequireDefault(require("@mui/material/Stack"));
|
|
10
|
+
var _style = _interopRequireDefault(require("./style"));
|
|
11
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
14
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
15
|
+
function stringToColor(string) {
|
|
16
|
+
let hash = 0;
|
|
17
|
+
let i;
|
|
18
|
+
for (i = 0; i < string.length; i += 1) {
|
|
19
|
+
hash = string.charCodeAt(i) + ((hash << 5) - hash);
|
|
20
|
+
}
|
|
21
|
+
let color = "#";
|
|
22
|
+
for (i = 0; i < 3; i += 1) {
|
|
23
|
+
const value = hash >> i * 8 & 0xff;
|
|
24
|
+
color += "00".concat(value.toString(16)).slice(-2);
|
|
25
|
+
}
|
|
26
|
+
return color;
|
|
27
|
+
}
|
|
28
|
+
function stringAvatar(name, height, width) {
|
|
29
|
+
return {
|
|
30
|
+
sx: {
|
|
31
|
+
bgcolor: stringToColor(name),
|
|
32
|
+
height: "".concat(height, "vh"),
|
|
33
|
+
width: "".concat(width, "vw"),
|
|
34
|
+
fontSize: "1.2vw",
|
|
35
|
+
padding: "1.2rem 1.2rem"
|
|
36
|
+
},
|
|
37
|
+
children: "".concat(name.split(" ")[0][0]).concat(name.split(" ")[1][0] === undefined ? "" : "".concat(name.split(" ")[1][0]))
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function Avatar(props) {
|
|
41
|
+
var _props$loggedInUser, _props$loggedInUser2;
|
|
42
|
+
let name = typeof props.loggedInUser !== "object" ? props.loggedInUser : (_props$loggedInUser = props.loggedInUser) === null || _props$loggedInUser === void 0 ? void 0 : _props$loggedInUser.firstName;
|
|
43
|
+
let lastName = ((_props$loggedInUser2 = props.loggedInUser) === null || _props$loggedInUser2 === void 0 ? void 0 : _props$loggedInUser2.lastName) !== undefined ? props.loggedInUser.lastName : "";
|
|
44
|
+
const classes = (0, _style.default)();
|
|
45
|
+
return /*#__PURE__*/React.createElement(_Stack.default, {
|
|
46
|
+
direction: "row",
|
|
47
|
+
spacing: 2
|
|
48
|
+
}, /*#__PURE__*/React.createElement(_material.Avatar, _extends({
|
|
49
|
+
disableRipple: true
|
|
50
|
+
// variant="rounded"
|
|
51
|
+
,
|
|
52
|
+
className: (0, _clsx.default)(classes.avatar, "avatar", classes[props.size]),
|
|
53
|
+
size: props.size
|
|
54
|
+
}, stringAvatar((name === null || name === void 0 ? void 0 : name.toUpperCase()) + " " + (lastName === null || lastName === void 0 ? void 0 : lastName.toUpperCase()), props.height, props.width))));
|
|
55
|
+
}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _material = require("@mui/material");
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _breadCrumbs = _interopRequireDefault(require("../../breadCrumbs"));
|
|
10
|
+
var _avatar = _interopRequireDefault(require("../topBar/avatar"));
|
|
11
|
+
var _propTypes = _interopRequireWildcard(require("prop-types"));
|
|
12
|
+
var _style = _interopRequireDefault(require("./style"));
|
|
13
|
+
var _reactRouterDom = require("react-router-dom");
|
|
14
|
+
var _text = _interopRequireDefault(require("../../text"));
|
|
15
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
16
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
18
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
19
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
20
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
21
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
22
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } // import { Box, Paper } from '@mui/material';
|
|
23
|
+
// import React from 'react';
|
|
24
|
+
// const TopBar = () => {
|
|
25
|
+
// return (
|
|
26
|
+
// <Box
|
|
27
|
+
// sx={{
|
|
28
|
+
// display: 'flex',
|
|
29
|
+
// flexWrap: 'wrap',
|
|
30
|
+
// '& > :not(style)': {
|
|
31
|
+
// m: 1,
|
|
32
|
+
// width: '100vw',
|
|
33
|
+
// height: '60px',
|
|
34
|
+
// margin: '0px !important',
|
|
35
|
+
// },
|
|
36
|
+
// }}
|
|
37
|
+
// >
|
|
38
|
+
// <Paper>TopBar</Paper>
|
|
39
|
+
// </Box>
|
|
40
|
+
// );
|
|
41
|
+
// };
|
|
42
|
+
// export default TopBar;
|
|
43
|
+
/* eslint-disable no-lone-blocks */ // import styles from "./index.module.css";
|
|
44
|
+
const TopBar = props => {
|
|
45
|
+
var _props$menuDetails, _concatedMenu$clicked;
|
|
46
|
+
const classes = (0, _style.default)();
|
|
47
|
+
const open = Boolean(props.anchorElUser);
|
|
48
|
+
const _React$useState = _react.default.useState(null),
|
|
49
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
50
|
+
anchorEl = _React$useState2[0],
|
|
51
|
+
setAnchorEl = _React$useState2[1];
|
|
52
|
+
const _React$useState3 = _react.default.useState(null),
|
|
53
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
54
|
+
clickedState = _React$useState4[0],
|
|
55
|
+
setClickedState = _React$useState4[1];
|
|
56
|
+
const handleOpenUserMenu = event => {
|
|
57
|
+
setAnchorEl(event === null || event === void 0 ? void 0 : event.currentTarget);
|
|
58
|
+
};
|
|
59
|
+
const handleCloseUserMenu = () => {
|
|
60
|
+
setAnchorEl(null);
|
|
61
|
+
};
|
|
62
|
+
const userMenuObject = [{
|
|
63
|
+
name: 'User',
|
|
64
|
+
icon: /*#__PURE__*/_react.default.createElement(_avatar.default, {
|
|
65
|
+
loggedInUser: props.loggedInUser,
|
|
66
|
+
height: "2",
|
|
67
|
+
width: "2"
|
|
68
|
+
}),
|
|
69
|
+
listOfItems: props.userMenu
|
|
70
|
+
}];
|
|
71
|
+
const concatedMenu = (_props$menuDetails = props.menuDetails) === null || _props$menuDetails === void 0 ? void 0 : _props$menuDetails.concat(userMenuObject);
|
|
72
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
73
|
+
sx: {
|
|
74
|
+
flexGrow: 1
|
|
75
|
+
}
|
|
76
|
+
}, /*#__PURE__*/_react.default.createElement(_material.AppBar, {
|
|
77
|
+
position: "static",
|
|
78
|
+
className: classes.appBar
|
|
79
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Toolbar, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
80
|
+
className: classes.logoContent
|
|
81
|
+
}, /*#__PURE__*/_react.default.createElement("a", {
|
|
82
|
+
href: "/".concat(props.location)
|
|
83
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
84
|
+
className: classes.appLogo
|
|
85
|
+
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
86
|
+
src: props.logo,
|
|
87
|
+
alt: "app png logo"
|
|
88
|
+
})))), /*#__PURE__*/_react.default.createElement(_material.Divider, {
|
|
89
|
+
orientation: "vertical",
|
|
90
|
+
flexItem: true
|
|
91
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
92
|
+
className: classes.breadCrumbs
|
|
93
|
+
}, /*#__PURE__*/_react.default.createElement(_breadCrumbs.default, {
|
|
94
|
+
crumbInfo: props === null || props === void 0 ? void 0 : props.crumbInfo
|
|
95
|
+
})), concatedMenu && concatedMenu.map((menu, key) => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
96
|
+
style: {
|
|
97
|
+
display: 'flex',
|
|
98
|
+
alignItems: 'center',
|
|
99
|
+
padding: concatedMenu.length - 1 === key ? '0rem 0rem 0rem 1rem' : '0rem 1rem 0rem 0rem'
|
|
100
|
+
}
|
|
101
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Box, null, /*#__PURE__*/_react.default.createElement(_material.Tooltip, {
|
|
102
|
+
title: menu.name
|
|
103
|
+
}, /*#__PURE__*/_react.default.createElement(_material.IconButton, {
|
|
104
|
+
key: key,
|
|
105
|
+
onClick: e => {
|
|
106
|
+
handleOpenUserMenu(e);
|
|
107
|
+
setClickedState(key);
|
|
108
|
+
},
|
|
109
|
+
size: "small",
|
|
110
|
+
sx: {
|
|
111
|
+
ml: 2
|
|
112
|
+
}
|
|
113
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
114
|
+
style: {
|
|
115
|
+
fontSize: '2vw',
|
|
116
|
+
display: 'flex',
|
|
117
|
+
alignItems: 'center'
|
|
118
|
+
}
|
|
119
|
+
}, menu.icon))))), concatedMenu.length - 1 !== key && /*#__PURE__*/_react.default.createElement(_material.Divider, {
|
|
120
|
+
orientation: "vertical",
|
|
121
|
+
flexItem: true
|
|
122
|
+
}))), /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_material.Menu, {
|
|
123
|
+
anchorEl: anchorEl,
|
|
124
|
+
id: "basic-menu",
|
|
125
|
+
disableRipple: true,
|
|
126
|
+
open: Boolean(anchorEl),
|
|
127
|
+
onClose: handleCloseUserMenu,
|
|
128
|
+
onClick: handleCloseUserMenu,
|
|
129
|
+
sx: {
|
|
130
|
+
top: 12,
|
|
131
|
+
left: 5
|
|
132
|
+
}
|
|
133
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
134
|
+
style: {
|
|
135
|
+
maxHeight: '40vh',
|
|
136
|
+
//width: 160,
|
|
137
|
+
maxWidth: '100%'
|
|
138
|
+
}
|
|
139
|
+
}, concatedMenu && ((_concatedMenu$clicked = concatedMenu[clickedState]) === null || _concatedMenu$clicked === void 0 || (_concatedMenu$clicked = _concatedMenu$clicked.listOfItems) === null || _concatedMenu$clicked === void 0 ? void 0 : _concatedMenu$clicked.map((item, index) => /*#__PURE__*/_react.default.createElement(_reactRouterDom.Link, {
|
|
140
|
+
to: item === null || item === void 0 ? void 0 : item.to,
|
|
141
|
+
style: {
|
|
142
|
+
textDecoration: 'none'
|
|
143
|
+
}
|
|
144
|
+
}, /*#__PURE__*/_react.default.createElement(_material.MenuItem, {
|
|
145
|
+
onClick: handleCloseUserMenu,
|
|
146
|
+
key: index,
|
|
147
|
+
style: {
|
|
148
|
+
display: 'flex',
|
|
149
|
+
flexGrow: 1
|
|
150
|
+
}
|
|
151
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
152
|
+
style: {
|
|
153
|
+
display: 'flex',
|
|
154
|
+
flexGrow: 1
|
|
155
|
+
}
|
|
156
|
+
}, item.icon && /*#__PURE__*/_react.default.createElement("div", {
|
|
157
|
+
style: {
|
|
158
|
+
display: 'flex',
|
|
159
|
+
alignItems: 'center',
|
|
160
|
+
paddingRight: '1.5rem',
|
|
161
|
+
fontSize: '1.1rem',
|
|
162
|
+
color: '#44409A'
|
|
163
|
+
}
|
|
164
|
+
}, item.icon), /*#__PURE__*/_react.default.createElement("div", {
|
|
165
|
+
style: {
|
|
166
|
+
display: 'flex',
|
|
167
|
+
flexDirection: 'column'
|
|
168
|
+
}
|
|
169
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
170
|
+
style: {
|
|
171
|
+
fontWeight: 600,
|
|
172
|
+
color: '#000000DE',
|
|
173
|
+
// fontSize: "0.9rem",
|
|
174
|
+
fontSize: '80%'
|
|
175
|
+
}
|
|
176
|
+
}, /*#__PURE__*/_react.default.createElement(_text.default, null, item.name)), /*#__PURE__*/_react.default.createElement("div", {
|
|
177
|
+
style: {
|
|
178
|
+
color: '#000000DE',
|
|
179
|
+
// fontSize: "13px",
|
|
180
|
+
fontSize: '80%'
|
|
181
|
+
}
|
|
182
|
+
}, /*#__PURE__*/_react.default.createElement(_text.default, null, item.description)))))))))))))));
|
|
183
|
+
};
|
|
184
|
+
TopBar.propTypes = {
|
|
185
|
+
logo: _propTypes.default.string.isRequired,
|
|
186
|
+
location: _propTypes.default.string.isRequired,
|
|
187
|
+
anchorElUser: _propTypes.default.object.isRequired,
|
|
188
|
+
setAnchorElUser: _propTypes.default.object.isRequired,
|
|
189
|
+
handleOpenUserMenu: _propTypes.default.func,
|
|
190
|
+
handleCloseUserMenu: _propTypes.default.func,
|
|
191
|
+
loggedInUser: _propTypes.default.object.isRequired,
|
|
192
|
+
menuDetails: _propTypes.default.array,
|
|
193
|
+
userMenu: _propTypes.default.array,
|
|
194
|
+
crumbInfo: _propTypes.default.array
|
|
195
|
+
};
|
|
196
|
+
var _default = exports.default = TopBar;
|
|
@@ -5,10 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
function _interopRequireDefault(
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
const MenuIcon = _ref => {
|
|
10
|
+
let children = _ref.children;
|
|
11
11
|
return /*#__PURE__*/_react.default.createElement("div", null, children);
|
|
12
12
|
};
|
|
13
|
-
var _default = MenuIcon;
|
|
14
|
-
exports.default = _default;
|
|
13
|
+
var _default = exports.default = MenuIcon;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _styles = require("@mui/styles");
|
|
8
|
+
var _default2 = _interopRequireDefault(require("../../../themes/default"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
var _default = exports.default = (0, _styles.makeStyles)(() => ({
|
|
11
|
+
"@global": {
|
|
12
|
+
html: {
|
|
13
|
+
"scroll-behavior": "smooth",
|
|
14
|
+
height: "100vh"
|
|
15
|
+
},
|
|
16
|
+
body: {
|
|
17
|
+
position: "relative",
|
|
18
|
+
margin: 0,
|
|
19
|
+
height: "100vh",
|
|
20
|
+
color: "#000000",
|
|
21
|
+
backgroundColor: "#f4f7fc"
|
|
22
|
+
},
|
|
23
|
+
"*::-webkit-scrollbar": {
|
|
24
|
+
width: "0.2rem"
|
|
25
|
+
},
|
|
26
|
+
"*::-webkit-scrollbar-thumb": {
|
|
27
|
+
backgroundColor: "#636A74",
|
|
28
|
+
borderRadius: "3px",
|
|
29
|
+
opacity: 0.5
|
|
30
|
+
},
|
|
31
|
+
"*::-webkit-scrollbar-track": {
|
|
32
|
+
background: "transparent"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
appBar: {
|
|
36
|
+
position: "relative !important",
|
|
37
|
+
margin: "0rem !important",
|
|
38
|
+
padding: " 0rem !important",
|
|
39
|
+
boxShadow: "-1px 1px 7px 0px rgba(0, 0, 0, 0.2) !important",
|
|
40
|
+
backgroundColor: "white !important"
|
|
41
|
+
},
|
|
42
|
+
logoContent: {
|
|
43
|
+
display: "block !important",
|
|
44
|
+
height: "100% !important",
|
|
45
|
+
width: "6rem !important",
|
|
46
|
+
margin: "auto",
|
|
47
|
+
paddingTop: "1rem"
|
|
48
|
+
},
|
|
49
|
+
topbarMenuLink: {
|
|
50
|
+
textDecoration: "none"
|
|
51
|
+
},
|
|
52
|
+
appLogo: {
|
|
53
|
+
display: "flex",
|
|
54
|
+
width: "6rem !important",
|
|
55
|
+
height: "2rem !important"
|
|
56
|
+
},
|
|
57
|
+
"& .MuiContainer-root": {
|
|
58
|
+
maxWidth: "100%",
|
|
59
|
+
height: "90vh"
|
|
60
|
+
},
|
|
61
|
+
breadCrumbs: {
|
|
62
|
+
display: "flex",
|
|
63
|
+
flexGrow: 1,
|
|
64
|
+
marginLeft: "32px"
|
|
65
|
+
},
|
|
66
|
+
avatar: _ref => {
|
|
67
|
+
let avatarColor = _ref.avatarColor;
|
|
68
|
+
return {
|
|
69
|
+
backgroundColor: "".concat(avatarColor),
|
|
70
|
+
fontWeight: 400,
|
|
71
|
+
letterSpacing: "0px"
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
}));
|
package/http/index.js
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.put = exports.postClient = exports.post = exports.parseAxiosError = exports.getSecureClient = exports.getClient = exports.get = exports.doDelete = void 0;
|
|
7
|
+
var _axios = _interopRequireDefault(require("axios"));
|
|
8
|
+
var _authenticationProvider = _interopRequireDefault(require("../components/authenticationProvider"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
function ownKeys(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; }
|
|
11
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
13
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
14
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
15
|
+
const getApiAccessToken = _authenticationProvider.default.getApiAccessToken;
|
|
16
|
+
const getClient = () => {
|
|
17
|
+
return _axios.default.create({
|
|
18
|
+
headers: {
|
|
19
|
+
"Content-Type": "application/json"
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
exports.getClient = getClient;
|
|
24
|
+
const getSecureClient = () => {
|
|
25
|
+
return _axios.default.create({
|
|
26
|
+
headers: {
|
|
27
|
+
"Content-Type": "application/json",
|
|
28
|
+
Authorization: "Bearer ".concat(getApiAccessToken())
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
exports.getSecureClient = getSecureClient;
|
|
33
|
+
const get = async url => {
|
|
34
|
+
try {
|
|
35
|
+
const response = await getSecureClient().get(url);
|
|
36
|
+
return {
|
|
37
|
+
success: true,
|
|
38
|
+
data: response.data
|
|
39
|
+
};
|
|
40
|
+
} catch (error) {
|
|
41
|
+
console.warn("Get ".concat(url, " failed"));
|
|
42
|
+
const parsedError = parseAxiosError(error);
|
|
43
|
+
return {
|
|
44
|
+
success: false,
|
|
45
|
+
data: parsedError
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
exports.get = get;
|
|
50
|
+
const post = async (url, data) => {
|
|
51
|
+
try {
|
|
52
|
+
const response = await getSecureClient().post(url, data);
|
|
53
|
+
return {
|
|
54
|
+
success: true,
|
|
55
|
+
data: response.data
|
|
56
|
+
};
|
|
57
|
+
} catch (error) {
|
|
58
|
+
console.warn("Post ".concat(url, " failed"));
|
|
59
|
+
const parsedError = parseAxiosError(error);
|
|
60
|
+
return {
|
|
61
|
+
success: false,
|
|
62
|
+
data: parsedError
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
exports.post = post;
|
|
67
|
+
const postClient = async (url, data) => {
|
|
68
|
+
try {
|
|
69
|
+
const response = await _axios.default.post(url, data);
|
|
70
|
+
return {
|
|
71
|
+
success: true,
|
|
72
|
+
data: response.data
|
|
73
|
+
};
|
|
74
|
+
} catch (error) {
|
|
75
|
+
console.warn("Post ".concat(url, " failed"));
|
|
76
|
+
const parsedError = parseAxiosError(error);
|
|
77
|
+
return {
|
|
78
|
+
success: false,
|
|
79
|
+
data: parsedError
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
exports.postClient = postClient;
|
|
84
|
+
const put = async (url, data) => {
|
|
85
|
+
try {
|
|
86
|
+
const response = await getSecureClient().put(url, data);
|
|
87
|
+
return {
|
|
88
|
+
success: true,
|
|
89
|
+
data: response.data
|
|
90
|
+
};
|
|
91
|
+
} catch (error) {
|
|
92
|
+
console.warn("Put ".concat(url, " failed"));
|
|
93
|
+
const parsedError = parseAxiosError(error);
|
|
94
|
+
return {
|
|
95
|
+
success: false,
|
|
96
|
+
data: parsedError
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
exports.put = put;
|
|
101
|
+
const doDelete = async url => {
|
|
102
|
+
try {
|
|
103
|
+
await getSecureClient().delete(url);
|
|
104
|
+
return {
|
|
105
|
+
success: true
|
|
106
|
+
};
|
|
107
|
+
} catch (error) {
|
|
108
|
+
console.warn("Delete ".concat(url, " failed"));
|
|
109
|
+
const parsedError = parseAxiosError(error);
|
|
110
|
+
return {
|
|
111
|
+
success: false,
|
|
112
|
+
data: parsedError
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
exports.doDelete = doDelete;
|
|
117
|
+
const parseAxiosError = error => {
|
|
118
|
+
let parsedError = {
|
|
119
|
+
status: 500,
|
|
120
|
+
statusText: "Internal Server Error",
|
|
121
|
+
message: "An unexpected error occurred while processing your request. Please try again. If problem persists, please contact Tenjin support"
|
|
122
|
+
};
|
|
123
|
+
if (error && error.response) {
|
|
124
|
+
var _error$response$data$;
|
|
125
|
+
parsedError = _objectSpread(_objectSpread({}, parsedError), {}, {
|
|
126
|
+
status: error.response.status,
|
|
127
|
+
statusText: error.response.statusText,
|
|
128
|
+
message: error.response.status === 503 ? (_error$response$data$ = error.response.data.message) !== null && _error$response$data$ !== void 0 ? _error$response$data$ : "A network error occurred. Please try again" : error.response.status === 401 ? "Authentication Failed" : error.response.data ? error.response.data.message ? error.response.data.message : "An unexpected error occurred while processing your request. Please try again. If problem persists, please contact Tenjin support" : "An unexpected error occurred while processing your request. Please try again. If problem persists, please contact Tenjin support"
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
return parsedError;
|
|
132
|
+
};
|
|
133
|
+
exports.parseAxiosError = parseAxiosError;
|