@agilemotion/oui-react-js 1.6.3 → 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 +26 -21
|
@@ -1,189 +1,73 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
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); }
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.default = void 0;
|
|
9
|
-
|
|
10
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
8
|
var _core = require("@material-ui/core");
|
|
13
|
-
|
|
14
9
|
var _Send = _interopRequireDefault(require("@material-ui/icons/Send"));
|
|
15
|
-
|
|
16
10
|
var _Tooltip = _interopRequireDefault(require("@material-ui/core/Tooltip"));
|
|
17
|
-
|
|
18
11
|
var _reactRouterDom = require("react-router-dom");
|
|
19
|
-
|
|
20
12
|
require("./ChatRooms.scss");
|
|
21
|
-
|
|
22
13
|
var _moment = _interopRequireDefault(require("moment"));
|
|
23
|
-
|
|
24
14
|
var _InputAdornment = _interopRequireDefault(require("@material-ui/core/InputAdornment"));
|
|
25
|
-
|
|
26
15
|
var _LoginStyle = _interopRequireDefault(require("../view/security/LoginStyle"));
|
|
27
|
-
|
|
28
16
|
var _CustomInput = _interopRequireDefault(require("../customInput/CustomInput"));
|
|
29
|
-
|
|
30
17
|
var _LottieIcon = _interopRequireDefault(require("../LottieIcon"));
|
|
31
|
-
|
|
32
18
|
var _reactFeather = require("react-feather");
|
|
33
|
-
|
|
34
19
|
var _Utils = _interopRequireDefault(require("../../Utils"));
|
|
35
|
-
|
|
36
20
|
var _SocketManager = _interopRequireDefault(require("../../service/SocketManager"));
|
|
37
|
-
|
|
38
21
|
var _types = require("../../types");
|
|
39
|
-
|
|
40
22
|
var _AppManager = _interopRequireDefault(require("../../../common/service/AppManager"));
|
|
41
|
-
|
|
42
23
|
var _icons = require("@material-ui/icons");
|
|
43
|
-
|
|
44
24
|
var _AutoComplete = _interopRequireDefault(require("../customInput/AutoComplete"));
|
|
45
|
-
|
|
46
25
|
var _RestService = require("../../service/RestService");
|
|
47
|
-
|
|
48
26
|
var _reactstrap = require("reactstrap");
|
|
49
|
-
|
|
50
27
|
var _Dialog = _interopRequireDefault(require("@material-ui/core/Dialog"));
|
|
51
|
-
|
|
52
28
|
var _DialogActions = _interopRequireDefault(require("@material-ui/core/DialogActions"));
|
|
53
|
-
|
|
54
29
|
var _Button = _interopRequireDefault(require("@material-ui/core/Button"));
|
|
55
|
-
|
|
56
30
|
var _ChatPoll = _interopRequireDefault(require("./ChatPoll"));
|
|
57
|
-
|
|
58
31
|
var _linkifyReact = _interopRequireDefault(require("linkify-react"));
|
|
59
|
-
|
|
60
32
|
var _File = _interopRequireDefault(require("../customInput/File"));
|
|
61
|
-
|
|
62
33
|
var _Icon = _interopRequireDefault(require("../Icon"));
|
|
63
|
-
|
|
64
34
|
var _PollContainer = _interopRequireDefault(require("./PollContainer"));
|
|
65
|
-
|
|
66
|
-
function
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
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; }
|
|
91
|
-
|
|
92
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
93
|
-
|
|
94
|
-
var _window = window,
|
|
95
|
-
electron = _window.electron;
|
|
96
|
-
|
|
97
|
-
var ChatRoom = function ChatRoom(props) {
|
|
98
|
-
var navigate = (0, _reactRouterDom.useNavigate)();
|
|
99
|
-
|
|
100
|
-
var _useState = (0, _react.useState)(false),
|
|
101
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
102
|
-
refresher = _useState2[0],
|
|
103
|
-
setRefresher = _useState2[1];
|
|
104
|
-
|
|
105
|
-
var _useState3 = (0, _react.useState)(_AppManager.default.getUserDetails()),
|
|
106
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
107
|
-
currentUser = _useState4[0],
|
|
108
|
-
setCurrentUser = _useState4[1];
|
|
109
|
-
|
|
110
|
-
var _useState5 = (0, _react.useState)(''),
|
|
111
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
112
|
-
message = _useState6[0],
|
|
113
|
-
setMessage = _useState6[1];
|
|
114
|
-
|
|
115
|
-
var _useState7 = (0, _react.useState)(props.selectedChat),
|
|
116
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
117
|
-
selectedChat = _useState8[0],
|
|
118
|
-
setSelectedChat = _useState8[1];
|
|
119
|
-
|
|
120
|
-
var _useState9 = (0, _react.useState)(null),
|
|
121
|
-
_useState10 = _slicedToArray(_useState9, 2),
|
|
122
|
-
documents = _useState10[0],
|
|
123
|
-
setDocuments = _useState10[1];
|
|
124
|
-
|
|
125
|
-
var _useState11 = (0, _react.useState)([]),
|
|
126
|
-
_useState12 = _slicedToArray(_useState11, 2),
|
|
127
|
-
messages = _useState12[0],
|
|
128
|
-
setMessages = _useState12[1];
|
|
129
|
-
|
|
130
|
-
var _useState13 = (0, _react.useState)([]),
|
|
131
|
-
_useState14 = _slicedToArray(_useState13, 2),
|
|
132
|
-
newParticipants = _useState14[0],
|
|
133
|
-
setNewParticipants = _useState14[1];
|
|
134
|
-
|
|
135
|
-
var _useState15 = (0, _react.useState)(''),
|
|
136
|
-
_useState16 = _slicedToArray(_useState15, 2),
|
|
137
|
-
confirm = _useState16[0],
|
|
138
|
-
setImgUploadConfirm = _useState16[1];
|
|
139
|
-
|
|
140
|
-
var messagesEndRef = (0, _react.useRef)(null);
|
|
141
|
-
|
|
142
|
-
var _useState17 = (0, _react.useState)(true),
|
|
143
|
-
_useState18 = _slicedToArray(_useState17, 2),
|
|
144
|
-
loading = _useState18[0],
|
|
145
|
-
setLoading = _useState18[1];
|
|
146
|
-
|
|
147
|
-
var _useState19 = (0, _react.useState)('CHAT'),
|
|
148
|
-
_useState20 = _slicedToArray(_useState19, 2),
|
|
149
|
-
mode = _useState20[0],
|
|
150
|
-
setMode = _useState20[1];
|
|
151
|
-
|
|
152
|
-
var _useState21 = (0, _react.useState)([]),
|
|
153
|
-
_useState22 = _slicedToArray(_useState21, 2),
|
|
154
|
-
currentVote = _useState22[0],
|
|
155
|
-
setCurrentVote = _useState22[1];
|
|
156
|
-
|
|
157
|
-
var _useState23 = (0, _react.useState)(false),
|
|
158
|
-
_useState24 = _slicedToArray(_useState23, 2),
|
|
159
|
-
clearUploadedFileSwitch = _useState24[0],
|
|
160
|
-
setClearUploadedFileSwitch = _useState24[1];
|
|
161
|
-
|
|
162
|
-
var _useState25 = (0, _react.useState)(false),
|
|
163
|
-
_useState26 = _slicedToArray(_useState25, 2),
|
|
164
|
-
openAddPeople = _useState26[0],
|
|
165
|
-
setOpenAddPeople = _useState26[1];
|
|
166
|
-
|
|
167
|
-
var _useState27 = (0, _react.useState)({}),
|
|
168
|
-
_useState28 = _slicedToArray(_useState27, 1),
|
|
169
|
-
socketEventHandler = _useState28[0];
|
|
170
|
-
|
|
171
|
-
var socketEventHandlerApi = function socketEventHandlerApi() {
|
|
35
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
36
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
37
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
38
|
+
const {
|
|
39
|
+
electron
|
|
40
|
+
} = window;
|
|
41
|
+
const ChatRoom = props => {
|
|
42
|
+
const navigate = (0, _reactRouterDom.useNavigate)();
|
|
43
|
+
const [refresher, setRefresher] = (0, _react.useState)(false);
|
|
44
|
+
const [currentUser, setCurrentUser] = (0, _react.useState)(_AppManager.default.getUserDetails());
|
|
45
|
+
const [message, setMessage] = (0, _react.useState)('');
|
|
46
|
+
const [selectedChat, setSelectedChat] = (0, _react.useState)(props.selectedChat);
|
|
47
|
+
const [documents, setDocuments] = (0, _react.useState)(null);
|
|
48
|
+
const [messages, setMessages] = (0, _react.useState)([]);
|
|
49
|
+
const [newParticipants, setNewParticipants] = (0, _react.useState)([]);
|
|
50
|
+
const [confirm, setImgUploadConfirm] = (0, _react.useState)('');
|
|
51
|
+
const messagesEndRef = (0, _react.useRef)(null);
|
|
52
|
+
const [loading, setLoading] = (0, _react.useState)(true);
|
|
53
|
+
const [mode, setMode] = (0, _react.useState)('CHAT');
|
|
54
|
+
const [currentVote, setCurrentVote] = (0, _react.useState)([]);
|
|
55
|
+
const [clearUploadedFileSwitch, setClearUploadedFileSwitch] = (0, _react.useState)(false);
|
|
56
|
+
const [openAddPeople, setOpenAddPeople] = (0, _react.useState)(false);
|
|
57
|
+
const [socketEventHandler] = (0, _react.useState)({});
|
|
58
|
+
const socketEventHandlerApi = () => {
|
|
172
59
|
return {
|
|
173
60
|
get id() {
|
|
174
61
|
return 'chat-room-122991829';
|
|
175
62
|
},
|
|
176
|
-
|
|
177
|
-
on: function on(eventType, be) {
|
|
63
|
+
on: (eventType, be) => {
|
|
178
64
|
switch (eventType) {
|
|
179
65
|
case _types.MessageType.CHAT_MESSAGE:
|
|
180
66
|
onMessage(be.payload);
|
|
181
67
|
break;
|
|
182
|
-
|
|
183
68
|
case _types.MessageType.DELETE_CHAT_MESSAGE:
|
|
184
69
|
onDeleteMessage(be.payload);
|
|
185
70
|
break;
|
|
186
|
-
|
|
187
71
|
case _types.MessageType.SYSTEM_EVENT:
|
|
188
72
|
onSystemEvent(be.payload);
|
|
189
73
|
break;
|
|
@@ -191,64 +75,52 @@ var ChatRoom = function ChatRoom(props) {
|
|
|
191
75
|
}
|
|
192
76
|
};
|
|
193
77
|
};
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
(0, _RestService.get)("".concat(_AppManager.default.getAPIHost(), "/api/v1/chat/fetchMeetingChat/").concat(selectedChat.meetingId), function (response) {
|
|
78
|
+
const fetchChat = () => {
|
|
79
|
+
(0, _RestService.get)(`${_AppManager.default.getAPIHost()}/api/v1/chat/fetchMeetingChat/${selectedChat.meetingId}`, response => {
|
|
197
80
|
if (response && response.id) {
|
|
198
81
|
setSelectedChat(response);
|
|
199
82
|
}
|
|
200
|
-
},
|
|
83
|
+
}, e => {}, '', false);
|
|
201
84
|
};
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
sendMessage(e, "Poll: ".concat(poll.question, " has been closed."));
|
|
206
|
-
|
|
85
|
+
const closePollHandler = (e, poll) => {
|
|
86
|
+
(0, _RestService.post)(`${_AppManager.default.getAPIHost()}/api/v1/poll/close`, response => {
|
|
87
|
+
sendMessage(e, `Poll: ${poll.question} has been closed.`);
|
|
207
88
|
if (props.chatTab) {
|
|
208
89
|
fetchChat();
|
|
209
90
|
} else {
|
|
210
91
|
props.addedPeopleHandler();
|
|
211
92
|
}
|
|
212
|
-
},
|
|
93
|
+
}, e => {}, {
|
|
213
94
|
id: poll.id
|
|
214
95
|
});
|
|
215
96
|
};
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
return p.userId === currentUser.userId;
|
|
220
|
-
});
|
|
221
|
-
var data = {
|
|
97
|
+
const submitPollVoteHandler = poll => {
|
|
98
|
+
let chatParticipant = selectedChat.participants.find(p => p.userId === currentUser.userId);
|
|
99
|
+
const data = {
|
|
222
100
|
pollId: poll.id,
|
|
223
101
|
optionId: poll.selectedOption,
|
|
224
102
|
chatParticipant: chatParticipant
|
|
225
103
|
};
|
|
226
|
-
(0, _RestService.post)(
|
|
104
|
+
(0, _RestService.post)(`${_AppManager.default.getAPIHost()}/api/v1/poll/vote`, response => {
|
|
227
105
|
if (!props.chatTab) {
|
|
228
106
|
props.addedPeopleHandler();
|
|
229
107
|
}
|
|
230
|
-
},
|
|
108
|
+
}, e => {}, data);
|
|
231
109
|
};
|
|
232
|
-
|
|
233
|
-
var onSystemEvent = function onSystemEvent(payload) {
|
|
110
|
+
const onSystemEvent = payload => {
|
|
234
111
|
console.log(messages);
|
|
235
|
-
|
|
236
112
|
if (payload.systemEventType === "NEW_POLL_VOTE") {
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
if (find) {//find.totalVotes++;
|
|
113
|
+
let find = messages.find(msg => msg.poll && msg.poll.id === payload.data.pollId);
|
|
114
|
+
if (find) {
|
|
115
|
+
//find.totalVotes++;
|
|
242
116
|
}
|
|
243
117
|
}
|
|
244
118
|
};
|
|
245
|
-
|
|
246
|
-
var onMessage = function onMessage(payload) {
|
|
119
|
+
const onMessage = payload => {
|
|
247
120
|
if (selectedChat && selectedChat.id === payload.roomId) {
|
|
248
121
|
if (props.onMessage) {
|
|
249
122
|
props.onMessage(payload.chatMessage, selectedChat);
|
|
250
123
|
}
|
|
251
|
-
|
|
252
124
|
if (payload.chatMessage.type === 'EVENT') {
|
|
253
125
|
if (props.chatTab) {
|
|
254
126
|
fetchChat();
|
|
@@ -256,227 +128,167 @@ var ChatRoom = function ChatRoom(props) {
|
|
|
256
128
|
props.addedPeopleHandler();
|
|
257
129
|
}
|
|
258
130
|
}
|
|
259
|
-
|
|
260
131
|
selectedChat.messages.push(payload.chatMessage);
|
|
261
132
|
loadMessages();
|
|
262
133
|
}
|
|
263
134
|
};
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
var msg = messages.find(function (m) {
|
|
267
|
-
return m.id === payload.messageId;
|
|
268
|
-
});
|
|
269
|
-
|
|
135
|
+
const onDeleteMessage = payload => {
|
|
136
|
+
let msg = messages.find(m => m.id === payload.messageId);
|
|
270
137
|
if (msg) {
|
|
271
138
|
msg.active = false;
|
|
272
139
|
setRefresher(!refresher);
|
|
273
140
|
}
|
|
274
141
|
};
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
var accessToken = _AppManager.default.get("accessToken");
|
|
280
|
-
|
|
142
|
+
const onDownload = document => {
|
|
143
|
+
let documentFileUrl = '';
|
|
144
|
+
let accessToken = _AppManager.default.get("accessToken");
|
|
281
145
|
if (document.id) {
|
|
282
|
-
documentFileUrl =
|
|
146
|
+
documentFileUrl = `${_AppManager.default.getAPIHost()}/api/v1/document/download/${document.id}?access_token=${accessToken}`;
|
|
283
147
|
} else {
|
|
284
|
-
|
|
285
|
-
documentFileUrl =
|
|
148
|
+
const encodedDocumentLocation = encodeURIComponent(document.location);
|
|
149
|
+
documentFileUrl = `${_AppManager.default.getAPIHost()}/api/v1/document/download/location?documentLocation=${encodedDocumentLocation}&access_token=${accessToken}`;
|
|
286
150
|
}
|
|
287
|
-
|
|
288
151
|
electron.ipcRenderer.sendMessage('downloadFile', {
|
|
289
152
|
payload: {
|
|
290
153
|
fileURL: documentFileUrl
|
|
291
154
|
}
|
|
292
155
|
});
|
|
293
156
|
};
|
|
294
|
-
|
|
295
|
-
var loadMessages = function loadMessages() {
|
|
157
|
+
const loadMessages = () => {
|
|
296
158
|
scrollToBottom();
|
|
297
|
-
|
|
298
159
|
if (selectedChat) {
|
|
299
|
-
|
|
300
|
-
// NB : @Amu has change the code to first find a user and do a null check so that it does not break
|
|
301
|
-
|
|
302
|
-
var find = selectedChat.participants.find(function (p) {
|
|
303
|
-
return p.userId === currentUser.userId;
|
|
304
|
-
});
|
|
160
|
+
const newMessages = [].concat(selectedChat.messages);
|
|
305
161
|
|
|
162
|
+
// TODO. @Nsovo. This code is very unreliable. it breaks randomly. Please check if a user exists in the chat. If not call the back end to add them and then filter their messages from he current date
|
|
163
|
+
// NB : @Amu has change the code to first find a user and do a null check so that it does not break
|
|
164
|
+
let find = selectedChat.participants.find(p => p.userId === currentUser.userId);
|
|
306
165
|
if (_Utils.default.isNull(find)) {
|
|
307
|
-
(0, _RestService.post)(
|
|
166
|
+
(0, _RestService.post)(`${_AppManager.default.getAPIHost()}/api/v1/chat/addParticipants`, response => {}, e => {}, {
|
|
308
167
|
chatId: selectedChat.id,
|
|
309
168
|
participants: [_AppManager.default.getUserDetails()]
|
|
310
169
|
});
|
|
311
170
|
}
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
var filteredMessages = newMessages.filter(function (txt) {
|
|
315
|
-
return dateAddedToChat === null || new Date(dateAddedToChat) < new Date(txt.createdDate);
|
|
316
|
-
});
|
|
171
|
+
const dateAddedToChat = find ? find.dateAddedToChat : new Date();
|
|
172
|
+
const filteredMessages = newMessages.filter(txt => dateAddedToChat === null || new Date(dateAddedToChat) < new Date(txt.createdDate));
|
|
317
173
|
setMessages(filteredMessages);
|
|
318
174
|
}
|
|
319
|
-
|
|
320
175
|
setLoading(false);
|
|
321
176
|
};
|
|
322
|
-
|
|
323
|
-
var getChatRoomTitle = function getChatRoomTitle() {
|
|
177
|
+
const getChatRoomTitle = () => {
|
|
324
178
|
if (selectedChat.type === 'CALENDAR_MEETING' || selectedChat.title) {
|
|
325
179
|
return selectedChat.title;
|
|
326
180
|
}
|
|
327
|
-
|
|
328
181
|
return _Utils.default.getChatMeetingTitle(selectedChat.participants, currentUser.userId, 58);
|
|
329
182
|
};
|
|
330
|
-
|
|
331
|
-
(0, _react.useEffect)(function () {
|
|
183
|
+
(0, _react.useEffect)(() => {
|
|
332
184
|
setSelectedChat(props.selectedChat);
|
|
333
185
|
}, [props.selectedChat]);
|
|
334
|
-
(0, _react.useEffect)(
|
|
186
|
+
(0, _react.useEffect)(() => {
|
|
335
187
|
scrollToBottom();
|
|
336
188
|
}, [messages]);
|
|
337
|
-
(0, _react.useEffect)(
|
|
189
|
+
(0, _react.useEffect)(() => {
|
|
338
190
|
setMessage('');
|
|
339
191
|
setDocuments(null);
|
|
340
192
|
loadMessages();
|
|
341
193
|
}, [selectedChat]);
|
|
342
|
-
(0, _react.useEffect)(
|
|
194
|
+
(0, _react.useEffect)(() => {
|
|
343
195
|
setCurrentUser(_AppManager.default.getUserDetails());
|
|
344
|
-
|
|
345
196
|
_SocketManager.default.addSubscriptions(socketEventHandler, _types.MessageType.DELETE_CHAT_MESSAGE, _types.MessageType.CHAT_MESSAGE, _types.MessageType.SYSTEM_EVENT);
|
|
346
197
|
}, []);
|
|
347
|
-
(0, _react.useEffect)(
|
|
198
|
+
(0, _react.useEffect)(() => {
|
|
348
199
|
socketEventHandler.api = socketEventHandlerApi();
|
|
349
200
|
});
|
|
350
|
-
(0, _react.useEffect)(
|
|
351
|
-
return
|
|
201
|
+
(0, _react.useEffect)(() => {
|
|
202
|
+
return () => {
|
|
352
203
|
_SocketManager.default.removeSubscriptions(socketEventHandler);
|
|
353
204
|
};
|
|
354
205
|
}, []);
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
var _messagesEndRef$curre;
|
|
358
|
-
|
|
359
|
-
(_messagesEndRef$curre = messagesEndRef.current) === null || _messagesEndRef$curre === void 0 ? void 0 : _messagesEndRef$curre.scrollIntoView({
|
|
206
|
+
const scrollToBottom = () => {
|
|
207
|
+
messagesEndRef.current?.scrollIntoView({
|
|
360
208
|
behavior: 'smooth'
|
|
361
209
|
});
|
|
362
210
|
};
|
|
363
|
-
|
|
364
|
-
var handleChange = function handleChange(e) {
|
|
211
|
+
const handleChange = e => {
|
|
365
212
|
setMessage(e.target.value);
|
|
366
213
|
};
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
return selectedChat.participants.filter(function (user) {
|
|
370
|
-
return user.userId !== currentUser.userId;
|
|
371
|
-
}).map(function (user) {
|
|
372
|
-
return user.userId;
|
|
373
|
-
});
|
|
214
|
+
const participantsUserIds = () => {
|
|
215
|
+
return selectedChat.participants.filter(user => user.userId !== currentUser.userId).map(user => user.userId);
|
|
374
216
|
};
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
var poll = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
379
|
-
|
|
217
|
+
const sendMessage = function (e) {
|
|
218
|
+
let finalMessage = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
219
|
+
let poll = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
380
220
|
if (e) {
|
|
381
221
|
e.preventDefault();
|
|
382
222
|
}
|
|
383
|
-
|
|
384
223
|
if (message || documents || finalMessage || poll) {
|
|
385
|
-
|
|
386
|
-
|
|
224
|
+
let mType = 'TEXT';
|
|
387
225
|
if (documents && documents.length > 0) {
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
_step;
|
|
392
|
-
|
|
393
|
-
try {
|
|
394
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
395
|
-
var doc = _step.value;
|
|
396
|
-
combinedSize = combinedSize + parseInt(doc.size);
|
|
397
|
-
}
|
|
398
|
-
} catch (err) {
|
|
399
|
-
_iterator.e(err);
|
|
400
|
-
} finally {
|
|
401
|
-
_iterator.f();
|
|
226
|
+
let combinedSize = 0;
|
|
227
|
+
for (const doc of documents) {
|
|
228
|
+
combinedSize = combinedSize + parseInt(doc.size);
|
|
402
229
|
}
|
|
403
|
-
|
|
404
230
|
if (combinedSize > 7500000) {
|
|
405
231
|
_AppManager.default.fireEvent(_types.SystemEventType.API_ERROR, {
|
|
406
232
|
message: 'Attachment should be not more than 7.5MB.'
|
|
407
233
|
});
|
|
408
|
-
|
|
409
234
|
return;
|
|
410
235
|
}
|
|
411
|
-
|
|
412
236
|
mType = 'FILE';
|
|
413
237
|
} else if (poll) {
|
|
414
238
|
mType = 'POLL';
|
|
415
239
|
} else if (finalMessage) {
|
|
416
240
|
mType = 'EVENT';
|
|
417
241
|
}
|
|
418
|
-
|
|
419
|
-
var msg = {
|
|
242
|
+
const msg = {
|
|
420
243
|
createdDate: new Date(),
|
|
421
244
|
type: mType,
|
|
422
245
|
active: true,
|
|
423
246
|
content: finalMessage ? finalMessage : message,
|
|
424
247
|
participant: currentUser
|
|
425
248
|
};
|
|
426
|
-
|
|
427
249
|
if (documents && documents.length > 0) {
|
|
428
250
|
msg.documents = documents;
|
|
429
251
|
setClearUploadedFileSwitch(!clearUploadedFileSwitch);
|
|
430
252
|
}
|
|
431
|
-
|
|
432
253
|
if (poll) {
|
|
433
254
|
msg.poll = poll;
|
|
434
255
|
}
|
|
435
|
-
|
|
436
256
|
msg.participant.active = true;
|
|
437
|
-
|
|
438
|
-
|
|
257
|
+
const participantsToSignalIds = participantsUserIds();
|
|
439
258
|
_SocketManager.default.emitEvent(_types.MessageType.CHAT_MESSAGE, {
|
|
440
259
|
roomId: selectedChat.id,
|
|
441
260
|
chatMessage: msg,
|
|
442
|
-
participantsToSignalIds
|
|
261
|
+
participantsToSignalIds,
|
|
443
262
|
skipAlert: props.chatTab || finalMessage,
|
|
444
263
|
newChat: selectedChat.messages.length === 0,
|
|
445
264
|
meetingId: props.meetingId ? props.meetingId : null
|
|
446
|
-
}).then(
|
|
265
|
+
}).then(data => {
|
|
447
266
|
msg.id = data.id;
|
|
448
|
-
setMessages(
|
|
449
|
-
return [].concat(_toConsumableArray(oldMsgs), [msg]);
|
|
450
|
-
});
|
|
267
|
+
setMessages(oldMsgs => [...oldMsgs, msg]);
|
|
451
268
|
selectedChat.messages.push(msg);
|
|
452
|
-
|
|
453
269
|
if (props.onMessage && selectedChat) {
|
|
454
270
|
props.onMessage(msg, selectedChat);
|
|
455
271
|
}
|
|
456
|
-
}).catch(
|
|
272
|
+
}).catch(error => {});
|
|
457
273
|
}
|
|
458
|
-
|
|
459
274
|
setMessage('');
|
|
460
275
|
setImgUploadConfirm('');
|
|
461
276
|
setDocuments(null);
|
|
462
277
|
};
|
|
463
|
-
|
|
464
|
-
var callNow = function callNow(e) {
|
|
278
|
+
const callNow = e => {
|
|
465
279
|
e.preventDefault();
|
|
466
|
-
sendMessage(e,
|
|
467
|
-
(0, _RestService.get)(
|
|
468
|
-
|
|
280
|
+
sendMessage(e, `${currentUser.name} has started a call.`);
|
|
281
|
+
(0, _RestService.get)(`${_AppManager.default.getAPIHost()}/api/v1/meeting/generateId`, response => {
|
|
282
|
+
const directCallRoom = {
|
|
469
283
|
id: response
|
|
470
284
|
};
|
|
471
|
-
|
|
472
|
-
|
|
285
|
+
const participantsToSignalIds = participantsUserIds();
|
|
473
286
|
_SocketManager.default.emitEvent(_types.MessageType.CALL_MULTIPLE_USER, {
|
|
474
287
|
room: directCallRoom.id,
|
|
475
288
|
usersToCall: participantsToSignalIds,
|
|
476
289
|
callerId: _SocketManager.default.socket.id,
|
|
477
290
|
name: currentUser.name
|
|
478
|
-
}).catch(
|
|
479
|
-
|
|
291
|
+
}).catch(error => {});
|
|
480
292
|
navigate("/view/meetingRoom", {
|
|
481
293
|
state: {
|
|
482
294
|
displayMode: 'window',
|
|
@@ -488,39 +300,37 @@ var ChatRoom = function ChatRoom(props) {
|
|
|
488
300
|
usersToCall: participantsToSignalIds
|
|
489
301
|
}
|
|
490
302
|
});
|
|
491
|
-
},
|
|
303
|
+
}, e => {}, '', true);
|
|
492
304
|
};
|
|
493
|
-
|
|
494
|
-
var addPeople = function addPeople(e) {
|
|
305
|
+
const addPeople = e => {
|
|
495
306
|
if (newParticipants.length > 0) {
|
|
496
|
-
newParticipants.forEach(
|
|
307
|
+
newParticipants.forEach(participant => {
|
|
497
308
|
selectedChat.participants.push(participant);
|
|
498
309
|
});
|
|
499
|
-
(0, _RestService.post)(
|
|
310
|
+
(0, _RestService.post)(`${_AppManager.default.getAPIHost()}/api/v1/chat/addParticipants`, response => {
|
|
500
311
|
sendMessage(e, newParticipants[0].name + ' has join the conversation.');
|
|
501
312
|
setNewParticipants([]);
|
|
502
313
|
setOpenAddPeople(false);
|
|
503
314
|
props.addedPeopleHandler();
|
|
504
|
-
},
|
|
315
|
+
}, e => {}, {
|
|
505
316
|
chatId: selectedChat.id,
|
|
506
317
|
participants: newParticipants
|
|
507
318
|
});
|
|
508
319
|
}
|
|
509
320
|
};
|
|
510
|
-
|
|
511
|
-
var handleClose = function handleClose(e) {
|
|
321
|
+
const handleClose = e => {
|
|
512
322
|
setNewParticipants([]);
|
|
513
323
|
setOpenAddPeople(false);
|
|
514
324
|
};
|
|
515
|
-
|
|
516
|
-
var openAddPeopleDialog = function openAddPeopleDialog(e) {
|
|
325
|
+
const openAddPeopleDialog = e => {
|
|
517
326
|
setOpenAddPeople(true);
|
|
518
327
|
};
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
328
|
+
const renderFileThumbnail = message => {
|
|
329
|
+
const {
|
|
330
|
+
documents
|
|
331
|
+
} = message;
|
|
332
|
+
const thumbnails = [];
|
|
333
|
+
documents.forEach((doc, index) => {
|
|
524
334
|
if (doc.type.includes('image')) {
|
|
525
335
|
return thumbnails.push( /*#__PURE__*/_react.default.createElement("div", {
|
|
526
336
|
style: {
|
|
@@ -539,14 +349,13 @@ var ChatRoom = function ChatRoom(props) {
|
|
|
539
349
|
}
|
|
540
350
|
})), /*#__PURE__*/_react.default.createElement(_core.IconButton, {
|
|
541
351
|
component: "span",
|
|
542
|
-
onClick:
|
|
352
|
+
onClick: () => {
|
|
543
353
|
onDownload(documents[index]);
|
|
544
354
|
}
|
|
545
355
|
}, /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
546
356
|
id: 'DOWNLOAD'
|
|
547
357
|
}))));
|
|
548
358
|
}
|
|
549
|
-
|
|
550
359
|
if (doc.type.includes('pdf')) {
|
|
551
360
|
thumbnails.push( /*#__PURE__*/_react.default.createElement("div", {
|
|
552
361
|
key: index,
|
|
@@ -565,9 +374,7 @@ var ChatRoom = function ChatRoom(props) {
|
|
|
565
374
|
}
|
|
566
375
|
})), /*#__PURE__*/_react.default.createElement(_core.IconButton, {
|
|
567
376
|
component: "span",
|
|
568
|
-
onClick:
|
|
569
|
-
return onDownload(documents[index]);
|
|
570
|
-
}
|
|
377
|
+
onClick: () => onDownload(documents[index])
|
|
571
378
|
}, /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
572
379
|
id: 'DOWNLOAD'
|
|
573
380
|
}))));
|
|
@@ -589,9 +396,7 @@ var ChatRoom = function ChatRoom(props) {
|
|
|
589
396
|
}
|
|
590
397
|
})), /*#__PURE__*/_react.default.createElement(_core.IconButton, {
|
|
591
398
|
component: "span",
|
|
592
|
-
onClick:
|
|
593
|
-
return onDownload(documents[index]);
|
|
594
|
-
}
|
|
399
|
+
onClick: () => onDownload(documents[index])
|
|
595
400
|
}, /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
596
401
|
id: 'DOWNLOAD'
|
|
597
402
|
}))));
|
|
@@ -613,9 +418,7 @@ var ChatRoom = function ChatRoom(props) {
|
|
|
613
418
|
}
|
|
614
419
|
})), /*#__PURE__*/_react.default.createElement(_core.IconButton, {
|
|
615
420
|
component: "span",
|
|
616
|
-
onClick:
|
|
617
|
-
return onDownload(documents[index]);
|
|
618
|
-
}
|
|
421
|
+
onClick: () => onDownload(documents[index])
|
|
619
422
|
}, /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
620
423
|
id: 'DOWNLOAD'
|
|
621
424
|
}))));
|
|
@@ -637,9 +440,7 @@ var ChatRoom = function ChatRoom(props) {
|
|
|
637
440
|
}
|
|
638
441
|
})), /*#__PURE__*/_react.default.createElement(_core.IconButton, {
|
|
639
442
|
component: "span",
|
|
640
|
-
onClick:
|
|
641
|
-
return onDownload(documents[index]);
|
|
642
|
-
}
|
|
443
|
+
onClick: () => onDownload(documents[index])
|
|
643
444
|
}, /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
644
445
|
id: 'DOWNLOAD'
|
|
645
446
|
}))));
|
|
@@ -667,9 +468,7 @@ var ChatRoom = function ChatRoom(props) {
|
|
|
667
468
|
}
|
|
668
469
|
}, documents[index].name)), /*#__PURE__*/_react.default.createElement(_core.IconButton, {
|
|
669
470
|
component: "span",
|
|
670
|
-
onClick:
|
|
671
|
-
return onDownload(documents[index]);
|
|
672
|
-
}
|
|
471
|
+
onClick: () => onDownload(documents[index])
|
|
673
472
|
}, /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
674
473
|
id: 'DOWNLOAD'
|
|
675
474
|
}))));
|
|
@@ -677,31 +476,31 @@ var ChatRoom = function ChatRoom(props) {
|
|
|
677
476
|
});
|
|
678
477
|
return thumbnails;
|
|
679
478
|
};
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
479
|
+
const renderLink = _ref => {
|
|
480
|
+
let {
|
|
481
|
+
attributes,
|
|
482
|
+
content
|
|
483
|
+
} = _ref;
|
|
484
|
+
const {
|
|
485
|
+
href
|
|
486
|
+
} = attributes;
|
|
685
487
|
return /*#__PURE__*/_react.default.createElement("a", {
|
|
686
|
-
onClick:
|
|
488
|
+
onClick: () => {
|
|
687
489
|
window.open(href);
|
|
688
490
|
}
|
|
689
491
|
}, content);
|
|
690
492
|
};
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
var participantsToSignalIds = participantsUserIds();
|
|
694
|
-
|
|
493
|
+
const deleteChatMessage = message => {
|
|
494
|
+
const participantsToSignalIds = participantsUserIds();
|
|
695
495
|
_SocketManager.default.emitEvent(_types.MessageType.DELETE_CHAT_MESSAGE, {
|
|
696
496
|
messageId: message.id,
|
|
697
|
-
participantsToSignalIds
|
|
698
|
-
}).then(
|
|
497
|
+
participantsToSignalIds
|
|
498
|
+
}).then(data => {
|
|
699
499
|
message.active = false;
|
|
700
500
|
setRefresher(!refresher);
|
|
701
|
-
}).catch(
|
|
501
|
+
}).catch(error => {});
|
|
702
502
|
};
|
|
703
|
-
|
|
704
|
-
var renderMessages = function renderMessages(message, index) {
|
|
503
|
+
const renderMessages = (message, index) => {
|
|
705
504
|
if (!message.active) {
|
|
706
505
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
707
506
|
key: index,
|
|
@@ -748,7 +547,7 @@ var ChatRoom = function ChatRoom(props) {
|
|
|
748
547
|
className: 'col chat-time'
|
|
749
548
|
}, (0, _moment.default)(message.createdDate).format('DD/MM, HH:mm')), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_core.IconButton, {
|
|
750
549
|
component: "span",
|
|
751
|
-
onClick:
|
|
550
|
+
onClick: () => {
|
|
752
551
|
deleteChatMessage(message);
|
|
753
552
|
}
|
|
754
553
|
}, /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
@@ -757,7 +556,6 @@ var ChatRoom = function ChatRoom(props) {
|
|
|
757
556
|
key: index
|
|
758
557
|
}, message.content)));
|
|
759
558
|
}
|
|
760
|
-
|
|
761
559
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
762
560
|
key: index,
|
|
763
561
|
className: "chatroom__message"
|
|
@@ -784,7 +582,7 @@ var ChatRoom = function ChatRoom(props) {
|
|
|
784
582
|
className: 'col chat-time'
|
|
785
583
|
}, (0, _moment.default)(message.createdDate).format('DD/MM, HH:mm')), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_core.IconButton, {
|
|
786
584
|
component: "span",
|
|
787
|
-
onClick:
|
|
585
|
+
onClick: () => {
|
|
788
586
|
deleteChatMessage(message);
|
|
789
587
|
}
|
|
790
588
|
}, /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
@@ -799,11 +597,10 @@ var ChatRoom = function ChatRoom(props) {
|
|
|
799
597
|
style: {
|
|
800
598
|
marginBottom: '4px'
|
|
801
599
|
}
|
|
802
|
-
}, message.content.split('\n').map(
|
|
600
|
+
}, message.content.split('\n').map((token, index) => {
|
|
803
601
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, token, /*#__PURE__*/_react.default.createElement("br", null));
|
|
804
602
|
})))));
|
|
805
603
|
}
|
|
806
|
-
|
|
807
604
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
808
605
|
key: index,
|
|
809
606
|
className: "chatroom__message"
|
|
@@ -821,7 +618,7 @@ var ChatRoom = function ChatRoom(props) {
|
|
|
821
618
|
style: {
|
|
822
619
|
marginBottom: '4px'
|
|
823
620
|
}
|
|
824
|
-
}, message.content.split('\n').map(
|
|
621
|
+
}, message.content.split('\n').map((token, index) => {
|
|
825
622
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, token, /*#__PURE__*/_react.default.createElement("br", null));
|
|
826
623
|
}))))));
|
|
827
624
|
} else if (message.type === 'EVENT') {
|
|
@@ -847,25 +644,16 @@ var ChatRoom = function ChatRoom(props) {
|
|
|
847
644
|
chatTab: props.chatTab,
|
|
848
645
|
pollCreator: message.participant,
|
|
849
646
|
createdDate: message.createdDate,
|
|
850
|
-
submitPollVoteHandler:
|
|
851
|
-
|
|
852
|
-
},
|
|
853
|
-
pollParticipantIDs: selectedChat.participants.map(function (p) {
|
|
854
|
-
return p.userId;
|
|
855
|
-
}),
|
|
647
|
+
submitPollVoteHandler: poll => submitPollVoteHandler(poll),
|
|
648
|
+
pollParticipantIDs: selectedChat.participants.map(p => p.userId),
|
|
856
649
|
currentUser: currentUser,
|
|
857
|
-
closePollHandler:
|
|
858
|
-
return _closePollHandler(e, poll);
|
|
859
|
-
},
|
|
650
|
+
closePollHandler: (e, poll) => closePollHandler(e, poll),
|
|
860
651
|
numberOfPollParticipants: selectedChat.participants.length
|
|
861
652
|
});
|
|
862
653
|
}
|
|
863
654
|
}
|
|
864
655
|
};
|
|
865
|
-
|
|
866
656
|
if (selectedChat && messages) {
|
|
867
|
-
var _messages$sort;
|
|
868
|
-
|
|
869
657
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
870
658
|
className: "chatroom"
|
|
871
659
|
}, /*#__PURE__*/_react.default.createElement(_Dialog.default, {
|
|
@@ -899,10 +687,10 @@ var ChatRoom = function ChatRoom(props) {
|
|
|
899
687
|
showImages: true,
|
|
900
688
|
searchAttribute: 'name',
|
|
901
689
|
validationRegex: /^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/,
|
|
902
|
-
valueChangeHandler:
|
|
690
|
+
valueChangeHandler: (value, id) => {
|
|
903
691
|
setNewParticipants(value);
|
|
904
692
|
},
|
|
905
|
-
optionsUrl:
|
|
693
|
+
optionsUrl: `${_AppManager.default.getAPIHost()}/api/v1/auth/search`,
|
|
906
694
|
fullWidth: true
|
|
907
695
|
}))))), /*#__PURE__*/_react.default.createElement(_DialogActions.default, null, /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
908
696
|
onClick: handleClose
|
|
@@ -921,20 +709,18 @@ var ChatRoom = function ChatRoom(props) {
|
|
|
921
709
|
style: {
|
|
922
710
|
backgroundColor: props.chatTab ? 'transparent' : null
|
|
923
711
|
}
|
|
924
|
-
}, selectedChat.type === 'CALENDAR_MEETING' || selectedChat.participants.length > 2 ? /*#__PURE__*/_react.default.createElement(_reactFeather.Calendar, null) : _Utils.default.getInitials(selectedChat.participants.find(
|
|
925
|
-
return p.userId !== currentUser.userId;
|
|
926
|
-
}).name))), /*#__PURE__*/_react.default.createElement("h5", null, getChatRoomTitle())), /*#__PURE__*/_react.default.createElement("div", {
|
|
712
|
+
}, selectedChat.type === 'CALENDAR_MEETING' || selectedChat.participants.length > 2 ? /*#__PURE__*/_react.default.createElement(_reactFeather.Calendar, null) : _Utils.default.getInitials(selectedChat.participants.find(p => p.userId !== currentUser.userId).name))), /*#__PURE__*/_react.default.createElement("h5", null, getChatRoomTitle())), /*#__PURE__*/_react.default.createElement("div", {
|
|
927
713
|
className: "chatroom__headerright"
|
|
928
714
|
}, !props.chatTab && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Tooltip.default, {
|
|
929
715
|
title: "Add People"
|
|
930
716
|
}, /*#__PURE__*/_react.default.createElement(_core.IconButton, {
|
|
931
|
-
onClick:
|
|
717
|
+
onClick: e => {
|
|
932
718
|
openAddPeopleDialog(e);
|
|
933
719
|
}
|
|
934
720
|
}, /*#__PURE__*/_react.default.createElement(_icons.GroupAdd, null)))), /*#__PURE__*/_react.default.createElement(_Tooltip.default, {
|
|
935
721
|
title: "Poll"
|
|
936
722
|
}, /*#__PURE__*/_react.default.createElement(_core.IconButton, {
|
|
937
|
-
onClick:
|
|
723
|
+
onClick: e => {
|
|
938
724
|
setMode('POLL');
|
|
939
725
|
}
|
|
940
726
|
}, /*#__PURE__*/_react.default.createElement(_icons.Poll, {
|
|
@@ -945,19 +731,17 @@ var ChatRoom = function ChatRoom(props) {
|
|
|
945
731
|
}))))), mode === 'POLL' ? /*#__PURE__*/_react.default.createElement(_ChatPoll.default, {
|
|
946
732
|
chatTab: props.chatTab,
|
|
947
733
|
participants: selectedChat.participants,
|
|
948
|
-
createPollHandler:
|
|
734
|
+
createPollHandler: pollData => {
|
|
949
735
|
sendMessage(null, null, pollData);
|
|
950
736
|
setMode('CHAT');
|
|
951
737
|
},
|
|
952
|
-
cancelPollHandler:
|
|
738
|
+
cancelPollHandler: () => {
|
|
953
739
|
setMode('CHAT');
|
|
954
740
|
}
|
|
955
741
|
}) : /*#__PURE__*/_react.default.createElement("div", {
|
|
956
742
|
id: "messages",
|
|
957
743
|
className: "chatroom__body"
|
|
958
|
-
},
|
|
959
|
-
return new Date(a.createdDate) - new Date(b.createdDate);
|
|
960
|
-
})) === null || _messages$sort === void 0 ? void 0 : _messages$sort.map(renderMessages), /*#__PURE__*/_react.default.createElement("div", {
|
|
744
|
+
}, messages.sort((a, b) => new Date(a.createdDate) - new Date(b.createdDate))?.map(renderMessages), /*#__PURE__*/_react.default.createElement("div", {
|
|
961
745
|
ref: messagesEndRef
|
|
962
746
|
}, "\xA0")), mode === 'CHAT' && /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("form", {
|
|
963
747
|
className: "chatroom__sendMessage"
|
|
@@ -983,7 +767,7 @@ var ChatRoom = function ChatRoom(props) {
|
|
|
983
767
|
iconColor: props.chatTab ? 'white' : null,
|
|
984
768
|
value: documents,
|
|
985
769
|
clearUploadedFileSwitch: clearUploadedFileSwitch,
|
|
986
|
-
valueChangeHandler:
|
|
770
|
+
valueChangeHandler: (value, id) => {
|
|
987
771
|
setDocuments(value);
|
|
988
772
|
}
|
|
989
773
|
})), /*#__PURE__*/_react.default.createElement(_CustomInput.default, {
|
|
@@ -1006,7 +790,7 @@ var ChatRoom = function ChatRoom(props) {
|
|
|
1006
790
|
}, /*#__PURE__*/_react.default.createElement(_core.IconButton, {
|
|
1007
791
|
style: _LoginStyle.default.inputAdornmentIcon,
|
|
1008
792
|
type: "submit",
|
|
1009
|
-
onClick:
|
|
793
|
+
onClick: e => {
|
|
1010
794
|
sendMessage(e);
|
|
1011
795
|
}
|
|
1012
796
|
}, /*#__PURE__*/_react.default.createElement(_Send.default, {
|
|
@@ -1016,7 +800,7 @@ var ChatRoom = function ChatRoom(props) {
|
|
|
1016
800
|
}
|
|
1017
801
|
}))),
|
|
1018
802
|
value: message,
|
|
1019
|
-
onChange:
|
|
803
|
+
onChange: e => {
|
|
1020
804
|
handleChange(e);
|
|
1021
805
|
}
|
|
1022
806
|
}
|
|
@@ -1044,6 +828,4 @@ var ChatRoom = function ChatRoom(props) {
|
|
|
1044
828
|
return null;
|
|
1045
829
|
}
|
|
1046
830
|
};
|
|
1047
|
-
|
|
1048
|
-
var _default = ChatRoom;
|
|
1049
|
-
exports.default = _default;
|
|
831
|
+
var _default = exports.default = ChatRoom;
|