@agilemotion/oui-react-js 1.6.0 → 1.6.2

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.
Files changed (229) hide show
  1. package/dist/ApplicationManager.js +698 -421
  2. package/dist/BasicApp.js +5 -5
  3. package/dist/BasicAppHome.js +55 -26
  4. package/dist/DynamicJS.js +147 -65
  5. package/dist/InteractionPortalApp.css +1 -1
  6. package/dist/InteractionPortalApp.js +5 -5
  7. package/dist/InteractionPortalAppHome.js +65 -18
  8. package/dist/InteractionPortalApp_old.js +107 -61
  9. package/dist/RestUtils.js +339 -287
  10. package/dist/TypedValue.js +18 -15
  11. package/dist/Utils.js +375 -276
  12. package/dist/WithRouter.js +6 -6
  13. package/dist/assets/jss/components/authNavbarStyle.js +166 -164
  14. package/dist/assets/jss/components/buttonStyle.js +1 -1
  15. package/dist/assets/jss/components/cardAvatarStyle.js +1 -1
  16. package/dist/assets/jss/components/cardBodyStyle.js +1 -1
  17. package/dist/assets/jss/components/cardFooterStyle.js +1 -1
  18. package/dist/assets/jss/components/cardHeaderStyle.js +13 -13
  19. package/dist/assets/jss/components/cardIconStyle.js +1 -1
  20. package/dist/assets/jss/components/cardStyle.js +1 -1
  21. package/dist/assets/jss/components/cardTextStyle.js +1 -1
  22. package/dist/assets/jss/components/customDropdownStyle.js +168 -169
  23. package/dist/assets/jss/components/customInputStyle.js +9 -3
  24. package/dist/assets/jss/components/dropdownStyle.js +69 -69
  25. package/dist/assets/jss/components/footerStyle.js +19 -13
  26. package/dist/assets/jss/components/headerLinksStyle.js +45 -48
  27. package/dist/assets/jss/components/headerStyle.js +68 -65
  28. package/dist/assets/jss/components/navbarLinksStyle.js +66 -77
  29. package/dist/assets/jss/components/navbarStyle.js +79 -76
  30. package/dist/assets/jss/components/sidebarStyle.js +436 -436
  31. package/dist/assets/jss/components/typographyStyle.js +9 -3
  32. package/dist/assets/jss/rootStyle.js +96 -81
  33. package/dist/assets/jss/views/layoutStyle.js +44 -41
  34. package/dist/assets/jss/views/loginBasicStyle.js +1 -1
  35. package/dist/assets/jss/views/loginBusinessPortalStyle.js +1 -1
  36. package/dist/assets/jss/views/loginStyle.js +82 -77
  37. package/dist/components/AlertBar.js +50 -17
  38. package/dist/components/AlertItem.js +35 -12
  39. package/dist/components/AlertTemplate.js +30 -29
  40. package/dist/components/Button.js +62 -34
  41. package/dist/components/Calendar.js +140 -91
  42. package/dist/components/ConfirmationDialog.js +36 -11
  43. package/dist/components/DataGrid.js +512 -270
  44. package/dist/components/DataGridColumn.js +47 -22
  45. package/dist/components/DataGridFilter.js +186 -105
  46. package/dist/components/DataGridHeading.js +50 -32
  47. package/dist/components/Dialog.js +90 -35
  48. package/dist/components/DocumentTemplateDesigner.js +34 -16
  49. package/dist/components/DocumentTemplateDesignerComponent.css +0 -157
  50. package/dist/components/DocumentTemplateDesignerComponent.js +118 -62
  51. package/dist/components/DocumentTemplatePlaceholderDialog.js +52 -30
  52. package/dist/components/DocumentViewer.js +34 -18
  53. package/dist/components/DocumentViewerComponent.js +26 -9
  54. package/dist/components/ElementResizeHandler.js +229 -207
  55. package/dist/components/FileThumb.js +32 -10
  56. package/dist/components/Graph.js +153 -85
  57. package/dist/components/GraphNode.js +58 -38
  58. package/dist/components/HtmlPanel.js +67 -39
  59. package/dist/components/Icon.js +206 -166
  60. package/dist/components/LoadingIndicator.js +3 -3
  61. package/dist/components/LottieIcon.js +1 -1
  62. package/dist/components/PopupView.js +39 -19
  63. package/dist/components/Portlet.js +35 -19
  64. package/dist/components/RegularButton.js +28 -32
  65. package/dist/components/SignaturePanel.js +37 -17
  66. package/dist/components/SocketManager.js +178 -119
  67. package/dist/components/StepperTitleBar.js +62 -42
  68. package/dist/components/TabPage.js +30 -25
  69. package/dist/components/TabPanel.js +86 -33
  70. package/dist/components/TableCellContent.js +51 -32
  71. package/dist/components/TemplateDesigner.js +173 -121
  72. package/dist/components/TemplateItemEventHandler.js +335 -221
  73. package/dist/components/TemplateTable.js +183 -118
  74. package/dist/components/TitleBar.js +26 -11
  75. package/dist/components/Toolbar.js +67 -38
  76. package/dist/components/Tooltip.js +43 -35
  77. package/dist/components/Tree.js +85 -44
  78. package/dist/components/UseIsVisible.js +25 -4
  79. package/dist/components/card/Card.js +27 -33
  80. package/dist/components/card/CardAvatar.js +20 -19
  81. package/dist/components/card/CardBody.js +24 -27
  82. package/dist/components/card/CardFooter.js +23 -24
  83. package/dist/components/card/CardHeader.js +24 -27
  84. package/dist/components/card/CardIcon.js +17 -13
  85. package/dist/components/card/CardText.js +17 -13
  86. package/dist/components/customInput/CustomInput.js +22 -36
  87. package/dist/components/dashboard/{BasicBusinessAppDashboard.js → FoldingSideTabDashboard.js} +111 -63
  88. package/dist/components/dashboard/SideMenuModuleDashboard.css +60 -0
  89. package/dist/components/dashboard/SideMenuModuleDashboard.js +423 -0
  90. package/dist/components/dashboard/TopMenuModuleDashboard.js +138 -0
  91. package/dist/components/dashboard/components/Header.js +29 -12
  92. package/dist/components/dashboard/components/LeftDrawer.js +3 -5
  93. package/dist/components/dashboard/components/UserIdentity.js +2 -2
  94. package/dist/components/dashboard/components/blackDashboard/fixedPlugin/FixedPlugin.js +131 -87
  95. package/dist/components/dashboard/components/blackDashboard/sidebar/FoldingTabSidebar.js +488 -0
  96. package/dist/components/dashboard/components/blackDashboard/sidebar/ModuleMenu.js +64 -0
  97. package/dist/components/dashboard/components/blackDashboard/sidebar/ModuleMenuSidebar.css +65 -0
  98. package/dist/components/dashboard/components/blackDashboard/sidebar/ModuleMenuSidebar.js +556 -0
  99. package/dist/components/dashboard/components/portal/Timeline.js +1 -1
  100. package/dist/components/dashboard/components/portal/Workspace.js +5 -11
  101. package/dist/components/footer/Footer.js +31 -24
  102. package/dist/components/footer/HomeFooter.js +68 -34
  103. package/dist/components/form/AddressSearch.js +78 -42
  104. package/dist/components/form/AutoComplete.js +136 -55
  105. package/dist/components/form/BaseField.js +108 -56
  106. package/dist/components/form/Checkbox.js +10 -8
  107. package/dist/components/form/DatePicker.js +47 -25
  108. package/dist/components/form/FieldSet.js +217 -84
  109. package/dist/components/form/Form.js +334 -200
  110. package/dist/components/form/GridField.js +185 -82
  111. package/dist/components/form/IconField.js +9 -7
  112. package/dist/components/form/ImageEditor.js +141 -92
  113. package/dist/components/form/LabelField.js +12 -10
  114. package/dist/components/form/LookupField.js +54 -32
  115. package/dist/components/form/MultiFileUploadField.js +101 -67
  116. package/dist/components/form/RadioGroup.js +33 -16
  117. package/dist/components/form/Section.js +84 -34
  118. package/dist/components/form/SelectItem.js +55 -33
  119. package/dist/components/form/SignatureTemplateDesignerField.js +11 -9
  120. package/dist/components/form/Switch.js +10 -8
  121. package/dist/components/form/TextField.js +34 -16
  122. package/dist/components/form/TimePicker.js +19 -15
  123. package/dist/components/form/TransferList.js +153 -75
  124. package/dist/components/form/UploadField.js +183 -128
  125. package/dist/components/grid/GridContainer.js +12 -8
  126. package/dist/components/grid/GridItem.js +12 -8
  127. package/dist/components/layout/CollapsiblePanel.js +44 -18
  128. package/dist/components/layout/Layout.js +81 -40
  129. package/dist/components/layout/VC.css +1 -1
  130. package/dist/components/layout/View.js +136 -62
  131. package/dist/components/layout/ViewContainer.js +13 -11
  132. package/dist/components/layout/ViewPort.js +25 -10
  133. package/dist/components/layout/Window.js +87 -53
  134. package/dist/components/layout/WindowViewPort.js +38 -16
  135. package/dist/components/media/ClosablePanel.js +7 -7
  136. package/dist/components/media/LobbyWaitingList.js +7 -9
  137. package/dist/components/media/MediaSoupHelper.js +379 -187
  138. package/dist/components/media/SideBarContent.js +22 -14
  139. package/dist/components/media/SocketRequest.js +5 -1
  140. package/dist/components/media/SocketResponse.js +5 -1
  141. package/dist/components/media/Timer.js +35 -15
  142. package/dist/components/media/Toolbar.css +5 -0
  143. package/dist/components/media/Toolbar.js +220 -102
  144. package/dist/components/media/ToolbarButton.js +82 -33
  145. package/dist/components/media/Toolbar_bck.js +142 -70
  146. package/dist/components/media/Tracks.js +31 -28
  147. package/dist/components/media/TrainingRoom.js +284 -121
  148. package/dist/components/media/Transports.js +27 -24
  149. package/dist/components/media/VCEventManager.js +95 -31
  150. package/dist/components/media/VCEventType.js +5 -1
  151. package/dist/components/media/VCParticipantList.js +40 -14
  152. package/dist/components/media/VCParticipantListItem.js +92 -41
  153. package/dist/components/media/VCRoom.js +29 -11
  154. package/dist/components/media/VCRoomParticipant.js +488 -242
  155. package/dist/components/media/VCRoomRecorder.js +236 -175
  156. package/dist/components/media/VCRoomWorkspace.js +505 -245
  157. package/dist/components/media/Video.js +89 -25
  158. package/dist/components/media/VideoPlayer.js +56 -22
  159. package/dist/components/media/chat/ChatRoom.js +255 -132
  160. package/dist/components/media/chat/ChatRoomItem.js +35 -14
  161. package/dist/components/media/chat/ChatRoomList.js +43 -13
  162. package/dist/components/menu/CollapsibleMenu.js +39 -20
  163. package/dist/components/menu/MenuBars.js +81 -48
  164. package/dist/components/menu/MenuButton.js +95 -60
  165. package/dist/components/menu/MenuItem.js +28 -9
  166. package/dist/components/menu/MenuLink.js +12 -10
  167. package/dist/components/menu/PopupMenu.js +16 -12
  168. package/dist/components/navbars/AuthNavbar.js +27 -18
  169. package/dist/components/navbars/HomeNavbar.js +243 -194
  170. package/dist/components/navbars/PortalNavbar.js +50 -26
  171. package/dist/components/signatures/AgilitySignaturePanel.js +96 -39
  172. package/dist/components/signatures/AlertItem.js +36 -13
  173. package/dist/components/signatures/Card.js +4 -4
  174. package/dist/components/signatures/DocumentContainer.js +141 -57
  175. package/dist/components/signatures/ImageSignatureInput.js +90 -59
  176. package/dist/components/signatures/MenuButton.js +53 -33
  177. package/dist/components/signatures/Prompt.js +26 -5
  178. package/dist/components/signatures/ResponsiveTable.js +302 -197
  179. package/dist/components/signatures/SearchView.js +77 -36
  180. package/dist/components/signatures/SignatorySearch.js +30 -10
  181. package/dist/components/signatures/SignatorySearchForm.js +35 -18
  182. package/dist/components/signatures/SignatureInput.js +56 -26
  183. package/dist/components/signatures/SignatureInputProps.js +107 -55
  184. package/dist/components/signatures/SignatureTemplateDesigner.js +340 -235
  185. package/dist/components/signatures/Toolbar.js +135 -94
  186. package/dist/components/signatures/ViewUtils.js +273 -224
  187. package/dist/components/typography/Danger.js +3 -5
  188. package/dist/components/typography/Info.js +3 -5
  189. package/dist/components/typography/Link.js +3 -5
  190. package/dist/event/ActionHandlers.js +57 -43
  191. package/dist/event/Event.js +16 -13
  192. package/dist/event/EventListener.js +39 -36
  193. package/dist/event/EventType.js +5 -1
  194. package/dist/event/LoadDataActionHandler.js +20 -8
  195. package/dist/event/Observable.js +323 -142
  196. package/dist/event/RouteActionHandler.js +139 -125
  197. package/dist/event/ScriptActionHandler.js +20 -8
  198. package/dist/event/ServiceCallActionHandler.js +51 -39
  199. package/dist/event/SignalGraphActionHandler.js +19 -7
  200. package/dist/js/Addresses.js +38 -24
  201. package/dist/js/Calendar.js +168 -161
  202. package/dist/js/DynamicLib.js +14 -11
  203. package/dist/js/Media.js +213 -120
  204. package/dist/js/Validators.js +6 -5
  205. package/dist/js/Windows.js +48 -47
  206. package/dist/redux/store/ConfigureStore.js +17 -9
  207. package/dist/redux/store/DashboardStore.js +110 -43
  208. package/dist/redux/store/History.js +1 -1
  209. package/dist/redux/store/SecurityStore.js +59 -20
  210. package/dist/security/TokenManager.js +44 -30
  211. package/dist/theme-default.js +1 -1
  212. package/dist/view/Dashboard.js +230 -137
  213. package/dist/view/PortalDashboard.js +5 -5
  214. package/dist/view/Settings.js +4 -2
  215. package/dist/view/Views.js +27 -14
  216. package/dist/view/security/ChangePasswordBasic.js +97 -40
  217. package/dist/view/security/ForgotPassword.js +59 -22
  218. package/dist/view/security/ForgotPasswordBasic.js +62 -21
  219. package/dist/view/security/Login.js +64 -24
  220. package/dist/view/security/LoginBasic.js +65 -26
  221. package/dist/view/security/LoginInteractionPortal.js +62 -25
  222. package/dist/view/security/ResetPassword.js +65 -23
  223. package/dist/view/security/ResetPasswordBasic.js +91 -37
  224. package/dist/view/security/Security.js +12 -12
  225. package/package.json +1 -2
  226. package/dist/components/dashboard/BusinessPortalAppDashboard.js +0 -154
  227. package/dist/components/dashboard/components/blackDashboard/sidebar/Sidebar.js +0 -447
  228. /package/dist/components/dashboard/{BusinessPortalAppDashboard.css → TopMenuModuleDashboard.css} +0 -0
  229. /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
