@agilemotion/oui-react-js 1.3.8 → 1.3.9

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 (213) hide show
  1. package/README.TXT +1 -0
  2. package/dist/ApplicationContext.js +161 -284
  3. package/dist/BasicApp.js +1 -1
  4. package/dist/BasicAppHome.js +17 -4
  5. package/dist/BusinessPortalApp.js +1 -1
  6. package/dist/BusinessPortalAppHome.js +10 -39
  7. package/dist/DynamicJS.js +20 -52
  8. package/dist/RestUtils.js +83 -108
  9. package/dist/Utils.js +36 -30
  10. package/dist/assets/jss/components/authNavbarStyle.js +34 -35
  11. package/dist/assets/jss/components/cardHeaderStyle.js +12 -12
  12. package/dist/assets/jss/components/customDropdownStyle.js +26 -26
  13. package/dist/assets/jss/components/customInputStyle.js +2 -8
  14. package/dist/assets/jss/components/dropdownStyle.js +10 -15
  15. package/dist/assets/jss/components/footerStyle.js +12 -18
  16. package/dist/assets/jss/components/headerLinksStyle.js +7 -13
  17. package/dist/assets/jss/components/headerStyle.js +24 -25
  18. package/dist/assets/jss/components/navbarLinksStyle.js +7 -13
  19. package/dist/assets/jss/components/navbarStyle.js +24 -25
  20. package/dist/assets/jss/components/sidebarStyle.js +41 -43
  21. package/dist/assets/jss/components/typographyStyle.js +2 -8
  22. package/dist/assets/jss/rootStyle.js +32 -47
  23. package/dist/assets/jss/views/layoutStyle.js +6 -11
  24. package/dist/assets/jss/views/loginStyle.js +4 -10
  25. package/dist/assets/lotties/call-loading.json +1 -0
  26. package/dist/assets/lotties/calling-2.json +1 -0
  27. package/dist/assets/lotties/calling.json +1 -0
  28. package/dist/assets/lotties/calling2.json +1 -0
  29. package/dist/assets/lotties/chat.json +1 -0
  30. package/dist/assets/lotties/join.json +1 -0
  31. package/dist/assets/lotties/loading.json +1 -0
  32. package/dist/assets/lotties/msg2.json +1 -0
  33. package/dist/assets/lotties/recording.json +1 -0
  34. package/dist/assets/lotties/waiting.json +1 -0
  35. package/dist/assets/scss/black-dashboard-react/bootstrap/_card.scss +5 -5
  36. package/dist/assets/scss/black-dashboard-react/bootstrap/_carousel.scss +2 -2
  37. package/dist/assets/scss/black-dashboard-react/bootstrap/_custom-forms.scss +3 -3
  38. package/dist/assets/scss/black-dashboard-react/bootstrap/_functions.scss +1 -1
  39. package/dist/assets/scss/black-dashboard-react/bootstrap/_images.scss +1 -1
  40. package/dist/assets/scss/black-dashboard-react/bootstrap/_jumbotron.scss +1 -1
  41. package/dist/assets/scss/black-dashboard-react/bootstrap/_popover.scss +7 -5
  42. package/dist/assets/scss/black-dashboard-react/bootstrap/_tooltip.scss +4 -4
  43. package/dist/assets/scss/black-dashboard-react/bootstrap/_variables.scss +5 -5
  44. package/dist/assets/scss/black-dashboard-react/bootstrap/mixins/_grid-framework.scss +2 -2
  45. package/dist/assets/scss/black-dashboard-react/bootstrap/mixins/_grid.scss +11 -9
  46. package/dist/assets/scss/black-dashboard-react/bootstrap/utilities/_embed.scss +6 -4
  47. package/dist/assets/scss/black-dashboard-react/custom/_variables.scss +1 -1
  48. package/dist/components/AlertBar.js +39 -80
  49. package/dist/components/AlertItem.js +4 -26
  50. package/dist/components/Button.js +24 -36
  51. package/dist/components/Calendar.js +478 -0
  52. package/dist/components/Calender.css +244 -0
  53. package/dist/components/ConfirmationDialog.js +5 -29
  54. package/dist/components/DataGrid.js +169 -338
  55. package/dist/components/DataGridColumn.js +5 -28
  56. package/dist/components/DataGridFilter.js +46 -114
  57. package/dist/components/DataGridHeading.js +11 -19
  58. package/dist/components/Dialog.js +27 -121
  59. package/dist/components/DocumentViewer.js +8 -34
  60. package/dist/components/DocumentViewerComponent.js +2 -20
  61. package/dist/components/FileThumb.js +115 -0
  62. package/dist/components/Graph.js +25 -75
  63. package/dist/components/GraphNode.js +4 -21
  64. package/dist/components/HtmlPanel.js +59 -78
  65. package/dist/components/Icon.js +99 -1
  66. package/dist/components/LoadingIndicator.js +4 -4
  67. package/dist/components/LottieIcon.js +134 -0
  68. package/dist/components/PopupView.js +2 -20
  69. package/dist/components/RegularButton.js +15 -19
  70. package/dist/components/SignaturePanel.js +9 -40
  71. package/dist/components/SocketManager.js +170 -0
  72. package/dist/components/StepperTitleBar.js +30 -56
  73. package/dist/components/TabPage.js +6 -9
  74. package/dist/components/TabPanel.js +41 -98
  75. package/dist/components/TableCellContent.js +30 -38
  76. package/dist/components/TemplateDesigner.js +107 -151
  77. package/dist/components/TemplateItemEventHandler.js +33 -100
  78. package/dist/components/TemplateTable.js +6 -42
  79. package/dist/components/TitleBar.js +35 -52
  80. package/dist/components/Toolbar.js +33 -179
  81. package/dist/components/Tree.js +27 -64
  82. package/dist/components/card/Card.js +16 -20
  83. package/dist/components/card/CardAvatar.js +9 -13
  84. package/dist/components/card/CardBody.js +13 -17
  85. package/dist/components/card/CardFooter.js +12 -16
  86. package/dist/components/card/CardHeader.js +13 -17
  87. package/dist/components/card/CardIcon.js +6 -10
  88. package/dist/components/card/CardText.js +6 -10
  89. package/dist/components/customInput/CustomInput.js +12 -10
  90. package/dist/components/dashboard/BasicBusinessAppDashboard.js +79 -155
  91. package/dist/components/dashboard/BusinessPortalAppDashboard.js +30 -75
  92. package/dist/components/dashboard/components/Header.js +8 -25
  93. package/dist/components/dashboard/components/LeftDrawer.js +3 -1
  94. package/dist/components/dashboard/components/blackDashboard/fixedPlugin/FixedPlugin.js +1 -1
  95. package/dist/components/dashboard/components/blackDashboard/sidebar/Sidebar.js +138 -30
  96. package/dist/components/footer/Footer.js +6 -18
  97. package/dist/components/form/AddressSearch.js +32 -66
  98. package/dist/components/form/AutoComplete.js +160 -0
  99. package/dist/components/form/BaseField.js +66 -96
  100. package/dist/components/form/DatePicker.js +3 -21
  101. package/dist/components/form/FieldSet.js +158 -180
  102. package/dist/components/form/Form.css +1 -1
  103. package/dist/components/form/Form.js +137 -471
  104. package/dist/components/form/GridField.js +46 -146
  105. package/dist/components/form/IconField.js +35 -0
  106. package/dist/components/form/ImageEditor.js +19 -57
  107. package/dist/components/form/LookupField.js +8 -29
  108. package/dist/components/form/MultiFileUploadField.js +186 -0
  109. package/dist/components/form/RadioGroup.js +1 -16
  110. package/dist/components/form/Section.js +31 -92
  111. package/dist/components/form/SelectItem.js +14 -33
  112. package/dist/components/form/SignatureTemplateDesignerField.js +0 -1
  113. package/dist/components/form/Switch.js +53 -0
  114. package/dist/components/form/TextField.js +10 -17
  115. package/dist/components/form/TimePicker.js +7 -1
  116. package/dist/components/form/TransferList.css +2 -2
  117. package/dist/components/form/TransferList.js +67 -125
  118. package/dist/components/form/UploadField.js +27 -79
  119. package/dist/components/form/fieldset.css +8 -0
  120. package/dist/components/grid/GridContainer.js +5 -9
  121. package/dist/components/grid/GridItem.js +5 -9
  122. package/dist/components/layout/CollapsiblePanel.js +11 -33
  123. package/dist/components/layout/Layout.js +175 -290
  124. package/dist/components/layout/VC.css +17 -0
  125. package/dist/components/layout/View.css +17 -1
  126. package/dist/components/layout/View.js +77 -194
  127. package/dist/components/loader.css +1 -1
  128. package/dist/components/media/ClosablePanel.css +37 -0
  129. package/dist/components/media/ClosablePanel.js +53 -0
  130. package/dist/components/media/LobbyWaitingList.js +91 -0
  131. package/dist/components/media/MediaSoupHelper.js +223 -0
  132. package/dist/components/media/Recorder.js +235 -0
  133. package/dist/components/media/SideBarContent.css +54 -0
  134. package/dist/components/media/SideBarContent.js +46 -0
  135. package/dist/components/media/SocketRequest.js +20 -0
  136. package/dist/components/media/SocketResponse.js +16 -0
  137. package/dist/components/media/Timer.css +30 -0
  138. package/dist/components/media/Timer.js +88 -0
  139. package/dist/components/media/Toolbar.css +20 -0
  140. package/dist/components/media/Toolbar.js +470 -0
  141. package/dist/components/media/Tracks.js +39 -0
  142. package/dist/components/media/TrainingRoom.js +531 -0
  143. package/dist/components/media/Transports.js +35 -0
  144. package/dist/components/media/VCEventManager.js +74 -0
  145. package/dist/components/media/VCEventType.js +164 -0
  146. package/dist/components/media/VCParticipantList.css +72 -0
  147. package/dist/components/media/VCParticipantList.js +56 -0
  148. package/dist/components/media/VCParticipantListItem.css +73 -0
  149. package/dist/components/media/VCParticipantListItem.js +319 -0
  150. package/dist/components/media/VCRoom.css +42 -0
  151. package/dist/components/media/VCRoom.js +90 -0
  152. package/dist/components/media/VCRoomParticipant.css +25 -0
  153. package/dist/components/media/VCRoomParticipant.js +806 -0
  154. package/dist/components/media/VCRoomWorkspace.css +86 -0
  155. package/dist/components/media/VCRoomWorkspace.js +653 -0
  156. package/dist/components/media/Video.css +4 -0
  157. package/dist/components/media/Video.js +131 -0
  158. package/dist/components/media/chat/ChatRoom.js +926 -0
  159. package/dist/components/media/chat/ChatRoomItem.js +83 -0
  160. package/dist/components/media/chat/ChatRoomList.js +78 -0
  161. package/dist/components/media/chat/ChatRooms.scss +567 -0
  162. package/dist/components/menu/CollapsibleMenu.js +2 -19
  163. package/dist/components/menu/MenuBars.js +6 -33
  164. package/dist/components/menu/MenuButton.js +7 -35
  165. package/dist/components/menu/MenuItem.js +3 -20
  166. package/dist/components/menu/MenuLink.js +18 -12
  167. package/dist/components/navbars/AuthNavbar.js +5 -18
  168. package/dist/components/navbars/HomeNavbar.js +3 -5
  169. package/dist/components/navbars/PortalNavbar.js +4 -22
  170. package/dist/components/signatures/AgilitySignaturePanel.js +35 -101
  171. package/dist/components/signatures/AlertItem.js +3 -24
  172. package/dist/components/signatures/DocumentContainer.js +47 -134
  173. package/dist/components/signatures/ImageSignatureInput.js +8 -35
  174. package/dist/components/signatures/MenuButton.js +1 -16
  175. package/dist/components/signatures/Prompt.js +3 -24
  176. package/dist/components/signatures/ResponsiveTable.js +42 -83
  177. package/dist/components/signatures/SearchView.js +13 -50
  178. package/dist/components/signatures/SignatorySearch.js +83 -99
  179. package/dist/components/signatures/SignatorySearchForm.js +11 -17
  180. package/dist/components/signatures/SignatureInput.js +15 -44
  181. package/dist/components/signatures/SignatureInputProps.js +18 -60
  182. package/dist/components/signatures/SignatureTemplateDesigner.js +147 -235
  183. package/dist/components/signatures/Toolbar.js +7 -34
  184. package/dist/components/signatures/ViewUtils.js +2 -6
  185. package/dist/components/typography/Danger.js +3 -1
  186. package/dist/components/typography/Info.js +3 -1
  187. package/dist/components/typography/Link.js +6 -2
  188. package/dist/event/ActionHandlers.js +3 -3
  189. package/dist/event/EventType.js +7 -1
  190. package/dist/event/LoadDataActionHandler.js +1 -1
  191. package/dist/event/Observable.js +56 -168
  192. package/dist/event/RouteActionHandler.js +45 -11
  193. package/dist/event/ServiceCallActionHandler.js +34 -24
  194. package/dist/js/Addresses.js +10 -8
  195. package/dist/js/Media.js +157 -0
  196. package/dist/redux/store/ConfigureStore.js +3 -9
  197. package/dist/redux/store/DashboardStore.js +42 -94
  198. package/dist/redux/store/SecurityStore.js +15 -50
  199. package/dist/view/Dashboard.js +242 -163
  200. package/dist/view/security/ChangePasswordBasic.js +23 -76
  201. package/dist/view/security/ForgotPassword.js +9 -42
  202. package/dist/view/security/ForgotPasswordBasic.js +8 -41
  203. package/dist/view/security/Login.js +11 -47
  204. package/dist/view/security/LoginBasic.js +8 -41
  205. package/dist/view/security/LoginBusinessPortal.js +8 -41
  206. package/dist/view/security/ResetPassword.js +9 -47
  207. package/dist/view/security/ResetPasswordBasic.js +21 -71
  208. package/dist/view/security/Security.js +1 -0
  209. package/package.json +29 -13
  210. package/README.md +0 -1623
  211. package/dist/components/dashboard/BasicApp.js +0 -140
  212. package/dist/components/navbars/NavbarLinks.js +0 -212
  213. package/dist/components/signatures/OLD.js +0 -1138
