@agilemotion/oui-react-js 1.3.7 → 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.
- package/README.TXT +1 -0
- package/dist/ApplicationContext.js +161 -284
- package/dist/BasicApp.js +1 -1
- package/dist/BasicAppHome.js +17 -4
- package/dist/BusinessPortalApp.js +4 -4
- package/dist/BusinessPortalAppHome.js +10 -39
- package/dist/DynamicJS.js +20 -52
- package/dist/RestUtils.js +86 -111
- package/dist/Utils.js +36 -30
- package/dist/assets/jss/components/authNavbarStyle.js +34 -35
- package/dist/assets/jss/components/cardHeaderStyle.js +12 -12
- package/dist/assets/jss/components/customDropdownStyle.js +26 -26
- package/dist/assets/jss/components/customInputStyle.js +2 -8
- package/dist/assets/jss/components/dropdownStyle.js +10 -15
- package/dist/assets/jss/components/footerStyle.js +12 -18
- package/dist/assets/jss/components/headerLinksStyle.js +7 -13
- package/dist/assets/jss/components/headerStyle.js +24 -25
- package/dist/assets/jss/components/navbarLinksStyle.js +7 -13
- package/dist/assets/jss/components/navbarStyle.js +24 -25
- package/dist/assets/jss/components/sidebarStyle.js +41 -43
- package/dist/assets/jss/components/typographyStyle.js +2 -8
- package/dist/assets/jss/rootStyle.js +32 -47
- package/dist/assets/jss/views/layoutStyle.js +6 -11
- package/dist/assets/jss/views/loginStyle.js +4 -10
- package/dist/assets/lotties/call-loading.json +1 -0
- package/dist/assets/lotties/calling-2.json +1 -0
- package/dist/assets/lotties/calling.json +1 -0
- package/dist/assets/lotties/calling2.json +1 -0
- package/dist/assets/lotties/chat.json +1 -0
- package/dist/assets/lotties/join.json +1 -0
- package/dist/assets/lotties/loading.json +1 -0
- package/dist/assets/lotties/msg2.json +1 -0
- package/dist/assets/lotties/recording.json +1 -0
- package/dist/assets/lotties/waiting.json +1 -0
- package/dist/assets/scss/black-dashboard-react/bootstrap/_card.scss +5 -5
- package/dist/assets/scss/black-dashboard-react/bootstrap/_carousel.scss +2 -2
- package/dist/assets/scss/black-dashboard-react/bootstrap/_custom-forms.scss +3 -3
- package/dist/assets/scss/black-dashboard-react/bootstrap/_functions.scss +1 -1
- package/dist/assets/scss/black-dashboard-react/bootstrap/_images.scss +1 -1
- package/dist/assets/scss/black-dashboard-react/bootstrap/_jumbotron.scss +1 -1
- package/dist/assets/scss/black-dashboard-react/bootstrap/_popover.scss +7 -5
- package/dist/assets/scss/black-dashboard-react/bootstrap/_tooltip.scss +4 -4
- package/dist/assets/scss/black-dashboard-react/bootstrap/_variables.scss +5 -5
- package/dist/assets/scss/black-dashboard-react/bootstrap/mixins/_grid-framework.scss +2 -2
- package/dist/assets/scss/black-dashboard-react/bootstrap/mixins/_grid.scss +11 -9
- package/dist/assets/scss/black-dashboard-react/bootstrap/utilities/_embed.scss +6 -4
- package/dist/assets/scss/black-dashboard-react/custom/_variables.scss +1 -1
- package/dist/components/AlertBar.js +39 -80
- package/dist/components/AlertItem.js +4 -26
- package/dist/components/Button.js +24 -36
- package/dist/components/Calendar.js +478 -0
- package/dist/components/Calender.css +244 -0
- package/dist/components/ConfirmationDialog.js +5 -29
- package/dist/components/DataGrid.js +169 -338
- package/dist/components/DataGridColumn.js +5 -28
- package/dist/components/DataGridFilter.js +46 -114
- package/dist/components/DataGridHeading.js +11 -19
- package/dist/components/Dialog.js +27 -121
- package/dist/components/DocumentViewer.js +15 -35
- package/dist/components/DocumentViewerComponent.js +2 -20
- package/dist/components/FileThumb.js +115 -0
- package/dist/components/Graph.js +25 -75
- package/dist/components/GraphNode.js +4 -21
- package/dist/components/HtmlPanel.js +59 -78
- package/dist/components/Icon.js +99 -1
- package/dist/components/LoadingIndicator.js +4 -4
- package/dist/components/LottieIcon.js +134 -0
- package/dist/components/PopupView.js +2 -20
- package/dist/components/RegularButton.js +15 -19
- package/dist/components/SignaturePanel.js +9 -40
- package/dist/components/SocketManager.js +170 -0
- package/dist/components/StepperTitleBar.js +30 -56
- package/dist/components/TabPage.js +6 -9
- package/dist/components/TabPanel.js +41 -98
- package/dist/components/TableCellContent.js +30 -38
- package/dist/components/TemplateDesigner.css +0 -1
- package/dist/components/TemplateDesigner.js +107 -151
- package/dist/components/TemplateItemEventHandler.js +33 -100
- package/dist/components/TemplateTable.js +6 -42
- package/dist/components/TitleBar.js +35 -52
- package/dist/components/Toolbar.js +33 -179
- package/dist/components/Tree.js +27 -64
- package/dist/components/card/Card.js +16 -20
- package/dist/components/card/CardAvatar.js +9 -13
- package/dist/components/card/CardBody.js +13 -17
- package/dist/components/card/CardFooter.js +12 -16
- package/dist/components/card/CardHeader.js +13 -17
- package/dist/components/card/CardIcon.js +6 -10
- package/dist/components/card/CardText.js +6 -10
- package/dist/components/customInput/CustomInput.js +12 -10
- package/dist/components/dashboard/BasicBusinessAppDashboard.js +81 -158
- package/dist/components/dashboard/BusinessPortalAppDashboard.js +33 -79
- package/dist/components/dashboard/components/Header.js +8 -25
- package/dist/components/dashboard/components/LeftDrawer.js +3 -1
- package/dist/components/dashboard/components/blackDashboard/fixedPlugin/FixedPlugin.js +1 -1
- package/dist/components/dashboard/components/blackDashboard/sidebar/Sidebar.js +143 -36
- package/dist/components/footer/Footer.js +6 -18
- package/dist/components/form/AddressSearch.js +32 -66
- package/dist/components/form/AutoComplete.js +160 -0
- package/dist/components/form/BaseField.js +66 -96
- package/dist/components/form/DatePicker.js +3 -21
- package/dist/components/form/FieldSet.js +158 -180
- package/dist/components/form/Form.css +1 -1
- package/dist/components/form/Form.js +137 -471
- package/dist/components/form/GridField.js +46 -146
- package/dist/components/form/IconField.js +35 -0
- package/dist/components/form/ImageEditor.js +19 -57
- package/dist/components/form/LookupField.js +8 -29
- package/dist/components/form/MultiFileUploadField.js +186 -0
- package/dist/components/form/RadioGroup.js +1 -16
- package/dist/components/form/Section.js +31 -92
- package/dist/components/form/SelectItem.js +14 -33
- package/dist/components/form/SignatureTemplateDesignerField.js +4 -2
- package/dist/components/form/Switch.js +53 -0
- package/dist/components/form/TextField.js +10 -17
- package/dist/components/form/TimePicker.js +7 -1
- package/dist/components/form/TransferList.css +2 -2
- package/dist/components/form/TransferList.js +67 -125
- package/dist/components/form/UploadField.js +27 -79
- package/dist/components/form/fieldset.css +8 -0
- package/dist/components/grid/GridContainer.js +5 -9
- package/dist/components/grid/GridItem.js +5 -9
- package/dist/components/layout/CollapsiblePanel.js +11 -33
- package/dist/components/layout/Layout.js +175 -290
- package/dist/components/layout/VC.css +17 -0
- package/dist/components/layout/View.css +17 -1
- package/dist/components/layout/View.js +77 -194
- package/dist/components/loader.css +1 -1
- package/dist/components/media/ClosablePanel.css +37 -0
- package/dist/components/media/ClosablePanel.js +53 -0
- package/dist/components/media/LobbyWaitingList.js +91 -0
- package/dist/components/media/MediaSoupHelper.js +223 -0
- package/dist/components/media/Recorder.js +235 -0
- package/dist/components/media/SideBarContent.css +54 -0
- package/dist/components/media/SideBarContent.js +46 -0
- package/dist/components/media/SocketRequest.js +20 -0
- package/dist/components/media/SocketResponse.js +16 -0
- package/dist/components/media/Timer.css +30 -0
- package/dist/components/media/Timer.js +88 -0
- package/dist/components/media/Toolbar.css +20 -0
- package/dist/components/media/Toolbar.js +470 -0
- package/dist/components/media/Tracks.js +39 -0
- package/dist/components/media/TrainingRoom.js +531 -0
- package/dist/components/media/Transports.js +35 -0
- package/dist/components/media/VCEventManager.js +74 -0
- package/dist/components/media/VCEventType.js +164 -0
- package/dist/components/media/VCParticipantList.css +72 -0
- package/dist/components/media/VCParticipantList.js +56 -0
- package/dist/components/media/VCParticipantListItem.css +73 -0
- package/dist/components/media/VCParticipantListItem.js +319 -0
- package/dist/components/media/VCRoom.css +42 -0
- package/dist/components/media/VCRoom.js +90 -0
- package/dist/components/media/VCRoomParticipant.css +25 -0
- package/dist/components/media/VCRoomParticipant.js +806 -0
- package/dist/components/media/VCRoomWorkspace.css +86 -0
- package/dist/components/media/VCRoomWorkspace.js +653 -0
- package/dist/components/media/Video.css +4 -0
- package/dist/components/media/Video.js +131 -0
- package/dist/components/media/chat/ChatRoom.js +926 -0
- package/dist/components/media/chat/ChatRoomItem.js +83 -0
- package/dist/components/media/chat/ChatRoomList.js +78 -0
- package/dist/components/media/chat/ChatRooms.scss +567 -0
- package/dist/components/menu/CollapsibleMenu.js +2 -19
- package/dist/components/menu/MenuBars.js +6 -33
- package/dist/components/menu/MenuButton.js +7 -35
- package/dist/components/menu/MenuItem.js +3 -20
- package/dist/components/menu/MenuLink.js +18 -12
- package/dist/components/navbars/AuthNavbar.js +5 -18
- package/dist/components/navbars/HomeNavbar.js +3 -5
- package/dist/components/navbars/PortalNavbar.js +4 -22
- package/dist/components/signatures/AgilitySignaturePanel.js +35 -101
- package/dist/components/signatures/AlertItem.js +3 -24
- package/dist/components/signatures/DocumentContainer.js +47 -135
- package/dist/components/signatures/ImageSignatureInput.js +8 -35
- package/dist/components/signatures/MenuButton.js +1 -16
- package/dist/components/signatures/Prompt.js +3 -24
- package/dist/components/signatures/ResponsiveTable.js +75 -96
- package/dist/components/signatures/SearchView.js +14 -50
- package/dist/components/signatures/SignatorySearch.js +83 -98
- package/dist/components/signatures/SignatorySearchForm.js +11 -17
- package/dist/components/signatures/SignatureInput.js +15 -44
- package/dist/components/signatures/SignatureInputProps.js +20 -60
- package/dist/components/signatures/SignatureTemplateDesigner.js +148 -235
- package/dist/components/signatures/Toolbar.js +7 -34
- package/dist/components/signatures/ViewUtils.js +2 -6
- package/dist/components/typography/Danger.js +3 -1
- package/dist/components/typography/Info.js +3 -1
- package/dist/components/typography/Link.js +6 -2
- package/dist/event/ActionHandlers.js +3 -3
- package/dist/event/EventType.js +7 -1
- package/dist/event/LoadDataActionHandler.js +1 -1
- package/dist/event/Observable.js +56 -168
- package/dist/event/RouteActionHandler.js +45 -11
- package/dist/event/ServiceCallActionHandler.js +34 -24
- package/dist/js/Addresses.js +10 -8
- package/dist/js/Media.js +157 -0
- package/dist/redux/store/ConfigureStore.js +3 -9
- package/dist/redux/store/DashboardStore.js +42 -94
- package/dist/redux/store/SecurityStore.js +15 -50
- package/dist/view/Dashboard.js +242 -163
- package/dist/view/security/ChangePasswordBasic.js +23 -76
- package/dist/view/security/ForgotPassword.js +9 -42
- package/dist/view/security/ForgotPasswordBasic.js +8 -41
- package/dist/view/security/Login.js +11 -47
- package/dist/view/security/LoginBasic.js +8 -41
- package/dist/view/security/LoginBusinessPortal.js +8 -41
- package/dist/view/security/ResetPassword.js +9 -47
- package/dist/view/security/ResetPasswordBasic.js +21 -71
- package/dist/view/security/Security.js +1 -0
- package/package.json +29 -13
- package/README.md +0 -1623
- package/dist/components/dashboard/BasicApp.js +0 -140
- package/dist/components/navbars/NavbarLinks.js +0 -212
- 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
|
|
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
|
|
package/dist/BasicAppHome.js
CHANGED
|
@@ -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
|
|
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 +
|
|
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
|
|
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
|
|
|
@@ -54,7 +54,7 @@ class BusinessPortalApp extends _react.Component {
|
|
|
54
54
|
}), /*#__PURE__*/_react.default.createElement(_reactRouterDom.Route, {
|
|
55
55
|
path: "/forgot-password",
|
|
56
56
|
render: () => /*#__PURE__*/_react.default.createElement(_ForgotPasswordBasic.default, {
|
|
57
|
-
url: location + this.props.
|
|
57
|
+
url: location + this.props.contextRoot + this.props.implConfig.authUrl + "/password/forgot",
|
|
58
58
|
background: this.props.implConfig.loginBackgroundColor,
|
|
59
59
|
textColor: this.props.implConfig.loginTextColor,
|
|
60
60
|
title: this.props.implConfig.loginTitle,
|
|
@@ -63,7 +63,7 @@ class BusinessPortalApp extends _react.Component {
|
|
|
63
63
|
}), /*#__PURE__*/_react.default.createElement(_reactRouterDom.Route, {
|
|
64
64
|
path: "/reset-password",
|
|
65
65
|
render: () => /*#__PURE__*/_react.default.createElement(_ResetPasswordBasic.default, {
|
|
66
|
-
url: location + this.props.
|
|
66
|
+
url: location + this.props.contextRoot + this.props.implConfig.authUrl + "/password/confirmForgot",
|
|
67
67
|
background: this.props.implConfig.loginBackgroundColor,
|
|
68
68
|
textColor: this.props.implConfig.loginTextColor,
|
|
69
69
|
title: this.props.implConfig.loginTitle,
|
|
@@ -72,7 +72,7 @@ class BusinessPortalApp extends _react.Component {
|
|
|
72
72
|
}), /*#__PURE__*/_react.default.createElement(_reactRouterDom.Route, {
|
|
73
73
|
path: "/change-password",
|
|
74
74
|
render: () => /*#__PURE__*/_react.default.createElement(_ChangePasswordBasic.default, {
|
|
75
|
-
url: location + this.props.
|
|
75
|
+
url: location + this.props.contextRoot + this.props.implConfig.authUrl + "/password/challenge",
|
|
76
76
|
background: this.props.implConfig.loginBackgroundColor,
|
|
77
77
|
textColor: this.props.implConfig.loginTextColor,
|
|
78
78
|
title: this.props.implConfig.loginTitle,
|
|
@@ -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
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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 +
|
|
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
|
|
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
|
-
|
|
43
|
-
|
|
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 (
|
|
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
|
-
|
|
100
|
-
|
|
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
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
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
|
-
|
|
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
|
-
|
|
63
|
-
|
|
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
|
-
|
|
72
|
-
|
|
73
|
-
|
|
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
|
-
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
80
68
|
|
|
81
|
-
|
|
82
|
-
httpParameterType = 'REQUEST_PARAMETER';
|
|
83
|
-
}
|
|
69
|
+
let httpParameterType = parameter.httpParameterType;
|
|
84
70
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
queryString += '&';
|
|
89
|
-
}
|
|
71
|
+
if (_Utils.default.isNull(httpParameterType)) {
|
|
72
|
+
httpParameterType = 'QUERY_PARAMETER';
|
|
73
|
+
}
|
|
90
74
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
75
|
+
if (httpParameterType === 'QUERY_PARAMETER') {
|
|
76
|
+
if (!_Utils.default.isNull(parameterValue)) {
|
|
77
|
+
if (queryString.length > 0) {
|
|
78
|
+
queryString += '&';
|
|
79
|
+
}
|
|
94
80
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
81
|
+
if (!_Utils.default.isNull(service.includeParameterTypes) && service.includeParameterTypes === true) {
|
|
82
|
+
queryString += parameterValue.type + ':';
|
|
83
|
+
}
|
|
98
84
|
|
|
99
|
-
|
|
100
|
-
|
|
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
|
-
|
|
105
|
-
|
|
106
|
-
|
|
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
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
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(
|
|
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
|
-
|
|
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(
|
|
183
|
-
} else if (contentType ===
|
|
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(
|
|
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
|
-
|
|
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 ===
|
|
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.
|
|
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 ===
|
|
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(
|
|
300
|
-
const idToken = sessionStorage.getItem(
|
|
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,30 +322,32 @@ 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) {
|
|
364
|
-
(0, _reactPromiseTracker.trackPromise)(this.
|
|
337
|
+
(0, _reactPromiseTracker.trackPromise)(this.executeFetch(url, fetchConfig, successCallback, viewId, successMessage, errorCallback));
|
|
365
338
|
} else {
|
|
366
|
-
this.
|
|
339
|
+
this.executeFetch(url, fetchConfig, successCallback, viewId, successMessage, errorCallback);
|
|
367
340
|
}
|
|
368
341
|
}
|
|
369
342
|
}
|
|
370
343
|
|
|
371
|
-
|
|
344
|
+
executeFetch(url, fetchConfig, successCallback, viewId, successMessage, errorCallback) {
|
|
372
345
|
return fetch(encodeURI(url), fetchConfig).then(status).then(json).then(data => {
|
|
373
346
|
this.processSuccessfulResponseData(null, data, successCallback, viewId, successMessage);
|
|
374
347
|
}).catch(e => {
|
|
375
348
|
console.error(e);
|
|
376
349
|
|
|
377
|
-
if (e.code === 401 && !url.endsWith(
|
|
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 (
|
|
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 =
|
|
380
|
+
let responseData = response ? response.data : null;
|
|
406
381
|
|
|
407
|
-
if (
|
|
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
|
|