@agilemotion/oui-react-js 1.6.3 → 1.6.5
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/ApplicationManager.js +675 -1044
- package/dist/BasicApp.js +7 -27
- package/dist/BasicAppHome.js +27 -101
- package/dist/DynamicJS.js +109 -197
- package/dist/InteractionPortalApp.js +7 -27
- package/dist/InteractionPortalAppHome.js +21 -87
- package/dist/InteractionPortalApp_old.js +60 -122
- package/dist/RestUtils.js +269 -410
- package/dist/TypedValue.js +20 -26
- package/dist/Utils.js +295 -481
- package/dist/WithRouter.js +9 -17
- package/dist/assets/jss/components/authNavbarStyle.js +168 -171
- package/dist/assets/jss/components/buttonStyle.js +2 -5
- package/dist/assets/jss/components/cardAvatarStyle.js +2 -5
- package/dist/assets/jss/components/cardBodyStyle.js +2 -5
- package/dist/assets/jss/components/cardFooterStyle.js +2 -5
- package/dist/assets/jss/components/cardHeaderStyle.js +20 -17
- package/dist/assets/jss/components/cardIconStyle.js +2 -5
- package/dist/assets/jss/components/cardStyle.js +2 -5
- package/dist/assets/jss/components/cardTextStyle.js +2 -5
- package/dist/assets/jss/components/customDropdownStyle.js +171 -173
- package/dist/assets/jss/components/customInputStyle.js +5 -13
- package/dist/assets/jss/components/dropdownStyle.js +71 -74
- package/dist/assets/jss/components/footerStyle.js +14 -23
- package/dist/assets/jss/components/headerLinksStyle.js +52 -53
- package/dist/assets/jss/components/headerStyle.js +68 -73
- package/dist/assets/jss/components/navbarLinksStyle.js +81 -74
- package/dist/assets/jss/components/navbarStyle.js +79 -84
- package/dist/assets/jss/components/sidebarStyle.js +438 -441
- package/dist/assets/jss/components/typographyStyle.js +5 -13
- package/dist/assets/jss/rootStyle.js +85 -151
- package/dist/assets/jss/views/layoutStyle.js +45 -51
- package/dist/assets/jss/views/loginBasicStyle.js +2 -5
- package/dist/assets/jss/views/loginBusinessPortalStyle.js +2 -5
- package/dist/assets/jss/views/loginStyle.js +80 -87
- package/dist/components/AlertBar.js +20 -75
- package/dist/components/AlertItem.js +13 -49
- package/dist/components/AlertTemplate.js +12 -18
- package/dist/components/Button.js +41 -112
- package/dist/components/Calendar.js +99 -208
- package/dist/components/ConfirmationDialog.js +13 -54
- package/dist/components/DataGrid.js +271 -695
- package/dist/components/DataGridColumn.js +24 -74
- package/dist/components/DataGridFilter.js +107 -245
- package/dist/components/DataGridHeading.js +34 -78
- package/dist/components/Dialog.js +37 -130
- package/dist/components/DocumentTemplateDesigner.js +16 -57
- package/dist/components/DocumentTemplateDesignerComponent.js +47 -141
- package/dist/components/DocumentTemplatePlaceholderDialog.js +34 -67
- package/dist/components/DocumentViewer.js +25 -65
- package/dist/components/DocumentViewerComponent.js +13 -44
- package/dist/components/ElementResizeHandler.js +148 -200
- package/dist/components/FileThumb.js +15 -56
- package/dist/components/Graph.js +98 -203
- package/dist/components/GraphNode.js +20 -61
- package/dist/components/HtmlPanel.js +38 -105
- package/dist/components/Icon.js +174 -253
- package/dist/components/LoadingIndicator.js +4 -11
- package/dist/components/LottieIcon.js +63 -60
- package/dist/components/PopupView.js +21 -60
- package/dist/components/Portlet.js +18 -60
- package/dist/components/RegularButton.js +34 -42
- package/dist/components/SignaturePanel.js +19 -67
- package/dist/components/SocketManager.js +133 -228
- package/dist/components/StepperTitleBar.js +48 -99
- package/dist/components/TabPage.js +30 -47
- package/dist/components/TabPanel.js +35 -122
- package/dist/components/TableCellContent.js +34 -98
- package/dist/components/TemplateDesigner.js +115 -230
- package/dist/components/TemplateItemEventHandler.js +298 -481
- package/dist/components/TemplateTable.js +117 -218
- package/dist/components/TitleBar.js +15 -53
- package/dist/components/Toolbar.js +44 -110
- package/dist/components/Tooltip.js +37 -56
- package/dist/components/Tree.js +50 -143
- package/dist/components/UseIsVisible.js +5 -25
- package/dist/components/card/Card.js +35 -39
- package/dist/components/card/CardAvatar.js +21 -32
- package/dist/components/card/CardBody.js +29 -36
- package/dist/components/card/CardFooter.js +26 -35
- package/dist/components/card/CardHeader.js +29 -36
- package/dist/components/card/CardIcon.js +15 -29
- package/dist/components/card/CardText.js +15 -29
- package/dist/components/customInput/CustomInput.js +38 -40
- package/dist/components/dashboard/FoldingSideTabDashboard.js +65 -184
- package/dist/components/dashboard/SideMenuModuleDashboard.js +67 -185
- package/dist/components/dashboard/TopMenuModuleDashboard.js +22 -63
- package/dist/components/dashboard/components/Header.js +15 -52
- package/dist/components/dashboard/components/LeftDrawer.js +9 -23
- package/dist/components/dashboard/components/UserIdentity.js +4 -12
- package/dist/components/dashboard/components/blackDashboard/fixedPlugin/FixedPlugin.js +115 -155
- package/dist/components/dashboard/components/blackDashboard/sidebar/FoldingTabSidebar.js +344 -419
- package/dist/components/dashboard/components/blackDashboard/sidebar/ModuleMenu.js +15 -29
- package/dist/components/dashboard/components/blackDashboard/sidebar/ModuleMenuSidebar.js +405 -485
- package/dist/components/dashboard/components/portal/Timeline.js +3 -8
- package/dist/components/dashboard/components/portal/Workspace.js +4 -13
- package/dist/components/footer/Footer.js +23 -45
- package/dist/components/footer/HomeFooter.js +38 -78
- package/dist/components/form/AddressSearch.js +26 -76
- package/dist/components/form/AutoComplete.js +54 -168
- package/dist/components/form/BaseField.js +59 -189
- package/dist/components/form/Checkbox.js +11 -24
- package/dist/components/form/DatePicker.js +28 -82
- package/dist/components/form/FieldSet.js +84 -300
- package/dist/components/form/Form.js +206 -501
- package/dist/components/form/GridField.js +83 -243
- package/dist/components/form/IconField.js +10 -21
- package/dist/components/form/ImageEditor.js +98 -208
- package/dist/components/form/LabelField.js +13 -28
- package/dist/components/form/LookupField.js +36 -102
- package/dist/components/form/MultiFileUploadField.js +67 -134
- package/dist/components/form/RadioGroup.js +20 -57
- package/dist/components/form/Section.js +33 -118
- package/dist/components/form/SelectItem.js +36 -83
- package/dist/components/form/SignatureTemplateDesignerField.js +12 -26
- package/dist/components/form/Switch.js +11 -24
- package/dist/components/form/TextField.js +19 -55
- package/dist/components/form/TimePicker.js +18 -43
- package/dist/components/form/TransferList.js +76 -200
- package/dist/components/form/UploadField.js +134 -256
- package/dist/components/grid/GridContainer.js +10 -23
- package/dist/components/grid/GridItem.js +10 -23
- package/dist/components/layout/CollapsiblePanel.js +20 -59
- package/dist/components/layout/Layout.js +40 -149
- package/dist/components/layout/View.js +65 -195
- package/dist/components/layout/ViewContainer.js +13 -33
- package/dist/components/layout/ViewPort.js +14 -48
- package/dist/components/layout/Window.js +62 -135
- package/dist/components/layout/WindowViewPort.js +18 -63
- package/dist/components/media/ClosablePanel.js +9 -18
- package/dist/components/media/LobbyWaitingList.js +11 -17
- package/dist/components/media/MediaSoupHelper.js +173 -401
- package/dist/components/media/SideBarContent.js +17 -34
- package/dist/components/media/SocketRequest.js +7 -18
- package/dist/components/media/SocketResponse.js +5 -14
- package/dist/components/media/Timer.js +18 -54
- package/dist/components/media/Toolbar.js +97 -254
- package/dist/components/media/ToolbarButton.js +34 -95
- package/dist/components/media/Toolbar_bck.js +70 -186
- package/dist/components/media/Tracks.js +19 -33
- package/dist/components/media/TrainingRoom.js +121 -374
- package/dist/components/media/Transports.js +17 -29
- package/dist/components/media/VCEventManager.js +45 -116
- package/dist/components/media/VCEventType.js +82 -168
- package/dist/components/media/VCParticipantList.js +16 -51
- package/dist/components/media/VCParticipantListItem.js +44 -141
- package/dist/components/media/VCRoom.js +14 -58
- package/dist/components/media/VCRoomParticipant.js +235 -556
- package/dist/components/media/VCRoomRecorder.js +106 -204
- package/dist/components/media/VCRoomWorkspace.js +248 -584
- package/dist/components/media/Video.js +27 -112
- package/dist/components/media/VideoPlayer.js +23 -91
- package/dist/components/media/chat/ChatRoom.js +143 -361
- package/dist/components/media/chat/ChatRoomItem.js +17 -58
- package/dist/components/media/chat/ChatRoomList.js +15 -60
- package/dist/components/menu/CollapsibleMenu.js +22 -52
- package/dist/components/menu/MenuBars.js +50 -116
- package/dist/components/menu/MenuButton.js +53 -130
- package/dist/components/menu/MenuItem.js +11 -51
- package/dist/components/menu/MenuLink.js +13 -41
- package/dist/components/menu/PopupMenu.js +13 -25
- package/dist/components/navbars/AuthNavbar.js +21 -56
- package/dist/components/navbars/HomeNavbar.js +213 -290
- package/dist/components/navbars/PortalNavbar.js +26 -81
- package/dist/components/signatures/AgilitySignaturePanel.js +41 -135
- package/dist/components/signatures/AlertItem.js +14 -50
- package/dist/components/signatures/Card.js +6 -16
- package/dist/components/signatures/DocumentContainer.js +57 -165
- package/dist/components/signatures/ImageSignatureInput.js +64 -124
- package/dist/components/signatures/MenuButton.js +28 -63
- package/dist/components/signatures/Prompt.js +6 -41
- package/dist/components/signatures/ResponsiveTable.js +181 -370
- package/dist/components/signatures/SearchView.js +34 -112
- package/dist/components/signatures/SignatorySearch.js +11 -44
- package/dist/components/signatures/SignatorySearchForm.js +19 -50
- package/dist/components/signatures/SignatureInput.js +28 -91
- package/dist/components/signatures/SignatureInputProps.js +49 -144
- package/dist/components/signatures/SignatureTemplateDesigner.js +230 -430
- package/dist/components/signatures/Toolbar.js +99 -173
- package/dist/components/signatures/ViewUtils.js +207 -313
- package/dist/components/typography/Danger.js +6 -11
- package/dist/components/typography/Info.js +7 -11
- package/dist/components/typography/Link.js +6 -12
- package/dist/event/ActionHandlers.js +48 -87
- package/dist/event/Event.js +21 -25
- package/dist/event/EventListener.js +54 -48
- package/dist/event/EventType.js +18 -40
- package/dist/event/LoadDataActionHandler.js +10 -31
- package/dist/event/Observable.js +204 -396
- package/dist/event/RouteActionHandler.js +119 -171
- package/dist/event/ScriptActionHandler.js +10 -32
- package/dist/event/ServiceCallActionHandler.js +37 -64
- package/dist/event/SignalGraphActionHandler.js +9 -31
- package/dist/js/Addresses.js +23 -42
- package/dist/js/Calendar.js +41 -89
- package/dist/js/DynamicLib.js +11 -23
- package/dist/js/Media.js +80 -174
- package/dist/js/Validators.js +6 -12
- package/dist/js/Windows.js +22 -40
- package/dist/redux/store/ConfigureStore.js +12 -29
- package/dist/redux/store/DashboardStore.js +47 -120
- package/dist/redux/store/History.js +2 -5
- package/dist/redux/store/SecurityStore.js +22 -65
- package/dist/security/TokenManager.js +29 -53
- package/dist/theme-default.js +3 -8
- package/dist/view/Dashboard.js +140 -308
- package/dist/view/PortalDashboard.js +6 -13
- package/dist/view/Settings.js +3 -11
- package/dist/view/Views.js +15 -35
- package/dist/view/security/ChangePasswordBasic.js +41 -147
- package/dist/view/security/ForgotPassword.js +26 -106
- package/dist/view/security/ForgotPasswordBasic.js +22 -96
- package/dist/view/security/Login.js +29 -117
- package/dist/view/security/LoginBasic.js +28 -108
- package/dist/view/security/LoginInteractionPortal.js +28 -106
- package/dist/view/security/ResetPassword.js +25 -110
- package/dist/view/security/ResetPasswordBasic.js +39 -142
- package/dist/view/security/Security.js +14 -26
- package/package.json +26 -21
|
@@ -1,324 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.default = void 0;
|
|
9
|
-
|
|
10
7
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
|
|
14
9
|
var _Utils = _interopRequireDefault(require("../../../../../Utils"));
|
|
15
|
-
|
|
16
10
|
var _reactstrap = require("reactstrap");
|
|
17
|
-
|
|
18
11
|
var _MenuLink = _interopRequireDefault(require("../../../../menu/MenuLink"));
|
|
19
|
-
|
|
20
12
|
var _CardAvatar = _interopRequireDefault(require("../../../../card/CardAvatar"));
|
|
21
|
-
|
|
22
13
|
var _core = require("@material-ui/core");
|
|
23
|
-
|
|
24
14
|
var _RestUtils = require("../../../../../RestUtils");
|
|
25
|
-
|
|
26
15
|
require("./ModuleMenuSidebar.css");
|
|
16
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
+
/*eslint-disable*/
|
|
27
18
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
31
|
-
|
|
32
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
33
|
-
|
|
34
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
35
|
-
|
|
36
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
37
|
-
|
|
38
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
39
|
-
|
|
40
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
41
|
-
|
|
42
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
43
|
-
|
|
44
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
45
|
-
|
|
46
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
47
|
-
|
|
48
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
49
|
-
|
|
50
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
51
|
-
|
|
52
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
53
|
-
|
|
54
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
55
|
-
|
|
56
|
-
var ps;
|
|
57
|
-
var TAB = 16;
|
|
58
|
-
|
|
59
|
-
var ModuleMenuSidebar = /*#__PURE__*/function (_React$Component) {
|
|
60
|
-
_inherits(ModuleMenuSidebar, _React$Component);
|
|
61
|
-
|
|
62
|
-
var _super = _createSuper(ModuleMenuSidebar);
|
|
63
|
-
|
|
64
|
-
function ModuleMenuSidebar(props) {
|
|
65
|
-
var _this;
|
|
66
|
-
|
|
67
|
-
_classCallCheck(this, ModuleMenuSidebar);
|
|
68
|
-
|
|
69
|
-
_this = _super.call(this, props);
|
|
70
|
-
|
|
71
|
-
_defineProperty(_assertThisInitialized(_this), "getViews", function (menus, level) {
|
|
72
|
-
var newViews = [];
|
|
73
|
-
|
|
74
|
-
for (var i = 0; i < menus.length; i++) {
|
|
75
|
-
var createView = {};
|
|
76
|
-
createView.name = menus[i].attributes.label;
|
|
77
|
-
createView.id = menus[i].id;
|
|
78
|
-
createView.mini = 'SS';
|
|
79
|
-
createView.layout = '/admin';
|
|
80
|
-
createView.level = level;
|
|
81
|
-
|
|
82
|
-
if (menus[i].subMenu) {
|
|
83
|
-
createView.collapse = true;
|
|
84
|
-
createView.state = menus[i].id + 'Collapse';
|
|
85
|
-
createView.views = _this.getItems(menus[i].subMenu.items, level + 1);
|
|
86
|
-
} else {
|
|
87
|
-
createView.item = menus[i];
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
newViews.push(createView);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
console.log('VIEWS : ', newViews, menus);
|
|
94
|
-
return newViews;
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
_defineProperty(_assertThisInitialized(_this), "getItems", function (items, level) {
|
|
98
|
-
var newItems = [];
|
|
99
|
-
|
|
100
|
-
for (var i = 0; i < items.length; i++) {
|
|
101
|
-
var createItem = {};
|
|
102
|
-
createItem.name = items[i].attributes.label;
|
|
103
|
-
createItem.id = items[i].id;
|
|
104
|
-
createItem.mini = 'SS';
|
|
105
|
-
createItem.layout = '/admin';
|
|
106
|
-
createItem.item = items[i];
|
|
107
|
-
createItem.level = level;
|
|
108
|
-
|
|
109
|
-
if (!_Utils.default.isNull(items[i].subMenu)) {
|
|
110
|
-
createItem.collapse = true;
|
|
111
|
-
createItem.state = items[i].id + 'SubMenuCollapse';
|
|
112
|
-
createItem.views = _this.getItems(items[i].subMenu.items, level + 1);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
newItems.push(createItem);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
return newItems;
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
_defineProperty(_assertThisInitialized(_this), "getCollapseStates", function (routes) {
|
|
122
|
-
var initialState = {};
|
|
123
|
-
|
|
124
|
-
if (routes) {
|
|
125
|
-
routes.map(function (prop, key) {
|
|
126
|
-
if (prop.collapse) {
|
|
127
|
-
initialState = _objectSpread(_objectSpread(_defineProperty({}, prop.state, _this.getCollapseInitialState(prop.views)), _this.getCollapseStates(prop.views)), initialState);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
return null;
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
return initialState;
|
|
135
|
-
});
|
|
19
|
+
// javascript plugin used to create scrollbars on windows
|
|
136
20
|
|
|
137
|
-
|
|
138
|
-
return new Promise(function (resolve) {
|
|
139
|
-
var service = {
|
|
140
|
-
url: '/ui/api/v1/menu/get',
|
|
141
|
-
parameters: [{
|
|
142
|
-
name: 'id',
|
|
143
|
-
value: route.menu,
|
|
144
|
-
httpParameterType: 'QUERY_PARAMETER'
|
|
145
|
-
}, {
|
|
146
|
-
name: 'version',
|
|
147
|
-
value: 1.0,
|
|
148
|
-
httpParameterType: 'QUERY_PARAMETER'
|
|
149
|
-
}],
|
|
150
|
-
contentType: 'application/json'
|
|
151
|
-
};
|
|
152
|
-
(0, _RestUtils.invokeRest)(service, {
|
|
153
|
-
api: {
|
|
154
|
-
get id() {
|
|
155
|
-
return 'dashboard-sidebar';
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
}
|
|
159
|
-
}, 'dashboard-sidebar', function (result) {
|
|
160
|
-
resolve(_this.getViews(result.menus, route.level + 1));
|
|
161
|
-
}, function (e) {
|
|
162
|
-
console.error(e);
|
|
163
|
-
resolve(null);
|
|
164
|
-
}, null);
|
|
165
|
-
});
|
|
166
|
-
});
|
|
167
|
-
|
|
168
|
-
_defineProperty(_assertThisInitialized(_this), "getLiClassName", function (prop) {
|
|
169
|
-
return "li-" + prop.level;
|
|
170
|
-
});
|
|
171
|
-
|
|
172
|
-
_defineProperty(_assertThisInitialized(_this), "createModuleTabs", function (routes) {
|
|
173
|
-
var _this$props = _this.props,
|
|
174
|
-
rtlActive = _this$props.rtlActive,
|
|
175
|
-
secondaryThemeColor = _this$props.secondaryThemeColor,
|
|
176
|
-
primaryThemeColor = _this$props.primaryThemeColor;
|
|
177
|
-
return routes.map(function (module, key) {
|
|
178
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
179
|
-
key: key,
|
|
180
|
-
style: {
|
|
181
|
-
backgroundColor: _this.activeModule(module.name) ? primaryThemeColor : (0, _core.lighten)(secondaryThemeColor, .1)
|
|
182
|
-
},
|
|
183
|
-
className: "".concat(_this.activeModule(module.name) ? 'module-tab-selected' : 'module-tab'),
|
|
184
|
-
onClick: function onClick(e) {
|
|
185
|
-
_this.setState(_objectSpread(_objectSpread({}, _this.state), {}, {
|
|
186
|
-
activeModule: module.name
|
|
187
|
-
}));
|
|
188
|
-
|
|
189
|
-
var currentModule = _this.state.routes.find(function (r) {
|
|
190
|
-
return r.name === module.name;
|
|
191
|
-
});
|
|
192
|
-
|
|
193
|
-
_this.getMenu(currentModule).then(function (result) {
|
|
194
|
-
_this.setState(_objectSpread(_objectSpread({}, _this.state), {}, {
|
|
195
|
-
selectedMenuRoutes: result
|
|
196
|
-
}));
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
}, /*#__PURE__*/_react.default.createElement("div", null, module.icon ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
200
|
-
className: 'tab-icon'
|
|
201
|
-
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
202
|
-
className: module.icon,
|
|
203
|
-
style: {
|
|
204
|
-
width: '28px',
|
|
205
|
-
color: _this.activeModule(module.name) ? '#000000' : '#444746'
|
|
206
|
-
}
|
|
207
|
-
}), ' '), /*#__PURE__*/_react.default.createElement("div", null, ' ', module.label), ' ', ' ') : /*#__PURE__*/_react.default.createElement("span", null, module.name), _this.activeModule(module.name) && /*#__PURE__*/_react.default.createElement("i", {
|
|
208
|
-
className: 'fas fa-caret-left selected-module-caret'
|
|
209
|
-
})));
|
|
210
|
-
});
|
|
211
|
-
});
|
|
212
|
-
|
|
213
|
-
_defineProperty(_assertThisInitialized(_this), "createLinks", function (routes) {
|
|
214
|
-
var _this$props2 = _this.props,
|
|
215
|
-
rtlActive = _this$props2.rtlActive,
|
|
216
|
-
secondaryThemeColor = _this$props2.secondaryThemeColor,
|
|
217
|
-
primaryThemeColor = _this$props2.primaryThemeColor;
|
|
218
|
-
return routes.map(function (prop, key) {
|
|
219
|
-
if (prop.redirect) {
|
|
220
|
-
return null;
|
|
221
|
-
}
|
|
21
|
+
// reactstrap components
|
|
222
22
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
href: "#pablo",
|
|
231
|
-
className: 'li-link-' + prop.level,
|
|
232
|
-
"data-toggle": "collapse",
|
|
233
|
-
style: {
|
|
234
|
-
marginLeft: (prop.level + 1) * TAB + 'px'
|
|
235
|
-
},
|
|
236
|
-
"aria-expanded": _this.state[prop.state],
|
|
237
|
-
onClick: function onClick(e) {
|
|
238
|
-
if (!prop.views) {
|
|
239
|
-
_this.getMenu(prop).then(function (views) {
|
|
240
|
-
if (views) {
|
|
241
|
-
prop.views = views; //this.getCollapseInitialState(views);
|
|
242
|
-
|
|
243
|
-
_this.setState(st);
|
|
244
|
-
}
|
|
245
|
-
});
|
|
246
|
-
} else {
|
|
247
|
-
_this.setState(st);
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
e.preventDefault();
|
|
251
|
-
}
|
|
252
|
-
}, prop.icon !== undefined ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("i", {
|
|
253
|
-
className: prop.icon,
|
|
254
|
-
style: {
|
|
255
|
-
width: '28px'
|
|
256
|
-
}
|
|
257
|
-
}), ' ', /*#__PURE__*/_react.default.createElement("span", null, ' ', prop.name, ' ', prop.collapse ? /*#__PURE__*/_react.default.createElement("span", {
|
|
258
|
-
className: "caret",
|
|
259
|
-
style: {
|
|
260
|
-
marginTop: '0'
|
|
261
|
-
}
|
|
262
|
-
}) : null), ' ', ' ') : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("span", {
|
|
263
|
-
className: "sidebar-normal",
|
|
264
|
-
style: {
|
|
265
|
-
paddingLeft: '4px'
|
|
266
|
-
}
|
|
267
|
-
}, ' ', prop.name, ' ', /*#__PURE__*/_react.default.createElement("b", {
|
|
268
|
-
className: "caret"
|
|
269
|
-
})), ' '), ' '), ' ', prop.collapse && prop.views ? /*#__PURE__*/_react.default.createElement(_reactstrap.Collapse, {
|
|
270
|
-
isOpen: _this.state[prop.state]
|
|
271
|
-
}, /*#__PURE__*/_react.default.createElement("ul", {
|
|
272
|
-
className: "nav"
|
|
273
|
-
}, " ", _this.createLinks(prop.views), " "), ' ') : null);
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
return /*#__PURE__*/_react.default.createElement("li", {
|
|
277
|
-
className: "".concat('menu-link-li' + (_this.activeRoute(prop.id) ? '-active' : '') + (prop.name === 'Dashboard' ? ' dashboard-link' : '')),
|
|
278
|
-
key: key,
|
|
279
|
-
style: _this.activeRoute(prop.id) ? {
|
|
280
|
-
backgroundColor: (0, _core.lighten)(secondaryThemeColor, .9),
|
|
281
|
-
borderRadius: '16px',
|
|
282
|
-
color: secondaryThemeColor,
|
|
283
|
-
fontWeight: 500
|
|
284
|
-
} : {}
|
|
285
|
-
}, /*#__PURE__*/_react.default.createElement(_MenuLink.default, {
|
|
286
|
-
config: prop.item,
|
|
287
|
-
clickCallback: prop.name === 'Dashboard' ? function (item) {
|
|
288
|
-
_this.props.dashboardLauncher();
|
|
289
|
-
|
|
290
|
-
_this.setState(_objectSpread(_objectSpread({}, _this.state), {}, {
|
|
291
|
-
activeRouteMenu: item
|
|
292
|
-
}));
|
|
293
|
-
} : function (item) {
|
|
294
|
-
return _this.setState(_objectSpread(_objectSpread({}, _this.state), {}, {
|
|
295
|
-
activeRouteMenu: item
|
|
296
|
-
}));
|
|
297
|
-
},
|
|
298
|
-
autoClick: prop.name === 'My Work Items' || prop.item && prop.item.defaultItem,
|
|
299
|
-
viewId: "menuBar",
|
|
300
|
-
icon: prop.icon,
|
|
301
|
-
iconColor: (prop.name === 'Dashboard' || prop.name === 'My Work Items') && _this.activeRoute(prop.id) ? secondaryThemeColor : null,
|
|
302
|
-
backgroundColor: _this.activeRoute(prop.id) ? (0, _core.lighten)(secondaryThemeColor, .9) : null,
|
|
303
|
-
name: prop.name,
|
|
304
|
-
id: prop.id,
|
|
305
|
-
level: prop.level,
|
|
306
|
-
tab: TAB,
|
|
307
|
-
color: _this.activeRoute(prop.id) ? secondaryThemeColor : null
|
|
308
|
-
}), ' ');
|
|
309
|
-
});
|
|
310
|
-
});
|
|
311
|
-
|
|
312
|
-
_defineProperty(_assertThisInitialized(_this), "activeRoute", function (routeName) {
|
|
313
|
-
// return this.props.location.pathname.indexOf(routeName) > -1 ? "active" : "";
|
|
314
|
-
return _this.state.activeRouteMenu.id === routeName;
|
|
315
|
-
});
|
|
316
|
-
|
|
317
|
-
_defineProperty(_assertThisInitialized(_this), "activeModule", function (moduleName) {
|
|
318
|
-
return _this.state.activeModule === moduleName;
|
|
319
|
-
});
|
|
320
|
-
|
|
321
|
-
_this.state = _objectSpread(_objectSpread({}, _this.getCollapseStates(props.routes)), {}, {
|
|
23
|
+
let ps;
|
|
24
|
+
const TAB = 16;
|
|
25
|
+
class ModuleMenuSidebar extends _react.default.Component {
|
|
26
|
+
constructor(props) {
|
|
27
|
+
super(props);
|
|
28
|
+
this.state = {
|
|
29
|
+
...this.getCollapseStates(props.routes),
|
|
322
30
|
isLoading: false,
|
|
323
31
|
error: false,
|
|
324
32
|
activeRouteMenu: {
|
|
@@ -326,54 +34,99 @@ var ModuleMenuSidebar = /*#__PURE__*/function (_React$Component) {
|
|
|
326
34
|
name: 'Dashboard'
|
|
327
35
|
},
|
|
328
36
|
activeModule: 'home'
|
|
329
|
-
}
|
|
330
|
-
return _this;
|
|
37
|
+
};
|
|
331
38
|
}
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
39
|
+
getViews = (menus, level) => {
|
|
40
|
+
let newViews = [];
|
|
41
|
+
for (let i = 0; i < menus.length; i++) {
|
|
42
|
+
let createView = {};
|
|
43
|
+
createView.name = menus[i].attributes.label;
|
|
44
|
+
createView.id = menus[i].id;
|
|
45
|
+
createView.mini = 'SS';
|
|
46
|
+
createView.layout = '/admin';
|
|
47
|
+
createView.level = level;
|
|
48
|
+
if (menus[i].subMenu) {
|
|
49
|
+
createView.collapse = true;
|
|
50
|
+
createView.state = menus[i].id + 'Collapse';
|
|
51
|
+
createView.views = this.getItems(menus[i].subMenu.items, level + 1);
|
|
52
|
+
} else {
|
|
53
|
+
createView.item = menus[i];
|
|
341
54
|
}
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
55
|
+
newViews.push(createView);
|
|
56
|
+
}
|
|
57
|
+
console.log('VIEWS : ', newViews, menus);
|
|
58
|
+
return newViews;
|
|
59
|
+
};
|
|
60
|
+
getItems = (items, level) => {
|
|
61
|
+
let newItems = [];
|
|
62
|
+
for (let i = 0; i < items.length; i++) {
|
|
63
|
+
let createItem = {};
|
|
64
|
+
createItem.name = items[i].attributes.label;
|
|
65
|
+
createItem.id = items[i].id;
|
|
66
|
+
createItem.mini = 'SS';
|
|
67
|
+
createItem.layout = '/admin';
|
|
68
|
+
createItem.item = items[i];
|
|
69
|
+
createItem.level = level;
|
|
70
|
+
if (!_Utils.default.isNull(items[i].subMenu)) {
|
|
71
|
+
createItem.collapse = true;
|
|
72
|
+
createItem.state = items[i].id + 'SubMenuCollapse';
|
|
73
|
+
createItem.views = this.getItems(items[i].subMenu.items, level + 1);
|
|
353
74
|
}
|
|
354
|
-
|
|
75
|
+
newItems.push(createItem);
|
|
76
|
+
}
|
|
77
|
+
return newItems;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
// this creates the intial state of this component based on the collapse routes
|
|
81
|
+
// that it gets through this.state.routes
|
|
82
|
+
getCollapseStates = routes => {
|
|
83
|
+
let initialState = {};
|
|
84
|
+
if (routes) {
|
|
85
|
+
routes.map((prop, key) => {
|
|
86
|
+
if (prop.collapse) {
|
|
87
|
+
initialState = {
|
|
88
|
+
[prop.state]: this.getCollapseInitialState(prop.views),
|
|
89
|
+
...this.getCollapseStates(prop.views),
|
|
90
|
+
...initialState
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
return null;
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
return initialState;
|
|
97
|
+
};
|
|
98
|
+
// this verifies if any of the collapses should be default opened on a rerender of this component
|
|
99
|
+
// for example, on the refresh of the page,
|
|
100
|
+
// while on the src/views/forms/RegularForms.js - route /admin/regular-forms
|
|
101
|
+
getCollapseInitialState(routes) {
|
|
102
|
+
if (!routes) {
|
|
355
103
|
return false;
|
|
356
104
|
}
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
var _this2 = this;
|
|
361
|
-
|
|
362
|
-
// if you are using a Windows Machine, the scrollbars will have a Mac look
|
|
363
|
-
if (navigator.platform.indexOf('Win') > -1) {
|
|
364
|
-
/*ps = new PerfectScrollbar(this.refs.sidebar, {
|
|
365
|
-
suppressScrollX: true,
|
|
366
|
-
suppressScrollY: false,
|
|
367
|
-
});*/
|
|
105
|
+
for (let i = 0; i < routes.length; i++) {
|
|
106
|
+
if (!routes[i].views) {
|
|
107
|
+
return true;
|
|
368
108
|
}
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
109
|
+
if (routes[i].collapse && this.getCollapseInitialState(routes[i].views)) {
|
|
110
|
+
return true;
|
|
111
|
+
} else if (window.location.href.indexOf(routes[i].path) !== -1) {
|
|
112
|
+
return true;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
117
|
+
getMenu = route => {
|
|
118
|
+
return new Promise(resolve => {
|
|
119
|
+
let service = {
|
|
120
|
+
url: '/ui/api/v1/menu/get',
|
|
372
121
|
parameters: [{
|
|
373
|
-
|
|
374
|
-
|
|
122
|
+
name: 'id',
|
|
123
|
+
value: route.menu,
|
|
124
|
+
httpParameterType: 'QUERY_PARAMETER'
|
|
125
|
+
}, {
|
|
126
|
+
name: 'version',
|
|
127
|
+
value: 1.0,
|
|
128
|
+
httpParameterType: 'QUERY_PARAMETER'
|
|
375
129
|
}],
|
|
376
|
-
method: 'POST',
|
|
377
130
|
contentType: 'application/json'
|
|
378
131
|
};
|
|
379
132
|
(0, _RestUtils.invokeRest)(service, {
|
|
@@ -381,160 +134,328 @@ var ModuleMenuSidebar = /*#__PURE__*/function (_React$Component) {
|
|
|
381
134
|
get id() {
|
|
382
135
|
return 'dashboard-sidebar';
|
|
383
136
|
}
|
|
384
|
-
|
|
385
137
|
}
|
|
386
|
-
}, 'dashboard-sidebar',
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
}));
|
|
390
|
-
|
|
391
|
-
var currentModule = result.find(function (r) {
|
|
392
|
-
return r.name === _this2.state.activeModule;
|
|
393
|
-
});
|
|
394
|
-
|
|
395
|
-
if (currentModule) {
|
|
396
|
-
_this2.getMenu(currentModule).then(function (result) {
|
|
397
|
-
_this2.setState(_objectSpread(_objectSpread({}, _this2.state), {}, {
|
|
398
|
-
selectedMenuRoutes: result
|
|
399
|
-
}));
|
|
400
|
-
});
|
|
401
|
-
}
|
|
402
|
-
}, function (e) {
|
|
138
|
+
}, 'dashboard-sidebar', result => {
|
|
139
|
+
resolve(this.getViews(result.menus, route.level + 1));
|
|
140
|
+
}, e => {
|
|
403
141
|
console.error(e);
|
|
142
|
+
resolve(null);
|
|
404
143
|
}, null);
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
var _this$props3 = this.props,
|
|
418
|
-
activeColor = _this$props3.activeColor,
|
|
419
|
-
logo = _this$props3.logo;
|
|
420
|
-
var logoImg = null;
|
|
421
|
-
var logoText = null;
|
|
422
|
-
|
|
423
|
-
if (!_Utils.default.isNull(logo)) {
|
|
424
|
-
logoImg = /*#__PURE__*/_react.default.createElement("a", {
|
|
425
|
-
href: logo.outterLink,
|
|
426
|
-
className: "logo-normal",
|
|
427
|
-
onClick: this.props.closeSidebar
|
|
428
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
429
|
-
className: "logo-img",
|
|
430
|
-
style: {
|
|
431
|
-
paddingTop: '16px',
|
|
432
|
-
paddingBottom: '8px'
|
|
433
|
-
}
|
|
434
|
-
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
435
|
-
src: logo.imgSrc,
|
|
436
|
-
alt: "logo"
|
|
437
|
-
})), ' ');
|
|
438
|
-
logoText = /*#__PURE__*/_react.default.createElement("a", {
|
|
439
|
-
href: logo.outterLink,
|
|
440
|
-
className: "simple-text ",
|
|
441
|
-
onClick: this.props.closeSidebar
|
|
442
|
-
}, logo.text, ' ');
|
|
443
|
-
}
|
|
444
|
-
|
|
144
|
+
});
|
|
145
|
+
};
|
|
146
|
+
getLiClassName = prop => {
|
|
147
|
+
return "li-" + prop.level;
|
|
148
|
+
};
|
|
149
|
+
createModuleTabs = routes => {
|
|
150
|
+
const {
|
|
151
|
+
rtlActive,
|
|
152
|
+
secondaryThemeColor,
|
|
153
|
+
primaryThemeColor
|
|
154
|
+
} = this.props;
|
|
155
|
+
return routes.map((module, key) => {
|
|
445
156
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
446
|
-
|
|
447
|
-
data: activeColor,
|
|
448
|
-
style: {
|
|
449
|
-
overflow: 'auto',
|
|
450
|
-
maxHeight: '100vh'
|
|
451
|
-
}
|
|
452
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
453
|
-
className: "row no-padding no-margin flex-nowrap w-100 h-100"
|
|
454
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
455
|
-
className: 'h-100 module-menu-strip',
|
|
157
|
+
key: key,
|
|
456
158
|
style: {
|
|
457
|
-
backgroundColor: this.
|
|
458
|
-
}
|
|
459
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
460
|
-
style: {
|
|
461
|
-
height: '16%'
|
|
462
|
-
}
|
|
463
|
-
}), this.state.routes && /*#__PURE__*/_react.default.createElement(_reactstrap.Nav, {
|
|
464
|
-
style: {
|
|
465
|
-
padding: '8px'
|
|
159
|
+
backgroundColor: this.activeModule(module.name) ? primaryThemeColor : (0, _core.lighten)(secondaryThemeColor, .1)
|
|
466
160
|
},
|
|
467
|
-
className: '
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
style: {
|
|
481
|
-
height: '10%'
|
|
482
|
-
}
|
|
483
|
-
}, ' ', logoImg !== null ? /*#__PURE__*/_react.default.createElement("div", {
|
|
484
|
-
className: "logo",
|
|
485
|
-
style: {
|
|
486
|
-
display: 'flex',
|
|
487
|
-
justifyContent: 'center',
|
|
488
|
-
alignItems: 'center',
|
|
489
|
-
height: '100%'
|
|
161
|
+
className: `${this.activeModule(module.name) ? 'module-tab-selected' : 'module-tab'}`,
|
|
162
|
+
onClick: e => {
|
|
163
|
+
this.setState({
|
|
164
|
+
...this.state,
|
|
165
|
+
activeModule: module.name
|
|
166
|
+
});
|
|
167
|
+
let currentModule = this.state.routes.find(r => r.name === module.name);
|
|
168
|
+
this.getMenu(currentModule).then(result => {
|
|
169
|
+
this.setState({
|
|
170
|
+
...this.state,
|
|
171
|
+
selectedMenuRoutes: result
|
|
172
|
+
});
|
|
173
|
+
});
|
|
490
174
|
}
|
|
491
|
-
},
|
|
492
|
-
className:
|
|
175
|
+
}, /*#__PURE__*/_react.default.createElement("div", null, module.icon ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
176
|
+
className: 'tab-icon'
|
|
177
|
+
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
178
|
+
className: module.icon,
|
|
493
179
|
style: {
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
alignItems: 'center',
|
|
497
|
-
height: '100%',
|
|
498
|
-
fontSize: '20px',
|
|
499
|
-
fontWeight: 600
|
|
180
|
+
width: '28px',
|
|
181
|
+
color: this.activeModule(module.name) ? '#000000' : '#444746'
|
|
500
182
|
}
|
|
501
|
-
},
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
183
|
+
}), ' '), /*#__PURE__*/_react.default.createElement("div", null, ' ', module.label), ' ', ' ') : /*#__PURE__*/_react.default.createElement("span", null, module.name), this.activeModule(module.name) && /*#__PURE__*/_react.default.createElement("i", {
|
|
184
|
+
className: 'fas fa-caret-left selected-module-caret'
|
|
185
|
+
})));
|
|
186
|
+
});
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
// this function creates the links and collapses that appear in the sidebar (left menu)
|
|
190
|
+
createLinks = routes => {
|
|
191
|
+
const {
|
|
192
|
+
rtlActive,
|
|
193
|
+
secondaryThemeColor,
|
|
194
|
+
primaryThemeColor
|
|
195
|
+
} = this.props;
|
|
196
|
+
return routes.map((prop, key) => {
|
|
197
|
+
if (prop.redirect) {
|
|
198
|
+
return null;
|
|
199
|
+
}
|
|
200
|
+
if ((prop.collapse || prop.isParent) && prop.name !== 'Dashboard' && prop.name !== 'My Work Items') {
|
|
201
|
+
var st = {};
|
|
202
|
+
st[prop['state']] = !this.state[prop.state];
|
|
203
|
+
return /*#__PURE__*/_react.default.createElement("li", {
|
|
204
|
+
className: prop.collapse ? this.getCollapseInitialState(prop.views) + '-' + prop.level ? 'active ' + this.getLiClassName(prop) : this.getLiClassName(prop) : this.getLiClassName(prop),
|
|
205
|
+
key: key
|
|
206
|
+
}, /*#__PURE__*/_react.default.createElement("a", {
|
|
207
|
+
href: "#pablo",
|
|
208
|
+
className: 'li-link-' + prop.level,
|
|
209
|
+
"data-toggle": "collapse",
|
|
210
|
+
style: {
|
|
211
|
+
marginLeft: (prop.level + 1) * TAB + 'px'
|
|
212
|
+
},
|
|
213
|
+
"aria-expanded": this.state[prop.state],
|
|
214
|
+
onClick: e => {
|
|
215
|
+
if (!prop.views) {
|
|
216
|
+
this.getMenu(prop).then(views => {
|
|
217
|
+
if (views) {
|
|
218
|
+
prop.views = views;
|
|
219
|
+
//this.getCollapseInitialState(views);
|
|
220
|
+
this.setState(st);
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
} else {
|
|
224
|
+
this.setState(st);
|
|
225
|
+
}
|
|
226
|
+
e.preventDefault();
|
|
227
|
+
}
|
|
228
|
+
}, prop.icon !== undefined ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("i", {
|
|
229
|
+
className: prop.icon,
|
|
230
|
+
style: {
|
|
231
|
+
width: '28px'
|
|
232
|
+
}
|
|
233
|
+
}), ' ', /*#__PURE__*/_react.default.createElement("span", null, ' ', prop.name, ' ', prop.collapse ? /*#__PURE__*/_react.default.createElement("span", {
|
|
234
|
+
className: "caret",
|
|
235
|
+
style: {
|
|
236
|
+
marginTop: '0'
|
|
237
|
+
}
|
|
238
|
+
}) : null), ' ', ' ') : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("span", {
|
|
239
|
+
className: "sidebar-normal",
|
|
240
|
+
style: {
|
|
241
|
+
paddingLeft: '4px'
|
|
242
|
+
}
|
|
243
|
+
}, ' ', prop.name, ' ', /*#__PURE__*/_react.default.createElement("b", {
|
|
244
|
+
className: "caret"
|
|
245
|
+
})), ' '), ' '), ' ', prop.collapse && prop.views ? /*#__PURE__*/_react.default.createElement(_reactstrap.Collapse, {
|
|
246
|
+
isOpen: this.state[prop.state]
|
|
247
|
+
}, /*#__PURE__*/_react.default.createElement("ul", {
|
|
248
|
+
className: "nav"
|
|
249
|
+
}, " ", this.createLinks(prop.views), " "), ' ') : null);
|
|
250
|
+
}
|
|
251
|
+
return /*#__PURE__*/_react.default.createElement("li", {
|
|
252
|
+
className: `${'menu-link-li' + (this.activeRoute(prop.id) ? '-active' : '') + (prop.name === 'Dashboard' ? ' dashboard-link' : '')}`,
|
|
253
|
+
key: key,
|
|
254
|
+
style: this.activeRoute(prop.id) ? {
|
|
255
|
+
backgroundColor: (0, _core.lighten)(secondaryThemeColor, .9),
|
|
256
|
+
borderRadius: '16px',
|
|
257
|
+
color: secondaryThemeColor,
|
|
258
|
+
fontWeight: 500
|
|
259
|
+
} : {}
|
|
260
|
+
}, /*#__PURE__*/_react.default.createElement(_MenuLink.default, {
|
|
261
|
+
config: prop.item,
|
|
262
|
+
clickCallback: prop.name === 'Dashboard' ? item => {
|
|
263
|
+
this.props.dashboardLauncher();
|
|
264
|
+
this.setState({
|
|
265
|
+
...this.state,
|
|
266
|
+
activeRouteMenu: item
|
|
267
|
+
});
|
|
268
|
+
} : item => this.setState({
|
|
269
|
+
...this.state,
|
|
270
|
+
activeRouteMenu: item
|
|
271
|
+
}),
|
|
272
|
+
autoClick: prop.name === 'My Work Items' || prop.item && prop.item.defaultItem,
|
|
273
|
+
viewId: "menuBar",
|
|
274
|
+
icon: prop.icon,
|
|
275
|
+
iconColor: (prop.name === 'Dashboard' || prop.name === 'My Work Items') && this.activeRoute(prop.id) ? secondaryThemeColor : null,
|
|
276
|
+
backgroundColor: this.activeRoute(prop.id) ? (0, _core.lighten)(secondaryThemeColor, .9) : null,
|
|
277
|
+
name: prop.name,
|
|
278
|
+
id: prop.id,
|
|
279
|
+
level: prop.level,
|
|
280
|
+
tab: TAB,
|
|
281
|
+
color: this.activeRoute(prop.id) ? secondaryThemeColor : null
|
|
282
|
+
}), ' ');
|
|
283
|
+
});
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
// verifies if routeName is the one active (in browser input)
|
|
287
|
+
activeRoute = routeName => {
|
|
288
|
+
// return this.props.location.pathname.indexOf(routeName) > -1 ? "active" : "";
|
|
289
|
+
return this.state.activeRouteMenu.id === routeName;
|
|
290
|
+
};
|
|
291
|
+
activeModule = moduleName => {
|
|
292
|
+
return this.state.activeModule === moduleName;
|
|
293
|
+
};
|
|
294
|
+
componentDidMount() {
|
|
295
|
+
// if you are using a Windows Machine, the scrollbars will have a Mac look
|
|
296
|
+
if (navigator.platform.indexOf('Win') > -1) {
|
|
297
|
+
/*ps = new PerfectScrollbar(this.refs.sidebar, {
|
|
298
|
+
suppressScrollX: true,
|
|
299
|
+
suppressScrollY: false,
|
|
300
|
+
});*/
|
|
301
|
+
}
|
|
302
|
+
let service = {
|
|
303
|
+
url: '/ui/api/v1/menu/filter',
|
|
304
|
+
parameters: [{
|
|
305
|
+
value: this.props.routes,
|
|
306
|
+
httpParameterType: 'REQUEST_BODY'
|
|
307
|
+
}],
|
|
308
|
+
method: 'POST',
|
|
309
|
+
contentType: 'application/json'
|
|
310
|
+
};
|
|
311
|
+
(0, _RestUtils.invokeRest)(service, {
|
|
312
|
+
api: {
|
|
313
|
+
get id() {
|
|
314
|
+
return 'dashboard-sidebar';
|
|
523
315
|
}
|
|
316
|
+
}
|
|
317
|
+
}, 'dashboard-sidebar', result => {
|
|
318
|
+
this.setState({
|
|
319
|
+
...this.state,
|
|
320
|
+
routes: result
|
|
321
|
+
});
|
|
322
|
+
let currentModule = result.find(r => r.name === this.state.activeModule);
|
|
323
|
+
if (currentModule) {
|
|
324
|
+
this.getMenu(currentModule).then(result => {
|
|
325
|
+
this.setState({
|
|
326
|
+
...this.state,
|
|
327
|
+
selectedMenuRoutes: result
|
|
328
|
+
});
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
}, e => {
|
|
332
|
+
console.error(e);
|
|
333
|
+
}, null);
|
|
334
|
+
}
|
|
335
|
+
componentWillUnmount() {
|
|
336
|
+
// we need to destroy the false scrollbar when we navigate
|
|
337
|
+
// to a page that doesn't have this component rendered
|
|
338
|
+
if (navigator.platform.indexOf('Win') > -1) {
|
|
339
|
+
//ps.destroy();
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
render() {
|
|
343
|
+
const {
|
|
344
|
+
activeColor,
|
|
345
|
+
logo
|
|
346
|
+
} = this.props;
|
|
347
|
+
let logoImg = null;
|
|
348
|
+
let logoText = null;
|
|
349
|
+
if (!_Utils.default.isNull(logo)) {
|
|
350
|
+
logoImg = /*#__PURE__*/_react.default.createElement("a", {
|
|
351
|
+
href: logo.outterLink,
|
|
352
|
+
className: "logo-normal",
|
|
353
|
+
onClick: this.props.closeSidebar
|
|
524
354
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
355
|
+
className: "logo-img",
|
|
525
356
|
style: {
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
alignItems: 'center',
|
|
529
|
-
marginTop: '8px'
|
|
357
|
+
paddingTop: '16px',
|
|
358
|
+
paddingBottom: '8px'
|
|
530
359
|
}
|
|
531
|
-
},
|
|
360
|
+
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
361
|
+
src: logo.imgSrc,
|
|
362
|
+
alt: "logo"
|
|
363
|
+
})), ' ');
|
|
364
|
+
logoText = /*#__PURE__*/_react.default.createElement("a", {
|
|
365
|
+
href: logo.outterLink,
|
|
366
|
+
className: "simple-text ",
|
|
367
|
+
onClick: this.props.closeSidebar
|
|
368
|
+
}, logo.text, ' ');
|
|
532
369
|
}
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
370
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
371
|
+
className: this.props.className,
|
|
372
|
+
data: activeColor,
|
|
373
|
+
style: {
|
|
374
|
+
overflow: 'auto',
|
|
375
|
+
maxHeight: '100vh'
|
|
376
|
+
}
|
|
377
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
378
|
+
className: `row no-padding no-margin flex-nowrap w-100 h-100`
|
|
379
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
380
|
+
className: 'h-100 module-menu-strip',
|
|
381
|
+
style: {
|
|
382
|
+
backgroundColor: this.props.secondaryThemeColor
|
|
383
|
+
}
|
|
384
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
385
|
+
style: {
|
|
386
|
+
height: '16%'
|
|
387
|
+
}
|
|
388
|
+
}), this.state.routes && /*#__PURE__*/_react.default.createElement(_reactstrap.Nav, {
|
|
389
|
+
style: {
|
|
390
|
+
padding: '8px'
|
|
391
|
+
},
|
|
392
|
+
className: 'nav-wrapper'
|
|
393
|
+
}, this.createModuleTabs(this.state.routes))), /*#__PURE__*/_react.default.createElement("div", {
|
|
394
|
+
className: 'h-100',
|
|
395
|
+
style: {
|
|
396
|
+
width: 'calc(100% - 120px)'
|
|
397
|
+
}
|
|
398
|
+
}, /*#__PURE__*/_react.default.createElement("table", {
|
|
399
|
+
style: {
|
|
400
|
+
height: '96%',
|
|
401
|
+
maxHeight: '100%',
|
|
402
|
+
width: '100%'
|
|
403
|
+
}
|
|
404
|
+
}, /*#__PURE__*/_react.default.createElement("tbody", null, /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", {
|
|
405
|
+
style: {
|
|
406
|
+
height: '10%'
|
|
407
|
+
}
|
|
408
|
+
}, ' ', logoImg !== null ? /*#__PURE__*/_react.default.createElement("div", {
|
|
409
|
+
className: "logo",
|
|
410
|
+
style: {
|
|
411
|
+
display: 'flex',
|
|
412
|
+
justifyContent: 'center',
|
|
413
|
+
alignItems: 'center',
|
|
414
|
+
height: '100%'
|
|
415
|
+
}
|
|
416
|
+
}, ' ', logoImg, ' ') : null, ' ', !_Utils.default.isNull(this.props.heading) ? /*#__PURE__*/_react.default.createElement("div", {
|
|
417
|
+
className: "logo",
|
|
418
|
+
style: {
|
|
419
|
+
display: 'flex',
|
|
420
|
+
justifyContent: 'center',
|
|
421
|
+
alignItems: 'center',
|
|
422
|
+
height: '100%',
|
|
423
|
+
fontSize: '20px',
|
|
424
|
+
fontWeight: 600
|
|
425
|
+
}
|
|
426
|
+
}, this.props.heading) : null)), /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", {
|
|
427
|
+
style: {
|
|
428
|
+
height: '75%'
|
|
429
|
+
},
|
|
430
|
+
valign: 'top'
|
|
431
|
+
}, this.state.selectedMenuRoutes && /*#__PURE__*/_react.default.createElement(_reactstrap.Nav, {
|
|
432
|
+
style: {
|
|
433
|
+
margin: '8px',
|
|
434
|
+
padding: '16px'
|
|
435
|
+
},
|
|
436
|
+
className: 'nav-wrapper'
|
|
437
|
+
}, this.createLinks(this.state.selectedMenuRoutes)))), /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", {
|
|
438
|
+
className: 'sidebar-app-logo-wrapper',
|
|
439
|
+
style: {
|
|
440
|
+
height: '5%'
|
|
441
|
+
},
|
|
442
|
+
valign: 'top'
|
|
443
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
444
|
+
className: 'sidebar-app-logo',
|
|
445
|
+
style: {
|
|
446
|
+
justifyContent: 'center',
|
|
447
|
+
height: '48px'
|
|
448
|
+
}
|
|
449
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
450
|
+
style: {
|
|
451
|
+
display: 'flex',
|
|
452
|
+
justifyContent: 'center',
|
|
453
|
+
alignItems: 'center',
|
|
454
|
+
marginTop: '8px'
|
|
455
|
+
}
|
|
456
|
+
}, "Copyrights \xA9 ", 1900 + new Date().getYear(), " ", ' ')))))))));
|
|
457
|
+
}
|
|
458
|
+
}
|
|
538
459
|
ModuleMenuSidebar.propTypes = {
|
|
539
460
|
activeColor: _propTypes.default.oneOf(['primary', 'blue', 'green', 'orange', 'red', 'agility']),
|
|
540
461
|
secondaryThemeColor: _propTypes.default.string.isRequired,
|
|
@@ -552,5 +473,4 @@ ModuleMenuSidebar.propTypes = {
|
|
|
552
473
|
// this is used on responsive to close the sidebar on route navigation
|
|
553
474
|
closeSidebar: _propTypes.default.func
|
|
554
475
|
};
|
|
555
|
-
var _default = ModuleMenuSidebar;
|
|
556
|
-
exports.default = _default;
|
|
476
|
+
var _default = exports.default = ModuleMenuSidebar;
|