package/dist/BasicApp.js CHANGED
@@ -29,7 +29,7 @@ var _ThemeProvider = _interopRequireDefault(require("@material-ui/styles/ThemePr
29
29
 
30
30
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
31
31
 
32
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
32
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
33
33
 
34
34
  function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
35
35
 
@@ -31,9 +31,19 @@ var _ThemeProvider = _interopRequireDefault(require("@material-ui/styles/ThemePr
31
31
 
32
32
  var _RestUtils = require("./RestUtils");
33
33
 
34
+ var _SocketManager = _interopRequireDefault(require("./components/SocketManager"));
35
+
36
+ var _SocketRequest = _interopRequireDefault(require("./components/media/SocketRequest"));
37
+
38
+ var _Event = _interopRequireDefault(require("./event/Event"));
39
+
40
+ var _Observable = _interopRequireDefault(require("./event/Observable"));
41
+
42
+ var _EventType = _interopRequireDefault(require("./event/EventType"));
43
+
34
44
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
35
45
 
36
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
46
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
37
47
 
38
48
  function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
39
49
 
@@ -70,11 +80,12 @@ class BasicAppHome extends _react.Component {
70
80
 
71
81
  _ApplicationContext.default.setContextRoot(this.props.contextRoot);
72
82
 
73
- _ApplicationContext.default.setBaseApiUrl(this.props.baseApiUrl);
74
-
75
83
  _ApplicationContext.default.setFilesApiPath(this.props.filesApiPath);
76
84
 
77
- this.props.getDashboardSettings(location + this.props.contextRoot + this.props.baseApiUrl + "/ui/setup");
85
+ this.props.getDashboardSettings(location + this.props.contextRoot + "/system/api/v1/setup");
86
+ (0, _RestUtils.sendRequest)(location + _ApplicationContext.default.getContextRoot() + '/auth/api/v1/user/avatar/getId', response => {
87
+ sessionStorage.setItem("userAvatarId", response);
88
+ }, e => {});
78
89
  }
79
90
 
80
91
  componentDidUpdate(prevProps) {
@@ -131,6 +142,8 @@ class BasicAppHome extends _react.Component {
131
142
 
132
143
  _ApplicationContext.default.clear();
133
144
 
145
+ _SocketManager.default.disconnect();
146
+
134
147
  this.props.history.push('/login');
135
148
  }, e => {
136
149
  console.error('Error loging out');
@@ -21,7 +21,7 @@ var _ChangePasswordBasic = _interopRequireDefault(require("./view/security/Chang
21
21
 
22
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
23
 
24
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
24
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
25
25
 
26
26
  function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
27
27
 
@@ -25,18 +25,6 @@ var _reactRouter = require("react-router");
25
25
 
26
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27
27
 
28
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
29
-
30
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
31
-
32
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
33
-
34
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
35
-
36
- function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
37
-
38
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
39
-
40
28
  const location = window.location.protocol + "//" + window.location.hostname;
41
29
 
42
30
  const status = response => {
@@ -54,30 +42,15 @@ const json = response => {
54
42
  };
55
43
 
56
44
  const BusinessPortalAppHome = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwardRef((props, ref) => {
57
- const _React$useState = _react.default.useState(null),
58
- _React$useState2 = _slicedToArray(_React$useState, 2),
59
- dashboardSettings = _React$useState2[0],
60
- setDashboardSettings = _React$useState2[1];
61
-
62
- const _React$useState3 = _react.default.useState(null),
63
- _React$useState4 = _slicedToArray(_React$useState3, 2),
64
- tokenRefreshMonitorStarted = _React$useState4[0],
65
- setTokenRefreshMonitorStarted = _React$useState4[1];
66
-
67
- const _React$useState5 = _react.default.useState(null),
68
- _React$useState6 = _slicedToArray(_React$useState5, 2),
69
- loadingColor = _React$useState6[0],
70
- setLoadingColor = _React$useState6[1];
71
-
72
- const _React$useState7 = _react.default.useState(false),
73
- _React$useState8 = _slicedToArray(_React$useState7, 2),
74
- hasClientError = _React$useState8[0],
75
- setHasClientError = _React$useState8[1];
76
-
77
- const _React$useState9 = _react.default.useState(location + props.contextRoot + props.implConfig.authUrl + "/user/avatar?" + "access_token=" + sessionStorage.getItem("accessToken") + "&idToken=" + sessionStorage.getItem("idToken")),
78
- _React$useState10 = _slicedToArray(_React$useState9, 2),
79
- avatarUrl = _React$useState10[0],
80
- setAvatarUrl = _React$useState10[1];
45
+ const [dashboardSettings, setDashboardSettings] = _react.default.useState(null);
46
+
47
+ const [tokenRefreshMonitorStarted, setTokenRefreshMonitorStarted] = _react.default.useState(null);
48
+
49
+ const [loadingColor, setLoadingColor] = _react.default.useState(null);
50
+
51
+ const [hasClientError, setHasClientError] = _react.default.useState(false);
52
+
53
+ const [avatarUrl, setAvatarUrl] = _react.default.useState(location + props.contextRoot + props.implConfig.authUrl + "/user/avatar?" + "access_token=" + sessionStorage.getItem("accessToken") + "&idToken=" + sessionStorage.getItem("idToken"));
81
54
 
82
55
  const history = (0, _reactRouter.useHistory)();
83
56
 
@@ -91,8 +64,6 @@ const BusinessPortalAppHome = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_re
91
64
 
92
65
  _ApplicationContext.default.setContextRoot(props.contextRoot);
93
66
 
94
- _ApplicationContext.default.setBaseApiUrl(props.implConfig.baseApiUrl);
95
-
96
67
  _ApplicationContext.default.setFilesApiPath(props.implConfig.filesApiPath);
97
68
 
98
69
  let cid = sessionStorage.getItem("cid");
@@ -101,7 +72,7 @@ const BusinessPortalAppHome = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_re
101
72
  cid = 'default';
102
73
  }
103
74
 
104
- (0, _reactPromiseTracker.trackPromise)(fetch(encodeURI(location + props.contextRoot + props.implConfig.baseApiUrl + "/ui/setup/" + cid), {
75
+ (0, _reactPromiseTracker.trackPromise)(fetch(encodeURI(location + props.contextRoot + "/system/api/v1/setup/" + cid), {
105
76
  method: 'GET',
106
77
  headers: {
107
78
  'Accept': 'application/json',
package/dist/DynamicJS.js CHANGED
@@ -11,16 +11,10 @@ var _Utils = _interopRequireDefault(require("./Utils"));
11
11
 
12
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
13
 
14
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
14
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
15
15
 
16
16
  function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
17
17
 
18
- function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
19
-
20
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
21
-
22
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
23
-
24
18
  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; }
25
19
 
26
20
  const TEMPLATE_REGEX = new RegExp('[@]{1}([#@]{1}{)(([a-zA-Z0-9_.[\\]]*)+){1}}((\\(([^)]*)\\))*)', 'g');
@@ -28,36 +22,31 @@ exports.TEMPLATE_REGEX = TEMPLATE_REGEX;
28
22
 
29
23
  class DynamicJS {
30
24
  constructor() {
25
+ _defineProperty(this, "removeKey", (k = "", {
26
+ [k]: _,
27
+ ...o
28
+ } = {}) => o);
29
+
30
+ _defineProperty(this, "removeKeys", (keys = [], o = {}) => o ? keys.reduce((r, k) => this.removeKey(k, r), o) : null);
31
+
31
32
  _defineProperty(this, "evaluateExpression", expression => {
32
33
  return _ApplicationContext.default.resolveExpressionValue(expression);
33
34
  });
34
35
 
35
36
  _defineProperty(this, "parseScript", (script, componentId, isScriptlet) => {
36
- let parsedScript = script.replace(/#this/g, '#' + componentId).replace(/isNull/g, 'this.isNull').replace(/\$application/g, _ApplicationContext.APP_VARIABLE).replace(/isEmpty/g, 'this.isEmpty');
37
+ let parsedScript = script.replace(/#this/g, '#' + componentId).replace(/isNull/g, 'this.isNull').replace(/removeKeys/g, 'this.removeKeys').replace(/\$application/g, _ApplicationContext.APP_VARIABLE).replace(/isEmpty/g, 'this.isEmpty');
37
38
  let matches = parsedScript.match(TEMPLATE_REGEX);
38
39
 
39
40
  if (!_Utils.default.isNull(matches)) {
40
41
  let expressions = [];
41
42
 
42
- var _iterator = _createForOfIteratorHelper(matches),
43
- _step;
44
-
45
- try {
46
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
47
- const match = _step.value;
48
-
49
- if (!expressions.includes(match.trim())) {
50
- expressions.push(match.trim());
51
- }
43
+ for (const match of matches) {
44
+ if (!expressions.includes(match.trim())) {
45
+ expressions.push(match.trim());
52
46
  }
53
- } catch (err) {
54
- _iterator.e(err);
55
- } finally {
56
- _iterator.f();
57
47
  }
58
48
 
59
- for (var _i = 0, _expressions = expressions; _i < _expressions.length; _i++) {
60
- const expression = _expressions[_i];
49
+ for (const expression of expressions) {
61
50
  var replaceRegex = new RegExp("".concat(expression), 'g');
62
51
  parsedScript = parsedScript.replace(replaceRegex, "this.evaluateExpression(\"".concat(expression, "\")"));
63
52
  }
@@ -85,9 +74,8 @@ class DynamicJS {
85
74
  return result;
86
75
  }
87
76
  } catch (e) {
88
- console.error("Error Executing script : " + name + " - " + parsedScript);
89
77
  console.error(e);
90
- throw e;
78
+ throw new Error("Error Executing script : " + parsedScript + " - " + e.message);
91
79
  }
92
80
 
93
81
  return null;
@@ -96,18 +84,8 @@ class DynamicJS {
96
84
  _defineProperty(this, "executeScriptObject", (name, script, componentId = null, valuesMap = {}, event = null) => {
97
85
  let scriptBody = '';
98
86
 
99
- var _iterator2 = _createForOfIteratorHelper(script.lines),
100
- _step2;
101
-
102
- try {
103
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
104
- const line = _step2.value;
105
- scriptBody += this.parseScriptLine(line, valuesMap);
106
- }
107
- } catch (err) {
108
- _iterator2.e(err);
109
- } finally {
110
- _iterator2.f();
87
+ for (const line of script.lines) {
88
+ scriptBody += this.parseScriptLine(line, valuesMap);
111
89
  }
112
90
 
113
91
  return this.executeScript(name, scriptBody, componentId, false, event);
@@ -138,20 +116,10 @@ class DynamicJS {
138
116
  if (!_Utils.default.isNull(valuesMap)) {
139
117
  const properties = Object.getOwnPropertyNames(valuesMap);
140
118
 
141
- var _iterator3 = _createForOfIteratorHelper(properties),
142
- _step3;
143
-
144
- try {
145
- for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
146
- const property = _step3.value;
147
- var replaceRegex = new RegExp("@{".concat(property, "}"), 'g');
148
- let propertyValue = valuesMap[property];
149
- parsedLine = parsedLine.replace(replaceRegex, propertyValue);
150
- }
151
- } catch (err) {
152
- _iterator3.e(err);
153
- } finally {
154
- _iterator3.f();
119
+ for (const property of properties) {
120
+ var replaceRegex = new RegExp("@{".concat(property, "}"), 'g');
121
+ let propertyValue = valuesMap[property];
122
+ parsedLine = parsedLine.replace(replaceRegex, propertyValue);
155
123
  }
156
124
  }
157
125
 
package/dist/RestUtils.js CHANGED
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.invokeRest = exports.invokeRpc = exports.download = exports.sendRequest = exports.postData = void 0;
6
+ exports.invokeRest = exports.invokeRpc = exports.download = exports.sendRequest = exports.postData = exports.location = void 0;
7
7
 
8
8
  var _Utils = _interopRequireDefault(require("./Utils"));
9
9
 
@@ -19,13 +19,8 @@ var _EventType = _interopRequireDefault(require("./event/EventType"));
19
19
 
20
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
21
 
22
- function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
23
-
24
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
25
-
26
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
27
-
28
- const location = window.location.protocol + "//" + window.location.hostname;
22
+ const location = window.location.protocol + '//' + window.location.hostname;
23
+ exports.location = location;
29
24
 
30
25
  const status = response => {
31
26
  if (response.ok) {
@@ -55,81 +50,71 @@ class RestUtils {
55
50
  let requestBody = null;
56
51
 
57
52
  if (!_Utils.default.isNull(service.parameters)) {
58
- let queryString = "";
59
- let pathParameters = "";
53
+ let queryString = '';
54
+ let pathParameters = '';
60
55
  let requestBodyParamFound = false;
61
56
 
62
- var _iterator = _createForOfIteratorHelper(service.parameters),
63
- _step;
64
-
65
- try {
66
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
67
- const parameter = _step.value;
68
-
69
- let parameterValue = _ApplicationContext.default.resolveParameterValue(parameter, event ? event.data : null);
57
+ for (const parameter of service.parameters) {
58
+ let parameterValue = _ApplicationContext.default.resolveParameterValue(parameter, event ? event.data : null);
70
59
 
71
- if (!_Utils.default.isNull(parameter.validator) && !_Utils.default.evaluateBooleanExpression(parameter.validator.nullable, parameter.name) && this.isParamValueNull(parameterValue)) {
72
- if (!_Utils.default.isNull(invalidParamCallback)) {
73
- invalidParamCallback(parameter);
74
- }
75
-
76
- return;
60
+ if (!_Utils.default.isNull(parameter.validator) && !_Utils.default.evaluateBooleanExpression(parameter.validator.nullable, parameter.name) && this.isParamValueNull(parameterValue)) {
61
+ if (!_Utils.default.isNull(invalidParamCallback)) {
62
+ console.error('INVALID PARAMETER : ', parameter);
63
+ invalidParamCallback(parameter);
77
64
  }
78
65
 
79
- let httpParameterType = parameter.httpParameterType;
66
+ return;
67
+ }
80
68
 
81
- if (_Utils.default.isNull(httpParameterType)) {
82
- httpParameterType = 'REQUEST_PARAMETER';
83
- }
69
+ let httpParameterType = parameter.httpParameterType;
84
70
 
85
- if (httpParameterType === 'REQUEST_PARAMETER') {
86
- if (!_Utils.default.isNull(parameterValue)) {
87
- if (queryString.length > 0) {
88
- queryString += '&';
89
- }
71
+ if (_Utils.default.isNull(httpParameterType)) {
72
+ httpParameterType = 'QUERY_PARAMETER';
73
+ }
90
74
 
91
- if (!_Utils.default.isNull(service.includeParameterTypes) && service.includeParameterTypes === true) {
92
- queryString += parameterValue.type + ":";
93
- }
75
+ if (httpParameterType === 'QUERY_PARAMETER') {
76
+ if (!_Utils.default.isNull(parameterValue)) {
77
+ if (queryString.length > 0) {
78
+ queryString += '&';
79
+ }
94
80
 
95
- if (parameterValue.type === 'MapObject') {
96
- parameterValue.value.type = 'MapEntityDto';
97
- }
81
+ if (!_Utils.default.isNull(service.includeParameterTypes) && service.includeParameterTypes === true) {
82
+ queryString += parameterValue.type + ':';
83
+ }
98
84
 
99
- queryString += parameter.name + "=";
100
- queryString += typeof parameterValue.value === 'string' || typeof parameterValue.value === 'number' ? parameterValue.value : JSON.stringify(parameterValue.value);
85
+ if (parameterValue.type === 'MapObject') {
86
+ parameterValue.value.type = 'MapEntityDto';
101
87
  }
88
+
89
+ queryString += parameter.name + '=';
90
+ queryString += typeof parameterValue.value === 'string' || typeof parameterValue.value === 'number' ? parameterValue.value : JSON.stringify(parameterValue.value);
102
91
  }
92
+ }
103
93
 
104
- if (httpParameterType === 'PATH_VARIABLE') {
105
- if (!_Utils.default.isNull(parameterValue)) {
106
- pathParameters += '/' + (typeof parameterValue.value === 'object' ? JSON.stringify(parameterValue.value) : parameterValue.instanceType === 'TypedValue' ? parameterValue.value : parameterValue);
107
- }
94
+ if (httpParameterType === 'PATH_VARIABLE') {
95
+ if (!_Utils.default.isNull(parameterValue)) {
96
+ pathParameters += '/' + (typeof parameterValue.value === 'object' ? JSON.stringify(parameterValue.value) : parameterValue.instanceType === 'TypedValue' ? parameterValue.value : parameterValue);
108
97
  }
98
+ }
99
+
100
+ if (httpParameterType === 'REQUEST_BODY') {
101
+ if (requestBodyParamFound) {
102
+ console.error('Only one request body is permitted');
103
+ return;
104
+ } else {
105
+ if (!this.isParamValueNull(parameterValue)) {
106
+ requestBody = parameterValue.instanceType === 'TypedValue' ? parameterValue.value : parameterValue;
109
107
 
110
- if (httpParameterType === 'REQUEST_BODY') {
111
- if (requestBodyParamFound) {
112
- console.error("Only one request body is permitted");
113
- return;
114
- } else {
115
- if (!this.isParamValueNull(parameterValue)) {
116
- requestBody = parameterValue.instanceType === 'TypedValue' ? parameterValue.value : parameterValue;
117
-
118
- if (parameterValue.type === 'MapObject') {
119
- requestBody.type = 'MapEntityDto';
120
- } else {
121
- if (typeof requestBody === 'object') {
122
- requestBody.type = parameterValue.type;
123
- }
108
+ if (parameterValue.type === 'MapObject') {
109
+ requestBody.type = 'MapEntityDto';
110
+ } else {
111
+ if (typeof requestBody === 'object') {
112
+ requestBody.type = parameterValue.type;
124
113
  }
125
114
  }
126
115
  }
127
116
  }
128
117
  }
129
- } catch (err) {
130
- _iterator.e(err);
131
- } finally {
132
- _iterator.f();
133
118
  }
134
119
 
135
120
  if (pathParameters.length > 0) {
@@ -150,15 +135,14 @@ class RestUtils {
150
135
  }
151
136
 
152
137
  if (requestBody !== null && service.method === 'GET') {
153
- console.error("A request body parameter cannot be specified for a GET request");
138
+ console.error('A request body parameter cannot be specified for a GET request');
154
139
  return;
155
140
  }
156
141
 
157
142
  if (requestBody !== null || service.method === 'POST') {
143
+ console.log("POSTING REST REQUEST BODY : ", requestBody);
158
144
  postData(url, response => {
159
- let responseData = !_Utils.default.isNull(response) ? response.data : null;
160
-
161
- if (!_Utils.default.isNull(responseData) && response.dataType === 'message' && responseData.messageType === "ERROR") {
145
+ if (!_Utils.default.isNull(response) && response.dataType === 'message' && response.messageType === 'ERROR') {
162
146
  this.fireEvent(viewId, component, _EventType.default.SERVICE_CALL_FAILURE);
163
147
  } else {
164
148
  if (!_Utils.default.isNull(successCallback)) {
@@ -179,8 +163,8 @@ class RestUtils {
179
163
  }
180
164
 
181
165
  this.fireEvent(viewId, component, _EventType.default.SERVICE_CALL_FAILURE);
182
- }, !service.url.startsWith("http://"), requestBody);
183
- } else if (contentType === "application/pdf" || contentType === "application/vnd.ms-excel") {
166
+ }, !service.url.startsWith('http://'), requestBody);
167
+ } else if (contentType === 'application/pdf' || contentType === 'application/vnd.ms-excel') {
184
168
  download(url, data => {}, e => {
185
169
  if (!_Utils.default.isNull(errorCallback)) {
186
170
  errorCallback(e);
@@ -205,15 +189,17 @@ class RestUtils {
205
189
  if (!_Utils.default.isNull(errorCallback)) {
206
190
  errorCallback(e);
207
191
  }
208
- }, !service.url.startsWith("http://"));
192
+ }, !service.url.startsWith('http://'));
209
193
  }
210
194
  }
211
195
 
212
196
  invokeRpc(rpcDetails, component, viewId, successCallback, errorCallback, invalidParamCallback, returnValueBinding, successMessage, event = null) {
213
197
  let request = {};
214
198
  request.id = viewId;
215
- request.service = rpcDetails.serviceId;
199
+ let split = rpcDetails.serviceId.split('.');
200
+ request.service = split[1];
216
201
  request.method = rpcDetails.procedureName;
202
+ let module = split[0].toLowerCase();
217
203
 
218
204
  if (!_Utils.default.isNull(rpcDetails.parameters) && rpcDetails.parameters.length > 0) {
219
205
  request.parameters = [];
@@ -236,7 +222,7 @@ class RestUtils {
236
222
  }
237
223
  }
238
224
 
239
- if (typeof parameter.value === "undefined") {
225
+ if (typeof parameter.value === 'undefined') {
240
226
  parameter.value = null;
241
227
  }
242
228
 
@@ -246,6 +232,7 @@ class RestUtils {
246
232
 
247
233
  if (!_Utils.default.isNull(parameterConfig.validator) && _Utils.default.evaluateBooleanExpression(parameterConfig.validator.nullable, parameterConfig.name) === false && this.isParamValueNull(parameter)) {
248
234
  if (!_Utils.default.isNull(invalidParamCallback)) {
235
+ console.error('INVALID PARAMETER : ', parameter);
249
236
  invalidParamCallback(parameter);
250
237
  }
251
238
 
@@ -256,11 +243,7 @@ class RestUtils {
256
243
  }
257
244
  }
258
245
 
259
- this.doFetch(location + _ApplicationContext.default.getBaseApiUrl() + _ApplicationContext.default.getServiceApiPath() + '/invoke', response => {
260
- if (successCallback !== null) {
261
- successCallback(response);
262
- }
263
-
246
+ this.doFetch(location + _ApplicationContext.default.getContextRoot() + '/' + module + '/api/v1/rpc/invoke', response => {
264
247
  if (!_Utils.default.isNull(viewId) && !_Utils.default.isNull(component)) {
265
248
  let path = _Utils.default.getPropertyChainPath(returnValueBinding);
266
249
 
@@ -270,10 +253,18 @@ class RestUtils {
270
253
 
271
254
  let responseData = !_Utils.default.isNull(response) ? response.data : null;
272
255
 
273
- if (!_Utils.default.isNull(responseData) && response.dataType === 'message' && responseData.messageType === "ERROR") {
274
- this.fireEvent(viewId, component, _EventType.default.SERVICE_CALL_FAILURE);
256
+ if (!_Utils.default.isNull(responseData) && response.dataType === 'message' && responseData.messageType === 'ERROR') {
257
+ this.fireEvent(viewId, component, _EventType.default.SERVICE_CALL_FAILURE, responseData);
258
+
259
+ if (errorCallback !== null) {
260
+ errorCallback(response);
261
+ }
275
262
  } else {
276
263
  this.fireEvent(viewId, component, _EventType.default.SERVICE_CALL_SUCCESS, response.data);
264
+
265
+ if (successCallback !== null) {
266
+ successCallback(response);
267
+ }
277
268
  }
278
269
  }
279
270
  }, e => {
@@ -296,28 +287,8 @@ class RestUtils {
296
287
  }
297
288
 
298
289
  fetchWithCustomConfig(url, successCallback, errorCallback, secure, config, method, download, body, serviceType, viewId, successMessage, track) {
299
- const accessToken = sessionStorage.getItem("accessToken");
300
- const idToken = sessionStorage.getItem("idToken");
301
- /*let data = null;
302
- if(serviceType === 'rest') {
303
- data = JSON.stringify(body);
304
- } else {
305
- if (!Utils.isNull(body)) {
306
- data = new FormData();
307
- const json = JSON.stringify(body);
308
- data.append("requestDto", json);
309
- let currentView = applicationContext.getCurrentView();
310
- if (!Utils.isNull(currentView)) {
311
- let domainCache = applicationContext.getFileDomainCache(currentView.config.id);
312
- if (!Utils.isNull(domainCache)) {
313
- for (const file of domainCache.files) {
314
- data.append(file.correlationId, file.content);
315
- }
316
- }
317
- }
318
- }
319
- }*/
320
-
290
+ const accessToken = sessionStorage.getItem('accessToken');
291
+ const idToken = sessionStorage.getItem('idToken');
321
292
  let data = body ? JSON.stringify(body) : null;
322
293
  let fetchConfig = config;
323
294
 
@@ -351,13 +322,15 @@ class RestUtils {
351
322
 
352
323
  if (download) {
353
324
  if (url.indexOf('?') < 0) {
354
- url += "?";
325
+ url += '?';
355
326
  } else {
356
- url += "&";
327
+ url += '&';
357
328
  }
358
329
 
359
330
  url += 'access_token=' + accessToken;
360
331
  url += '&idToken=' + idToken;
332
+ url += '&themePrimaryColor=' + encodeURIComponent(_ApplicationContext.default.getApplicationPrimaryColor());
333
+ url += '&themeSecondaryColor=' + encodeURIComponent(_ApplicationContext.default.getApplicationSecondaryColor());
361
334
  window.open(encodeURI(url), '_blank');
362
335
  } else {
363
336
  if (_Utils.default.isNull(track) || track === true) {
@@ -374,7 +347,7 @@ class RestUtils {
374
347
  }).catch(e => {
375
348
  console.error(e);
376
349
 
377
- if (e.code === 401 && !url.endsWith("/logout")) {
350
+ if (e.code === 401 && !url.endsWith('/logout')) {
378
351
  errorCallback(e);
379
352
 
380
353
  _ApplicationContext.default.clear();
@@ -391,7 +364,9 @@ class RestUtils {
391
364
  processSuccessfulResponseData(component, data, successCallback, viewId, successMessage) {
392
365
  let response;
393
366
 
394
- if (typeof data === "object" || _Utils.default.isNull(data) || data.toString().trim().length === 0) {
367
+ if (!_Utils.default.isNull(data) && data.toString().trim().length === 0) {
368
+ response = null;
369
+ } else if (typeof data === 'object' || _Utils.default.isNull(data) || data.toString().trim().length === 0) {
395
370
  response = data;
396
371
  } else {
397
372
  try {
@@ -402,9 +377,9 @@ class RestUtils {
402
377
  }
403
378
 
404
379
  if (successCallback !== null) {
405
- let responseData = !_Utils.default.isNull(response) ? response.data : null;
380
+ let responseData = response ? response.data : null;
406
381
 
407
- if (!_Utils.default.isNull(responseData) && response.dataType === 'message') {
382
+ if (response && responseData && response.dataType === 'message') {
408
383
  let event = new _Event.default(_ApplicationContext.default, viewId, responseData);
409
384
 
410
385
  _Observable.default.fireEvent(_EventType.default.MESSAGE_ARRIVED, event);
@@ -417,7 +392,7 @@ class RestUtils {
417
392
  } else if (!_Utils.default.isNull(successMessage)) {
418
393
  let message = {
419
394
  messageType: 'SUCCESS',
420
- message: _ApplicationContext.default.populateTemplate(successMessage, response.data)
395
+ message: _ApplicationContext.default.populateTemplate(successMessage, response ? response.data : null)
421
396
  };
422
397
  let event = new _Event.default(_ApplicationContext.default, viewId, message);
423
398