@agilemotion/oui-react-js 1.6.4 → 1.6.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/dist/ApplicationManager.js +675 -1044
  2. package/dist/BasicApp.js +7 -27
  3. package/dist/BasicAppHome.js +27 -101
  4. package/dist/DynamicJS.js +109 -197
  5. package/dist/InteractionPortalApp.js +7 -27
  6. package/dist/InteractionPortalAppHome.js +21 -87
  7. package/dist/InteractionPortalApp_old.js +60 -122
  8. package/dist/RestUtils.js +269 -410
  9. package/dist/TypedValue.js +20 -26
  10. package/dist/Utils.js +295 -481
  11. package/dist/WithRouter.js +9 -17
  12. package/dist/assets/jss/components/authNavbarStyle.js +168 -171
  13. package/dist/assets/jss/components/buttonStyle.js +2 -5
  14. package/dist/assets/jss/components/cardAvatarStyle.js +2 -5
  15. package/dist/assets/jss/components/cardBodyStyle.js +2 -5
  16. package/dist/assets/jss/components/cardFooterStyle.js +2 -5
  17. package/dist/assets/jss/components/cardHeaderStyle.js +20 -17
  18. package/dist/assets/jss/components/cardIconStyle.js +2 -5
  19. package/dist/assets/jss/components/cardStyle.js +2 -5
  20. package/dist/assets/jss/components/cardTextStyle.js +2 -5
  21. package/dist/assets/jss/components/customDropdownStyle.js +171 -173
  22. package/dist/assets/jss/components/customInputStyle.js +5 -13
  23. package/dist/assets/jss/components/dropdownStyle.js +71 -74
  24. package/dist/assets/jss/components/footerStyle.js +14 -23
  25. package/dist/assets/jss/components/headerLinksStyle.js +52 -53
  26. package/dist/assets/jss/components/headerStyle.js +68 -73
  27. package/dist/assets/jss/components/navbarLinksStyle.js +81 -74
  28. package/dist/assets/jss/components/navbarStyle.js +79 -84
  29. package/dist/assets/jss/components/sidebarStyle.js +438 -441
  30. package/dist/assets/jss/components/typographyStyle.js +5 -13
  31. package/dist/assets/jss/rootStyle.js +85 -151
  32. package/dist/assets/jss/views/layoutStyle.js +45 -51
  33. package/dist/assets/jss/views/loginBasicStyle.js +2 -5
  34. package/dist/assets/jss/views/loginBusinessPortalStyle.js +2 -5
  35. package/dist/assets/jss/views/loginStyle.js +80 -87
  36. package/dist/components/AlertBar.js +20 -75
  37. package/dist/components/AlertItem.js +13 -49
  38. package/dist/components/AlertTemplate.js +12 -18
  39. package/dist/components/Button.js +41 -112
  40. package/dist/components/Calendar.js +99 -208
  41. package/dist/components/ConfirmationDialog.js +13 -54
  42. package/dist/components/DataGrid.js +271 -695
  43. package/dist/components/DataGridColumn.js +24 -74
  44. package/dist/components/DataGridFilter.js +107 -245
  45. package/dist/components/DataGridHeading.js +34 -78
  46. package/dist/components/Dialog.js +37 -130
  47. package/dist/components/DocumentTemplateDesigner.js +16 -57
  48. package/dist/components/DocumentTemplateDesignerComponent.js +47 -141
  49. package/dist/components/DocumentTemplatePlaceholderDialog.js +34 -67
  50. package/dist/components/DocumentViewer.js +25 -65
  51. package/dist/components/DocumentViewerComponent.js +13 -44
  52. package/dist/components/ElementResizeHandler.js +148 -200
  53. package/dist/components/FileThumb.js +15 -56
  54. package/dist/components/Graph.js +98 -203
  55. package/dist/components/GraphNode.js +20 -61
  56. package/dist/components/HtmlPanel.js +38 -105
  57. package/dist/components/Icon.js +174 -253
  58. package/dist/components/LoadingIndicator.js +4 -11
  59. package/dist/components/LottieIcon.js +63 -60
  60. package/dist/components/PopupView.js +21 -60
  61. package/dist/components/Portlet.js +18 -60
  62. package/dist/components/RegularButton.js +34 -42
  63. package/dist/components/SignaturePanel.js +19 -67
  64. package/dist/components/SocketManager.js +133 -228
  65. package/dist/components/StepperTitleBar.js +48 -99
  66. package/dist/components/TabPage.js +30 -47
  67. package/dist/components/TabPanel.js +35 -122
  68. package/dist/components/TableCellContent.js +34 -98
  69. package/dist/components/TemplateDesigner.js +115 -230
  70. package/dist/components/TemplateItemEventHandler.js +298 -481
  71. package/dist/components/TemplateTable.js +117 -218
  72. package/dist/components/TitleBar.js +15 -53
  73. package/dist/components/Toolbar.js +44 -110
  74. package/dist/components/Tooltip.js +37 -56
  75. package/dist/components/Tree.js +50 -143
  76. package/dist/components/UseIsVisible.js +5 -25
  77. package/dist/components/card/Card.js +35 -39
  78. package/dist/components/card/CardAvatar.js +21 -32
  79. package/dist/components/card/CardBody.js +29 -36
  80. package/dist/components/card/CardFooter.js +26 -35
  81. package/dist/components/card/CardHeader.js +29 -36
  82. package/dist/components/card/CardIcon.js +15 -29
  83. package/dist/components/card/CardText.js +15 -29
  84. package/dist/components/customInput/CustomInput.js +38 -40
  85. package/dist/components/dashboard/FoldingSideTabDashboard.js +65 -184
  86. package/dist/components/dashboard/SideMenuModuleDashboard.js +67 -185
  87. package/dist/components/dashboard/TopMenuModuleDashboard.js +22 -63
  88. package/dist/components/dashboard/components/Header.js +15 -52
  89. package/dist/components/dashboard/components/LeftDrawer.js +9 -23
  90. package/dist/components/dashboard/components/UserIdentity.js +4 -12
  91. package/dist/components/dashboard/components/blackDashboard/fixedPlugin/FixedPlugin.js +115 -155
  92. package/dist/components/dashboard/components/blackDashboard/sidebar/FoldingTabSidebar.js +344 -419
  93. package/dist/components/dashboard/components/blackDashboard/sidebar/ModuleMenu.js +15 -29
  94. package/dist/components/dashboard/components/blackDashboard/sidebar/ModuleMenuSidebar.js +405 -485
  95. package/dist/components/dashboard/components/portal/Timeline.js +3 -8
  96. package/dist/components/dashboard/components/portal/Workspace.js +4 -13
  97. package/dist/components/footer/Footer.js +23 -45
  98. package/dist/components/footer/HomeFooter.js +38 -78
  99. package/dist/components/form/AddressSearch.js +26 -76
  100. package/dist/components/form/AutoComplete.js +54 -168
  101. package/dist/components/form/BaseField.js +59 -189
  102. package/dist/components/form/Checkbox.js +11 -24
  103. package/dist/components/form/DatePicker.js +28 -82
  104. package/dist/components/form/FieldSet.js +84 -300
  105. package/dist/components/form/Form.js +206 -501
  106. package/dist/components/form/GridField.js +83 -243
  107. package/dist/components/form/IconField.js +10 -21
  108. package/dist/components/form/ImageEditor.js +98 -208
  109. package/dist/components/form/LabelField.js +13 -28
  110. package/dist/components/form/LookupField.js +36 -102
  111. package/dist/components/form/MultiFileUploadField.js +67 -134
  112. package/dist/components/form/RadioGroup.js +20 -57
  113. package/dist/components/form/Section.js +33 -118
  114. package/dist/components/form/SelectItem.js +36 -83
  115. package/dist/components/form/SignatureTemplateDesignerField.js +12 -26
  116. package/dist/components/form/Switch.js +11 -24
  117. package/dist/components/form/TextField.js +19 -55
  118. package/dist/components/form/TimePicker.js +18 -43
  119. package/dist/components/form/TransferList.js +76 -200
  120. package/dist/components/form/UploadField.js +134 -256
  121. package/dist/components/grid/GridContainer.js +10 -23
  122. package/dist/components/grid/GridItem.js +10 -23
  123. package/dist/components/layout/CollapsiblePanel.js +20 -59
  124. package/dist/components/layout/Layout.js +40 -149
  125. package/dist/components/layout/View.js +65 -195
  126. package/dist/components/layout/ViewContainer.js +13 -33
  127. package/dist/components/layout/ViewPort.js +14 -48
  128. package/dist/components/layout/Window.js +62 -135
  129. package/dist/components/layout/WindowViewPort.js +18 -63
  130. package/dist/components/media/ClosablePanel.js +9 -18
  131. package/dist/components/media/LobbyWaitingList.js +11 -17
  132. package/dist/components/media/MediaSoupHelper.js +173 -401
  133. package/dist/components/media/SideBarContent.js +17 -34
  134. package/dist/components/media/SocketRequest.js +7 -18
  135. package/dist/components/media/SocketResponse.js +5 -14
  136. package/dist/components/media/Timer.js +18 -54
  137. package/dist/components/media/Toolbar.js +97 -254
  138. package/dist/components/media/ToolbarButton.js +34 -95
  139. package/dist/components/media/Toolbar_bck.js +70 -186
  140. package/dist/components/media/Tracks.js +19 -33
  141. package/dist/components/media/TrainingRoom.js +121 -374
  142. package/dist/components/media/Transports.js +17 -29
  143. package/dist/components/media/VCEventManager.js +45 -116
  144. package/dist/components/media/VCEventType.js +82 -168
  145. package/dist/components/media/VCParticipantList.js +16 -51
  146. package/dist/components/media/VCParticipantListItem.js +44 -141
  147. package/dist/components/media/VCRoom.js +14 -58
  148. package/dist/components/media/VCRoomParticipant.js +235 -556
  149. package/dist/components/media/VCRoomRecorder.js +106 -204
  150. package/dist/components/media/VCRoomWorkspace.js +248 -584
  151. package/dist/components/media/Video.js +27 -112
  152. package/dist/components/media/VideoPlayer.js +23 -91
  153. package/dist/components/media/chat/ChatRoom.js +143 -361
  154. package/dist/components/media/chat/ChatRoomItem.js +17 -58
  155. package/dist/components/media/chat/ChatRoomList.js +15 -60
  156. package/dist/components/menu/CollapsibleMenu.js +22 -52
  157. package/dist/components/menu/MenuBars.js +50 -116
  158. package/dist/components/menu/MenuButton.js +53 -130
  159. package/dist/components/menu/MenuItem.js +11 -51
  160. package/dist/components/menu/MenuLink.js +13 -41
  161. package/dist/components/menu/PopupMenu.js +13 -25
  162. package/dist/components/navbars/AuthNavbar.js +21 -56
  163. package/dist/components/navbars/HomeNavbar.js +213 -290
  164. package/dist/components/navbars/PortalNavbar.js +26 -81
  165. package/dist/components/signatures/AgilitySignaturePanel.js +41 -135
  166. package/dist/components/signatures/AlertItem.js +14 -50
  167. package/dist/components/signatures/Card.js +6 -16
  168. package/dist/components/signatures/DocumentContainer.js +57 -165
  169. package/dist/components/signatures/ImageSignatureInput.js +64 -124
  170. package/dist/components/signatures/MenuButton.js +28 -63
  171. package/dist/components/signatures/Prompt.js +6 -41
  172. package/dist/components/signatures/ResponsiveTable.js +181 -370
  173. package/dist/components/signatures/SearchView.js +34 -112
  174. package/dist/components/signatures/SignatorySearch.js +11 -44
  175. package/dist/components/signatures/SignatorySearchForm.js +19 -50
  176. package/dist/components/signatures/SignatureInput.js +28 -91
  177. package/dist/components/signatures/SignatureInputProps.js +49 -144
  178. package/dist/components/signatures/SignatureTemplateDesigner.js +230 -430
  179. package/dist/components/signatures/Toolbar.js +99 -173
  180. package/dist/components/signatures/ViewUtils.js +207 -313
  181. package/dist/components/typography/Danger.js +6 -11
  182. package/dist/components/typography/Info.js +7 -11
  183. package/dist/components/typography/Link.js +6 -12
  184. package/dist/event/ActionHandlers.js +48 -87
  185. package/dist/event/Event.js +21 -25
  186. package/dist/event/EventListener.js +54 -48
  187. package/dist/event/EventType.js +18 -40
  188. package/dist/event/LoadDataActionHandler.js +10 -31
  189. package/dist/event/Observable.js +204 -396
  190. package/dist/event/RouteActionHandler.js +119 -171
  191. package/dist/event/ScriptActionHandler.js +10 -32
  192. package/dist/event/ServiceCallActionHandler.js +37 -64
  193. package/dist/event/SignalGraphActionHandler.js +9 -31
  194. package/dist/js/Addresses.js +23 -42
  195. package/dist/js/Calendar.js +41 -89
  196. package/dist/js/DynamicLib.js +11 -23
  197. package/dist/js/Media.js +80 -174
  198. package/dist/js/Validators.js +6 -12
  199. package/dist/js/Windows.js +22 -40
  200. package/dist/redux/store/ConfigureStore.js +12 -29
  201. package/dist/redux/store/DashboardStore.js +47 -120
  202. package/dist/redux/store/History.js +2 -5
  203. package/dist/redux/store/SecurityStore.js +22 -65
  204. package/dist/security/TokenManager.js +29 -53
  205. package/dist/theme-default.js +3 -8
  206. package/dist/view/Dashboard.js +140 -308
  207. package/dist/view/PortalDashboard.js +6 -13
  208. package/dist/view/Settings.js +3 -11
  209. package/dist/view/Views.js +15 -35
  210. package/dist/view/security/ChangePasswordBasic.js +41 -147
  211. package/dist/view/security/ForgotPassword.js +26 -106
  212. package/dist/view/security/ForgotPasswordBasic.js +22 -96
  213. package/dist/view/security/Login.js +29 -117
  214. package/dist/view/security/LoginBasic.js +28 -108
  215. package/dist/view/security/LoginInteractionPortal.js +28 -106
  216. package/dist/view/security/ResetPassword.js +25 -110
  217. package/dist/view/security/ResetPasswordBasic.js +39 -142
  218. package/dist/view/security/Security.js +14 -26
  219. package/package.json +25 -20
