@agilemotion/oui-react-js 1.6.4 → 1.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ApplicationManager.js +675 -1044
- package/dist/BasicApp.js +9 -27
- package/dist/BasicAppHome.js +27 -101
- package/dist/DynamicJS.js +109 -197
- package/dist/InteractionPortalApp.js +7 -27
- package/dist/InteractionPortalAppHome.js +21 -87
- package/dist/InteractionPortalApp_old.js +60 -122
- package/dist/RestUtils.js +269 -410
- package/dist/TypedValue.js +20 -26
- package/dist/Utils.js +295 -481
- package/dist/WithRouter.js +9 -17
- package/dist/assets/jss/components/authNavbarStyle.js +168 -171
- package/dist/assets/jss/components/buttonStyle.js +2 -5
- package/dist/assets/jss/components/cardAvatarStyle.js +2 -5
- package/dist/assets/jss/components/cardBodyStyle.js +2 -5
- package/dist/assets/jss/components/cardFooterStyle.js +2 -5
- package/dist/assets/jss/components/cardHeaderStyle.js +20 -17
- package/dist/assets/jss/components/cardIconStyle.js +2 -5
- package/dist/assets/jss/components/cardStyle.js +2 -5
- package/dist/assets/jss/components/cardTextStyle.js +2 -5
- package/dist/assets/jss/components/customDropdownStyle.js +171 -173
- package/dist/assets/jss/components/customInputStyle.js +5 -13
- package/dist/assets/jss/components/dropdownStyle.js +71 -74
- package/dist/assets/jss/components/footerStyle.js +14 -23
- package/dist/assets/jss/components/headerLinksStyle.js +52 -53
- package/dist/assets/jss/components/headerStyle.js +68 -73
- package/dist/assets/jss/components/navbarLinksStyle.js +81 -74
- package/dist/assets/jss/components/navbarStyle.js +79 -84
- package/dist/assets/jss/components/sidebarStyle.js +438 -441
- package/dist/assets/jss/components/typographyStyle.js +5 -13
- package/dist/assets/jss/rootStyle.js +85 -151
- package/dist/assets/jss/views/layoutStyle.js +45 -51
- package/dist/assets/jss/views/loginBasicStyle.js +2 -5
- package/dist/assets/jss/views/loginBusinessPortalStyle.js +2 -5
- package/dist/assets/jss/views/loginStyle.js +80 -87
- package/dist/components/AlertBar.js +20 -75
- package/dist/components/AlertItem.js +13 -49
- package/dist/components/AlertTemplate.js +12 -18
- package/dist/components/Button.js +41 -112
- package/dist/components/Calendar.js +99 -208
- package/dist/components/ConfirmationDialog.js +13 -54
- package/dist/components/DataGrid.js +271 -695
- package/dist/components/DataGridColumn.js +24 -74
- package/dist/components/DataGridFilter.js +107 -245
- package/dist/components/DataGridHeading.js +34 -78
- package/dist/components/Dialog.js +37 -130
- package/dist/components/DocumentTemplateDesigner.js +16 -57
- package/dist/components/DocumentTemplateDesignerComponent.js +47 -141
- package/dist/components/DocumentTemplatePlaceholderDialog.js +34 -67
- package/dist/components/DocumentViewer.js +25 -65
- package/dist/components/DocumentViewerComponent.js +13 -44
- package/dist/components/ElementResizeHandler.js +148 -200
- package/dist/components/FileThumb.js +15 -56
- package/dist/components/Graph.js +98 -203
- package/dist/components/GraphNode.js +20 -61
- package/dist/components/HtmlPanel.js +38 -105
- package/dist/components/Icon.js +174 -253
- package/dist/components/LoadingIndicator.js +4 -11
- package/dist/components/LottieIcon.js +63 -60
- package/dist/components/PopupView.js +21 -60
- package/dist/components/Portlet.js +18 -60
- package/dist/components/RegularButton.js +34 -42
- package/dist/components/SignaturePanel.js +19 -67
- package/dist/components/SocketManager.js +133 -228
- package/dist/components/StepperTitleBar.js +48 -99
- package/dist/components/TabPage.js +30 -47
- package/dist/components/TabPanel.js +35 -122
- package/dist/components/TableCellContent.js +34 -98
- package/dist/components/TemplateDesigner.js +115 -230
- package/dist/components/TemplateItemEventHandler.js +298 -481
- package/dist/components/TemplateTable.js +117 -218
- package/dist/components/TitleBar.js +15 -53
- package/dist/components/Toolbar.js +44 -110
- package/dist/components/Tooltip.js +37 -56
- package/dist/components/Tree.js +50 -143
- package/dist/components/UseIsVisible.js +5 -25
- package/dist/components/card/Card.js +35 -39
- package/dist/components/card/CardAvatar.js +21 -32
- package/dist/components/card/CardBody.js +29 -36
- package/dist/components/card/CardFooter.js +26 -35
- package/dist/components/card/CardHeader.js +29 -36
- package/dist/components/card/CardIcon.js +15 -29
- package/dist/components/card/CardText.js +15 -29
- package/dist/components/customInput/CustomInput.js +38 -40
- package/dist/components/dashboard/FoldingSideTabDashboard.js +65 -184
- package/dist/components/dashboard/SideMenuModuleDashboard.js +67 -185
- package/dist/components/dashboard/TopMenuModuleDashboard.js +22 -63
- package/dist/components/dashboard/components/Header.js +15 -52
- package/dist/components/dashboard/components/LeftDrawer.js +9 -23
- package/dist/components/dashboard/components/UserIdentity.js +4 -12
- package/dist/components/dashboard/components/blackDashboard/fixedPlugin/FixedPlugin.js +115 -155
- package/dist/components/dashboard/components/blackDashboard/sidebar/FoldingTabSidebar.js +344 -419
- package/dist/components/dashboard/components/blackDashboard/sidebar/ModuleMenu.js +15 -29
- package/dist/components/dashboard/components/blackDashboard/sidebar/ModuleMenuSidebar.js +405 -485
- package/dist/components/dashboard/components/portal/Timeline.js +3 -8
- package/dist/components/dashboard/components/portal/Workspace.js +4 -13
- package/dist/components/footer/Footer.js +23 -45
- package/dist/components/footer/HomeFooter.js +38 -78
- package/dist/components/form/AddressSearch.js +26 -76
- package/dist/components/form/AutoComplete.js +54 -168
- package/dist/components/form/BaseField.js +59 -189
- package/dist/components/form/Checkbox.js +11 -24
- package/dist/components/form/DatePicker.js +28 -82
- package/dist/components/form/FieldSet.js +84 -300
- package/dist/components/form/Form.js +206 -501
- package/dist/components/form/GridField.js +83 -243
- package/dist/components/form/IconField.js +10 -21
- package/dist/components/form/ImageEditor.js +98 -208
- package/dist/components/form/LabelField.js +13 -28
- package/dist/components/form/LookupField.js +36 -102
- package/dist/components/form/MultiFileUploadField.js +67 -134
- package/dist/components/form/RadioGroup.js +20 -57
- package/dist/components/form/Section.js +33 -118
- package/dist/components/form/SelectItem.js +36 -83
- package/dist/components/form/SignatureTemplateDesignerField.js +12 -26
- package/dist/components/form/Switch.js +11 -24
- package/dist/components/form/TextField.js +19 -55
- package/dist/components/form/TimePicker.js +18 -43
- package/dist/components/form/TransferList.js +76 -200
- package/dist/components/form/UploadField.js +134 -256
- package/dist/components/grid/GridContainer.js +10 -23
- package/dist/components/grid/GridItem.js +10 -23
- package/dist/components/layout/CollapsiblePanel.js +20 -59
- package/dist/components/layout/Layout.js +40 -149
- package/dist/components/layout/View.js +65 -195
- package/dist/components/layout/ViewContainer.js +13 -33
- package/dist/components/layout/ViewPort.js +14 -48
- package/dist/components/layout/Window.js +62 -135
- package/dist/components/layout/WindowViewPort.js +18 -63
- package/dist/components/media/ClosablePanel.js +9 -18
- package/dist/components/media/LobbyWaitingList.js +11 -17
- package/dist/components/media/MediaSoupHelper.js +173 -401
- package/dist/components/media/SideBarContent.js +17 -34
- package/dist/components/media/SocketRequest.js +7 -18
- package/dist/components/media/SocketResponse.js +5 -14
- package/dist/components/media/Timer.js +18 -54
- package/dist/components/media/Toolbar.js +97 -254
- package/dist/components/media/ToolbarButton.js +34 -95
- package/dist/components/media/Toolbar_bck.js +70 -186
- package/dist/components/media/Tracks.js +19 -33
- package/dist/components/media/TrainingRoom.js +121 -374
- package/dist/components/media/Transports.js +17 -29
- package/dist/components/media/VCEventManager.js +45 -116
- package/dist/components/media/VCEventType.js +82 -168
- package/dist/components/media/VCParticipantList.js +16 -51
- package/dist/components/media/VCParticipantListItem.js +44 -141
- package/dist/components/media/VCRoom.js +14 -58
- package/dist/components/media/VCRoomParticipant.js +235 -556
- package/dist/components/media/VCRoomRecorder.js +106 -204
- package/dist/components/media/VCRoomWorkspace.js +248 -584
- package/dist/components/media/Video.js +27 -112
- package/dist/components/media/VideoPlayer.js +23 -91
- package/dist/components/media/chat/ChatRoom.js +143 -361
- package/dist/components/media/chat/ChatRoomItem.js +17 -58
- package/dist/components/media/chat/ChatRoomList.js +15 -60
- package/dist/components/menu/CollapsibleMenu.js +22 -52
- package/dist/components/menu/MenuBars.js +50 -116
- package/dist/components/menu/MenuButton.js +53 -130
- package/dist/components/menu/MenuItem.js +11 -51
- package/dist/components/menu/MenuLink.js +13 -41
- package/dist/components/menu/PopupMenu.js +13 -25
- package/dist/components/navbars/AuthNavbar.js +21 -56
- package/dist/components/navbars/HomeNavbar.js +213 -290
- package/dist/components/navbars/PortalNavbar.js +26 -81
- package/dist/components/signatures/AgilitySignaturePanel.js +41 -135
- package/dist/components/signatures/AlertItem.js +14 -50
- package/dist/components/signatures/Card.js +6 -16
- package/dist/components/signatures/DocumentContainer.js +57 -165
- package/dist/components/signatures/ImageSignatureInput.js +64 -124
- package/dist/components/signatures/MenuButton.js +28 -63
- package/dist/components/signatures/Prompt.js +6 -41
- package/dist/components/signatures/ResponsiveTable.js +181 -370
- package/dist/components/signatures/SearchView.js +34 -112
- package/dist/components/signatures/SignatorySearch.js +11 -44
- package/dist/components/signatures/SignatorySearchForm.js +19 -50
- package/dist/components/signatures/SignatureInput.js +28 -91
- package/dist/components/signatures/SignatureInputProps.js +49 -144
- package/dist/components/signatures/SignatureTemplateDesigner.js +230 -430
- package/dist/components/signatures/Toolbar.js +99 -173
- package/dist/components/signatures/ViewUtils.js +207 -313
- package/dist/components/typography/Danger.js +6 -11
- package/dist/components/typography/Info.js +7 -11
- package/dist/components/typography/Link.js +6 -12
- package/dist/event/ActionHandlers.js +48 -87
- package/dist/event/Event.js +21 -25
- package/dist/event/EventListener.js +54 -48
- package/dist/event/EventType.js +18 -40
- package/dist/event/LoadDataActionHandler.js +10 -31
- package/dist/event/Observable.js +204 -396
- package/dist/event/RouteActionHandler.js +119 -171
- package/dist/event/ScriptActionHandler.js +10 -32
- package/dist/event/ServiceCallActionHandler.js +37 -64
- package/dist/event/SignalGraphActionHandler.js +9 -31
- package/dist/js/Addresses.js +23 -42
- package/dist/js/Calendar.js +41 -89
- package/dist/js/DynamicLib.js +11 -23
- package/dist/js/Media.js +80 -174
- package/dist/js/Validators.js +6 -12
- package/dist/js/Windows.js +22 -40
- package/dist/redux/store/ConfigureStore.js +12 -29
- package/dist/redux/store/DashboardStore.js +47 -120
- package/dist/redux/store/History.js +2 -5
- package/dist/redux/store/SecurityStore.js +22 -65
- package/dist/security/TokenManager.js +29 -53
- package/dist/theme-default.js +3 -8
- package/dist/view/Dashboard.js +140 -308
- package/dist/view/PortalDashboard.js +6 -13
- package/dist/view/Settings.js +3 -11
- package/dist/view/Views.js +15 -35
- package/dist/view/security/ChangePasswordBasic.js +41 -147
- package/dist/view/security/ForgotPassword.js +26 -106
- package/dist/view/security/ForgotPasswordBasic.js +22 -96
- package/dist/view/security/Login.js +29 -117
- package/dist/view/security/LoginBasic.js +28 -108
- package/dist/view/security/LoginInteractionPortal.js +28 -106
- package/dist/view/security/ResetPassword.js +25 -110
- package/dist/view/security/ResetPasswordBasic.js +39 -142
- package/dist/view/security/Security.js +14 -26
- package/package.json +25 -20
package/dist/RestUtils.js
CHANGED
|
@@ -3,477 +3,336 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
|
|
6
|
+
exports.sendRequest = exports.postData = exports.location = exports.invokeRpc = exports.invokeRest = exports.download = void 0;
|
|
8
7
|
var _Utils = _interopRequireDefault(require("./Utils"));
|
|
9
|
-
|
|
10
8
|
var _reactPromiseTracker = require("react-promise-tracker");
|
|
11
|
-
|
|
12
9
|
var _ApplicationManager = _interopRequireDefault(require("./ApplicationManager"));
|
|
13
|
-
|
|
14
10
|
var _Event = _interopRequireDefault(require("./event/Event"));
|
|
15
|
-
|
|
16
11
|
var _Observable = _interopRequireDefault(require("./event/Observable"));
|
|
17
|
-
|
|
18
12
|
var _EventType = _interopRequireDefault(require("./event/EventType"));
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
31
|
-
|
|
32
|
-
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); } }
|
|
33
|
-
|
|
34
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
35
|
-
|
|
36
|
-
var location = window.location.protocol + '//' + window.location.hostname;
|
|
37
|
-
exports.location = location;
|
|
38
|
-
|
|
39
|
-
var status = function status(response) {
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
const location = exports.location = window.location.protocol + '//' + window.location.hostname;
|
|
15
|
+
const status = response => {
|
|
40
16
|
if (response.ok) {
|
|
41
17
|
return Promise.resolve(response);
|
|
42
18
|
} else {
|
|
43
19
|
return Promise.reject(response);
|
|
44
20
|
}
|
|
45
21
|
};
|
|
46
|
-
|
|
47
|
-
var json = function json(response) {
|
|
22
|
+
const json = response => {
|
|
48
23
|
return response.text();
|
|
49
24
|
};
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
_createClass(RestUtils, [{
|
|
57
|
-
key: "isParamValueNull",
|
|
58
|
-
value: function isParamValueNull(paramValue) {
|
|
59
|
-
if (_Utils.default.isNull(paramValue)) {
|
|
60
|
-
return true;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
return paramValue.hasOwnProperty('value') ? _Utils.default.isNull(paramValue.value) : false;
|
|
25
|
+
class RestUtils {
|
|
26
|
+
isParamValueNull(paramValue) {
|
|
27
|
+
if (_Utils.default.isNull(paramValue)) {
|
|
28
|
+
return true;
|
|
64
29
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
return;
|
|
30
|
+
return paramValue.hasOwnProperty('value') ? _Utils.default.isNull(paramValue.value) : false;
|
|
31
|
+
}
|
|
32
|
+
invokeRest(service, component, viewId, successCallback, errorCallback, invalidParamCallback, returnValueBinding, successMessage) {
|
|
33
|
+
let event = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : null;
|
|
34
|
+
let url = service.url.startsWith('http://') || service.url.startsWith('https://') ? service.url : location + `${_ApplicationManager.default.getContextRoot() + service.url}`;
|
|
35
|
+
let requestBody = null;
|
|
36
|
+
if (!_Utils.default.isNull(service.parameters)) {
|
|
37
|
+
let queryString = '';
|
|
38
|
+
let pathParameters = '';
|
|
39
|
+
let requestBodyParamFound = false;
|
|
40
|
+
for (const parameter of service.parameters) {
|
|
41
|
+
let parameterValue = _ApplicationManager.default.resolveParameterValue(parameter, event ? event.data : null);
|
|
42
|
+
if (!_Utils.default.isNull(parameter.validator) && !_Utils.default.evaluateBooleanExpression(parameter.validator.nullable, parameter.name) && this.isParamValueNull(parameterValue)) {
|
|
43
|
+
if (!_Utils.default.isNull(invalidParamCallback)) {
|
|
44
|
+
console.error('INVALID PARAMETER : ', parameter);
|
|
45
|
+
invalidParamCallback(parameter);
|
|
46
|
+
}
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
let httpParameterType = parameter.httpParameterType;
|
|
50
|
+
if (_Utils.default.isNull(httpParameterType)) {
|
|
51
|
+
httpParameterType = 'QUERY_PARAMETER';
|
|
52
|
+
}
|
|
53
|
+
if (httpParameterType === 'QUERY_PARAMETER') {
|
|
54
|
+
if (!_Utils.default.isNull(parameterValue)) {
|
|
55
|
+
if (queryString.length > 0) {
|
|
56
|
+
queryString += '&';
|
|
95
57
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
if (_Utils.default.isNull(httpParameterType)) {
|
|
100
|
-
httpParameterType = 'QUERY_PARAMETER';
|
|
58
|
+
if (!_Utils.default.isNull(service.includeParameterTypes) && service.includeParameterTypes === true) {
|
|
59
|
+
queryString += parameterValue.type + ':';
|
|
101
60
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
if (!_Utils.default.isNull(parameterValue)) {
|
|
105
|
-
if (queryString.length > 0) {
|
|
106
|
-
queryString += '&';
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
if (!_Utils.default.isNull(service.includeParameterTypes) && service.includeParameterTypes === true) {
|
|
110
|
-
queryString += parameterValue.type + ':';
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
if (parameterValue.type === 'MapObject') {
|
|
114
|
-
parameterValue.value.type = 'MapEntityDto';
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
queryString += parameter.name + '=';
|
|
118
|
-
queryString += typeof parameterValue.value === 'string' || typeof parameterValue.value === 'number' ? parameterValue.value : JSON.stringify(parameterValue.value);
|
|
119
|
-
}
|
|
61
|
+
if (parameterValue.type === 'MapObject') {
|
|
62
|
+
parameterValue.value.type = 'MapEntityDto';
|
|
120
63
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
64
|
+
queryString += parameter.name + '=';
|
|
65
|
+
queryString += typeof parameterValue.value === 'string' || typeof parameterValue.value === 'number' ? parameterValue.value : JSON.stringify(parameterValue.value);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
if (httpParameterType === 'PATH_VARIABLE') {
|
|
69
|
+
if (!_Utils.default.isNull(parameterValue)) {
|
|
70
|
+
pathParameters += '/' + (typeof parameterValue.value === 'object' ? JSON.stringify(parameterValue.value) : parameterValue.instanceType === 'TypedValue' ? parameterValue.value : parameterValue);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (httpParameterType === 'REQUEST_BODY') {
|
|
74
|
+
if (requestBodyParamFound) {
|
|
75
|
+
console.error('Only one request body is permitted');
|
|
76
|
+
return;
|
|
77
|
+
} else {
|
|
78
|
+
if (!this.isParamValueNull(parameterValue)) {
|
|
79
|
+
requestBody = parameterValue.instanceType === 'TypedValue' ? parameterValue.value : parameterValue;
|
|
80
|
+
if (parameterValue.type === 'MapObject') {
|
|
81
|
+
requestBody.type = 'MapEntityDto';
|
|
132
82
|
} else {
|
|
133
|
-
if (
|
|
134
|
-
requestBody = parameterValue.
|
|
135
|
-
|
|
136
|
-
if (parameterValue.type === 'MapObject') {
|
|
137
|
-
requestBody.type = 'MapEntityDto';
|
|
138
|
-
} else {
|
|
139
|
-
if (_typeof(requestBody) === 'object') {
|
|
140
|
-
requestBody.type = parameterValue.type;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
83
|
+
if (typeof requestBody === 'object') {
|
|
84
|
+
requestBody.type = parameterValue.type;
|
|
143
85
|
}
|
|
144
86
|
}
|
|
145
87
|
}
|
|
146
88
|
}
|
|
147
|
-
} catch (err) {
|
|
148
|
-
_iterator.e(err);
|
|
149
|
-
} finally {
|
|
150
|
-
_iterator.f();
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
if (pathParameters.length > 0) {
|
|
154
|
-
url += pathParameters;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
if (queryString.length > 0) {
|
|
158
|
-
url += '?';
|
|
159
|
-
url += queryString;
|
|
160
89
|
}
|
|
161
90
|
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
var contentType = null;
|
|
165
|
-
|
|
166
|
-
if (!_Utils.default.isNull(headers)) {
|
|
167
|
-
contentType = headers['Content-Type'];
|
|
91
|
+
if (pathParameters.length > 0) {
|
|
92
|
+
url += pathParameters;
|
|
168
93
|
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
if (requestBody !== null || service.method === 'POST') {
|
|
175
|
-
console.log("POSTING REST REQUEST BODY : ", requestBody);
|
|
176
|
-
postData(url, function (response) {
|
|
177
|
-
if (!_Utils.default.isNull(successCallback)) {
|
|
178
|
-
_this.processSuccessfulResponseData(component, response, successCallback, viewId, successMessage);
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
var path = _Utils.default.getPropertyChainPath(returnValueBinding);
|
|
182
|
-
|
|
183
|
-
if (!_Utils.default.isNull(path.valueObject) && !_Utils.default.isNull(path.property)) {
|
|
184
|
-
path.valueObject[path.property] = response;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
_this.fireEvent(viewId, component, _EventType.default.SERVICE_CALL_SUCCESS, response);
|
|
188
|
-
}, function (e) {
|
|
189
|
-
if (!_Utils.default.isNull(errorCallback)) {
|
|
190
|
-
errorCallback(e);
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
_this.fireEvent(viewId, component, _EventType.default.SERVICE_CALL_FAILURE);
|
|
194
|
-
}, !service.url.startsWith('http://'), requestBody);
|
|
195
|
-
} else if (contentType === 'application/pdf' || contentType === 'application/vnd.ms-excel') {
|
|
196
|
-
download(url, function (data) {}, function (e) {
|
|
197
|
-
if (!_Utils.default.isNull(errorCallback)) {
|
|
198
|
-
errorCallback(e);
|
|
199
|
-
}
|
|
200
|
-
});
|
|
201
|
-
} else {
|
|
202
|
-
sendRequest(url, function (data) {
|
|
203
|
-
var path = _Utils.default.getPropertyChainPath(returnValueBinding);
|
|
204
|
-
|
|
205
|
-
if (!_Utils.default.isNull(path.valueObject) && !_Utils.default.isNull(path.property)) {
|
|
206
|
-
path.valueObject[path.property] = data;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
_this.fireEvent(viewId, component, _EventType.default.SERVICE_CALL_SUCCESS, data);
|
|
210
|
-
|
|
211
|
-
if (!_Utils.default.isNull(successCallback)) {
|
|
212
|
-
successCallback(data);
|
|
213
|
-
}
|
|
214
|
-
}, function (e) {
|
|
215
|
-
_this.fireEvent(viewId, component, _EventType.default.SERVICE_CALL_FAILURE);
|
|
216
|
-
|
|
217
|
-
if (!_Utils.default.isNull(errorCallback)) {
|
|
218
|
-
errorCallback(e);
|
|
219
|
-
}
|
|
220
|
-
}, !service.url.startsWith('http://'));
|
|
94
|
+
if (queryString.length > 0) {
|
|
95
|
+
url += '?';
|
|
96
|
+
url += queryString;
|
|
221
97
|
}
|
|
222
98
|
}
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
if (!_Utils.default.isNull(rpcDetails.parameters) && rpcDetails.parameters.length > 0) {
|
|
237
|
-
request.parameters = [];
|
|
238
|
-
|
|
239
|
-
for (var i = 0; i < rpcDetails.parameters.length; i++) {
|
|
240
|
-
var parameterConfig = rpcDetails.parameters[i];
|
|
241
|
-
var parameter = {};
|
|
242
|
-
parameter.name = parameterConfig.name;
|
|
243
|
-
parameter.index = parameterConfig.index;
|
|
244
|
-
|
|
245
|
-
var val = _ApplicationManager.default.resolveParameterValue(parameterConfig, event ? event.data : null);
|
|
246
|
-
|
|
247
|
-
if (!_Utils.default.isNull(val)) {
|
|
248
|
-
parameter.value = val.value;
|
|
249
|
-
parameter.type = val.type;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
if (typeof parameter.value === 'undefined') {
|
|
253
|
-
parameter.value = null;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
if (_Utils.default.isNull(parameter.type)) {
|
|
257
|
-
parameter.type = 'String';
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
if (!_Utils.default.isNull(parameterConfig.validator) && _Utils.default.evaluateBooleanExpression(parameterConfig.validator.nullable, parameterConfig.name) === false && this.isParamValueNull(parameter)) {
|
|
261
|
-
if (!_Utils.default.isNull(invalidParamCallback)) {
|
|
262
|
-
console.error('INVALID PARAMETER : ', parameter);
|
|
263
|
-
invalidParamCallback(parameter);
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
return;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
request.parameters.push(parameter);
|
|
99
|
+
let headers = service.headers;
|
|
100
|
+
let contentType = null;
|
|
101
|
+
if (!_Utils.default.isNull(headers)) {
|
|
102
|
+
contentType = headers['Content-Type'];
|
|
103
|
+
}
|
|
104
|
+
if (requestBody !== null && service.method === 'GET') {
|
|
105
|
+
throw new Error('A request body parameter cannot be specified for a GET request');
|
|
106
|
+
}
|
|
107
|
+
if (requestBody !== null || service.method === 'POST') {
|
|
108
|
+
console.log("POSTING REST REQUEST BODY : ", requestBody);
|
|
109
|
+
postData(url, response => {
|
|
110
|
+
if (!_Utils.default.isNull(successCallback)) {
|
|
111
|
+
this.processSuccessfulResponseData(component, response, successCallback, viewId, successMessage);
|
|
270
112
|
}
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
if (!_Utils.default.isNull(viewId) && !_Utils.default.isNull(component)) {
|
|
275
|
-
var path = _Utils.default.getPropertyChainPath(returnValueBinding);
|
|
276
|
-
|
|
277
|
-
if (!_Utils.default.isNull(path.valueObject) && !_Utils.default.isNull(path.property)) {
|
|
278
|
-
path.valueObject[path.property] = response;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
_this2.fireEvent(viewId, component, _EventType.default.SERVICE_CALL_SUCCESS, response.data);
|
|
282
|
-
|
|
283
|
-
if (successCallback !== null) {
|
|
284
|
-
successCallback(response);
|
|
285
|
-
}
|
|
113
|
+
let path = _Utils.default.getPropertyChainPath(returnValueBinding);
|
|
114
|
+
if (!_Utils.default.isNull(path.valueObject) && !_Utils.default.isNull(path.property)) {
|
|
115
|
+
path.valueObject[path.property] = response;
|
|
286
116
|
}
|
|
287
|
-
|
|
288
|
-
|
|
117
|
+
this.fireEvent(viewId, component, _EventType.default.SERVICE_CALL_SUCCESS, response);
|
|
118
|
+
}, e => {
|
|
119
|
+
if (!_Utils.default.isNull(errorCallback)) {
|
|
289
120
|
errorCallback(e);
|
|
290
121
|
}
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
122
|
+
this.fireEvent(viewId, component, _EventType.default.SERVICE_CALL_FAILURE);
|
|
123
|
+
}, !service.url.startsWith('http://'), requestBody);
|
|
124
|
+
} else if (contentType === 'application/pdf' || contentType === 'application/vnd.ms-excel') {
|
|
125
|
+
download(url, data => {}, e => {
|
|
126
|
+
if (!_Utils.default.isNull(errorCallback)) {
|
|
127
|
+
errorCallback(e);
|
|
294
128
|
}
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
129
|
+
});
|
|
130
|
+
} else {
|
|
131
|
+
sendRequest(url, data => {
|
|
132
|
+
let path = _Utils.default.getPropertyChainPath(returnValueBinding);
|
|
133
|
+
if (!_Utils.default.isNull(path.valueObject) && !_Utils.default.isNull(path.property)) {
|
|
134
|
+
path.valueObject[path.property] = data;
|
|
135
|
+
}
|
|
136
|
+
this.fireEvent(viewId, component, _EventType.default.SERVICE_CALL_SUCCESS, data);
|
|
137
|
+
if (!_Utils.default.isNull(successCallback)) {
|
|
138
|
+
successCallback(data);
|
|
139
|
+
}
|
|
140
|
+
}, e => {
|
|
141
|
+
this.fireEvent(viewId, component, _EventType.default.SERVICE_CALL_FAILURE);
|
|
142
|
+
if (!_Utils.default.isNull(errorCallback)) {
|
|
143
|
+
errorCallback(e);
|
|
144
|
+
}
|
|
145
|
+
}, !service.url.startsWith('http://'));
|
|
306
146
|
}
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
fetchConfig = {
|
|
328
|
-
method: _Utils.default.isNull(method) ? 'GET' : method,
|
|
329
|
-
headers: {
|
|
330
|
-
'Content-Type': 'application/json',
|
|
331
|
-
'Accept': 'application/json'
|
|
332
|
-
},
|
|
333
|
-
body: data
|
|
334
|
-
};
|
|
147
|
+
}
|
|
148
|
+
invokeRpc(rpcDetails, component, viewId, successCallback, errorCallback, invalidParamCallback, returnValueBinding, successMessage) {
|
|
149
|
+
let event = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : null;
|
|
150
|
+
let request = {};
|
|
151
|
+
request.id = viewId;
|
|
152
|
+
let split = rpcDetails.serviceId.split('.');
|
|
153
|
+
request.service = split[1];
|
|
154
|
+
request.method = rpcDetails.procedureName;
|
|
155
|
+
let module = split[0].toLowerCase();
|
|
156
|
+
if (!_Utils.default.isNull(rpcDetails.parameters) && rpcDetails.parameters.length > 0) {
|
|
157
|
+
request.parameters = [];
|
|
158
|
+
for (let i = 0; i < rpcDetails.parameters.length; i++) {
|
|
159
|
+
let parameterConfig = rpcDetails.parameters[i];
|
|
160
|
+
let parameter = {};
|
|
161
|
+
parameter.name = parameterConfig.name;
|
|
162
|
+
parameter.index = parameterConfig.index;
|
|
163
|
+
let val = _ApplicationManager.default.resolveParameterValue(parameterConfig, event ? event.data : null);
|
|
164
|
+
if (!_Utils.default.isNull(val)) {
|
|
165
|
+
parameter.value = val.value;
|
|
166
|
+
parameter.type = val.type;
|
|
335
167
|
}
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
fetchConfig.headers['Content-Type'] = 'application/json; charset=utf-8';
|
|
168
|
+
if (typeof parameter.value === 'undefined') {
|
|
169
|
+
parameter.value = null;
|
|
339
170
|
}
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
if (download) {
|
|
343
|
-
if (url.indexOf('?') < 0) {
|
|
344
|
-
url += '?';
|
|
345
|
-
} else {
|
|
346
|
-
url += '&';
|
|
171
|
+
if (_Utils.default.isNull(parameter.type)) {
|
|
172
|
+
parameter.type = 'String';
|
|
347
173
|
}
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
} else {
|
|
355
|
-
if (_Utils.default.isNull(track) || track === true) {
|
|
356
|
-
(0, _reactPromiseTracker.trackPromise)(this.executeFetch(url, fetchConfig, successCallback, viewId, successMessage, errorCallback));
|
|
357
|
-
} else {
|
|
358
|
-
this.executeFetch(url, fetchConfig, successCallback, viewId, successMessage, errorCallback);
|
|
174
|
+
if (!_Utils.default.isNull(parameterConfig.validator) && _Utils.default.evaluateBooleanExpression(parameterConfig.validator.nullable, parameterConfig.name) === false && this.isParamValueNull(parameter)) {
|
|
175
|
+
if (!_Utils.default.isNull(invalidParamCallback)) {
|
|
176
|
+
console.error('INVALID PARAMETER : ', parameter);
|
|
177
|
+
invalidParamCallback(parameter);
|
|
178
|
+
}
|
|
179
|
+
return;
|
|
359
180
|
}
|
|
181
|
+
request.parameters.push(parameter);
|
|
360
182
|
}
|
|
361
183
|
}
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
return fetch(encodeURI(url), fetchConfig).then(status).then(json).then(function (data) {
|
|
368
|
-
_this3.processSuccessfulResponseData(null, data, successCallback, viewId, successMessage);
|
|
369
|
-
}).catch(function (e) {
|
|
370
|
-
console.error(e);
|
|
371
|
-
|
|
372
|
-
if (e.status === 401 && !url.endsWith('/logout')) {
|
|
373
|
-
errorCallback(e);
|
|
374
|
-
|
|
375
|
-
_ApplicationManager.default.clear();
|
|
376
|
-
|
|
377
|
-
_ApplicationManager.default.navigate('/login');
|
|
184
|
+
this.doFetch(location + _ApplicationManager.default.getContextRoot() + '/' + module + '/api/v1/rpc/invoke', response => {
|
|
185
|
+
if (!_Utils.default.isNull(viewId) && !_Utils.default.isNull(component)) {
|
|
186
|
+
let path = _Utils.default.getPropertyChainPath(returnValueBinding);
|
|
187
|
+
if (!_Utils.default.isNull(path.valueObject) && !_Utils.default.isNull(path.property)) {
|
|
188
|
+
path.valueObject[path.property] = response;
|
|
378
189
|
}
|
|
379
|
-
|
|
380
|
-
if (
|
|
381
|
-
|
|
190
|
+
this.fireEvent(viewId, component, _EventType.default.SERVICE_CALL_SUCCESS, response.data);
|
|
191
|
+
if (successCallback !== null) {
|
|
192
|
+
successCallback(response);
|
|
382
193
|
}
|
|
383
|
-
}
|
|
194
|
+
}
|
|
195
|
+
}, e => {
|
|
196
|
+
if (errorCallback !== null) {
|
|
197
|
+
errorCallback(e);
|
|
198
|
+
}
|
|
199
|
+
if (!_Utils.default.isNull(viewId) && !_Utils.default.isNull(component)) {
|
|
200
|
+
this.fireEvent(viewId, component, _EventType.default.SERVICE_CALL_FAILURE);
|
|
201
|
+
}
|
|
202
|
+
}, true, 'POST', false, request, viewId, successMessage, true);
|
|
203
|
+
}
|
|
204
|
+
doPostData(url, successCallback, errorCallback, secure, data, viewId, successMessage) {
|
|
205
|
+
this.fetchWithCustomConfig(url, successCallback, errorCallback, secure, null, 'POST', false, data, 'rest');
|
|
206
|
+
}
|
|
207
|
+
doFetch(url, successCallback, errorCallback, secure, method, download, body, viewId, successMessage, track) {
|
|
208
|
+
this.fetchWithCustomConfig(url, successCallback, errorCallback, secure, null, method, download, body, null, viewId, successMessage, track);
|
|
209
|
+
}
|
|
210
|
+
fetchWithCustomConfig(url, successCallback, errorCallback, secure, config, method, download, body, serviceType, viewId, successMessage, track) {
|
|
211
|
+
const accessToken = sessionStorage.getItem('accessToken');
|
|
212
|
+
const idToken = sessionStorage.getItem('idToken');
|
|
213
|
+
let data = body ? JSON.stringify(body) : null;
|
|
214
|
+
let fetchConfig = config;
|
|
215
|
+
if (_Utils.default.isNull(fetchConfig)) {
|
|
216
|
+
if (_Utils.default.isNull(secure) || secure === true) {
|
|
217
|
+
fetchConfig = {
|
|
218
|
+
method: _Utils.default.isNull(method) ? 'GET' : method,
|
|
219
|
+
headers: {
|
|
220
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
221
|
+
'Authorization': 'Bearer ' + accessToken,
|
|
222
|
+
'idToken': idToken
|
|
223
|
+
},
|
|
224
|
+
body: data
|
|
225
|
+
};
|
|
226
|
+
} else {
|
|
227
|
+
fetchConfig = {
|
|
228
|
+
method: _Utils.default.isNull(method) ? 'GET' : method,
|
|
229
|
+
headers: {
|
|
230
|
+
'Content-Type': 'application/json',
|
|
231
|
+
'Accept': 'application/json'
|
|
232
|
+
},
|
|
233
|
+
body: data
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
if ('rest' === serviceType) {
|
|
237
|
+
fetchConfig.headers['Content-Type'] = 'application/json; charset=utf-8';
|
|
238
|
+
}
|
|
384
239
|
}
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
var response;
|
|
389
|
-
|
|
390
|
-
if (!_Utils.default.isNull(data) && data.toString().trim().length === 0) {
|
|
391
|
-
response = null;
|
|
392
|
-
} else if (_typeof(data) === 'object' || _Utils.default.isNull(data) || data.toString().trim().length === 0) {
|
|
393
|
-
response = data;
|
|
240
|
+
if (download) {
|
|
241
|
+
if (url.indexOf('?') < 0) {
|
|
242
|
+
url += '?';
|
|
394
243
|
} else {
|
|
395
|
-
|
|
396
|
-
response = JSON.parse(data);
|
|
397
|
-
} catch (ignored) {
|
|
398
|
-
response = data;
|
|
399
|
-
}
|
|
244
|
+
url += '&';
|
|
400
245
|
}
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
246
|
+
url += 'access_token=' + accessToken;
|
|
247
|
+
url += '&idToken=' + idToken;
|
|
248
|
+
url += '&themePrimaryColor=' + encodeURIComponent(_ApplicationManager.default.getApplicationPrimaryColor());
|
|
249
|
+
url += '&themeSecondaryColor=' + encodeURIComponent(_ApplicationManager.default.getApplicationSecondaryColor());
|
|
250
|
+
window.open(encodeURI(url), '_blank');
|
|
251
|
+
} else {
|
|
252
|
+
if (_Utils.default.isNull(track) || track === true) {
|
|
253
|
+
(0, _reactPromiseTracker.trackPromise)(this.executeFetch(url, fetchConfig, successCallback, viewId, successMessage, errorCallback));
|
|
254
|
+
} else {
|
|
255
|
+
this.executeFetch(url, fetchConfig, successCallback, viewId, successMessage, errorCallback);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
executeFetch(url, fetchConfig, successCallback, viewId, successMessage, errorCallback) {
|
|
260
|
+
return fetch(encodeURI(url), fetchConfig).then(status).then(json).then(data => {
|
|
261
|
+
this.processSuccessfulResponseData(null, data, successCallback, viewId, successMessage);
|
|
262
|
+
}).catch(e => {
|
|
263
|
+
console.error(e);
|
|
264
|
+
if (e.status === 401 && !url.endsWith('/logout')) {
|
|
265
|
+
errorCallback(e);
|
|
266
|
+
_ApplicationManager.default.clear();
|
|
267
|
+
_ApplicationManager.default.navigate('/login');
|
|
268
|
+
}
|
|
269
|
+
if (errorCallback !== null) {
|
|
270
|
+
errorCallback(e);
|
|
271
|
+
}
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
processSuccessfulResponseData(component, data, successCallback, viewId, successMessage) {
|
|
275
|
+
let response;
|
|
276
|
+
if (!_Utils.default.isNull(data) && data.toString().trim().length === 0) {
|
|
277
|
+
response = null;
|
|
278
|
+
} else if (typeof data === 'object' || _Utils.default.isNull(data) || data.toString().trim().length === 0) {
|
|
279
|
+
response = data;
|
|
280
|
+
} else {
|
|
281
|
+
try {
|
|
282
|
+
response = JSON.parse(data);
|
|
283
|
+
} catch (ignored) {
|
|
284
|
+
response = data;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
if (successCallback !== null) {
|
|
288
|
+
let responseData = response ? response.data : null;
|
|
289
|
+
if (response && responseData && response.dataType === 'message') {
|
|
290
|
+
let event = new _Event.default(_ApplicationManager.default, viewId, responseData);
|
|
291
|
+
_Observable.default.fireEvent(_EventType.default.MESSAGE_ARRIVED, event);
|
|
292
|
+
if (component !== null) {
|
|
293
|
+
event = new _Event.default(component, viewId, responseData);
|
|
294
|
+
_Observable.default.fireEvent(_EventType.default.MESSAGE_ARRIVED, event);
|
|
295
|
+
}
|
|
296
|
+
} else if (!_Utils.default.isNull(successMessage)) {
|
|
297
|
+
let message = {
|
|
298
|
+
messageType: 'SUCCESS',
|
|
299
|
+
message: _ApplicationManager.default.populateTemplate(successMessage, response ? response.data : null)
|
|
300
|
+
};
|
|
301
|
+
let event = new _Event.default(_ApplicationManager.default, viewId, message);
|
|
302
|
+
_Observable.default.fireEvent(_EventType.default.MESSAGE_ARRIVED, event);
|
|
303
|
+
if (component !== null) {
|
|
304
|
+
event = new _Event.default(component, viewId, message);
|
|
408
305
|
_Observable.default.fireEvent(_EventType.default.MESSAGE_ARRIVED, event);
|
|
409
|
-
|
|
410
|
-
if (component !== null) {
|
|
411
|
-
event = new _Event.default(component, viewId, responseData);
|
|
412
|
-
|
|
413
|
-
_Observable.default.fireEvent(_EventType.default.MESSAGE_ARRIVED, event);
|
|
414
|
-
}
|
|
415
|
-
} else if (!_Utils.default.isNull(successMessage)) {
|
|
416
|
-
var message = {
|
|
417
|
-
messageType: 'SUCCESS',
|
|
418
|
-
message: _ApplicationManager.default.populateTemplate(successMessage, response ? response.data : null)
|
|
419
|
-
};
|
|
420
|
-
|
|
421
|
-
var _event = new _Event.default(_ApplicationManager.default, viewId, message);
|
|
422
|
-
|
|
423
|
-
_Observable.default.fireEvent(_EventType.default.MESSAGE_ARRIVED, _event);
|
|
424
|
-
|
|
425
|
-
if (component !== null) {
|
|
426
|
-
_event = new _Event.default(component, viewId, message);
|
|
427
|
-
|
|
428
|
-
_Observable.default.fireEvent(_EventType.default.MESSAGE_ARRIVED, _event);
|
|
429
|
-
}
|
|
430
306
|
}
|
|
431
|
-
|
|
432
|
-
successCallback(response);
|
|
433
307
|
}
|
|
308
|
+
successCallback(response);
|
|
434
309
|
}
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
return RestUtils;
|
|
445
|
-
}();
|
|
446
|
-
|
|
447
|
-
var instance = new RestUtils();
|
|
448
|
-
|
|
449
|
-
var postData = function postData(url, successCallback, errorCallback, secure, data) {
|
|
310
|
+
}
|
|
311
|
+
fireEvent(viewId, component, eventType, response) {
|
|
312
|
+
let event = new _Event.default(component, viewId, response);
|
|
313
|
+
_Observable.default.fireEvent(eventType, event);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
const instance = new RestUtils();
|
|
317
|
+
const postData = (url, successCallback, errorCallback, secure, data) => {
|
|
450
318
|
instance.doPostData(url, successCallback, errorCallback, secure, data);
|
|
451
319
|
};
|
|
452
|
-
|
|
453
320
|
exports.postData = postData;
|
|
454
|
-
|
|
455
|
-
var sendRequest = function sendRequest(url, successCallback, errorCallback, secure, track) {
|
|
321
|
+
const sendRequest = (url, successCallback, errorCallback, secure, track) => {
|
|
456
322
|
instance.doFetch(url, successCallback, errorCallback, secure, null, null, null, null, null, track);
|
|
457
323
|
};
|
|
458
|
-
|
|
459
324
|
exports.sendRequest = sendRequest;
|
|
460
|
-
|
|
461
|
-
var download = function download(url, successCallback, errorCallback, secure) {
|
|
325
|
+
const download = (url, successCallback, errorCallback, secure) => {
|
|
462
326
|
instance.doFetch(url, successCallback, errorCallback, secure, 'GET', true);
|
|
463
327
|
};
|
|
464
|
-
|
|
465
328
|
exports.download = download;
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
var event = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : null;
|
|
329
|
+
const invokeRpc = function (rpcDetails, component, viewId, successCallback, errorCallback, invalidParamCallback, returnValueBinding, successMessage) {
|
|
330
|
+
let event = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : null;
|
|
469
331
|
instance.invokeRpc(rpcDetails, component, viewId, successCallback, errorCallback, invalidParamCallback, returnValueBinding, successMessage, event);
|
|
470
332
|
};
|
|
471
|
-
|
|
472
333
|
exports.invokeRpc = invokeRpc;
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
var event = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : null;
|
|
334
|
+
const invokeRest = function (serviceConfig, component, viewId, successCallback, errorCallback, invalidParamCallback, returnValueBinding, successMessage) {
|
|
335
|
+
let event = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : null;
|
|
476
336
|
instance.invokeRest(serviceConfig, component, viewId, successCallback, errorCallback, invalidParamCallback, returnValueBinding, successMessage, event);
|
|
477
337
|
};
|
|
478
|
-
|
|
479
338
|
exports.invokeRest = invokeRest;
|