tenjin-ui-kit 0.3.73 → 0.3.74
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/README.md +13 -13
- package/common/hooks/apiHooks.js +199 -91
- package/common/hooks/newApiHook.js +258 -127
- package/common/utils/security/index.js +2 -2
- package/common/utils/security/securityConfig.js +2 -1
- package/components/Canvas.js +101 -172
- package/components/DragBox/index.js +31 -21
- package/components/InputWithChip/index.js +83 -178
- package/components/RightContext/index.css +20 -20
- package/components/RightContext/index.js +41 -17
- package/components/WorkFlow.js +29 -19
- package/components/WorkFlowBuilder.js +56 -32
- package/components/alert/Style.js +14 -11
- package/components/alert/index.js +14 -8
- package/components/attachment/index.js +31 -26
- package/components/authenticationProvider/AuthError.js +4 -3
- package/components/authenticationProvider/AuthLoader.js +4 -3
- package/components/authenticationProvider/index.js +130 -58
- package/components/avatar/index.js +23 -24
- package/components/avatar/styles.js +77 -76
- package/components/breadCrumbs/index.js +89 -64
- package/components/breadCrumbs/style.js +4 -1
- package/components/browsingTestCaseLayout/DetailsViewLayout/DetailsViewContent/index.js +6 -7
- package/components/browsingTestCaseLayout/DetailsViewLayout/DetailsViewContent/style.js +8 -5
- package/components/browsingTestCaseLayout/DetailsViewLayout/DetailsViewHeader/index.js +6 -7
- package/components/browsingTestCaseLayout/TreeViewLayout/TreeViewContent/Index.js +7 -8
- package/components/browsingTestCaseLayout/TreeViewLayout/TreeViewHeader/Index.js +7 -8
- package/components/browsingTestCaseLayout/TreeViewLayout/TreeViewHeader/style.js +19 -16
- package/components/browsingTestCaseLayout/index.js +46 -30
- package/components/browsingTestCaseLayout/style.css +82 -82
- package/components/button/index.js +58 -47
- package/components/chatBotModal/index.js +61 -40
- package/components/checkBox/index.js +10 -8
- package/components/combobox/index.js +216 -182
- package/components/divider/index.js +18 -9
- package/components/editableField/index.js +46 -19
- package/components/error/index.js +12 -6
- package/components/errorBoundary/index.js +98 -74
- package/components/fileUploader/index.js +58 -46
- package/components/fileUploader/style.js +49 -46
- package/components/filter/ValueSelector.js +243 -148
- package/components/filter/index.js +66 -43
- package/components/iconButton/index.js +4 -3
- package/components/input/index.js +74 -60
- package/components/layout/index.js +49 -36
- package/components/layout/main/index.js +14 -13
- package/components/layout/main/style.js +14 -11
- package/components/layout/pageContent/index.js +7 -8
- package/components/layout/sidebar/FlatMenu.js +47 -51
- package/components/layout/sidebar/GroupedIconMenu.js +194 -169
- package/components/layout/sidebar/GroupedMenu.js +50 -45
- package/components/layout/sidebar/ProjectMenu.js +185 -165
- package/components/layout/sidebar/index.js +26 -27
- package/components/layout/sidebar/style.js +143 -138
- package/components/layout/topBar/ProjectTopbar.js +119 -86
- package/components/layout/topBar/UserAvatar.js +65 -51
- package/components/layout/topBar/index.js +41 -23
- package/components/loader/index.js +12 -9
- package/components/menu/index.js +42 -23
- package/components/modal/Modal.js +6 -5
- package/components/modal/index.js +20 -16
- package/components/modal/style.js +56 -53
- package/components/optionMenu/index.js +72 -57
- package/components/pagination/index.js +43 -23
- package/components/pagination/style.js +28 -25
- package/components/paginationUpdated/index.js +26 -19
- package/components/paper/index.js +22 -20
- package/components/paper/style.js +27 -24
- package/components/reactSelect/index.js +97 -64
- package/components/reactSelect/style.js +151 -131
- package/components/richTextEditor/index.js +48 -24
- package/components/select/GroupedSelect.js +100 -56
- package/components/select/SimpleSelect.js +99 -59
- package/components/select/index.js +69 -56
- package/components/simpleSelect/index.js +22 -18
- package/components/sort/index.js +36 -23
- package/components/switch/index.js +15 -14
- package/components/switch/style.js +32 -29
- package/components/switch/switch.js +47 -30
- package/components/table/ReactTable.js +83 -59
- package/components/table/SimpleTable.js +91 -67
- package/components/table/index.js +206 -300
- package/components/text/index.js +30 -22
- package/components/timeStamp/index.js +6 -4
- package/components/timeStamp/style.js +15 -12
- package/components/topBar/index.js +102 -86
- package/components/tree/index.js +58 -30
- package/components/tree/style.js +23 -20
- package/components/valuePicker/ValueSelector.js +160 -78
- package/components/valuePicker/index.js +50 -30
- package/components/wrapperLayout/layout/index.js +7 -8
- package/components/wrapperLayout/main/index.js +7 -8
- package/components/wrapperLayout/main/pageContainer/index.js +5 -6
- package/components/wrapperLayout/main/sideBar/index.js +175 -171
- package/components/wrapperLayout/main/sideBar/style.js +183 -177
- package/components/wrapperLayout/topBar/UserAvatar.js +5 -6
- package/components/wrapperLayout/topBar/avatar.js +18 -15
- package/components/wrapperLayout/topBar/index.js +107 -115
- package/components/wrapperLayout/topBar/menuIcon.js +5 -6
- package/components/wrapperLayout/topBar/style.js +64 -63
- package/http/index.js +188 -92
- package/index.js +55 -53
- package/package.json +124 -125
- package/templates/listPage/index.js +196 -168
- package/themes/default.js +7 -5
- package/themes/defaultSmall.js +3 -2
- package/themes/responsiveTheme.js +8 -6
|
@@ -8,142 +8,147 @@ var _iconsMaterial = require("@mui/icons-material");
|
|
|
8
8
|
var _styles = require("@mui/styles");
|
|
9
9
|
var _system = require("@mui/system");
|
|
10
10
|
var _responsiveTheme = _interopRequireDefault(require("../../../themes/responsiveTheme"));
|
|
11
|
-
function _interopRequireDefault(
|
|
12
|
-
var _default =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
var _default = (0, _styles.makeStyles)(function () {
|
|
13
|
+
return {
|
|
14
|
+
subHeader: {
|
|
15
|
+
textTransform: "uppercase",
|
|
16
|
+
fontSize: _responsiveTheme.default.typography.fontSize - 2,
|
|
17
|
+
color: "rgba(0,0,0,0.5)",
|
|
18
|
+
fontWeight: 500
|
|
19
|
+
},
|
|
20
|
+
link: {
|
|
21
|
+
textDecoration: "none"
|
|
22
|
+
},
|
|
23
|
+
listItemText: {
|
|
24
|
+
color: "".concat(_responsiveTheme.default.palette.primary.main, " !important"),
|
|
25
|
+
fontWeight: "500 !important"
|
|
26
|
+
},
|
|
27
|
+
expanded: {
|
|
28
|
+
width: "200px"
|
|
29
|
+
},
|
|
30
|
+
collapsed: {
|
|
31
|
+
width: "72px"
|
|
32
|
+
},
|
|
33
|
+
collapsedFlatMenuItem: {
|
|
34
|
+
paddingLeft: "0",
|
|
35
|
+
paddingRight: "0",
|
|
36
|
+
display: "flex !important",
|
|
37
|
+
alignItems: "center !important",
|
|
38
|
+
justifyContent: "center !important",
|
|
39
|
+
"& .MuiListItemIcon-root": {
|
|
40
|
+
minWidth: "10px"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
collapsedFlatMenuItemText: {
|
|
44
|
+
display: "none !important"
|
|
45
|
+
},
|
|
46
|
+
flatMenuItem: {
|
|
47
|
+
height: "48px",
|
|
48
|
+
borderRadius: "7px !important"
|
|
49
|
+
},
|
|
50
|
+
selectedFlatMenuItem: {
|
|
51
|
+
backgroundColor: "".concat(_responsiveTheme.default.palette.primary.main, " !important"),
|
|
52
|
+
color: "#fff !important"
|
|
53
|
+
},
|
|
54
|
+
selectedGroupMenuItem: {
|
|
55
|
+
backgroundColor: "".concat(_responsiveTheme.default.palette.primary.main, " !important"),
|
|
56
|
+
color: "#fff !important",
|
|
57
|
+
borderRadius: "5px !important"
|
|
58
|
+
},
|
|
59
|
+
selectedFlatMenuIcon: {
|
|
60
|
+
color: "#fff !important"
|
|
61
|
+
},
|
|
62
|
+
selectedFlatMenuItemText: {
|
|
63
|
+
color: "#fff !important"
|
|
64
|
+
},
|
|
65
|
+
projectMenuMainWrapper: {
|
|
66
|
+
paddingTop: "0.5rem",
|
|
67
|
+
// padding: "7px",
|
|
68
|
+
display: "inline-block",
|
|
69
|
+
width: "100%"
|
|
70
|
+
},
|
|
71
|
+
projectMenuHeader: {
|
|
72
|
+
color: "#44409A",
|
|
73
|
+
fontFamily: "sans-serif",
|
|
74
|
+
fontSize: "18px !important",
|
|
75
|
+
lineHeight: "24px",
|
|
76
|
+
display: "flex",
|
|
77
|
+
justifyContent: "center",
|
|
78
|
+
VerticalAlignCenter: true
|
|
79
|
+
},
|
|
80
|
+
selectedProjectMenuItem: {
|
|
81
|
+
backgroundColor: "".concat(_responsiveTheme.default.palette.primary.main, " !important"),
|
|
82
|
+
color: "#fff !important",
|
|
83
|
+
borderRadius: "5px !important",
|
|
84
|
+
fontWeight: 600
|
|
85
|
+
// fontSize: "16px !important",
|
|
86
|
+
},
|
|
87
|
+
|
|
88
|
+
projectListText: {
|
|
89
|
+
color: "".concat(_responsiveTheme.default.palette.primary.main, " !important"),
|
|
90
|
+
marginLeft: "24px",
|
|
91
|
+
fontSize: "14px !important",
|
|
92
|
+
fontWeight: 600
|
|
93
|
+
},
|
|
94
|
+
projectListIcon: {
|
|
95
|
+
color: "".concat(_responsiveTheme.default.palette.primary.main, " !important"),
|
|
96
|
+
display: "flex",
|
|
97
|
+
alignItems: "center",
|
|
98
|
+
width: "1rem",
|
|
99
|
+
height: "1rem"
|
|
100
|
+
},
|
|
101
|
+
selectedProjectMenuItemText: {
|
|
102
|
+
color: "#fff !important"
|
|
103
|
+
// fontSize: "14px !important",
|
|
104
|
+
// fontWeight: 600,
|
|
105
|
+
},
|
|
106
|
+
|
|
107
|
+
selectedProjectMenuItemIcon: {
|
|
108
|
+
color: "#fff !important",
|
|
109
|
+
display: "flex",
|
|
110
|
+
alignItems: "center",
|
|
111
|
+
width: "1rem",
|
|
112
|
+
height: "1rem"
|
|
113
|
+
},
|
|
114
|
+
subHeaderIcon: {
|
|
115
|
+
color: "#44409A",
|
|
116
|
+
display: "flex",
|
|
117
|
+
alignItems: "center",
|
|
118
|
+
width: "0.8rem",
|
|
119
|
+
height: "0.8rem"
|
|
120
|
+
},
|
|
121
|
+
sidebar: {
|
|
122
|
+
display: "inline-block",
|
|
123
|
+
position: "relative"
|
|
124
|
+
},
|
|
125
|
+
buttonIcon: {
|
|
126
|
+
position: "relative",
|
|
127
|
+
padding: "16px",
|
|
128
|
+
fontSize: "16px"
|
|
129
|
+
},
|
|
130
|
+
menuItem: {
|
|
131
|
+
zIndex: 1300,
|
|
132
|
+
display: "none",
|
|
133
|
+
position: "absolute",
|
|
134
|
+
backgroundColor: "#f1f1f1",
|
|
135
|
+
minWidth: "160px",
|
|
136
|
+
boxShadow: "0px 8px 16px 0px rgba(0,0,0,0.2)",
|
|
137
|
+
left: "10%",
|
|
138
|
+
top: "auto"
|
|
139
|
+
},
|
|
140
|
+
menuItemOpen: {
|
|
141
|
+
zIndex: 1300,
|
|
142
|
+
display: "block",
|
|
143
|
+
position: "absolute",
|
|
144
|
+
backgroundColor: "#f1f1f1",
|
|
145
|
+
minWidth: "160px",
|
|
146
|
+
boxShadow: "0px 8px 16px 0px rgba(0,0,0,0.2)",
|
|
147
|
+
left: "92px",
|
|
148
|
+
top: "auto",
|
|
149
|
+
bottom: "auto",
|
|
150
|
+
marginTop: "-3.5rem"
|
|
40
151
|
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
},
|
|
45
|
-
flatMenuItem: {
|
|
46
|
-
height: "48px",
|
|
47
|
-
borderRadius: "7px !important"
|
|
48
|
-
},
|
|
49
|
-
selectedFlatMenuItem: {
|
|
50
|
-
backgroundColor: `${_responsiveTheme.default.palette.primary.main} !important`,
|
|
51
|
-
color: "#fff !important"
|
|
52
|
-
},
|
|
53
|
-
selectedGroupMenuItem: {
|
|
54
|
-
backgroundColor: `${_responsiveTheme.default.palette.primary.main} !important`,
|
|
55
|
-
color: "#fff !important",
|
|
56
|
-
borderRadius: "5px !important"
|
|
57
|
-
},
|
|
58
|
-
selectedFlatMenuIcon: {
|
|
59
|
-
color: "#fff !important"
|
|
60
|
-
},
|
|
61
|
-
selectedFlatMenuItemText: {
|
|
62
|
-
color: "#fff !important"
|
|
63
|
-
},
|
|
64
|
-
projectMenuMainWrapper: {
|
|
65
|
-
paddingTop: "0.5rem",
|
|
66
|
-
// padding: "7px",
|
|
67
|
-
display: "inline-block",
|
|
68
|
-
width: "100%"
|
|
69
|
-
},
|
|
70
|
-
projectMenuHeader: {
|
|
71
|
-
color: "#44409A",
|
|
72
|
-
fontFamily: "sans-serif",
|
|
73
|
-
fontSize: "18px !important",
|
|
74
|
-
lineHeight: "24px",
|
|
75
|
-
display: "flex",
|
|
76
|
-
justifyContent: "center",
|
|
77
|
-
VerticalAlignCenter: true
|
|
78
|
-
},
|
|
79
|
-
selectedProjectMenuItem: {
|
|
80
|
-
backgroundColor: `${_responsiveTheme.default.palette.primary.main} !important`,
|
|
81
|
-
color: "#fff !important",
|
|
82
|
-
borderRadius: "5px !important",
|
|
83
|
-
fontWeight: 600
|
|
84
|
-
// fontSize: "16px !important",
|
|
85
|
-
},
|
|
86
|
-
projectListText: {
|
|
87
|
-
color: `${_responsiveTheme.default.palette.primary.main} !important`,
|
|
88
|
-
marginLeft: "24px",
|
|
89
|
-
fontSize: "14px !important",
|
|
90
|
-
fontWeight: 600
|
|
91
|
-
},
|
|
92
|
-
projectListIcon: {
|
|
93
|
-
color: `${_responsiveTheme.default.palette.primary.main} !important`,
|
|
94
|
-
display: "flex",
|
|
95
|
-
alignItems: "center",
|
|
96
|
-
width: "1rem",
|
|
97
|
-
height: "1rem"
|
|
98
|
-
},
|
|
99
|
-
selectedProjectMenuItemText: {
|
|
100
|
-
color: "#fff !important"
|
|
101
|
-
// fontSize: "14px !important",
|
|
102
|
-
// fontWeight: 600,
|
|
103
|
-
},
|
|
104
|
-
selectedProjectMenuItemIcon: {
|
|
105
|
-
color: "#fff !important",
|
|
106
|
-
display: "flex",
|
|
107
|
-
alignItems: "center",
|
|
108
|
-
width: "1rem",
|
|
109
|
-
height: "1rem"
|
|
110
|
-
},
|
|
111
|
-
subHeaderIcon: {
|
|
112
|
-
color: "#44409A",
|
|
113
|
-
display: "flex",
|
|
114
|
-
alignItems: "center",
|
|
115
|
-
width: "0.8rem",
|
|
116
|
-
height: "0.8rem"
|
|
117
|
-
},
|
|
118
|
-
sidebar: {
|
|
119
|
-
display: "inline-block",
|
|
120
|
-
position: "relative"
|
|
121
|
-
},
|
|
122
|
-
buttonIcon: {
|
|
123
|
-
position: "relative",
|
|
124
|
-
padding: "16px",
|
|
125
|
-
fontSize: "16px"
|
|
126
|
-
},
|
|
127
|
-
menuItem: {
|
|
128
|
-
zIndex: 1300,
|
|
129
|
-
display: "none",
|
|
130
|
-
position: "absolute",
|
|
131
|
-
backgroundColor: "#f1f1f1",
|
|
132
|
-
minWidth: "160px",
|
|
133
|
-
boxShadow: "0px 8px 16px 0px rgba(0,0,0,0.2)",
|
|
134
|
-
left: "10%",
|
|
135
|
-
top: "auto"
|
|
136
|
-
},
|
|
137
|
-
menuItemOpen: {
|
|
138
|
-
zIndex: 1300,
|
|
139
|
-
display: "block",
|
|
140
|
-
position: "absolute",
|
|
141
|
-
backgroundColor: "#f1f1f1",
|
|
142
|
-
minWidth: "160px",
|
|
143
|
-
boxShadow: "0px 8px 16px 0px rgba(0,0,0,0.2)",
|
|
144
|
-
left: "92px",
|
|
145
|
-
top: "auto",
|
|
146
|
-
bottom: "auto",
|
|
147
|
-
marginTop: "-3.5rem"
|
|
148
|
-
}
|
|
149
|
-
}));
|
|
152
|
+
};
|
|
153
|
+
});
|
|
154
|
+
exports.default = _default;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
@@ -15,11 +16,22 @@ var _button = _interopRequireDefault(require("../../button"));
|
|
|
15
16
|
var _modal = _interopRequireDefault(require("../../modal"));
|
|
16
17
|
var _text = _interopRequireDefault(require("../../text"));
|
|
17
18
|
var _UserAvatar = _interopRequireDefault(require("./UserAvatar"));
|
|
18
|
-
function _interopRequireDefault(
|
|
19
|
-
function
|
|
19
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
22
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
23
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
24
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
25
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
26
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
27
|
+
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."); }
|
|
28
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
29
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
30
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
31
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
20
32
|
// import { BsChatRightText } from "react-icons/bs";
|
|
21
33
|
|
|
22
|
-
|
|
34
|
+
var ANNOUNCEMENT_TYPES = {
|
|
23
35
|
success: {
|
|
24
36
|
backgroundColor: "#EDF7ED",
|
|
25
37
|
borderLeft: "6px solid #4CAF50",
|
|
@@ -41,23 +53,30 @@ const ANNOUNCEMENT_TYPES = {
|
|
|
41
53
|
color: "#0D47A1"
|
|
42
54
|
}
|
|
43
55
|
};
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
loggedInUser,
|
|
48
|
-
actions,
|
|
49
|
-
onLogout,
|
|
50
|
-
onViewProfileClick,
|
|
51
|
-
hrefLink,
|
|
52
|
-
avatarItems,
|
|
53
|
-
announcement =
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
var ProjectTopbar = function ProjectTopbar(_ref) {
|
|
57
|
+
var _loggedInUser$role;
|
|
58
|
+
var homeIcon = _ref.homeIcon,
|
|
59
|
+
loggedInUser = _ref.loggedInUser,
|
|
60
|
+
actions = _ref.actions,
|
|
61
|
+
onLogout = _ref.onLogout,
|
|
62
|
+
onViewProfileClick = _ref.onViewProfileClick,
|
|
63
|
+
hrefLink = _ref.hrefLink,
|
|
64
|
+
avatarItems = _ref.avatarItems,
|
|
65
|
+
_ref$announcement = _ref.announcement,
|
|
66
|
+
announcement = _ref$announcement === void 0 ? null : _ref$announcement,
|
|
67
|
+
_ref$isChatEnabled = _ref.isChatEnabled,
|
|
68
|
+
isChatEnabled = _ref$isChatEnabled === void 0 ? false : _ref$isChatEnabled;
|
|
69
|
+
var theme = (0, _system.useTheme)();
|
|
70
|
+
var _useState = (0, _react.useState)(null),
|
|
71
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
72
|
+
anchorEl = _useState2[0],
|
|
73
|
+
setAnchorEl = _useState2[1];
|
|
74
|
+
var _useState3 = (0, _react.useState)(null),
|
|
75
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
76
|
+
openMenuIndex = _useState4[0],
|
|
77
|
+
setOpenMenuIndex = _useState4[1];
|
|
78
|
+
var updatedActions = (0, _react.useMemo)(function () {
|
|
79
|
+
var base = _toConsumableArray(actions);
|
|
61
80
|
// if (isChatEnabled) {
|
|
62
81
|
// base.push({
|
|
63
82
|
// icon: <BsChatRightText size="12px" />,
|
|
@@ -66,16 +85,16 @@ const ProjectTopbar = _ref => {
|
|
|
66
85
|
// }
|
|
67
86
|
return base;
|
|
68
87
|
}, [actions, isChatEnabled]);
|
|
69
|
-
|
|
70
|
-
|
|
88
|
+
var navigate = (0, _reactRouter.useNavigate)();
|
|
89
|
+
var handleMenuOpen = function handleMenuOpen(event, index) {
|
|
71
90
|
setAnchorEl(event.currentTarget);
|
|
72
91
|
setOpenMenuIndex(index);
|
|
73
92
|
};
|
|
74
|
-
|
|
93
|
+
var handleMenuClose = function handleMenuClose() {
|
|
75
94
|
setAnchorEl(null);
|
|
76
95
|
setOpenMenuIndex(null);
|
|
77
96
|
};
|
|
78
|
-
|
|
97
|
+
var handleItemClick = function handleItemClick(item) {
|
|
79
98
|
if (item.href) {
|
|
80
99
|
if (item.serverSide) {
|
|
81
100
|
window.location.href = item.href;
|
|
@@ -97,10 +116,17 @@ const ProjectTopbar = _ref => {
|
|
|
97
116
|
};
|
|
98
117
|
|
|
99
118
|
// Logout related code starts
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
119
|
+
var _useState5 = (0, _react.useState)(false),
|
|
120
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
121
|
+
open = _useState6[0],
|
|
122
|
+
setOpen = _useState6[1];
|
|
123
|
+
var handleOpen = function handleOpen() {
|
|
124
|
+
return setOpen(true);
|
|
125
|
+
};
|
|
126
|
+
var handleClose = function handleClose() {
|
|
127
|
+
return setOpen(false);
|
|
128
|
+
};
|
|
129
|
+
var logout = function logout() {
|
|
104
130
|
onLogout();
|
|
105
131
|
setOpen(false);
|
|
106
132
|
};
|
|
@@ -157,61 +183,67 @@ const ProjectTopbar = _ref => {
|
|
|
157
183
|
}, updatedActions && /*#__PURE__*/_react.default.createElement(_system.Box, null, /*#__PURE__*/_react.default.createElement(_material.Stack, {
|
|
158
184
|
direction: "row",
|
|
159
185
|
spacing: 1
|
|
160
|
-
}, updatedActions.map((action, index)
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
fontWeight: "600"
|
|
172
|
-
}
|
|
173
|
-
}, action.title)), action.dropdown && /*#__PURE__*/_react.default.createElement(_material.Menu, {
|
|
174
|
-
anchorEl: anchorEl,
|
|
175
|
-
open: openMenuIndex === index,
|
|
176
|
-
onClose: () => {
|
|
177
|
-
setOpenMenuIndex(null);
|
|
178
|
-
handleMenuClose();
|
|
179
|
-
}
|
|
180
|
-
}, action.dropdown.map((item, index) => /*#__PURE__*/_react.default.createElement("div", {
|
|
181
|
-
key: item.title,
|
|
182
|
-
onClick: () => {
|
|
183
|
-
if (item.clickable) {
|
|
184
|
-
handleItemClick(item);
|
|
186
|
+
}, updatedActions.map(function (action, index) {
|
|
187
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
188
|
+
key: action.title
|
|
189
|
+
}, /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
190
|
+
variant: "text",
|
|
191
|
+
startIcon: action.icon,
|
|
192
|
+
endIcon: action.dropdown ? /*#__PURE__*/_react.default.createElement(_reactFeather.ChevronDown, {
|
|
193
|
+
size: "0.9rem"
|
|
194
|
+
}) : null,
|
|
195
|
+
onClick: function onClick(event) {
|
|
196
|
+
return action.dropdown ? handleMenuOpen(event, index) : handleItemClick(action);
|
|
185
197
|
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
198
|
+
}, /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
199
|
+
style: {
|
|
200
|
+
fontWeight: "600"
|
|
201
|
+
}
|
|
202
|
+
}, action.title)), action.dropdown && /*#__PURE__*/_react.default.createElement(_material.Menu, {
|
|
203
|
+
anchorEl: anchorEl,
|
|
204
|
+
open: openMenuIndex === index,
|
|
205
|
+
onClose: function onClose() {
|
|
206
|
+
setOpenMenuIndex(null);
|
|
207
|
+
handleMenuClose();
|
|
208
|
+
}
|
|
209
|
+
}, action.dropdown.map(function (item, index) {
|
|
210
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
211
|
+
key: item.title,
|
|
212
|
+
onClick: function onClick() {
|
|
213
|
+
if (item.clickable) {
|
|
214
|
+
handleItemClick(item);
|
|
215
|
+
}
|
|
216
|
+
handleMenuClose();
|
|
217
|
+
},
|
|
218
|
+
style: {
|
|
219
|
+
margin: "10px",
|
|
220
|
+
paddingRight: "10px",
|
|
221
|
+
cursor: item.clickable ? "pointer" : "default",
|
|
222
|
+
backgroundColor: item.heading ? "transparent" : "transparent"
|
|
223
|
+
}
|
|
224
|
+
}, item.heading ? /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
225
|
+
variant: "subtitle1",
|
|
226
|
+
style: {
|
|
227
|
+
fontWeight: 600
|
|
228
|
+
}
|
|
229
|
+
}, item.title) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
230
|
+
style: {
|
|
231
|
+
display: "flex",
|
|
232
|
+
flexDirection: "column"
|
|
233
|
+
}
|
|
234
|
+
}, /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
235
|
+
style: {
|
|
236
|
+
fontWeight: item.clickable || item.heading ? 600 : 400
|
|
237
|
+
}
|
|
238
|
+
}, item.title), item.subtitle && /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
239
|
+
variant: "body2",
|
|
240
|
+
color: "#ACACAC",
|
|
241
|
+
sx: {
|
|
242
|
+
marginLeft: "5px"
|
|
243
|
+
}
|
|
244
|
+
}, item.subtitle)), item.divider && index !== action.dropdown.length - 1 && /*#__PURE__*/_react.default.createElement(_material.Divider, null)), item.divider && index === action.dropdown.length - 1 && /*#__PURE__*/_react.default.createElement(_material.Divider, null));
|
|
245
|
+
})));
|
|
246
|
+
})))), /*#__PURE__*/_react.default.createElement(_system.Box, {
|
|
215
247
|
className: "Right",
|
|
216
248
|
sx: {
|
|
217
249
|
justifySelf: "right",
|
|
@@ -239,14 +271,14 @@ const ProjectTopbar = _ref => {
|
|
|
239
271
|
sx: {
|
|
240
272
|
fontSize: "12px"
|
|
241
273
|
}
|
|
242
|
-
}, announcement.message) : announcement.message), loggedInUser
|
|
274
|
+
}, announcement.message) : announcement.message), (loggedInUser === null || loggedInUser === void 0 ? void 0 : (_loggedInUser$role = loggedInUser.role) === null || _loggedInUser$role === void 0 ? void 0 : _loggedInUser$role.id) === 1 && /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
243
275
|
variant: "text",
|
|
244
276
|
startIcon: /*#__PURE__*/_react.default.createElement(_reactFeather.Settings, {
|
|
245
277
|
size: "1rem"
|
|
246
278
|
})
|
|
247
279
|
// onClick={() => (window.location.href = "/admin/users")}
|
|
248
280
|
,
|
|
249
|
-
onClick: ()
|
|
281
|
+
onClick: function onClick() {
|
|
250
282
|
window.location.href = "/admin/users";
|
|
251
283
|
}
|
|
252
284
|
}, /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
@@ -259,7 +291,7 @@ const ProjectTopbar = _ref => {
|
|
|
259
291
|
startIcon: /*#__PURE__*/_react.default.createElement(_fi.FiInfo, {
|
|
260
292
|
size: "1rem"
|
|
261
293
|
}),
|
|
262
|
-
onClick: ()
|
|
294
|
+
onClick: function onClick() {
|
|
263
295
|
window.open("/about", "_blank");
|
|
264
296
|
}
|
|
265
297
|
}, /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
@@ -302,4 +334,5 @@ const ProjectTopbar = _ref => {
|
|
|
302
334
|
}, /*#__PURE__*/_react.default.createElement(_text.default, null, "Log out"))))));
|
|
303
335
|
};
|
|
304
336
|
ProjectTopbar.propTypes = {};
|
|
305
|
-
var _default =
|
|
337
|
+
var _default = ProjectTopbar;
|
|
338
|
+
exports.default = _default;
|