- const requestType = 'REQUEST';
11
- const receiveDashboardSettingsType = 'RECEIVE_DASHBOARD_SETTINGS';
12
- const activeRouteMenu = 'ACTIVE_ROUTE_MENU';
13
- const secondaryThemeColor = 'SECONDARY_THEME_COLOR';
14
- const initialState = {
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
- let currentDashboardSettings = {};
25
- const actionCreators = {
26
- getDashboardSettings: url => async dispatch => {
27
- dispatch({
28
- type: requestType
29
- });
30
- (0, _RestUtils.sendRequest)(url, response => {
31
- dispatch({
32
- type: receiveDashboardSettingsType,
33
- dashboardSettings: response,
34
- error: false
35
- });
36
- }, () => {
37
- dispatch({
38
- type: receiveDashboardSettingsType,
39
- dashboardSettings: null,
40
- error: true
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 => async dispatch => {
45
- dispatch({
46
- type: activeRouteMenu,
47
- activeRouteMenu: route
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 => async dispatch => {
51
- dispatch({
52
- type: secondaryThemeColor,
53
- secondaryThemeColor: secondaryColor
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
- const reducer = (state, action) => {
126
+ var reducer = function reducer(state, action) {
60
127
  state = state || initialState;
61
128
 
62
129
  if (action.type === requestType) {
63
- return { ...state,
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 { ...state,
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 { ...state,
147
+ return _objectSpread(_objectSpread({}, state), {}, {
81
148
  activeRouteMenu: action.activeRouteMenu
82
- };
149
+ });
83
150
  }
84
151
 
85
152
  if (action.type === secondaryThemeColor) {
86
- return { ...state,
153
+ return _objectSpread(_objectSpread({}, state), {}, {
87
154
  secondaryThemeColor: action.secondaryThemeColor
88
- };
155
+ });
89
156
  }
90
157
 
91
158
  return state;
@@ -7,6 +7,6 @@ exports.default = void 0;
7
7
 
8
8
  var _history = require("history");
9
9
 
10
- const history = (0, _history.createBrowserHistory)();
10
+ var history = (0, _history.createBrowserHistory)();
11
11
  var _default = history;
12
12
  exports.default = _default;
@@ -4,47 +4,86 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.reducer = exports.actionCreators = void 0;
7
- const requestType = 'REQUEST';
8
- const receiveUserDetailsType = 'RECEIVE_USER_DETAILS';
9
- const initialState = {
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
- let currentUserDetails = {};
16
- const actionCreators = {
17
- login: (url, username, password) => async dispatch => {
18
- dispatch({
19
- type: requestType
20
- });
21
- const response = await fetch(url);
22
- const userDetails = await response.json();
23
- dispatch({
24
- type: receiveUserDetailsType,
25
- userDetails
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
- const reducer = (state, action) => {
70
+ var reducer = function reducer(state, action) {
32
71
  state = state || initialState;
33
72
 
34
73
  if (action.type === requestType) {
35
- return { ...state,
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 { ...state,
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
- const MINUTE = 60000;
15
- const ACCESS_TOKEN_PROPERTY = "accessToken";
16
- const LAST_LOGIN = "lastLogin";
17
- const ID_TOKEN_PROPERTY = "idToken";
18
- const REFRESH_TOKEN_PROPERTY = "refreshToken";
19
-
20
- class TokenManager {
21
- startTokenRefreshMonitor(url, username) {
22
- setInterval(function () {
23
- let lastLogin = sessionStorage.getItem(LAST_LOGIN);
24
- let refreshToken = sessionStorage.getItem(REFRESH_TOKEN_PROPERTY);
25
-
26
- if (!_Utils.default.isNull(lastLogin) && !_Utils.default.isNull(refreshToken)) {
27
- let diff = (new Date().getTime() - parseFloat(lastLogin)) / MINUTE;
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
- const instance = new TokenManager();
60
+ var instance = new TokenManager();
47
61
  Object.freeze(instance);
48
62
  var _default = instance;
49
63
  exports.default = _default;
@@ -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
- const themeDefault = (0, _getMuiTheme.default)({
14
+ var themeDefault = (0, _getMuiTheme.default)({
15
15
  palette: {},
16
16
  appBar: {
17
17
  height: 57,