@agilemotion/oui-react-js 1.6.1 → 1.6.3
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 +698 -421
- package/dist/BasicApp.js +5 -5
- package/dist/BasicAppHome.js +55 -26
- package/dist/DynamicJS.js +147 -65
- package/dist/InteractionPortalApp.css +1 -1
- package/dist/InteractionPortalApp.js +5 -5
- package/dist/InteractionPortalAppHome.js +57 -22
- package/dist/InteractionPortalApp_old.js +107 -61
- package/dist/RestUtils.js +339 -287
- package/dist/TypedValue.js +18 -15
- package/dist/Utils.js +375 -276
- package/dist/WithRouter.js +6 -6
- package/dist/assets/jss/components/authNavbarStyle.js +166 -164
- package/dist/assets/jss/components/buttonStyle.js +1 -1
- package/dist/assets/jss/components/cardAvatarStyle.js +1 -1
- package/dist/assets/jss/components/cardBodyStyle.js +1 -1
- package/dist/assets/jss/components/cardFooterStyle.js +1 -1
- package/dist/assets/jss/components/cardHeaderStyle.js +13 -13
- package/dist/assets/jss/components/cardIconStyle.js +1 -1
- package/dist/assets/jss/components/cardStyle.js +1 -1
- package/dist/assets/jss/components/cardTextStyle.js +1 -1
- package/dist/assets/jss/components/customDropdownStyle.js +168 -169
- package/dist/assets/jss/components/customInputStyle.js +9 -3
- package/dist/assets/jss/components/dropdownStyle.js +69 -69
- package/dist/assets/jss/components/footerStyle.js +19 -13
- package/dist/assets/jss/components/headerLinksStyle.js +45 -48
- package/dist/assets/jss/components/headerStyle.js +68 -65
- package/dist/assets/jss/components/navbarLinksStyle.js +66 -77
- package/dist/assets/jss/components/navbarStyle.js +79 -76
- package/dist/assets/jss/components/sidebarStyle.js +436 -436
- package/dist/assets/jss/components/typographyStyle.js +9 -3
- package/dist/assets/jss/rootStyle.js +96 -81
- package/dist/assets/jss/views/layoutStyle.js +44 -41
- package/dist/assets/jss/views/loginBasicStyle.js +1 -1
- package/dist/assets/jss/views/loginBusinessPortalStyle.js +1 -1
- package/dist/assets/jss/views/loginStyle.js +82 -77
- package/dist/components/AlertBar.js +50 -17
- package/dist/components/AlertItem.js +35 -12
- package/dist/components/AlertTemplate.js +30 -29
- package/dist/components/Button.js +62 -34
- package/dist/components/Calendar.js +140 -91
- package/dist/components/ConfirmationDialog.js +36 -11
- package/dist/components/DataGrid.js +512 -270
- package/dist/components/DataGridColumn.js +47 -22
- package/dist/components/DataGridFilter.js +186 -105
- package/dist/components/DataGridHeading.js +50 -32
- package/dist/components/Dialog.js +90 -35
- package/dist/components/DocumentTemplateDesigner.js +34 -16
- package/dist/components/DocumentTemplateDesignerComponent.js +124 -48
- package/dist/components/DocumentTemplatePlaceholderDialog.js +52 -30
- package/dist/components/DocumentViewer.js +34 -18
- package/dist/components/DocumentViewerComponent.js +26 -9
- package/dist/components/ElementResizeHandler.js +229 -207
- package/dist/components/FileThumb.js +32 -10
- package/dist/components/Graph.js +153 -85
- package/dist/components/GraphNode.js +58 -38
- package/dist/components/HtmlPanel.js +67 -39
- package/dist/components/Icon.js +206 -166
- package/dist/components/LoadingIndicator.js +3 -3
- package/dist/components/LottieIcon.js +1 -1
- package/dist/components/PopupView.js +39 -19
- package/dist/components/Portlet.js +32 -17
- package/dist/components/RegularButton.js +28 -32
- package/dist/components/SignaturePanel.js +37 -17
- package/dist/components/SocketManager.js +178 -119
- package/dist/components/StepperTitleBar.js +62 -42
- package/dist/components/TabPage.js +30 -25
- package/dist/components/TabPanel.js +86 -33
- package/dist/components/TableCellContent.js +51 -32
- package/dist/components/TemplateDesigner.js +173 -121
- package/dist/components/TemplateItemEventHandler.js +335 -221
- package/dist/components/TemplateTable.js +183 -118
- package/dist/components/TitleBar.js +26 -11
- package/dist/components/Toolbar.js +67 -38
- package/dist/components/Tooltip.js +43 -35
- package/dist/components/Tree.js +85 -44
- package/dist/components/UseIsVisible.js +25 -4
- package/dist/components/card/Card.js +27 -33
- package/dist/components/card/CardAvatar.js +20 -19
- package/dist/components/card/CardBody.js +24 -27
- package/dist/components/card/CardFooter.js +23 -24
- package/dist/components/card/CardHeader.js +24 -27
- package/dist/components/card/CardIcon.js +17 -13
- package/dist/components/card/CardText.js +17 -13
- package/dist/components/customInput/CustomInput.js +22 -36
- package/dist/components/dashboard/{BasicBusinessAppDashboard.js → FoldingSideTabDashboard.js} +111 -63
- package/dist/components/dashboard/SideMenuModuleDashboard.css +60 -0
- package/dist/components/dashboard/SideMenuModuleDashboard.js +423 -0
- package/dist/components/dashboard/TopMenuModuleDashboard.js +138 -0
- package/dist/components/dashboard/components/Header.js +29 -12
- package/dist/components/dashboard/components/LeftDrawer.js +3 -5
- package/dist/components/dashboard/components/UserIdentity.js +2 -2
- package/dist/components/dashboard/components/blackDashboard/fixedPlugin/FixedPlugin.js +131 -87
- package/dist/components/dashboard/components/blackDashboard/sidebar/FoldingTabSidebar.js +488 -0
- package/dist/components/dashboard/components/blackDashboard/sidebar/ModuleMenu.js +64 -0
- package/dist/components/dashboard/components/blackDashboard/sidebar/ModuleMenuSidebar.css +65 -0
- package/dist/components/dashboard/components/blackDashboard/sidebar/ModuleMenuSidebar.js +556 -0
- package/dist/components/dashboard/components/portal/Timeline.js +1 -1
- package/dist/components/dashboard/components/portal/Workspace.js +5 -11
- package/dist/components/footer/Footer.js +31 -24
- package/dist/components/footer/HomeFooter.js +68 -34
- package/dist/components/form/AddressSearch.js +78 -42
- package/dist/components/form/AutoComplete.js +136 -55
- package/dist/components/form/BaseField.js +108 -56
- package/dist/components/form/Checkbox.js +10 -8
- package/dist/components/form/DatePicker.js +47 -25
- package/dist/components/form/FieldSet.js +217 -84
- package/dist/components/form/Form.js +334 -200
- package/dist/components/form/GridField.js +185 -82
- package/dist/components/form/IconField.js +9 -7
- package/dist/components/form/ImageEditor.js +141 -92
- package/dist/components/form/LabelField.js +12 -10
- package/dist/components/form/LookupField.js +54 -32
- package/dist/components/form/MultiFileUploadField.js +101 -67
- package/dist/components/form/RadioGroup.js +33 -16
- package/dist/components/form/Section.js +84 -34
- package/dist/components/form/SelectItem.js +55 -33
- package/dist/components/form/SignatureTemplateDesignerField.js +11 -9
- package/dist/components/form/Switch.js +10 -8
- package/dist/components/form/TextField.js +34 -16
- package/dist/components/form/TimePicker.js +19 -15
- package/dist/components/form/TransferList.js +153 -75
- package/dist/components/form/UploadField.js +183 -128
- package/dist/components/grid/GridContainer.js +12 -8
- package/dist/components/grid/GridItem.js +12 -8
- package/dist/components/layout/CollapsiblePanel.js +44 -18
- package/dist/components/layout/Layout.js +81 -40
- package/dist/components/layout/VC.css +1 -1
- package/dist/components/layout/View.js +136 -62
- package/dist/components/layout/ViewContainer.js +13 -11
- package/dist/components/layout/ViewPort.js +25 -10
- package/dist/components/layout/Window.js +87 -53
- package/dist/components/layout/WindowViewPort.js +38 -16
- package/dist/components/media/ClosablePanel.js +7 -7
- package/dist/components/media/LobbyWaitingList.js +7 -9
- package/dist/components/media/MediaSoupHelper.js +379 -187
- package/dist/components/media/SideBarContent.js +22 -14
- package/dist/components/media/SocketRequest.js +5 -1
- package/dist/components/media/SocketResponse.js +5 -1
- package/dist/components/media/Timer.js +35 -15
- package/dist/components/media/Toolbar.css +5 -0
- package/dist/components/media/Toolbar.js +220 -102
- package/dist/components/media/ToolbarButton.js +82 -33
- package/dist/components/media/Toolbar_bck.js +142 -70
- package/dist/components/media/Tracks.js +31 -28
- package/dist/components/media/TrainingRoom.js +284 -121
- package/dist/components/media/Transports.js +27 -24
- package/dist/components/media/VCEventManager.js +95 -31
- package/dist/components/media/VCEventType.js +5 -1
- package/dist/components/media/VCParticipantList.js +40 -14
- package/dist/components/media/VCParticipantListItem.js +92 -41
- package/dist/components/media/VCRoom.js +29 -11
- package/dist/components/media/VCRoomParticipant.js +488 -242
- package/dist/components/media/VCRoomRecorder.js +236 -175
- package/dist/components/media/VCRoomWorkspace.js +505 -245
- package/dist/components/media/Video.js +89 -25
- package/dist/components/media/VideoPlayer.js +56 -22
- package/dist/components/media/chat/ChatRoom.js +255 -132
- package/dist/components/media/chat/ChatRoomItem.js +35 -14
- package/dist/components/media/chat/ChatRoomList.js +43 -13
- package/dist/components/menu/CollapsibleMenu.js +39 -20
- package/dist/components/menu/MenuBars.js +81 -48
- package/dist/components/menu/MenuButton.js +95 -60
- package/dist/components/menu/MenuItem.js +28 -9
- package/dist/components/menu/MenuLink.js +12 -10
- package/dist/components/menu/PopupMenu.js +16 -12
- package/dist/components/navbars/AuthNavbar.js +27 -18
- package/dist/components/navbars/HomeNavbar.js +243 -194
- package/dist/components/navbars/PortalNavbar.js +50 -26
- package/dist/components/signatures/AgilitySignaturePanel.js +96 -39
- package/dist/components/signatures/AlertItem.js +36 -13
- package/dist/components/signatures/Card.js +4 -4
- package/dist/components/signatures/DocumentContainer.js +141 -57
- package/dist/components/signatures/ImageSignatureInput.js +90 -59
- package/dist/components/signatures/MenuButton.js +53 -33
- package/dist/components/signatures/Prompt.js +26 -5
- package/dist/components/signatures/ResponsiveTable.js +302 -197
- package/dist/components/signatures/SearchView.js +77 -36
- package/dist/components/signatures/SignatorySearch.js +30 -10
- package/dist/components/signatures/SignatorySearchForm.js +35 -18
- package/dist/components/signatures/SignatureInput.js +56 -26
- package/dist/components/signatures/SignatureInputProps.js +107 -55
- package/dist/components/signatures/SignatureTemplateDesigner.js +340 -235
- package/dist/components/signatures/Toolbar.js +135 -94
- package/dist/components/signatures/ViewUtils.js +273 -224
- package/dist/components/typography/Danger.js +3 -5
- package/dist/components/typography/Info.js +3 -5
- package/dist/components/typography/Link.js +3 -5
- package/dist/event/ActionHandlers.js +57 -43
- package/dist/event/Event.js +16 -13
- package/dist/event/EventListener.js +39 -36
- package/dist/event/EventType.js +5 -1
- package/dist/event/LoadDataActionHandler.js +20 -8
- package/dist/event/Observable.js +323 -142
- package/dist/event/RouteActionHandler.js +139 -125
- package/dist/event/ScriptActionHandler.js +20 -8
- package/dist/event/ServiceCallActionHandler.js +51 -39
- package/dist/event/SignalGraphActionHandler.js +19 -7
- package/dist/js/Addresses.js +38 -24
- package/dist/js/Calendar.js +168 -161
- package/dist/js/DynamicLib.js +14 -11
- package/dist/js/Media.js +213 -120
- package/dist/js/Validators.js +6 -5
- package/dist/js/Windows.js +48 -47
- package/dist/redux/store/ConfigureStore.js +17 -9
- package/dist/redux/store/DashboardStore.js +110 -43
- package/dist/redux/store/History.js +1 -1
- package/dist/redux/store/SecurityStore.js +59 -20
- package/dist/security/TokenManager.js +44 -30
- package/dist/theme-default.js +1 -1
- package/dist/view/Dashboard.js +230 -137
- package/dist/view/PortalDashboard.js +4 -4
- package/dist/view/Settings.js +4 -2
- package/dist/view/Views.js +27 -14
- package/dist/view/security/ChangePasswordBasic.js +97 -40
- package/dist/view/security/ForgotPassword.js +59 -22
- package/dist/view/security/ForgotPasswordBasic.js +62 -21
- package/dist/view/security/Login.js +64 -24
- package/dist/view/security/LoginBasic.js +65 -26
- package/dist/view/security/LoginInteractionPortal.js +62 -25
- package/dist/view/security/ResetPassword.js +65 -23
- package/dist/view/security/ResetPasswordBasic.js +91 -37
- package/dist/view/security/Security.js +12 -12
- package/package.json +2 -3
- package/dist/components/dashboard/BusinessPortalAppDashboard.js +0 -115
- package/dist/components/dashboard/components/blackDashboard/sidebar/Sidebar.js +0 -447
- /package/dist/components/dashboard/{BusinessPortalAppDashboard.css → TopMenuModuleDashboard.css} +0 -0
- /package/dist/components/dashboard/components/blackDashboard/sidebar/{Sidebar.css → FoldingTabSidebar.css} +0 -0
|
@@ -7,11 +7,21 @@ exports.reducer = exports.actionCreators = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _RestUtils = require("../../RestUtils");
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
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; }
|
|
11
|
+
|
|
12
|
+
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; }
|
|
13
|
+
|
|
14
|
+
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; }
|
|
15
|
+
|
|
16
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
17
|
+
|
|
18
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
19
|
+
|
|
20
|
+
var requestType = 'REQUEST';
|
|
21
|
+
var receiveDashboardSettingsType = 'RECEIVE_DASHBOARD_SETTINGS';
|
|
22
|
+
var activeRouteMenu = 'ACTIVE_ROUTE_MENU';
|
|
23
|
+
var secondaryThemeColor = 'SECONDARY_THEME_COLOR';
|
|
24
|
+
var initialState = {
|
|
15
25
|
dashboardSettings: {},
|
|
16
26
|
isLoading: false,
|
|
17
27
|
error: false,
|
|
@@ -21,71 +31,128 @@ const initialState = {
|
|
|
21
31
|
},
|
|
22
32
|
secondaryThemeColor: "red"
|
|
23
33
|
};
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
getDashboardSettings: url
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
34
|
+
var currentDashboardSettings = {};
|
|
35
|
+
var actionCreators = {
|
|
36
|
+
getDashboardSettings: function getDashboardSettings(url) {
|
|
37
|
+
return /*#__PURE__*/function () {
|
|
38
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(dispatch) {
|
|
39
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
40
|
+
while (1) {
|
|
41
|
+
switch (_context.prev = _context.next) {
|
|
42
|
+
case 0:
|
|
43
|
+
dispatch({
|
|
44
|
+
type: requestType
|
|
45
|
+
});
|
|
46
|
+
(0, _RestUtils.sendRequest)(url, function (response) {
|
|
47
|
+
dispatch({
|
|
48
|
+
type: receiveDashboardSettingsType,
|
|
49
|
+
dashboardSettings: response,
|
|
50
|
+
error: false
|
|
51
|
+
});
|
|
52
|
+
}, function () {
|
|
53
|
+
dispatch({
|
|
54
|
+
type: receiveDashboardSettingsType,
|
|
55
|
+
dashboardSettings: null,
|
|
56
|
+
error: true
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
case 2:
|
|
61
|
+
case "end":
|
|
62
|
+
return _context.stop();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}, _callee);
|
|
66
|
+
}));
|
|
67
|
+
|
|
68
|
+
return function (_x) {
|
|
69
|
+
return _ref.apply(this, arguments);
|
|
70
|
+
};
|
|
71
|
+
}();
|
|
43
72
|
},
|
|
44
|
-
setActiveRoute: route
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
73
|
+
setActiveRoute: function setActiveRoute(route) {
|
|
74
|
+
return /*#__PURE__*/function () {
|
|
75
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(dispatch) {
|
|
76
|
+
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
77
|
+
while (1) {
|
|
78
|
+
switch (_context2.prev = _context2.next) {
|
|
79
|
+
case 0:
|
|
80
|
+
dispatch({
|
|
81
|
+
type: activeRouteMenu,
|
|
82
|
+
activeRouteMenu: route
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
case 1:
|
|
86
|
+
case "end":
|
|
87
|
+
return _context2.stop();
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}, _callee2);
|
|
91
|
+
}));
|
|
92
|
+
|
|
93
|
+
return function (_x2) {
|
|
94
|
+
return _ref2.apply(this, arguments);
|
|
95
|
+
};
|
|
96
|
+
}();
|
|
49
97
|
},
|
|
50
|
-
setSecondaryThemeColor: secondaryColor
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
98
|
+
setSecondaryThemeColor: function setSecondaryThemeColor(secondaryColor) {
|
|
99
|
+
return /*#__PURE__*/function () {
|
|
100
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(dispatch) {
|
|
101
|
+
return regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
102
|
+
while (1) {
|
|
103
|
+
switch (_context3.prev = _context3.next) {
|
|
104
|
+
case 0:
|
|
105
|
+
dispatch({
|
|
106
|
+
type: secondaryThemeColor,
|
|
107
|
+
secondaryThemeColor: secondaryColor
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
case 1:
|
|
111
|
+
case "end":
|
|
112
|
+
return _context3.stop();
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}, _callee3);
|
|
116
|
+
}));
|
|
117
|
+
|
|
118
|
+
return function (_x3) {
|
|
119
|
+
return _ref3.apply(this, arguments);
|
|
120
|
+
};
|
|
121
|
+
}();
|
|
55
122
|
}
|
|
56
123
|
};
|
|
57
124
|
exports.actionCreators = actionCreators;
|
|
58
125
|
|
|
59
|
-
|
|
126
|
+
var reducer = function reducer(state, action) {
|
|
60
127
|
state = state || initialState;
|
|
61
128
|
|
|
62
129
|
if (action.type === requestType) {
|
|
63
|
-
return {
|
|
130
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
64
131
|
isLoading: true,
|
|
65
132
|
dashboardSettings: currentDashboardSettings,
|
|
66
133
|
error: false
|
|
67
|
-
};
|
|
134
|
+
});
|
|
68
135
|
}
|
|
69
136
|
|
|
70
137
|
if (action.type === receiveDashboardSettingsType) {
|
|
71
138
|
currentDashboardSettings = action.dashboardSettings;
|
|
72
|
-
return {
|
|
139
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
73
140
|
error: action.error,
|
|
74
141
|
dashboardSettings: currentDashboardSettings,
|
|
75
142
|
isLoading: false
|
|
76
|
-
};
|
|
143
|
+
});
|
|
77
144
|
}
|
|
78
145
|
|
|
79
146
|
if (action.type === activeRouteMenu) {
|
|
80
|
-
return {
|
|
147
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
81
148
|
activeRouteMenu: action.activeRouteMenu
|
|
82
|
-
};
|
|
149
|
+
});
|
|
83
150
|
}
|
|
84
151
|
|
|
85
152
|
if (action.type === secondaryThemeColor) {
|
|
86
|
-
return {
|
|
153
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
87
154
|
secondaryThemeColor: action.secondaryThemeColor
|
|
88
|
-
};
|
|
155
|
+
});
|
|
89
156
|
}
|
|
90
157
|
|
|
91
158
|
return state;
|
|
@@ -4,47 +4,86 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.reducer = exports.actionCreators = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
|
|
8
|
+
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; }
|
|
9
|
+
|
|
10
|
+
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; }
|
|
11
|
+
|
|
12
|
+
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; }
|
|
13
|
+
|
|
14
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
15
|
+
|
|
16
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
17
|
+
|
|
18
|
+
var requestType = 'REQUEST';
|
|
19
|
+
var receiveUserDetailsType = 'RECEIVE_USER_DETAILS';
|
|
20
|
+
var initialState = {
|
|
10
21
|
userDetails: {},
|
|
11
22
|
isLoading: false,
|
|
12
23
|
error: false,
|
|
13
24
|
currentMenuJson: ""
|
|
14
25
|
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
login: (url, username, password)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
var currentUserDetails = {};
|
|
27
|
+
var actionCreators = {
|
|
28
|
+
login: function login(url, username, password) {
|
|
29
|
+
return /*#__PURE__*/function () {
|
|
30
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(dispatch) {
|
|
31
|
+
var response, userDetails;
|
|
32
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
33
|
+
while (1) {
|
|
34
|
+
switch (_context.prev = _context.next) {
|
|
35
|
+
case 0:
|
|
36
|
+
dispatch({
|
|
37
|
+
type: requestType
|
|
38
|
+
});
|
|
39
|
+
_context.next = 3;
|
|
40
|
+
return fetch(url);
|
|
41
|
+
|
|
42
|
+
case 3:
|
|
43
|
+
response = _context.sent;
|
|
44
|
+
_context.next = 6;
|
|
45
|
+
return response.json();
|
|
46
|
+
|
|
47
|
+
case 6:
|
|
48
|
+
userDetails = _context.sent;
|
|
49
|
+
dispatch({
|
|
50
|
+
type: receiveUserDetailsType,
|
|
51
|
+
userDetails: userDetails
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
case 8:
|
|
55
|
+
case "end":
|
|
56
|
+
return _context.stop();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}, _callee);
|
|
60
|
+
}));
|
|
61
|
+
|
|
62
|
+
return function (_x) {
|
|
63
|
+
return _ref.apply(this, arguments);
|
|
64
|
+
};
|
|
65
|
+
}();
|
|
27
66
|
}
|
|
28
67
|
};
|
|
29
68
|
exports.actionCreators = actionCreators;
|
|
30
69
|
|
|
31
|
-
|
|
70
|
+
var reducer = function reducer(state, action) {
|
|
32
71
|
state = state || initialState;
|
|
33
72
|
|
|
34
73
|
if (action.type === requestType) {
|
|
35
|
-
return {
|
|
74
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
36
75
|
isLoading: true,
|
|
37
76
|
error: false,
|
|
38
77
|
userDetails: {}
|
|
39
|
-
};
|
|
78
|
+
});
|
|
40
79
|
}
|
|
41
80
|
|
|
42
81
|
if (action.type === receiveUserDetailsType) {
|
|
43
82
|
currentUserDetails = JSON.parse(action.userDetails);
|
|
44
|
-
return {
|
|
83
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
45
84
|
userDetails: currentUserDetails,
|
|
46
85
|
isLoading: false
|
|
47
|
-
};
|
|
86
|
+
});
|
|
48
87
|
}
|
|
49
88
|
|
|
50
89
|
return state;
|
|
@@ -11,39 +11,53 @@ var _RestUtils = require("../RestUtils");
|
|
|
11
11
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
if (diff >= 57) {
|
|
30
|
-
console.log("Refreshing Token AT [" + diff + "]");
|
|
31
|
-
let refreshUrl = "".concat(url, "?refreshToken=").concat(refreshToken, "&username=").concat(username);
|
|
32
|
-
(0, _RestUtils.sendRequest)(refreshUrl, response => {
|
|
33
|
-
sessionStorage.setItem(ACCESS_TOKEN_PROPERTY, response.accessToken);
|
|
34
|
-
sessionStorage.setItem(ID_TOKEN_PROPERTY, response.idToken);
|
|
35
|
-
sessionStorage.setItem(LAST_LOGIN, new Date().getTime());
|
|
36
|
-
}, e => {
|
|
37
|
-
console.error('Error refreshing token');
|
|
38
|
-
}, false);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}, MINUTE);
|
|
14
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
15
|
+
|
|
16
|
+
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); } }
|
|
17
|
+
|
|
18
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
19
|
+
|
|
20
|
+
var MINUTE = 60000;
|
|
21
|
+
var ACCESS_TOKEN_PROPERTY = "accessToken";
|
|
22
|
+
var LAST_LOGIN = "lastLogin";
|
|
23
|
+
var ID_TOKEN_PROPERTY = "idToken";
|
|
24
|
+
var REFRESH_TOKEN_PROPERTY = "refreshToken";
|
|
25
|
+
|
|
26
|
+
var TokenManager = /*#__PURE__*/function () {
|
|
27
|
+
function TokenManager() {
|
|
28
|
+
_classCallCheck(this, TokenManager);
|
|
42
29
|
}
|
|
43
30
|
|
|
44
|
-
|
|
31
|
+
_createClass(TokenManager, [{
|
|
32
|
+
key: "startTokenRefreshMonitor",
|
|
33
|
+
value: function startTokenRefreshMonitor(url, username) {
|
|
34
|
+
setInterval(function () {
|
|
35
|
+
var lastLogin = sessionStorage.getItem(LAST_LOGIN);
|
|
36
|
+
var refreshToken = sessionStorage.getItem(REFRESH_TOKEN_PROPERTY);
|
|
37
|
+
|
|
38
|
+
if (!_Utils.default.isNull(lastLogin) && !_Utils.default.isNull(refreshToken)) {
|
|
39
|
+
var diff = (new Date().getTime() - parseFloat(lastLogin)) / MINUTE;
|
|
40
|
+
|
|
41
|
+
if (diff >= 57) {
|
|
42
|
+
console.log("Refreshing Token AT [" + diff + "]");
|
|
43
|
+
var refreshUrl = "".concat(url, "?refreshToken=").concat(refreshToken, "&username=").concat(username);
|
|
44
|
+
(0, _RestUtils.sendRequest)(refreshUrl, function (response) {
|
|
45
|
+
sessionStorage.setItem(ACCESS_TOKEN_PROPERTY, response.accessToken);
|
|
46
|
+
sessionStorage.setItem(ID_TOKEN_PROPERTY, response.idToken);
|
|
47
|
+
sessionStorage.setItem(LAST_LOGIN, new Date().getTime());
|
|
48
|
+
}, function (e) {
|
|
49
|
+
console.error('Error refreshing token');
|
|
50
|
+
}, false);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}, MINUTE);
|
|
54
|
+
}
|
|
55
|
+
}]);
|
|
56
|
+
|
|
57
|
+
return TokenManager;
|
|
58
|
+
}();
|
|
45
59
|
|
|
46
|
-
|
|
60
|
+
var instance = new TokenManager();
|
|
47
61
|
Object.freeze(instance);
|
|
48
62
|
var _default = instance;
|
|
49
63
|
exports.default = _default;
|
package/dist/theme-default.js
CHANGED
|
@@ -11,7 +11,7 @@ var _colors = require("material-ui/styles/colors");
|
|
|
11
11
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
var themeDefault = (0, _getMuiTheme.default)({
|
|
15
15
|
palette: {},
|
|
16
16
|
appBar: {
|
|
17
17
|
height: 57,
|