package/dist/Utils.js CHANGED
@@ -4,530 +4,344 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _DynamicJS = _interopRequireDefault(require("./DynamicJS"));
9
-
10
8
  var _Event = _interopRequireDefault(require("./event/Event"));
11
-
12
9
  var _ApplicationManager = _interopRequireDefault(require("./ApplicationManager"));
13
-
14
10
  var _Observable = _interopRequireDefault(require("./event/Observable"));
15
-
16
11
  var _EventType = _interopRequireDefault(require("./event/EventType"));
17
-
18
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
-
20
- 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); } }
21
-
22
- 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); }); }; }
23
-
24
- 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; } } }; }
25
-
26
- 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); }
27
-
28
- 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; }
29
-
30
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
31
-
32
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
33
-
34
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
35
-
36
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
37
-
38
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
39
-
40
- function _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; }
41
-
42
- var Utils = /*#__PURE__*/function () {
43
- function Utils() {
44
- _classCallCheck(this, Utils);
45
-
46
- _defineProperty(this, "showMessage", function (viewRef, message, type) {
47
- if (Utils.isNull(message)) {
48
- message = "";
49
- }
50
-
51
- var messageType = type === "ERROR" ? "danger" : Utils.isNull(type) ? "message" : type;
52
- viewRef.setState({
53
- message: message,
54
- messageStyle: messageType
55
- });
56
- });
12
+ var _this = void 0;
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
+ class Utils {
15
+ constructor() {}
16
+ static SYSTEM_ERROR_MESSAGE = "A system error has accured. Please contact your system administrator";
17
+ static isNull(value) {
18
+ return value === null || typeof value === 'undefined';
57
19
  }
58
-
59
- _createClass(Utils, [{
60
- key: "saveForm",
61
- value: function saveForm(viewRef, formRef, url) {
62
- this.saveForm(viewRef, formRef, url, null, null, null);
63
- }
64
- }, {
65
- key: "saveForm",
66
- value: function saveForm(viewRef, formRef, url, successCallback, errorCallback) {
67
- this.saveForm(viewRef, formRef, url, successCallback, errorCallback, null);
68
- }
69
- }, {
70
- key: "autoSetDate",
71
- value: function autoSetDate(viewRef, formRef, newDate, yearOffset, monthOffset, dayOffset, autoFillDateName, refDateName) {
72
- var stateDate = viewRef.state[refDateName];
73
- var tempDate = stateDate;
74
-
75
- if (Utils.isNull(stateDate) || stateDate.getTime() !== newDate.getTime()) {
76
- viewRef.setState(_objectSpread(_objectSpread({}, viewRef.state), {}, _defineProperty({}, refDateName, newDate)), function () {
77
- if (!Utils.isNull(tempDate) && !Utils.isNull(viewRef.state.id)) {
78
- var autoFillDate = Utils.offsetDate(newDate, yearOffset, monthOffset, dayOffset);
79
- formRef.current.setValue(autoFillDateName, autoFillDate);
80
- } else if (Utils.isNull(viewRef.state.id)) {
81
- var _autoFillDate = Utils.offsetDate(newDate, yearOffset, monthOffset, dayOffset);
82
-
83
- formRef.current.setValue(autoFillDateName, _autoFillDate);
84
- }
85
- });
20
+ static getInitials(name) {
21
+ const parts = name.split(' ');
22
+ let initials = '';
23
+ for (let i = 0; i < parts.length; i++) {
24
+ if (parts[i].length > 0 && parts[i] !== '') {
25
+ initials += parts[i][0];
86
26
  }
87
27
  }
88
- }], [{
89
- key: "isNull",
90
- value: function isNull(value) {
91
- return value === null || typeof value === 'undefined';
92
- }
93
- }, {
94
- key: "getInitials",
95
- value: function getInitials(name) {
96
- var parts = name.split(' ');
97
- var initials = '';
98
-
99
- for (var i = 0; i < parts.length; i++) {
100
- if (parts[i].length > 0 && parts[i] !== '') {
101
- initials += parts[i][0];
102
- }
28
+ return initials;
29
+ }
30
+ static updateModel(values, model) {
31
+ if (!Utils.isNull(values)) {
32
+ for (let i = 0; i < values.length; i++) {
33
+ let value = values[i];
34
+ model[value.name] = value.value;
103
35
  }
104
-
105
- return initials;
106
36
  }
107
- }, {
108
- key: "updateModel",
109
- value: function updateModel(values, model) {
110
- if (!Utils.isNull(values)) {
111
- for (var i = 0; i < values.length; i++) {
112
- var value = values[i];
113
- model[value.name] = value.value;
114
- }
37
+ }
38
+ static capitalize = s => {
39
+ if (typeof s !== 'string') return '';
40
+ return s.charAt(0).toUpperCase() + s.slice(1);
41
+ };
42
+ static joinScript(lines) {
43
+ let script = '';
44
+ for (let i = 0; i < lines.length; i++) {
45
+ let line = lines[i].trim();
46
+ if (!line.endsWith(';') && !line.endsWith(':')) {
47
+ line += ';';
115
48
  }
49
+ line += '\n';
50
+ script += line;
116
51
  }
117
- }, {
118
- key: "joinScript",
119
- value: function joinScript(lines) {
120
- var script = '';
121
-
122
- for (var i = 0; i < lines.length; i++) {
123
- var line = lines[i].trim();
124
-
125
- if (!line.endsWith(';') && !line.endsWith(':')) {
126
- line += ';';
127
- }
128
-
129
- line += '\n';
130
- script += line;
52
+ return script;
53
+ }
54
+ static sleep(milliseconds) {
55
+ const date = Date.now();
56
+ let currentDate = null;
57
+ do {
58
+ currentDate = Date.now();
59
+ } while (currentDate - date < milliseconds);
60
+ }
61
+ static parseConfig(config, currentViewId) {
62
+ let index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
63
+ if (!this.isNull(config) && !this.isNull(config.id)) {
64
+ let configJson = JSON.stringify(config);
65
+ let replace = configJson.replace(/#{this}/g, '#{' + config.id + '}').replace(/#{view}/g, '#{' + currentViewId + '}');
66
+ if (index !== null) {
67
+ replace = replace.replace(/\[#i]/g, `[${index}]`);
131
68
  }
132
-
133
- return script;
69
+ return JSON.parse(replace);
134
70
  }
135
- }, {
136
- key: "sleep",
137
- value: function sleep(milliseconds) {
138
- var date = Date.now();
139
- var currentDate = null;
140
-
141
- do {
142
- currentDate = Date.now();
143
- } while (currentDate - date < milliseconds);
144
- }
145
- }, {
146
- key: "parseConfig",
147
- value: function parseConfig(config, currentViewId) {
148
- var index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
149
-
150
- if (!this.isNull(config) && !this.isNull(config.id)) {
151
- var configJson = JSON.stringify(config);
152
- var replace = configJson.replace(/#{this}/g, '#{' + config.id + '}').replace(/#{view}/g, '#{' + currentViewId + '}');
153
-
154
- if (index !== null) {
155
- replace = replace.replace(/\[#i]/g, "[".concat(index, "]"));
71
+ return config;
72
+ }
73
+ static isFieldRequired(id, formId) {
74
+ if (!Utils.isStringEmpty(formId)) {
75
+ let fields = Utils.getFields(formId, 'validate');
76
+ for (var i = 0; i < fields.length; i++) {
77
+ if (fields[i].id === id) {
78
+ return fields[i].required;
156
79
  }
157
-
158
- return JSON.parse(replace);
159
80
  }
160
-
161
- return config;
162
81
  }
163
- }, {
164
- key: "isFieldRequired",
165
- value: function isFieldRequired(id, formId) {
166
- if (!Utils.isStringEmpty(formId)) {
167
- var fields = Utils.getFields(formId, 'validate');
168
-
169
- for (var i = 0; i < fields.length; i++) {
170
- if (fields[i].id === id) {
171
- return fields[i].required;
172
- }
82
+ return false;
83
+ }
84
+ static isStringEmpty(val) {
85
+ return typeof val === 'undefined' || val === null || val.trim().length === 0;
86
+ }
87
+ static getFields(formId, className) {
88
+ let inputFields = [];
89
+ let form = document.getElementById(formId);
90
+ if (!Utils.isNull(form)) {
91
+ let inputDivs = form.getElementsByClassName(className);
92
+ for (let i = 0; i < inputDivs.length; i++) {
93
+ let inputs = inputDivs[i].getElementsByTagName("input");
94
+ for (let j = 0; j < inputs.length; j++) {
95
+ inputFields.push(inputs[j]);
173
96
  }
174
97
  }
175
-
176
- return false;
177
- }
178
- }, {
179
- key: "isStringEmpty",
180
- value: function isStringEmpty(val) {
181
- return typeof val === 'undefined' || val === null || val.trim().length === 0;
182
98
  }
183
- }, {
184
- key: "getFields",
185
- value: function getFields(formId, className) {
186
- var inputFields = [];
187
- var form = document.getElementById(formId);
188
-
189
- if (!Utils.isNull(form)) {
190
- var inputDivs = form.getElementsByClassName(className);
191
-
192
- for (var i = 0; i < inputDivs.length; i++) {
193
- var inputs = inputDivs[i].getElementsByTagName("input");
194
-
195
- for (var j = 0; j < inputs.length; j++) {
196
- inputFields.push(inputs[j]);
197
- }
198
- }
199
- }
200
-
201
- return inputFields;
99
+ return inputFields;
100
+ }
101
+ static validateField(id, required, values, currentValue, validator) {
102
+ let message = !this.isNull(validator) ? validator.errorMessage : null;
103
+ let regex = !this.isNull(validator) ? validator.regex : null;
104
+ let result = {};
105
+ result.valid = true;
106
+ result.message = "";
107
+ let value;
108
+ if (!this.isNull(currentValue)) {
109
+ value = currentValue;
110
+ } else {
111
+ value = JSON.parse(JSON.stringify(values))[id];
202
112
  }
203
- }, {
204
- key: "validateField",
205
- value: function validateField(id, required, values, currentValue, validator) {
206
- var message = !this.isNull(validator) ? validator.errorMessage : null;
207
- var regex = !this.isNull(validator) ? validator.regex : null;
208
- var result = {};
209
- result.valid = true;
113
+ let hasErrors = false;
114
+ if (required && (Utils.isNull(value) || Utils.isStringEmpty(value.toString()))) {
115
+ result.message = !Utils.isNull(message) ? message : "This field is required";
116
+ hasErrors = true;
117
+ } else {
210
118
  result.message = "";
211
- var value;
212
-
213
- if (!this.isNull(currentValue)) {
214
- value = currentValue;
215
- } else {
216
- value = JSON.parse(JSON.stringify(values))[id];
217
- }
218
-
219
- var hasErrors = false;
220
-
221
- if (required && (Utils.isNull(value) || Utils.isStringEmpty(value.toString()))) {
222
- result.message = !Utils.isNull(message) ? message : "This field is required";
223
- hasErrors = true;
224
- } else {
225
- result.message = "";
226
- }
227
-
228
- if (!hasErrors && !Utils.isNull(regex) && !Utils.isNull(value)) {
229
- hasErrors = Utils.isNull(value.toString().match(regex));
230
-
231
- if (hasErrors) {
232
- result.message = !Utils.isNull(message) ? message : "This field is invalid";
233
- }
234
- }
235
-
236
- result.valid = !hasErrors;
237
- return result;
238
- }
239
- }, {
240
- key: "getComponentAttribute",
241
- value: function getComponentAttribute(field, attribute, defaultValue) {
242
- if (this.isNull(field.attributes)) {
243
- return defaultValue;
244
- }
245
-
246
- return this.isNull(field.attributes[attribute]) ? defaultValue : field.attributes[attribute];
247
119
  }
248
- }, {
249
- key: "getComponentStyleAttribute",
250
- value: function getComponentStyleAttribute(field, attribute, defaultValue) {
251
- if (this.isNull(field.attributes) || this.isNull(field.attributes.style)) {
252
- return defaultValue;
120
+ if (!hasErrors && !Utils.isNull(regex) && !Utils.isNull(value)) {
121
+ hasErrors = Utils.isNull(value.toString().match(regex));
122
+ if (hasErrors) {
123
+ result.message = !Utils.isNull(message) ? message : "This field is invalid";
253
124
  }
254
-
255
- return this.isNull(field.attributes.style[attribute]) ? defaultValue : field.attributes.style[attribute];
256
125
  }
257
- }, {
258
- key: "doGetRequestJson",
259
- value: function doGetRequestJson(currentPage, curretRowsPerPage, currentSearchParameters, paged) {
260
- var request = {};
261
- request.pageSize = curretRowsPerPage;
262
- request.currentPage = currentPage;
263
- request.searchParameters = currentSearchParameters;
264
- request.paged = typeof paged === 'undefined' || paged === null || paged;
265
- return JSON.stringify(request);
126
+ result.valid = !hasErrors;
127
+ return result;
128
+ }
129
+ static getComponentAttribute(field, attribute, defaultValue) {
130
+ if (this.isNull(field.attributes)) {
131
+ return defaultValue;
266
132
  }
267
- }, {
268
- key: "getFieldGrid",
269
- value: function getFieldGrid(attributes, fields) {
270
- var fieldGrid = {};
271
- var maxColspan = !Utils.isNull(attributes) && !Utils.isNull(attributes.layoutColumns) ? attributes.layoutColumns : 1;
272
- fieldGrid.maxColPerRow = maxColspan;
273
- fieldGrid.rows = [];
274
- var currRow = this.createRow();
275
-
276
- for (var i = 0; i < fields.length; i++) {
277
- var field = fields[i];
278
- var colspan = this.getFieldColspan(field);
279
-
280
- if (!this.rowHasSpaceForNewField(currRow, colspan, maxColspan)) {
281
- this.fillRowWithSpacers(currRow, maxColspan);
282
- currRow = this.createRow();
283
- }
284
-
285
- if (currRow.fields.length === 0) {
286
- fieldGrid.rows.push(currRow);
287
- }
288
-
289
- currRow.fields.push(field);
290
- currRow.usedSlots += colspan;
291
- }
292
-
293
- return fieldGrid;
133
+ return this.isNull(field.attributes[attribute]) ? defaultValue : field.attributes[attribute];
134
+ }
135
+ static getComponentStyleAttribute(field, attribute, defaultValue) {
136
+ if (this.isNull(field.attributes) || this.isNull(field.attributes.style)) {
137
+ return defaultValue;
294
138
  }
295
- }, {
296
- key: "evaluateBooleanExpression",
297
- value: function evaluateBooleanExpression(expression, id, defaultValue) {
298
- if (expression === "false" || expression === false) {
299
- return false;
300
- } else if (expression === "true" || expression === true) {
301
- return true;
302
- } else if (!Utils.isNull(expression)) {
303
- return _DynamicJS.default.executeScript("".concat(id, "UtilsBoolEval"), expression);
304
- }
305
-
306
- return !this.isNull(defaultValue) ? defaultValue : false;
139
+ return this.isNull(field.attributes.style[attribute]) ? defaultValue : field.attributes.style[attribute];
140
+ }
141
+ static doGetRequestJson(currentPage, curretRowsPerPage, currentSearchParameters, paged) {
142
+ var request = {};
143
+ request.pageSize = curretRowsPerPage;
144
+ request.currentPage = currentPage;
145
+ request.searchParameters = currentSearchParameters;
146
+ request.paged = typeof paged === 'undefined' || paged === null || paged;
147
+ return JSON.stringify(request);
148
+ }
149
+ static getFieldColspan = field => {
150
+ return !Utils.isNull(field.attributes) && !Utils.isNull(field.attributes['colspan']) ? parseFloat(field.attributes['colspan']) : 1;
151
+ };
152
+ static createRow = () => {
153
+ let row = {};
154
+ row.fields = [];
155
+ row.usedSlots = 0;
156
+ return row;
157
+ };
158
+ static fillRowWithSpacers = (row, max) => {
159
+ for (let i = row.usedSlots; i < max; i++) {
160
+ let field = {};
161
+ field.fieldType = 'LABEL';
162
+ field.id = 'system_col_span_spacer_' + i;
163
+ row.fields.push(field);
307
164
  }
308
- }, {
309
- key: "getEntityViewTitle",
310
- value: function getEntityViewTitle(queryParameterState, viewName) {
311
- if (Utils.isNull(queryParameterState) || Utils.isNull(queryParameterState.selection)) {
312
- return !Utils.isNull(viewName) ? viewName + " > Add" : "Add";
313
- }
314
-
315
- var props = "";
316
-
317
- for (var _len = arguments.length, fields = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
318
- fields[_key - 2] = arguments[_key];
165
+ };
166
+ static rowHasSpaceForNewField = (row, colspan, max) => {
167
+ return colspan <= max - row.usedSlots;
168
+ };
169
+ static getFieldGrid(attributes, fields) {
170
+ let fieldGrid = {};
171
+ let maxColspan = !Utils.isNull(attributes) && !Utils.isNull(attributes.layoutColumns) ? attributes.layoutColumns : 1;
172
+ fieldGrid.maxColPerRow = maxColspan;
173
+ fieldGrid.rows = [];
174
+ let currRow = this.createRow();
175
+ for (let i = 0; i < fields.length; i++) {
176
+ let field = fields[i];
177
+ let colspan = this.getFieldColspan(field);
178
+ if (!this.rowHasSpaceForNewField(currRow, colspan, maxColspan)) {
179
+ this.fillRowWithSpacers(currRow, maxColspan);
180
+ currRow = this.createRow();
319
181
  }
320
-
321
- for (var i = 0; i < fields.length; i++) {
322
- if (!Utils.isNull(fields[i])) {
323
- props += fields[i].trim();
324
- props += " ";
325
- }
182
+ if (currRow.fields.length === 0) {
183
+ fieldGrid.rows.push(currRow);
326
184
  }
327
-
328
- props = props.trim();
329
- var prefix = Utils.isNull(viewName) ? "" : " > ";
330
- return (Utils.isNull(viewName) ? "" : viewName) + (props.length > 0 ? prefix + props : "");
185
+ currRow.fields.push(field);
186
+ currRow.usedSlots += colspan;
331
187
  }
332
- }, {
333
- key: "setLegendColor",
334
- value: function setLegendColor(color) {
335
- var legends = document.getElementsByClassName("legend");
336
-
337
- for (var i = 0; i < legends.length; i++) {
338
- legends[i].style.color = color;
339
- }
188
+ return fieldGrid;
189
+ }
190
+ static evaluateBooleanExpression(expression, id, defaultValue) {
191
+ if (expression === "false" || expression === false) {
192
+ return false;
193
+ } else if (expression === "true" || expression === true) {
194
+ return true;
195
+ } else if (!Utils.isNull(expression)) {
196
+ return _DynamicJS.default.executeScript(`${id}UtilsBoolEval`, expression);
197
+ }
198
+ return !this.isNull(defaultValue) ? defaultValue : false;
199
+ }
200
+ static getEntityViewTitle(queryParameterState, viewName) {
201
+ if (Utils.isNull(queryParameterState) || Utils.isNull(queryParameterState.selection)) {
202
+ return !Utils.isNull(viewName) ? viewName + " > Add" : "Add";
340
203
  }
341
- }, {
342
- key: "setLegend",
343
- value: function setLegend(text) {
344
- if (!Utils.isNull(text)) {
345
- var legend = document.getElementById("globalLegend");
346
- legend.innerHTML = text;
204
+ let props = "";
205
+ for (var _len = arguments.length, fields = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
206
+ fields[_key - 2] = arguments[_key];
207
+ }
208
+ for (let i = 0; i < fields.length; i++) {
209
+ if (!Utils.isNull(fields[i])) {
210
+ props += fields[i].trim();
211
+ props += " ";
347
212
  }
348
213
  }
349
- }, {
350
- key: "offsetDate",
351
- value: function offsetDate(date, yearOffset, monthOffset, dayOffset) {
352
- var year = date.getFullYear() + yearOffset;
353
- var day = date.getDate() + dayOffset;
354
- var month = date.getMonth() + monthOffset;
355
- return new Date(year, month, day);
214
+ props = props.trim();
215
+ let prefix = Utils.isNull(viewName) ? "" : " > ";
216
+ return (Utils.isNull(viewName) ? "" : viewName) + (props.length > 0 ? prefix + props : "");
217
+ }
218
+ static setLegendColor(color) {
219
+ let legends = document.getElementsByClassName("legend");
220
+ for (let i = 0; i < legends.length; i++) {
221
+ legends[i].style.color = color;
356
222
  }
357
- }, {
358
- key: "getArgs",
359
- value: function getArgs(func) {
360
- // First match everything inside the function argument parens.
361
- var args = func.toString().match(/function\s.*?\(([^)]*)\)/)[1]; // Split the arguments string into an array comma delimited.
362
-
363
- return args.split(',').map(function (arg) {
364
- // Ensure no inline comments are parsed and trim the whitespace.
365
- return arg.replace(/\/\*.*\*\//, '').trim();
366
- }).filter(function (arg) {
367
- // Ensure no undefined values are added.
368
- return arg;
369
- });
223
+ }
224
+ static setLegend(text) {
225
+ if (!Utils.isNull(text)) {
226
+ let legend = document.getElementById("globalLegend");
227
+ legend.innerHTML = text;
370
228
  }
371
- }, {
372
- key: "mergeObjects",
373
- value: function mergeObjects(source, target) {
374
- var properties = Object.getOwnPropertyNames(source);
375
-
376
- var _iterator = _createForOfIteratorHelper(properties),
377
- _step;
378
-
379
- try {
380
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
381
- var property = _step.value;
382
- target[property] = source[property];
383
- }
384
- } catch (err) {
385
- _iterator.e(err);
386
- } finally {
387
- _iterator.f();
388
- }
389
-
390
- return target;
229
+ }
230
+ showMessage = (viewRef, message, type) => {
231
+ if (Utils.isNull(message)) {
232
+ message = "";
391
233
  }
392
- }]);
393
-
394
- return Utils;
395
- }();
396
-
397
- exports.default = Utils;
398
-
399
- _defineProperty(Utils, "SYSTEM_ERROR_MESSAGE", "A system error has accured. Please contact your system administrator");
400
-
401
- _defineProperty(Utils, "capitalize", function (s) {
402
- if (typeof s !== 'string') return '';
403
- return s.charAt(0).toUpperCase() + s.slice(1);
404
- });
405
-
406
- _defineProperty(Utils, "getFieldColspan", function (field) {
407
- return !Utils.isNull(field.attributes) && !Utils.isNull(field.attributes['colspan']) ? parseFloat(field.attributes['colspan']) : 1;
408
- });
409
-
410
- _defineProperty(Utils, "createRow", function () {
411
- var row = {};
412
- row.fields = [];
413
- row.usedSlots = 0;
414
- return row;
415
- });
416
-
417
- _defineProperty(Utils, "fillRowWithSpacers", function (row, max) {
418
- for (var i = row.usedSlots; i < max; i++) {
419
- var field = {};
420
- field.fieldType = 'LABEL';
421
- field.id = 'system_col_span_spacer_' + i;
422
- row.fields.push(field);
234
+ let messageType = type === "ERROR" ? "danger" : Utils.isNull(type) ? "message" : type;
235
+ viewRef.setState({
236
+ message: message,
237
+ messageStyle: messageType
238
+ });
239
+ };
240
+ saveForm(viewRef, formRef, url) {
241
+ this.saveForm(viewRef, formRef, url, null, null, null);
423
242
  }
424
- });
425
-
426
- _defineProperty(Utils, "rowHasSpaceForNewField", function (row, colspan, max) {
427
- return colspan <= max - row.usedSlots;
428
- });
429
-
430
- _defineProperty(Utils, "getPropertyChainPath", function (expression) {
431
- var path = {};
432
-
433
- if (!Utils.isNull(expression)) {
434
- var tokens = expression.split('.');
435
- path.property = tokens[tokens.length - 1];
436
- var voExpression = expression.substring(0, expression.indexOf('.'));
437
- path.valueObject = _DynamicJS.default.executeScript("".concat(Math.random(), "_PropertyChainUtilsEval"), voExpression);
438
-
439
- for (var i = 1; i < tokens.length - 1; i++) {
440
- var token = tokens[i];
441
-
442
- if (!Utils.isNull(path.valueObject)) {
443
- var getter = path.valueObject[token];
444
-
445
- if (!Utils.isNull(getter)) {
446
- if (typeof getter === 'function') {
447
- path.valueObject = getter();
448
- } else {
449
- path.valueObject = getter;
450
- }
243
+ saveForm(viewRef, formRef, url, successCallback, errorCallback) {
244
+ this.saveForm(viewRef, formRef, url, successCallback, errorCallback, null);
245
+ }
246
+ static offsetDate(date, yearOffset, monthOffset, dayOffset) {
247
+ let year = date.getFullYear() + yearOffset;
248
+ let day = date.getDate() + dayOffset;
249
+ let month = date.getMonth() + monthOffset;
250
+ return new Date(year, month, day);
251
+ }
252
+ autoSetDate(viewRef, formRef, newDate, yearOffset, monthOffset, dayOffset, autoFillDateName, refDateName) {
253
+ let stateDate = viewRef.state[refDateName];
254
+ let tempDate = stateDate;
255
+ if (Utils.isNull(stateDate) || stateDate.getTime() !== newDate.getTime()) {
256
+ viewRef.setState({
257
+ ...viewRef.state,
258
+ [refDateName]: newDate
259
+ }, () => {
260
+ if (!Utils.isNull(tempDate) && !Utils.isNull(viewRef.state.id)) {
261
+ let autoFillDate = Utils.offsetDate(newDate, yearOffset, monthOffset, dayOffset);
262
+ formRef.current.setValue(autoFillDateName, autoFillDate);
263
+ } else if (Utils.isNull(viewRef.state.id)) {
264
+ let autoFillDate = Utils.offsetDate(newDate, yearOffset, monthOffset, dayOffset);
265
+ formRef.current.setValue(autoFillDateName, autoFillDate);
451
266
  }
452
- } else {
453
- break;
454
- }
267
+ });
455
268
  }
456
269
  }
457
-
458
- return path;
459
- });
460
-
461
- _defineProperty(Utils, "mergeStyles", function (defaultStyle, config) {
462
- var configStyle = Utils.getComponentAttribute(config, 'style', null);
463
-
464
- if (configStyle) {
465
- return Utils.mergeObjects(configStyle, defaultStyle);
270
+ static getArgs(func) {
271
+ // First match everything inside the function argument parens.
272
+ var args = func.toString().match(/function\s.*?\(([^)]*)\)/)[1];
273
+
274
+ // Split the arguments string into an array comma delimited.
275
+ return args.split(',').map(function (arg) {
276
+ // Ensure no inline comments are parsed and trim the whitespace.
277
+ return arg.replace(/\/\*.*\*\//, '').trim();
278
+ }).filter(function (arg) {
279
+ // Ensure no undefined values are added.
280
+ return arg;
281
+ });
466
282
  }
467
-
468
- return defaultStyle;
469
- });
470
-
471
- _defineProperty(Utils, "publishErrorMessage", /*#__PURE__*/function () {
472
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(e, viewId) {
473
- var component,
474
- messageText,
475
- data,
476
- message,
477
- event,
478
- _args = arguments;
479
- return regeneratorRuntime.wrap(function _callee$(_context) {
480
- while (1) {
481
- switch (_context.prev = _context.next) {
482
- case 0:
483
- component = _args.length > 2 && _args[2] !== undefined ? _args[2] : null;
484
-
485
- if (!e.json) {
486
- _context.next = 8;
487
- break;
283
+ static getPropertyChainPath = expression => {
284
+ let path = {};
285
+ if (!this.isNull(expression)) {
286
+ let tokens = expression.split('.');
287
+ path.property = tokens[tokens.length - 1];
288
+ let voExpression = expression.substring(0, expression.indexOf('.'));
289
+ path.valueObject = _DynamicJS.default.executeScript(`${Math.random()}_PropertyChainUtilsEval`, voExpression);
290
+ for (let i = 1; i < tokens.length - 1; i++) {
291
+ let token = tokens[i];
292
+ if (!this.isNull(path.valueObject)) {
293
+ let getter = path.valueObject[token];
294
+ if (!Utils.isNull(getter)) {
295
+ if (typeof getter === 'function') {
296
+ path.valueObject = getter();
297
+ } else {
298
+ path.valueObject = getter;
488
299
  }
489
-
490
- _context.next = 4;
491
- return e.json();
492
-
493
- case 4:
494
- data = _context.sent;
495
- messageText = data.message;
496
- _context.next = 9;
497
- break;
498
-
499
- case 8:
500
- messageText = Utils.SYSTEM_ERROR_MESSAGE;
501
-
502
- case 9:
503
- message = {
504
- messageType: 'ERROR',
505
- message: messageText
506
- };
507
- event = new _Event.default(_ApplicationManager.default, viewId, message);
508
-
509
- _Observable.default.fireEvent(_EventType.default.MESSAGE_ARRIVED, event);
510
-
511
- if (component !== null) {
512
- event = new _Event.default(component, viewId, message);
513
-
514
- _Observable.default.fireEvent(_EventType.default.MESSAGE_ARRIVED, event);
515
- }
516
-
517
- case 13:
518
- case "end":
519
- return _context.stop();
300
+ }
301
+ } else {
302
+ break;
520
303
  }
521
304
  }
522
- }, _callee);
523
- }));
524
-
525
- return function (_x, _x2) {
526
- return _ref.apply(this, arguments);
305
+ }
306
+ return path;
527
307
  };
528
- }());
529
-
530
- _defineProperty(Utils, "publishSystemErrorMessage", function (viewId) {
531
- var component = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
532
- Utils.publishErrorMessage('A system error has accured. Please try again later', viewId, component);
533
- });
308
+ static mergeStyles = (defaultStyle, config) => {
309
+ let configStyle = Utils.getComponentAttribute(config, 'style', null);
310
+ if (configStyle) {
311
+ return this.mergeObjects(configStyle, defaultStyle);
312
+ }
313
+ return defaultStyle;
314
+ };
315
+ static mergeObjects(source, target) {
316
+ let properties = Object.getOwnPropertyNames(source);
317
+ for (const property of properties) {
318
+ target[property] = source[property];
319
+ }
320
+ return target;
321
+ }
322
+ static publishErrorMessage = async function (e, viewId) {
323
+ let component = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
324
+ let messageText;
325
+ if (e.json) {
326
+ let data = await e.json();
327
+ messageText = data.message;
328
+ } else {
329
+ messageText = _this.SYSTEM_ERROR_MESSAGE;
330
+ }
331
+ let message = {
332
+ messageType: 'ERROR',
333
+ message: messageText
334
+ };
335
+ let event = new _Event.default(_ApplicationManager.default, viewId, message);
336
+ _Observable.default.fireEvent(_EventType.default.MESSAGE_ARRIVED, event);
337
+ if (component !== null) {
338
+ event = new _Event.default(component, viewId, message);
339
+ _Observable.default.fireEvent(_EventType.default.MESSAGE_ARRIVED, event);
340
+ }
341
+ };
342
+ static publishSystemErrorMessage = function (viewId) {
343
+ let component = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
344
+ Utils.publishErrorMessage('A system error has accured. Please try again later', viewId, component);
345
+ };
346
+ }
347
+ exports.default = Utils;