@agilemotion/oui-react-js 1.6.4 → 1.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ApplicationManager.js +675 -1044
- package/dist/BasicApp.js +7 -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
|
@@ -4,351 +4,245 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _reactPromiseTracker = require("react-promise-tracker");
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
|
|
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; }
|
|
23
|
-
|
|
24
|
-
var ViewUtils = /*#__PURE__*/function () {
|
|
25
|
-
function ViewUtils() {
|
|
26
|
-
var _this = this;
|
|
27
|
-
|
|
28
|
-
_classCallCheck(this, ViewUtils);
|
|
29
|
-
|
|
30
|
-
_defineProperty(this, "SYSTEM_ERROR_MESSAGE", "A system error has accured. Please contact your system administrator");
|
|
31
|
-
|
|
32
|
-
_defineProperty(this, "showMessage", function (viewRef, message, type) {
|
|
33
|
-
if (_this.isNull(message)) {
|
|
34
|
-
message = "";
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
var messageType = type === "ERROR" ? "danger" : _this.isNull(type) ? "message" : type;
|
|
38
|
-
viewRef.setState({
|
|
39
|
-
message: message,
|
|
40
|
-
messageStyle: messageType
|
|
41
|
-
});
|
|
42
|
-
});
|
|
8
|
+
class ViewUtils {
|
|
9
|
+
constructor() {}
|
|
10
|
+
SYSTEM_ERROR_MESSAGE = "A system error has accured. Please contact your system administrator";
|
|
11
|
+
isNull(value) {
|
|
12
|
+
return value === null || typeof value === 'undefined';
|
|
43
13
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
for (var i = 0; i < items.length; i++) {
|
|
56
|
-
var type = items[i].type;
|
|
57
|
-
|
|
58
|
-
if (type === 'buttonGroup') {
|
|
59
|
-
var buttons = items[i].buttons;
|
|
60
|
-
|
|
61
|
-
for (var j = 0; j < buttons.length; j++) {
|
|
62
|
-
var modes = buttons[j].modes;
|
|
63
|
-
|
|
64
|
-
if (!this.isNull(modes)) {
|
|
65
|
-
buttons[j].visible = modes.split(",").includes(viewMode);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
} // Force a new instance so that change event will be fired
|
|
70
|
-
|
|
71
|
-
|
|
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;
|
|
14
|
+
processToolbarConfig(viewMode, config) {
|
|
15
|
+
let items = config.items;
|
|
16
|
+
for (var i = 0; i < items.length; i++) {
|
|
17
|
+
let type = items[i].type;
|
|
18
|
+
if (type === 'buttonGroup') {
|
|
19
|
+
let buttons = items[i].buttons;
|
|
20
|
+
for (var j = 0; j < buttons.length; j++) {
|
|
21
|
+
let modes = buttons[j].modes;
|
|
22
|
+
if (!this.isNull(modes)) {
|
|
23
|
+
buttons[j].visible = modes.split(",").includes(viewMode);
|
|
83
24
|
}
|
|
84
25
|
}
|
|
85
26
|
}
|
|
86
|
-
|
|
87
|
-
return null;
|
|
88
27
|
}
|
|
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
28
|
|
|
95
|
-
|
|
96
|
-
|
|
29
|
+
// Force a new instance so that change event will be fired
|
|
30
|
+
return JSON.parse(JSON.stringify(config));
|
|
31
|
+
}
|
|
32
|
+
getField(id, settings) {
|
|
33
|
+
if (settings != null) {
|
|
34
|
+
for (var i = 0; i < settings.fields.length; i++) {
|
|
35
|
+
var field = settings.fields[i];
|
|
36
|
+
if (field.name === id) {
|
|
37
|
+
return field;
|
|
97
38
|
}
|
|
98
39
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
40
|
+
}
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
isFieldRequired(id, settings, formId) {
|
|
44
|
+
if (typeof settings !== 'undefined' && settings !== null) {
|
|
45
|
+
let field = this.getField(id, settings);
|
|
46
|
+
if (field != null) {
|
|
47
|
+
return field.required;
|
|
108
48
|
}
|
|
109
|
-
|
|
110
|
-
return false;
|
|
111
49
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
if (field != null) {
|
|
119
|
-
return field.visible;
|
|
50
|
+
if (!this.isStringEmpty(formId)) {
|
|
51
|
+
let fields = this.getFields(formId, 'validate');
|
|
52
|
+
for (var i = 0; i < fields.length; i++) {
|
|
53
|
+
if (fields[i].id === id) {
|
|
54
|
+
return fields[i].required;
|
|
120
55
|
}
|
|
121
56
|
}
|
|
122
|
-
|
|
123
|
-
return true;
|
|
124
57
|
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
isFieldVisible(id, settings) {
|
|
61
|
+
if (typeof settings !== 'undefined' && settings !== null) {
|
|
62
|
+
let field = this.getField(id, settings);
|
|
63
|
+
if (field != null) {
|
|
64
|
+
return field.visible;
|
|
65
|
+
}
|
|
129
66
|
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
}
|
|
67
|
+
return true;
|
|
68
|
+
}
|
|
69
|
+
isStringEmpty(val) {
|
|
70
|
+
return typeof val === 'undefined' || val === null || val.trim().length === 0;
|
|
71
|
+
}
|
|
72
|
+
getFields(formId, className) {
|
|
73
|
+
let inputFields = [];
|
|
74
|
+
let form = document.getElementById(formId);
|
|
75
|
+
if (!this.isNull(form)) {
|
|
76
|
+
let inputDivs = form.getElementsByClassName(className);
|
|
77
|
+
for (let i = 0; i < inputDivs.length; i++) {
|
|
78
|
+
let inputs = inputDivs[i].getElementsByTagName("input");
|
|
79
|
+
for (let j = 0; j < inputs.length; j++) {
|
|
80
|
+
inputFields.push(inputs[j]);
|
|
145
81
|
}
|
|
146
82
|
}
|
|
147
|
-
|
|
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
83
|
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
84
|
+
return inputFields;
|
|
85
|
+
}
|
|
86
|
+
validateField(id, required, values, currentValue) {
|
|
87
|
+
return this.validateField(id, required, values, currentValue, null, null);
|
|
88
|
+
}
|
|
89
|
+
validateField(id, required, values, currentValue, message) {
|
|
90
|
+
return this.validateField(id, required, values, currentValue, null, message);
|
|
91
|
+
}
|
|
92
|
+
validateField(id, required, values, currentValue, regex, message) {
|
|
93
|
+
let result = {};
|
|
94
|
+
result.valid = true;
|
|
95
|
+
result.message = "";
|
|
96
|
+
let value;
|
|
97
|
+
if (currentValue !== null) {
|
|
98
|
+
value = currentValue;
|
|
99
|
+
} else {
|
|
100
|
+
value = values[id];
|
|
101
|
+
}
|
|
102
|
+
let hasErrors = false;
|
|
103
|
+
if (required && (this.isNull(value) || this.isStringEmpty(value.toString()))) {
|
|
104
|
+
result.message = !this.isNull(message) ? message : "This field is required";
|
|
105
|
+
hasErrors = true;
|
|
106
|
+
} else {
|
|
165
107
|
result.message = "";
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
value = values[id];
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
var hasErrors = false;
|
|
175
|
-
|
|
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 = "";
|
|
108
|
+
}
|
|
109
|
+
if (!hasErrors && !this.isNull(regex) && !this.isNull(value)) {
|
|
110
|
+
hasErrors = this.isNull(value.toString().match(regex));
|
|
111
|
+
if (hasErrors) {
|
|
112
|
+
result.message = !this.isNull(message) ? message : "This field is invalid";
|
|
181
113
|
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
114
|
+
}
|
|
115
|
+
result.valid = !hasErrors;
|
|
116
|
+
return result;
|
|
117
|
+
}
|
|
118
|
+
getRequest(currentPage, curretRowsPerPage, currentSearchParameters, paged) {
|
|
119
|
+
var request = {};
|
|
120
|
+
request.pageSize = curretRowsPerPage;
|
|
121
|
+
request.currentPage = currentPage;
|
|
122
|
+
request.parameters = currentSearchParameters;
|
|
123
|
+
request.paged = typeof paged === 'undefined' || paged === null || paged;
|
|
124
|
+
return request;
|
|
125
|
+
}
|
|
126
|
+
getEntityViewTitle(queryParameterState, viewName) {
|
|
127
|
+
if (this.isNull(queryParameterState) || this.isNull(queryParameterState.selection)) {
|
|
128
|
+
return !this.isNull(viewName) ? viewName + " > Add" : "Add";
|
|
129
|
+
}
|
|
130
|
+
let props = "";
|
|
131
|
+
for (var _len = arguments.length, fields = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
132
|
+
fields[_key - 2] = arguments[_key];
|
|
133
|
+
}
|
|
134
|
+
for (let i = 0; i < fields.length; i++) {
|
|
135
|
+
if (!this.isNull(fields[i])) {
|
|
136
|
+
props += fields[i].trim();
|
|
137
|
+
props += " ";
|
|
189
138
|
}
|
|
190
|
-
|
|
191
|
-
result.valid = !hasErrors;
|
|
192
|
-
return result;
|
|
193
139
|
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
140
|
+
props = props.trim();
|
|
141
|
+
let prefix = this.isNull(viewName) ? "" : " > ";
|
|
142
|
+
return (this.isNull(viewName) ? "" : viewName) + (props.length > 0 ? prefix + props : "");
|
|
143
|
+
}
|
|
144
|
+
setLegendColor(color) {}
|
|
145
|
+
setLegend(text) {}
|
|
146
|
+
showMessage = (viewRef, message, type) => {
|
|
147
|
+
if (this.isNull(message)) {
|
|
148
|
+
message = "";
|
|
149
|
+
}
|
|
150
|
+
let messageType = type === "ERROR" ? "danger" : this.isNull(type) ? "message" : type;
|
|
151
|
+
viewRef.setState({
|
|
152
|
+
message: message,
|
|
153
|
+
messageStyle: messageType
|
|
154
|
+
});
|
|
155
|
+
};
|
|
156
|
+
saveForm(viewRef, formRef, url) {
|
|
157
|
+
this.saveForm(viewRef, formRef, url, null, null, null);
|
|
158
|
+
}
|
|
159
|
+
saveForm(viewRef, formRef, url, successCallback, errorCallback) {
|
|
160
|
+
this.saveForm(viewRef, formRef, url, successCallback, errorCallback, null);
|
|
161
|
+
}
|
|
162
|
+
offsetDate(date, yearOffset, monthOffset, dayOffset) {
|
|
163
|
+
let year = date.getFullYear() + yearOffset;
|
|
164
|
+
let day = date.getDate() + dayOffset;
|
|
165
|
+
let month = date.getMonth() + monthOffset;
|
|
166
|
+
return new Date(year, month, day);
|
|
167
|
+
}
|
|
168
|
+
autoSetDate(viewRef, formRef, newDate, yearOffset, monthOffset, dayOffset, autoFillDateName, refDateName) {
|
|
169
|
+
let stateDate = viewRef.state[refDateName];
|
|
170
|
+
let tempDate = stateDate;
|
|
171
|
+
if (this.isNull(stateDate) || stateDate.getTime() !== newDate.getTime()) {
|
|
172
|
+
viewRef.setState({
|
|
173
|
+
...viewRef.state,
|
|
174
|
+
[refDateName]: newDate
|
|
175
|
+
}, () => {
|
|
176
|
+
if (!this.isNull(tempDate) && !this.isNull(viewRef.state.id)) {
|
|
177
|
+
let autoFillDate = this.offsetDate(newDate, yearOffset, monthOffset, dayOffset);
|
|
178
|
+
formRef.current.setValue(autoFillDateName, autoFillDate);
|
|
179
|
+
} else if (this.isNull(viewRef.state.id)) {
|
|
180
|
+
let autoFillDate = this.offsetDate(newDate, yearOffset, monthOffset, dayOffset);
|
|
181
|
+
formRef.current.setValue(autoFillDateName, autoFillDate);
|
|
182
|
+
}
|
|
183
|
+
});
|
|
203
184
|
}
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
185
|
+
}
|
|
186
|
+
invokeUrl(url, data, successCallback, errorCallback) {
|
|
187
|
+
const accessToken = sessionStorage.getItem("accessToken");
|
|
188
|
+
const idToken = sessionStorage.getItem("idToken");
|
|
189
|
+
let fetchConfig = {
|
|
190
|
+
method: 'POST',
|
|
191
|
+
headers: {
|
|
192
|
+
'Accept': 'application/json',
|
|
193
|
+
'Content-Type': 'application/json',
|
|
194
|
+
'Authorization': 'Bearer ' + accessToken,
|
|
195
|
+
'idToken': idToken
|
|
196
|
+
},
|
|
197
|
+
body: data
|
|
198
|
+
};
|
|
199
|
+
(0, _reactPromiseTracker.trackPromise)(fetch(url, fetchConfig).then(res => res.json()).then(responseJson => {
|
|
200
|
+
let response = typeof responseJson === "object" ? responseJson : JSON.parse(responseJson);
|
|
201
|
+
if (successCallback !== null) {
|
|
202
|
+
successCallback(response);
|
|
215
203
|
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
props += fields[i].trim();
|
|
220
|
-
props += " ";
|
|
221
|
-
}
|
|
204
|
+
}).catch(e => {
|
|
205
|
+
if (errorCallback !== null) {
|
|
206
|
+
errorCallback(e);
|
|
222
207
|
}
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
}, {
|
|
235
|
-
key: "saveForm",
|
|
236
|
-
value: function saveForm(viewRef, formRef, url) {
|
|
237
|
-
this.saveForm(viewRef, formRef, url, null, null, null);
|
|
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;
|
|
256
|
-
|
|
257
|
-
var stateDate = viewRef.state[refDateName];
|
|
258
|
-
var tempDate = stateDate;
|
|
259
|
-
|
|
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);
|
|
264
|
-
|
|
265
|
-
formRef.current.setValue(autoFillDateName, autoFillDate);
|
|
266
|
-
} else if (_this2.isNull(viewRef.state.id)) {
|
|
267
|
-
var _autoFillDate = _this2.offsetDate(newDate, yearOffset, monthOffset, dayOffset);
|
|
268
|
-
|
|
269
|
-
formRef.current.setValue(autoFillDateName, _autoFillDate);
|
|
270
|
-
}
|
|
271
|
-
});
|
|
208
|
+
}));
|
|
209
|
+
}
|
|
210
|
+
saveForm(viewRef, formRef, url, successCallback, errorCallback, viewRoute) {
|
|
211
|
+
viewRef.setState({
|
|
212
|
+
message: "",
|
|
213
|
+
messageStyle: "message"
|
|
214
|
+
});
|
|
215
|
+
let formValue = formRef.current.getValue();
|
|
216
|
+
if (formValue !== null && typeof formValue !== 'undefined') {
|
|
217
|
+
if (!this.isNull(viewRef.props.location.state) && !this.isNull(viewRef.props.location.state.selection)) {
|
|
218
|
+
formValue.id = viewRef.props.location.state.selection;
|
|
272
219
|
}
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
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);
|
|
293
|
-
|
|
220
|
+
let data = JSON.stringify(formValue);
|
|
221
|
+
const fullUrl = url + `?data=${data}`;
|
|
222
|
+
this.invokeUrl(fullUrl, response => {
|
|
223
|
+
this.showMessage(viewRef, response.Message, response.MessageType);
|
|
294
224
|
if (successCallback !== null) {
|
|
295
225
|
successCallback(response);
|
|
296
226
|
}
|
|
297
|
-
|
|
227
|
+
if (!this.isNull(viewRoute) && !this.isNull(response.EntityId) && response.EntityId !== 0) {
|
|
228
|
+
viewRef.setState({
|
|
229
|
+
id: response.EntityId
|
|
230
|
+
}, () => {
|
|
231
|
+
viewRef.props.history.push({
|
|
232
|
+
pathname: viewRoute,
|
|
233
|
+
state: {
|
|
234
|
+
selection: viewRef.state.id
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
}, e => {
|
|
240
|
+
this.showMessage(viewRef, this.SYSTEM_ERROR_MESSAGE, "ERROR");
|
|
298
241
|
if (errorCallback !== null) {
|
|
299
242
|
errorCallback(e);
|
|
300
243
|
}
|
|
301
|
-
}));
|
|
302
|
-
}
|
|
303
|
-
}, {
|
|
304
|
-
key: "saveForm",
|
|
305
|
-
value: function saveForm(viewRef, formRef, url, successCallback, errorCallback, viewRoute) {
|
|
306
|
-
var _this3 = this;
|
|
307
|
-
|
|
308
|
-
viewRef.setState({
|
|
309
|
-
message: "",
|
|
310
|
-
messageStyle: "message"
|
|
311
244
|
});
|
|
312
|
-
var formValue = formRef.current.getValue();
|
|
313
|
-
|
|
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
|
-
}
|
|
318
|
-
|
|
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);
|
|
323
|
-
|
|
324
|
-
if (successCallback !== null) {
|
|
325
|
-
successCallback(response);
|
|
326
|
-
}
|
|
327
|
-
|
|
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
|
-
});
|
|
338
|
-
});
|
|
339
|
-
}
|
|
340
|
-
}, function (e) {
|
|
341
|
-
_this3.showMessage(viewRef, _this3.SYSTEM_ERROR_MESSAGE, "ERROR");
|
|
342
|
-
|
|
343
|
-
if (errorCallback !== null) {
|
|
344
|
-
errorCallback(e);
|
|
345
|
-
}
|
|
346
|
-
});
|
|
347
|
-
}
|
|
348
245
|
}
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
return ViewUtils;
|
|
352
|
-
}();
|
|
353
|
-
|
|
246
|
+
}
|
|
247
|
+
}
|
|
354
248
|
exports.default = ViewUtils;
|
|
@@ -4,28 +4,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = Danger;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
9
|
var _styles = require("@material-ui/core/styles");
|
|
13
|
-
|
|
14
10
|
var _typographyStyle = _interopRequireDefault(require("../../assets/jss/components/typographyStyle"));
|
|
15
|
-
|
|
16
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
-
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
18
12
|
// @material-ui/core components
|
|
19
|
-
var useStyles = (0, _styles.makeStyles)(_typographyStyle.default);
|
|
20
13
|
|
|
14
|
+
const useStyles = (0, _styles.makeStyles)(_typographyStyle.default);
|
|
21
15
|
function Danger(props) {
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
const classes = useStyles();
|
|
17
|
+
const {
|
|
18
|
+
children
|
|
19
|
+
} = props;
|
|
24
20
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
25
21
|
className: classes.defaultFontStyle + " " + classes.dangerText
|
|
26
22
|
}, children);
|
|
27
23
|
}
|
|
28
|
-
|
|
29
24
|
Danger.propTypes = {
|
|
30
25
|
children: _propTypes.default.node
|
|
31
26
|
};
|
|
@@ -4,29 +4,25 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = Info;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
9
|
var _styles = require("@material-ui/core/styles");
|
|
13
|
-
|
|
14
10
|
var _typographyStyle = _interopRequireDefault(require("../../assets/jss/components/typographyStyle"));
|
|
15
|
-
|
|
16
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
-
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
18
12
|
// @material-ui/core components
|
|
13
|
+
|
|
19
14
|
// core components
|
|
20
|
-
var useStyles = (0, _styles.makeStyles)(_typographyStyle.default);
|
|
21
15
|
|
|
16
|
+
const useStyles = (0, _styles.makeStyles)(_typographyStyle.default);
|
|
22
17
|
function Info(props) {
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
const classes = useStyles();
|
|
19
|
+
const {
|
|
20
|
+
children
|
|
21
|
+
} = props;
|
|
25
22
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
26
23
|
className: classes.defaultFontStyle + " " + classes.infoText
|
|
27
24
|
}, children);
|
|
28
25
|
}
|
|
29
|
-
|
|
30
26
|
Info.propTypes = {
|
|
31
27
|
children: _propTypes.default.node
|
|
32
28
|
};
|
|
@@ -4,27 +4,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = Info;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
9
|
var _typographyStyle = _interopRequireDefault(require("../../assets/jss/components/typographyStyle"));
|
|
13
|
-
|
|
14
10
|
var _styles = require("@material-ui/core/styles");
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var useStyles = (0, _styles.makeStyles)(_typographyStyle.default);
|
|
19
|
-
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
const useStyles = (0, _styles.makeStyles)(_typographyStyle.default);
|
|
20
13
|
function Info(props) {
|
|
21
|
-
|
|
22
|
-
|
|
14
|
+
const classes = useStyles();
|
|
15
|
+
const {
|
|
16
|
+
children
|
|
17
|
+
} = props;
|
|
23
18
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
24
19
|
className: classes.defaultFontStyle + " " + classes.infoText
|
|
25
20
|
}, children);
|
|
26
21
|
}
|
|
27
|
-
|
|
28
22
|
Info.propTypes = {
|
|
29
23
|
children: _propTypes.default.node
|
|
30
24
|
};
|