@agilemotion/oui-react-js 1.6.1 → 1.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ApplicationManager.js +698 -421
- package/dist/BasicApp.js +5 -5
- package/dist/BasicAppHome.js +55 -26
- package/dist/DynamicJS.js +147 -65
- package/dist/InteractionPortalApp.css +1 -1
- package/dist/InteractionPortalApp.js +5 -5
- package/dist/InteractionPortalAppHome.js +57 -22
- package/dist/InteractionPortalApp_old.js +107 -61
- package/dist/RestUtils.js +339 -287
- package/dist/TypedValue.js +18 -15
- package/dist/Utils.js +375 -276
- package/dist/WithRouter.js +6 -6
- package/dist/assets/jss/components/authNavbarStyle.js +166 -164
- package/dist/assets/jss/components/buttonStyle.js +1 -1
- package/dist/assets/jss/components/cardAvatarStyle.js +1 -1
- package/dist/assets/jss/components/cardBodyStyle.js +1 -1
- package/dist/assets/jss/components/cardFooterStyle.js +1 -1
- package/dist/assets/jss/components/cardHeaderStyle.js +13 -13
- package/dist/assets/jss/components/cardIconStyle.js +1 -1
- package/dist/assets/jss/components/cardStyle.js +1 -1
- package/dist/assets/jss/components/cardTextStyle.js +1 -1
- package/dist/assets/jss/components/customDropdownStyle.js +168 -169
- package/dist/assets/jss/components/customInputStyle.js +9 -3
- package/dist/assets/jss/components/dropdownStyle.js +69 -69
- package/dist/assets/jss/components/footerStyle.js +19 -13
- package/dist/assets/jss/components/headerLinksStyle.js +45 -48
- package/dist/assets/jss/components/headerStyle.js +68 -65
- package/dist/assets/jss/components/navbarLinksStyle.js +66 -77
- package/dist/assets/jss/components/navbarStyle.js +79 -76
- package/dist/assets/jss/components/sidebarStyle.js +436 -436
- package/dist/assets/jss/components/typographyStyle.js +9 -3
- package/dist/assets/jss/rootStyle.js +96 -81
- package/dist/assets/jss/views/layoutStyle.js +44 -41
- package/dist/assets/jss/views/loginBasicStyle.js +1 -1
- package/dist/assets/jss/views/loginBusinessPortalStyle.js +1 -1
- package/dist/assets/jss/views/loginStyle.js +82 -77
- package/dist/components/AlertBar.js +50 -17
- package/dist/components/AlertItem.js +35 -12
- package/dist/components/AlertTemplate.js +30 -29
- package/dist/components/Button.js +62 -34
- package/dist/components/Calendar.js +140 -91
- package/dist/components/ConfirmationDialog.js +36 -11
- package/dist/components/DataGrid.js +512 -270
- package/dist/components/DataGridColumn.js +47 -22
- package/dist/components/DataGridFilter.js +186 -105
- package/dist/components/DataGridHeading.js +50 -32
- package/dist/components/Dialog.js +90 -35
- package/dist/components/DocumentTemplateDesigner.js +34 -16
- package/dist/components/DocumentTemplateDesignerComponent.js +124 -48
- package/dist/components/DocumentTemplatePlaceholderDialog.js +52 -30
- package/dist/components/DocumentViewer.js +34 -18
- package/dist/components/DocumentViewerComponent.js +26 -9
- package/dist/components/ElementResizeHandler.js +229 -207
- package/dist/components/FileThumb.js +32 -10
- package/dist/components/Graph.js +153 -85
- package/dist/components/GraphNode.js +58 -38
- package/dist/components/HtmlPanel.js +67 -39
- package/dist/components/Icon.js +206 -166
- package/dist/components/LoadingIndicator.js +3 -3
- package/dist/components/LottieIcon.js +1 -1
- package/dist/components/PopupView.js +39 -19
- package/dist/components/Portlet.js +32 -17
- package/dist/components/RegularButton.js +28 -32
- package/dist/components/SignaturePanel.js +37 -17
- package/dist/components/SocketManager.js +178 -119
- package/dist/components/StepperTitleBar.js +62 -42
- package/dist/components/TabPage.js +30 -25
- package/dist/components/TabPanel.js +86 -33
- package/dist/components/TableCellContent.js +51 -32
- package/dist/components/TemplateDesigner.js +173 -121
- package/dist/components/TemplateItemEventHandler.js +335 -221
- package/dist/components/TemplateTable.js +183 -118
- package/dist/components/TitleBar.js +26 -11
- package/dist/components/Toolbar.js +67 -38
- package/dist/components/Tooltip.js +43 -35
- package/dist/components/Tree.js +85 -44
- package/dist/components/UseIsVisible.js +25 -4
- package/dist/components/card/Card.js +27 -33
- package/dist/components/card/CardAvatar.js +20 -19
- package/dist/components/card/CardBody.js +24 -27
- package/dist/components/card/CardFooter.js +23 -24
- package/dist/components/card/CardHeader.js +24 -27
- package/dist/components/card/CardIcon.js +17 -13
- package/dist/components/card/CardText.js +17 -13
- package/dist/components/customInput/CustomInput.js +22 -36
- package/dist/components/dashboard/{BasicBusinessAppDashboard.js → FoldingSideTabDashboard.js} +111 -63
- package/dist/components/dashboard/SideMenuModuleDashboard.css +60 -0
- package/dist/components/dashboard/SideMenuModuleDashboard.js +423 -0
- package/dist/components/dashboard/TopMenuModuleDashboard.js +138 -0
- package/dist/components/dashboard/components/Header.js +29 -12
- package/dist/components/dashboard/components/LeftDrawer.js +3 -5
- package/dist/components/dashboard/components/UserIdentity.js +2 -2
- package/dist/components/dashboard/components/blackDashboard/fixedPlugin/FixedPlugin.js +131 -87
- package/dist/components/dashboard/components/blackDashboard/sidebar/FoldingTabSidebar.js +488 -0
- package/dist/components/dashboard/components/blackDashboard/sidebar/ModuleMenu.js +64 -0
- package/dist/components/dashboard/components/blackDashboard/sidebar/ModuleMenuSidebar.css +65 -0
- package/dist/components/dashboard/components/blackDashboard/sidebar/ModuleMenuSidebar.js +556 -0
- package/dist/components/dashboard/components/portal/Timeline.js +1 -1
- package/dist/components/dashboard/components/portal/Workspace.js +5 -11
- package/dist/components/footer/Footer.js +31 -24
- package/dist/components/footer/HomeFooter.js +68 -34
- package/dist/components/form/AddressSearch.js +78 -42
- package/dist/components/form/AutoComplete.js +136 -55
- package/dist/components/form/BaseField.js +108 -56
- package/dist/components/form/Checkbox.js +10 -8
- package/dist/components/form/DatePicker.js +47 -25
- package/dist/components/form/FieldSet.js +217 -84
- package/dist/components/form/Form.js +334 -200
- package/dist/components/form/GridField.js +185 -82
- package/dist/components/form/IconField.js +9 -7
- package/dist/components/form/ImageEditor.js +141 -92
- package/dist/components/form/LabelField.js +12 -10
- package/dist/components/form/LookupField.js +54 -32
- package/dist/components/form/MultiFileUploadField.js +101 -67
- package/dist/components/form/RadioGroup.js +33 -16
- package/dist/components/form/Section.js +84 -34
- package/dist/components/form/SelectItem.js +55 -33
- package/dist/components/form/SignatureTemplateDesignerField.js +11 -9
- package/dist/components/form/Switch.js +10 -8
- package/dist/components/form/TextField.js +34 -16
- package/dist/components/form/TimePicker.js +19 -15
- package/dist/components/form/TransferList.js +153 -75
- package/dist/components/form/UploadField.js +183 -128
- package/dist/components/grid/GridContainer.js +12 -8
- package/dist/components/grid/GridItem.js +12 -8
- package/dist/components/layout/CollapsiblePanel.js +44 -18
- package/dist/components/layout/Layout.js +81 -40
- package/dist/components/layout/VC.css +1 -1
- package/dist/components/layout/View.js +136 -62
- package/dist/components/layout/ViewContainer.js +13 -11
- package/dist/components/layout/ViewPort.js +25 -10
- package/dist/components/layout/Window.js +87 -53
- package/dist/components/layout/WindowViewPort.js +38 -16
- package/dist/components/media/ClosablePanel.js +7 -7
- package/dist/components/media/LobbyWaitingList.js +7 -9
- package/dist/components/media/MediaSoupHelper.js +379 -187
- package/dist/components/media/SideBarContent.js +22 -14
- package/dist/components/media/SocketRequest.js +5 -1
- package/dist/components/media/SocketResponse.js +5 -1
- package/dist/components/media/Timer.js +35 -15
- package/dist/components/media/Toolbar.css +5 -0
- package/dist/components/media/Toolbar.js +220 -102
- package/dist/components/media/ToolbarButton.js +82 -33
- package/dist/components/media/Toolbar_bck.js +142 -70
- package/dist/components/media/Tracks.js +31 -28
- package/dist/components/media/TrainingRoom.js +284 -121
- package/dist/components/media/Transports.js +27 -24
- package/dist/components/media/VCEventManager.js +95 -31
- package/dist/components/media/VCEventType.js +5 -1
- package/dist/components/media/VCParticipantList.js +40 -14
- package/dist/components/media/VCParticipantListItem.js +92 -41
- package/dist/components/media/VCRoom.js +29 -11
- package/dist/components/media/VCRoomParticipant.js +488 -242
- package/dist/components/media/VCRoomRecorder.js +236 -175
- package/dist/components/media/VCRoomWorkspace.js +505 -245
- package/dist/components/media/Video.js +89 -25
- package/dist/components/media/VideoPlayer.js +56 -22
- package/dist/components/media/chat/ChatRoom.js +255 -132
- package/dist/components/media/chat/ChatRoomItem.js +35 -14
- package/dist/components/media/chat/ChatRoomList.js +43 -13
- package/dist/components/menu/CollapsibleMenu.js +39 -20
- package/dist/components/menu/MenuBars.js +81 -48
- package/dist/components/menu/MenuButton.js +95 -60
- package/dist/components/menu/MenuItem.js +28 -9
- package/dist/components/menu/MenuLink.js +12 -10
- package/dist/components/menu/PopupMenu.js +16 -12
- package/dist/components/navbars/AuthNavbar.js +27 -18
- package/dist/components/navbars/HomeNavbar.js +243 -194
- package/dist/components/navbars/PortalNavbar.js +50 -26
- package/dist/components/signatures/AgilitySignaturePanel.js +96 -39
- package/dist/components/signatures/AlertItem.js +36 -13
- package/dist/components/signatures/Card.js +4 -4
- package/dist/components/signatures/DocumentContainer.js +141 -57
- package/dist/components/signatures/ImageSignatureInput.js +90 -59
- package/dist/components/signatures/MenuButton.js +53 -33
- package/dist/components/signatures/Prompt.js +26 -5
- package/dist/components/signatures/ResponsiveTable.js +302 -197
- package/dist/components/signatures/SearchView.js +77 -36
- package/dist/components/signatures/SignatorySearch.js +30 -10
- package/dist/components/signatures/SignatorySearchForm.js +35 -18
- package/dist/components/signatures/SignatureInput.js +56 -26
- package/dist/components/signatures/SignatureInputProps.js +107 -55
- package/dist/components/signatures/SignatureTemplateDesigner.js +340 -235
- package/dist/components/signatures/Toolbar.js +135 -94
- package/dist/components/signatures/ViewUtils.js +273 -224
- package/dist/components/typography/Danger.js +3 -5
- package/dist/components/typography/Info.js +3 -5
- package/dist/components/typography/Link.js +3 -5
- package/dist/event/ActionHandlers.js +57 -43
- package/dist/event/Event.js +16 -13
- package/dist/event/EventListener.js +39 -36
- package/dist/event/EventType.js +5 -1
- package/dist/event/LoadDataActionHandler.js +20 -8
- package/dist/event/Observable.js +323 -142
- package/dist/event/RouteActionHandler.js +139 -125
- package/dist/event/ScriptActionHandler.js +20 -8
- package/dist/event/ServiceCallActionHandler.js +51 -39
- package/dist/event/SignalGraphActionHandler.js +19 -7
- package/dist/js/Addresses.js +38 -24
- package/dist/js/Calendar.js +168 -161
- package/dist/js/DynamicLib.js +14 -11
- package/dist/js/Media.js +213 -120
- package/dist/js/Validators.js +6 -5
- package/dist/js/Windows.js +48 -47
- package/dist/redux/store/ConfigureStore.js +17 -9
- package/dist/redux/store/DashboardStore.js +110 -43
- package/dist/redux/store/History.js +1 -1
- package/dist/redux/store/SecurityStore.js +59 -20
- package/dist/security/TokenManager.js +44 -30
- package/dist/theme-default.js +1 -1
- package/dist/view/Dashboard.js +230 -137
- package/dist/view/PortalDashboard.js +4 -4
- package/dist/view/Settings.js +4 -2
- package/dist/view/Views.js +27 -14
- package/dist/view/security/ChangePasswordBasic.js +97 -40
- package/dist/view/security/ForgotPassword.js +59 -22
- package/dist/view/security/ForgotPasswordBasic.js +62 -21
- package/dist/view/security/Login.js +64 -24
- package/dist/view/security/LoginBasic.js +65 -26
- package/dist/view/security/LoginInteractionPortal.js +62 -25
- package/dist/view/security/ResetPassword.js +65 -23
- package/dist/view/security/ResetPasswordBasic.js +91 -37
- package/dist/view/security/Security.js +12 -12
- package/package.json +1 -2
- package/dist/components/dashboard/BusinessPortalAppDashboard.js +0 -115
- package/dist/components/dashboard/components/blackDashboard/sidebar/Sidebar.js +0 -447
- /package/dist/components/dashboard/{BusinessPortalAppDashboard.css → TopMenuModuleDashboard.css} +0 -0
- /package/dist/components/dashboard/components/blackDashboard/sidebar/{Sidebar.css → FoldingTabSidebar.css} +0 -0
|
@@ -7,18 +7,34 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _reactPromiseTracker = require("react-promise-tracker");
|
|
9
9
|
|
|
10
|
+
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); }
|
|
11
|
+
|
|
12
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
13
|
+
|
|
14
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
15
|
+
|
|
16
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
17
|
+
|
|
18
|
+
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); } }
|
|
19
|
+
|
|
20
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
21
|
+
|
|
10
22
|
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; }
|
|
11
23
|
|
|
12
|
-
|
|
13
|
-
|
|
24
|
+
var ViewUtils = /*#__PURE__*/function () {
|
|
25
|
+
function ViewUtils() {
|
|
26
|
+
var _this = this;
|
|
27
|
+
|
|
28
|
+
_classCallCheck(this, ViewUtils);
|
|
29
|
+
|
|
14
30
|
_defineProperty(this, "SYSTEM_ERROR_MESSAGE", "A system error has accured. Please contact your system administrator");
|
|
15
31
|
|
|
16
|
-
_defineProperty(this, "showMessage", (viewRef, message, type)
|
|
17
|
-
if (
|
|
32
|
+
_defineProperty(this, "showMessage", function (viewRef, message, type) {
|
|
33
|
+
if (_this.isNull(message)) {
|
|
18
34
|
message = "";
|
|
19
35
|
}
|
|
20
36
|
|
|
21
|
-
|
|
37
|
+
var messageType = type === "ERROR" ? "danger" : _this.isNull(type) ? "message" : type;
|
|
22
38
|
viewRef.setState({
|
|
23
39
|
message: message,
|
|
24
40
|
messageStyle: messageType
|
|
@@ -26,280 +42,313 @@ class ViewUtils {
|
|
|
26
42
|
});
|
|
27
43
|
}
|
|
28
44
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
45
|
+
_createClass(ViewUtils, [{
|
|
46
|
+
key: "isNull",
|
|
47
|
+
value: function isNull(value) {
|
|
48
|
+
return value === null || typeof value === 'undefined';
|
|
49
|
+
}
|
|
50
|
+
}, {
|
|
51
|
+
key: "processToolbarConfig",
|
|
52
|
+
value: function processToolbarConfig(viewMode, config) {
|
|
53
|
+
var items = config.items;
|
|
35
54
|
|
|
36
|
-
|
|
37
|
-
|
|
55
|
+
for (var i = 0; i < items.length; i++) {
|
|
56
|
+
var type = items[i].type;
|
|
38
57
|
|
|
39
|
-
|
|
40
|
-
|
|
58
|
+
if (type === 'buttonGroup') {
|
|
59
|
+
var buttons = items[i].buttons;
|
|
41
60
|
|
|
42
|
-
|
|
43
|
-
|
|
61
|
+
for (var j = 0; j < buttons.length; j++) {
|
|
62
|
+
var modes = buttons[j].modes;
|
|
44
63
|
|
|
45
|
-
|
|
46
|
-
|
|
64
|
+
if (!this.isNull(modes)) {
|
|
65
|
+
buttons[j].visible = modes.split(",").includes(viewMode);
|
|
66
|
+
}
|
|
47
67
|
}
|
|
48
68
|
}
|
|
49
|
-
}
|
|
50
|
-
} // Force a new instance so that change event will be fired
|
|
51
|
-
|
|
69
|
+
} // Force a new instance so that change event will be fired
|
|
52
70
|
|
|
53
|
-
return JSON.parse(JSON.stringify(config));
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
getField(id, settings) {
|
|
57
|
-
if (settings != null) {
|
|
58
|
-
for (var i = 0; i < settings.fields.length; i++) {
|
|
59
|
-
var field = settings.fields[i];
|
|
60
71
|
|
|
61
|
-
|
|
62
|
-
|
|
72
|
+
return JSON.parse(JSON.stringify(config));
|
|
73
|
+
}
|
|
74
|
+
}, {
|
|
75
|
+
key: "getField",
|
|
76
|
+
value: function getField(id, settings) {
|
|
77
|
+
if (settings != null) {
|
|
78
|
+
for (var i = 0; i < settings.fields.length; i++) {
|
|
79
|
+
var field = settings.fields[i];
|
|
80
|
+
|
|
81
|
+
if (field.name === id) {
|
|
82
|
+
return field;
|
|
83
|
+
}
|
|
63
84
|
}
|
|
64
85
|
}
|
|
65
|
-
}
|
|
66
86
|
|
|
67
|
-
|
|
68
|
-
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
}, {
|
|
90
|
+
key: "isFieldRequired",
|
|
91
|
+
value: function isFieldRequired(id, settings, formId) {
|
|
92
|
+
if (typeof settings !== 'undefined' && settings !== null) {
|
|
93
|
+
var field = this.getField(id, settings);
|
|
94
|
+
|
|
95
|
+
if (field != null) {
|
|
96
|
+
return field.required;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
69
99
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
let field = this.getField(id, settings);
|
|
100
|
+
if (!this.isStringEmpty(formId)) {
|
|
101
|
+
var fields = this.getFields(formId, 'validate');
|
|
73
102
|
|
|
74
|
-
|
|
75
|
-
|
|
103
|
+
for (var i = 0; i < fields.length; i++) {
|
|
104
|
+
if (fields[i].id === id) {
|
|
105
|
+
return fields[i].required;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
76
108
|
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
if (!this.isStringEmpty(formId)) {
|
|
80
|
-
let fields = this.getFields(formId, 'validate');
|
|
81
109
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
}, {
|
|
113
|
+
key: "isFieldVisible",
|
|
114
|
+
value: function isFieldVisible(id, settings) {
|
|
115
|
+
if (typeof settings !== 'undefined' && settings !== null) {
|
|
116
|
+
var field = this.getField(id, settings);
|
|
117
|
+
|
|
118
|
+
if (field != null) {
|
|
119
|
+
return field.visible;
|
|
85
120
|
}
|
|
86
121
|
}
|
|
122
|
+
|
|
123
|
+
return true;
|
|
124
|
+
}
|
|
125
|
+
}, {
|
|
126
|
+
key: "isStringEmpty",
|
|
127
|
+
value: function isStringEmpty(val) {
|
|
128
|
+
return typeof val === 'undefined' || val === null || val.trim().length === 0;
|
|
87
129
|
}
|
|
130
|
+
}, {
|
|
131
|
+
key: "getFields",
|
|
132
|
+
value: function getFields(formId, className) {
|
|
133
|
+
var inputFields = [];
|
|
134
|
+
var form = document.getElementById(formId);
|
|
88
135
|
|
|
89
|
-
|
|
90
|
-
|
|
136
|
+
if (!this.isNull(form)) {
|
|
137
|
+
var inputDivs = form.getElementsByClassName(className);
|
|
91
138
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
let field = this.getField(id, settings);
|
|
139
|
+
for (var i = 0; i < inputDivs.length; i++) {
|
|
140
|
+
var inputs = inputDivs[i].getElementsByTagName("input");
|
|
95
141
|
|
|
96
|
-
|
|
97
|
-
|
|
142
|
+
for (var j = 0; j < inputs.length; j++) {
|
|
143
|
+
inputFields.push(inputs[j]);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
98
146
|
}
|
|
99
|
-
}
|
|
100
147
|
|
|
101
|
-
|
|
102
|
-
|
|
148
|
+
return inputFields;
|
|
149
|
+
}
|
|
150
|
+
}, {
|
|
151
|
+
key: "validateField",
|
|
152
|
+
value: function validateField(id, required, values, currentValue) {
|
|
153
|
+
return this.validateField(id, required, values, currentValue, null, null);
|
|
154
|
+
}
|
|
155
|
+
}, {
|
|
156
|
+
key: "validateField",
|
|
157
|
+
value: function validateField(id, required, values, currentValue, message) {
|
|
158
|
+
return this.validateField(id, required, values, currentValue, null, message);
|
|
159
|
+
}
|
|
160
|
+
}, {
|
|
161
|
+
key: "validateField",
|
|
162
|
+
value: function validateField(id, required, values, currentValue, regex, message) {
|
|
163
|
+
var result = {};
|
|
164
|
+
result.valid = true;
|
|
165
|
+
result.message = "";
|
|
166
|
+
var value;
|
|
103
167
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
168
|
+
if (currentValue !== null) {
|
|
169
|
+
value = currentValue;
|
|
170
|
+
} else {
|
|
171
|
+
value = values[id];
|
|
172
|
+
}
|
|
107
173
|
|
|
108
|
-
|
|
109
|
-
let inputFields = [];
|
|
110
|
-
let form = document.getElementById(formId);
|
|
174
|
+
var hasErrors = false;
|
|
111
175
|
|
|
112
|
-
|
|
113
|
-
|
|
176
|
+
if (required && (this.isNull(value) || this.isStringEmpty(value.toString()))) {
|
|
177
|
+
result.message = !this.isNull(message) ? message : "This field is required";
|
|
178
|
+
hasErrors = true;
|
|
179
|
+
} else {
|
|
180
|
+
result.message = "";
|
|
181
|
+
}
|
|
114
182
|
|
|
115
|
-
|
|
116
|
-
|
|
183
|
+
if (!hasErrors && !this.isNull(regex) && !this.isNull(value)) {
|
|
184
|
+
hasErrors = this.isNull(value.toString().match(regex));
|
|
117
185
|
|
|
118
|
-
|
|
119
|
-
|
|
186
|
+
if (hasErrors) {
|
|
187
|
+
result.message = !this.isNull(message) ? message : "This field is invalid";
|
|
120
188
|
}
|
|
121
189
|
}
|
|
122
|
-
}
|
|
123
190
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
validateField(id, required, values, currentValue) {
|
|
128
|
-
return this.validateField(id, required, values, currentValue, null, null);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
validateField(id, required, values, currentValue, message) {
|
|
132
|
-
return this.validateField(id, required, values, currentValue, null, message);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
validateField(id, required, values, currentValue, regex, message) {
|
|
136
|
-
let result = {};
|
|
137
|
-
result.valid = true;
|
|
138
|
-
result.message = "";
|
|
139
|
-
let value;
|
|
140
|
-
|
|
141
|
-
if (currentValue !== null) {
|
|
142
|
-
value = currentValue;
|
|
143
|
-
} else {
|
|
144
|
-
value = values[id];
|
|
191
|
+
result.valid = !hasErrors;
|
|
192
|
+
return result;
|
|
145
193
|
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
194
|
+
}, {
|
|
195
|
+
key: "getRequest",
|
|
196
|
+
value: function getRequest(currentPage, curretRowsPerPage, currentSearchParameters, paged) {
|
|
197
|
+
var request = {};
|
|
198
|
+
request.pageSize = curretRowsPerPage;
|
|
199
|
+
request.currentPage = currentPage;
|
|
200
|
+
request.parameters = currentSearchParameters;
|
|
201
|
+
request.paged = typeof paged === 'undefined' || paged === null || paged;
|
|
202
|
+
return request;
|
|
154
203
|
}
|
|
204
|
+
}, {
|
|
205
|
+
key: "getEntityViewTitle",
|
|
206
|
+
value: function getEntityViewTitle(queryParameterState, viewName) {
|
|
207
|
+
if (this.isNull(queryParameterState) || this.isNull(queryParameterState.selection)) {
|
|
208
|
+
return !this.isNull(viewName) ? viewName + " > Add" : "Add";
|
|
209
|
+
}
|
|
155
210
|
|
|
156
|
-
|
|
157
|
-
hasErrors = this.isNull(value.toString().match(regex));
|
|
211
|
+
var props = "";
|
|
158
212
|
|
|
159
|
-
|
|
160
|
-
|
|
213
|
+
for (var _len = arguments.length, fields = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
214
|
+
fields[_key - 2] = arguments[_key];
|
|
161
215
|
}
|
|
162
|
-
}
|
|
163
216
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
request.pageSize = curretRowsPerPage;
|
|
171
|
-
request.currentPage = currentPage;
|
|
172
|
-
request.parameters = currentSearchParameters;
|
|
173
|
-
request.paged = typeof paged === 'undefined' || paged === null || paged;
|
|
174
|
-
return request;
|
|
175
|
-
}
|
|
217
|
+
for (var i = 0; i < fields.length; i++) {
|
|
218
|
+
if (!this.isNull(fields[i])) {
|
|
219
|
+
props += fields[i].trim();
|
|
220
|
+
props += " ";
|
|
221
|
+
}
|
|
222
|
+
}
|
|
176
223
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
return
|
|
224
|
+
props = props.trim();
|
|
225
|
+
var prefix = this.isNull(viewName) ? "" : " > ";
|
|
226
|
+
return (this.isNull(viewName) ? "" : viewName) + (props.length > 0 ? prefix + props : "");
|
|
180
227
|
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
228
|
+
}, {
|
|
229
|
+
key: "setLegendColor",
|
|
230
|
+
value: function setLegendColor(color) {}
|
|
231
|
+
}, {
|
|
232
|
+
key: "setLegend",
|
|
233
|
+
value: function setLegend(text) {}
|
|
234
|
+
}, {
|
|
235
|
+
key: "saveForm",
|
|
236
|
+
value: function saveForm(viewRef, formRef, url) {
|
|
237
|
+
this.saveForm(viewRef, formRef, url, null, null, null);
|
|
189
238
|
}
|
|
239
|
+
}, {
|
|
240
|
+
key: "saveForm",
|
|
241
|
+
value: function saveForm(viewRef, formRef, url, successCallback, errorCallback) {
|
|
242
|
+
this.saveForm(viewRef, formRef, url, successCallback, errorCallback, null);
|
|
243
|
+
}
|
|
244
|
+
}, {
|
|
245
|
+
key: "offsetDate",
|
|
246
|
+
value: function offsetDate(date, yearOffset, monthOffset, dayOffset) {
|
|
247
|
+
var year = date.getFullYear() + yearOffset;
|
|
248
|
+
var day = date.getDate() + dayOffset;
|
|
249
|
+
var month = date.getMonth() + monthOffset;
|
|
250
|
+
return new Date(year, month, day);
|
|
251
|
+
}
|
|
252
|
+
}, {
|
|
253
|
+
key: "autoSetDate",
|
|
254
|
+
value: function autoSetDate(viewRef, formRef, newDate, yearOffset, monthOffset, dayOffset, autoFillDateName, refDateName) {
|
|
255
|
+
var _this2 = this;
|
|
190
256
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
return (this.isNull(viewName) ? "" : viewName) + (props.length > 0 ? prefix + props : "");
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
setLegendColor(color) {}
|
|
257
|
+
var stateDate = viewRef.state[refDateName];
|
|
258
|
+
var tempDate = stateDate;
|
|
197
259
|
|
|
198
|
-
|
|
260
|
+
if (this.isNull(stateDate) || stateDate.getTime() !== newDate.getTime()) {
|
|
261
|
+
viewRef.setState(_objectSpread(_objectSpread({}, viewRef.state), {}, _defineProperty({}, refDateName, newDate)), function () {
|
|
262
|
+
if (!_this2.isNull(tempDate) && !_this2.isNull(viewRef.state.id)) {
|
|
263
|
+
var autoFillDate = _this2.offsetDate(newDate, yearOffset, monthOffset, dayOffset);
|
|
199
264
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
265
|
+
formRef.current.setValue(autoFillDateName, autoFillDate);
|
|
266
|
+
} else if (_this2.isNull(viewRef.state.id)) {
|
|
267
|
+
var _autoFillDate = _this2.offsetDate(newDate, yearOffset, monthOffset, dayOffset);
|
|
203
268
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
269
|
+
formRef.current.setValue(autoFillDateName, _autoFillDate);
|
|
270
|
+
}
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
}, {
|
|
275
|
+
key: "invokeUrl",
|
|
276
|
+
value: function invokeUrl(url, data, successCallback, errorCallback) {
|
|
277
|
+
var accessToken = sessionStorage.getItem("accessToken");
|
|
278
|
+
var idToken = sessionStorage.getItem("idToken");
|
|
279
|
+
var fetchConfig = {
|
|
280
|
+
method: 'POST',
|
|
281
|
+
headers: {
|
|
282
|
+
'Accept': 'application/json',
|
|
283
|
+
'Content-Type': 'application/json',
|
|
284
|
+
'Authorization': 'Bearer ' + accessToken,
|
|
285
|
+
'idToken': idToken
|
|
286
|
+
},
|
|
287
|
+
body: data
|
|
288
|
+
};
|
|
289
|
+
(0, _reactPromiseTracker.trackPromise)(fetch(url, fetchConfig).then(function (res) {
|
|
290
|
+
return res.json();
|
|
291
|
+
}).then(function (responseJson) {
|
|
292
|
+
var response = _typeof(responseJson) === "object" ? responseJson : JSON.parse(responseJson);
|
|
214
293
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
let tempDate = stateDate;
|
|
218
|
-
|
|
219
|
-
if (this.isNull(stateDate) || stateDate.getTime() !== newDate.getTime()) {
|
|
220
|
-
viewRef.setState({ ...viewRef.state,
|
|
221
|
-
[refDateName]: newDate
|
|
222
|
-
}, () => {
|
|
223
|
-
if (!this.isNull(tempDate) && !this.isNull(viewRef.state.id)) {
|
|
224
|
-
let autoFillDate = this.offsetDate(newDate, yearOffset, monthOffset, dayOffset);
|
|
225
|
-
formRef.current.setValue(autoFillDateName, autoFillDate);
|
|
226
|
-
} else if (this.isNull(viewRef.state.id)) {
|
|
227
|
-
let autoFillDate = this.offsetDate(newDate, yearOffset, monthOffset, dayOffset);
|
|
228
|
-
formRef.current.setValue(autoFillDateName, autoFillDate);
|
|
294
|
+
if (successCallback !== null) {
|
|
295
|
+
successCallback(response);
|
|
229
296
|
}
|
|
230
|
-
})
|
|
297
|
+
}).catch(function (e) {
|
|
298
|
+
if (errorCallback !== null) {
|
|
299
|
+
errorCallback(e);
|
|
300
|
+
}
|
|
301
|
+
}));
|
|
231
302
|
}
|
|
232
|
-
}
|
|
303
|
+
}, {
|
|
304
|
+
key: "saveForm",
|
|
305
|
+
value: function saveForm(viewRef, formRef, url, successCallback, errorCallback, viewRoute) {
|
|
306
|
+
var _this3 = this;
|
|
233
307
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
headers: {
|
|
240
|
-
'Accept': 'application/json',
|
|
241
|
-
'Content-Type': 'application/json',
|
|
242
|
-
'Authorization': 'Bearer ' + accessToken,
|
|
243
|
-
'idToken': idToken
|
|
244
|
-
},
|
|
245
|
-
body: data
|
|
246
|
-
};
|
|
247
|
-
(0, _reactPromiseTracker.trackPromise)(fetch(url, fetchConfig).then(res => res.json()).then(responseJson => {
|
|
248
|
-
let response = typeof responseJson === "object" ? responseJson : JSON.parse(responseJson);
|
|
249
|
-
|
|
250
|
-
if (successCallback !== null) {
|
|
251
|
-
successCallback(response);
|
|
252
|
-
}
|
|
253
|
-
}).catch(e => {
|
|
254
|
-
if (errorCallback !== null) {
|
|
255
|
-
errorCallback(e);
|
|
256
|
-
}
|
|
257
|
-
}));
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
saveForm(viewRef, formRef, url, successCallback, errorCallback, viewRoute) {
|
|
261
|
-
viewRef.setState({
|
|
262
|
-
message: "",
|
|
263
|
-
messageStyle: "message"
|
|
264
|
-
});
|
|
265
|
-
let formValue = formRef.current.getValue();
|
|
308
|
+
viewRef.setState({
|
|
309
|
+
message: "",
|
|
310
|
+
messageStyle: "message"
|
|
311
|
+
});
|
|
312
|
+
var formValue = formRef.current.getValue();
|
|
266
313
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
314
|
+
if (formValue !== null && typeof formValue !== 'undefined') {
|
|
315
|
+
if (!this.isNull(viewRef.props.location.state) && !this.isNull(viewRef.props.location.state.selection)) {
|
|
316
|
+
formValue.id = viewRef.props.location.state.selection;
|
|
317
|
+
}
|
|
271
318
|
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
319
|
+
var data = JSON.stringify(formValue);
|
|
320
|
+
var fullUrl = url + "?data=".concat(data);
|
|
321
|
+
this.invokeUrl(fullUrl, function (response) {
|
|
322
|
+
_this3.showMessage(viewRef, response.Message, response.MessageType);
|
|
276
323
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
324
|
+
if (successCallback !== null) {
|
|
325
|
+
successCallback(response);
|
|
326
|
+
}
|
|
280
327
|
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
328
|
+
if (!_this3.isNull(viewRoute) && !_this3.isNull(response.EntityId) && response.EntityId !== 0) {
|
|
329
|
+
viewRef.setState({
|
|
330
|
+
id: response.EntityId
|
|
331
|
+
}, function () {
|
|
332
|
+
viewRef.props.history.push({
|
|
333
|
+
pathname: viewRoute,
|
|
334
|
+
state: {
|
|
335
|
+
selection: viewRef.state.id
|
|
336
|
+
}
|
|
337
|
+
});
|
|
290
338
|
});
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
this.showMessage(viewRef, this.SYSTEM_ERROR_MESSAGE, "ERROR");
|
|
339
|
+
}
|
|
340
|
+
}, function (e) {
|
|
341
|
+
_this3.showMessage(viewRef, _this3.SYSTEM_ERROR_MESSAGE, "ERROR");
|
|
295
342
|
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
343
|
+
if (errorCallback !== null) {
|
|
344
|
+
errorCallback(e);
|
|
345
|
+
}
|
|
346
|
+
});
|
|
347
|
+
}
|
|
300
348
|
}
|
|
301
|
-
}
|
|
349
|
+
}]);
|
|
302
350
|
|
|
303
|
-
|
|
351
|
+
return ViewUtils;
|
|
352
|
+
}();
|
|
304
353
|
|
|
305
354
|
exports.default = ViewUtils;
|
|
@@ -16,13 +16,11 @@ var _typographyStyle = _interopRequireDefault(require("../../assets/jss/componen
|
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
17
|
|
|
18
18
|
// @material-ui/core components
|
|
19
|
-
|
|
19
|
+
var useStyles = (0, _styles.makeStyles)(_typographyStyle.default);
|
|
20
20
|
|
|
21
21
|
function Danger(props) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
children
|
|
25
|
-
} = props;
|
|
22
|
+
var classes = useStyles();
|
|
23
|
+
var children = props.children;
|
|
26
24
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
27
25
|
className: classes.defaultFontStyle + " " + classes.dangerText
|
|
28
26
|
}, children);
|
|
@@ -17,13 +17,11 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
17
17
|
|
|
18
18
|
// @material-ui/core components
|
|
19
19
|
// core components
|
|
20
|
-
|
|
20
|
+
var useStyles = (0, _styles.makeStyles)(_typographyStyle.default);
|
|
21
21
|
|
|
22
22
|
function Info(props) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
children
|
|
26
|
-
} = props;
|
|
23
|
+
var classes = useStyles();
|
|
24
|
+
var children = props.children;
|
|
27
25
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
28
26
|
className: classes.defaultFontStyle + " " + classes.infoText
|
|
29
27
|
}, children);
|
|
@@ -15,13 +15,11 @@ var _styles = require("@material-ui/core/styles");
|
|
|
15
15
|
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
var useStyles = (0, _styles.makeStyles)(_typographyStyle.default);
|
|
19
19
|
|
|
20
20
|
function Info(props) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
children
|
|
24
|
-
} = props;
|
|
21
|
+
var classes = useStyles();
|
|
22
|
+
var children = props.children;
|
|
25
23
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
26
24
|
className: classes.defaultFontStyle + " " + classes.infoText
|
|
27
25
|
}, children);
|