@agilemotion/oui-react-js 1.8.40 → 1.8.41
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/components/Button.css +2 -1
- package/dist/components/Button.js +1 -0
- package/dist/components/DocumentViewer.js +2 -2
- package/dist/components/media/SideBarContent.js +2 -1
- package/dist/components/media/chat/ChatRoom.js +4 -2
- package/dist/components/media/chat/PollContainer.js +52 -2
- package/dist/js/Calendar.js +1 -0
- package/package.json +1 -1
|
@@ -90,6 +90,7 @@ const Button = props => {
|
|
|
90
90
|
refresh() {
|
|
91
91
|
let parsedConfig = _Utils.default.parseConfig(config ? config : props.config, props.viewId);
|
|
92
92
|
setDisabled(_Utils.default.evaluateBooleanExpression(parsedConfig.disabled, parsedConfig.id));
|
|
93
|
+
console.log("\n\n\n\nVISIBILITY CHECK [" + props.config.id + "] - [" + parsedConfig.visible + "] - [" + _Utils.default.evaluateBooleanExpression(parsedConfig.visible, parsedConfig.id) + "]");
|
|
93
94
|
setVisible(_Utils.default.isNull(parsedConfig.visible) || _Utils.default.evaluateBooleanExpression(parsedConfig.visible, parsedConfig.id));
|
|
94
95
|
}
|
|
95
96
|
};
|
|
@@ -129,10 +129,10 @@ const DocumentViewer = /*#__PURE__*/_react.default.memo(/*#__PURE__*/_react.defa
|
|
|
129
129
|
return visible && /*#__PURE__*/_react.default.createElement("div", {
|
|
130
130
|
style: _Utils.default.mergeStyles({}, props.config)
|
|
131
131
|
}, props.config.attributes?.label && /*#__PURE__*/_react.default.createElement("div", {
|
|
132
|
-
style: _Utils.default.mergeObjects(
|
|
132
|
+
style: _Utils.default.mergeObjects({
|
|
133
133
|
fontSize: '20px',
|
|
134
134
|
color: '#1d253b'
|
|
135
|
-
})
|
|
135
|
+
}, props.config.attributes?.labelStyle)
|
|
136
136
|
}, label), loading && /*#__PURE__*/_react.default.createElement("div", {
|
|
137
137
|
style: {
|
|
138
138
|
marginTop: '16px'
|
|
@@ -35,7 +35,8 @@ const SideBarContent = props => {
|
|
|
35
35
|
}) : /*#__PURE__*/_react.default.createElement(_ChatRoom.default, {
|
|
36
36
|
chatTab: true,
|
|
37
37
|
selectedChat: meetingChat,
|
|
38
|
-
meetingId: meetingId
|
|
38
|
+
meetingId: meetingId,
|
|
39
|
+
isHost: isHost
|
|
39
40
|
})));
|
|
40
41
|
};
|
|
41
42
|
var _default = exports.default = SideBarContent;
|
|
@@ -90,8 +90,9 @@ const ChatRoom = props => {
|
|
|
90
90
|
let chatParticipant = selectedChat.participants.find(p => p.username === currentUser.username);
|
|
91
91
|
const data = {
|
|
92
92
|
pollId: poll.id,
|
|
93
|
-
optionId: poll.selectedOption,
|
|
94
|
-
chatParticipant: chatParticipant
|
|
93
|
+
optionId: poll.selectedOption || poll.tieBreakerOption,
|
|
94
|
+
chatParticipant: chatParticipant,
|
|
95
|
+
tieBreaker: !_Utils.default.isNull(poll.tieBreakerOption)
|
|
95
96
|
};
|
|
96
97
|
(0, _RestUtils.postData)(`${location + '/' + _ApplicationManager.default.getContextRoot()}/calendar/api/v1/poll/vote`, response => {
|
|
97
98
|
fetchChat();
|
|
@@ -633,6 +634,7 @@ const ChatRoom = props => {
|
|
|
633
634
|
return /*#__PURE__*/_react.default.createElement(_PollContainer.default, {
|
|
634
635
|
poll: message.poll,
|
|
635
636
|
chatTab: props.chatTab,
|
|
637
|
+
isHost: props.isHost,
|
|
636
638
|
pollCreator: message.participant,
|
|
637
639
|
createdDate: message.createdDate,
|
|
638
640
|
submitPollVoteHandler: poll => submitPollVoteHandler(poll),
|
|
@@ -25,7 +25,9 @@ const PollContainer = props => {
|
|
|
25
25
|
const [poll, setPoll] = (0, _react.useState)({});
|
|
26
26
|
const [pollClosed, setPollClosed] = (0, _react.useState)(false);
|
|
27
27
|
const [currentVote, setCurrentVote] = (0, _react.useState)(null);
|
|
28
|
+
const [tieBreakerVote, setTieBreakerVote] = (0, _react.useState)(null);
|
|
28
29
|
const [totalVotes, setTotalVotes] = (0, _react.useState)(0);
|
|
30
|
+
const [tieOptions, setTieOptions] = (0, _react.useState)([]);
|
|
29
31
|
const [socketEventHandler] = (0, _react.useState)({});
|
|
30
32
|
const socketEventHandlerApi = () => {
|
|
31
33
|
return {
|
|
@@ -79,6 +81,14 @@ const PollContainer = props => {
|
|
|
79
81
|
voteCount: -Infinity
|
|
80
82
|
});
|
|
81
83
|
};
|
|
84
|
+
const tieForFirst = function () {
|
|
85
|
+
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
86
|
+
if (!Array.isArray(options) || options.length === 0) return [];
|
|
87
|
+
const counts = options.map(o => o?.voteCount ?? 0);
|
|
88
|
+
const max = Math.max(...counts);
|
|
89
|
+
const leaders = options.filter(o => (o?.voteCount ?? 0) === max);
|
|
90
|
+
return leaders.length >= 2 ? leaders : [];
|
|
91
|
+
};
|
|
82
92
|
(0, _react.useEffect)(() => {
|
|
83
93
|
_VCEventManager.default.addSubscriptions(socketEventHandler, _VCEventType.VCEventType.CHAT_MESSAGE, _VCEventType.VCEventType.SYSTEM_EVENT);
|
|
84
94
|
return () => {
|
|
@@ -89,7 +99,6 @@ const PollContainer = props => {
|
|
|
89
99
|
socketEventHandler.api = socketEventHandlerApi();
|
|
90
100
|
});
|
|
91
101
|
(0, _react.useEffect)(() => {
|
|
92
|
-
console.log('___ POLL: ', props.poll);
|
|
93
102
|
if (props.poll) {
|
|
94
103
|
const renderedPoll = props.poll;
|
|
95
104
|
setPoll(renderedPoll);
|
|
@@ -118,6 +127,7 @@ const PollContainer = props => {
|
|
|
118
127
|
label: option.text
|
|
119
128
|
}));
|
|
120
129
|
});
|
|
130
|
+
setTieOptions(tieForFirst(renderedPoll.options));
|
|
121
131
|
}
|
|
122
132
|
setPollOptions(pollOptionRows);
|
|
123
133
|
}
|
|
@@ -206,7 +216,47 @@ const PollContainer = props => {
|
|
|
206
216
|
style: {
|
|
207
217
|
color: '#945c33'
|
|
208
218
|
}
|
|
209
|
-
}, "You have voted ", props.poll.options.find(o => o.id === poll.selectedOption)?.text))
|
|
219
|
+
}, "You have voted ", props.poll.options.find(o => o.id === poll.selectedOption)?.text)), props.isHost && tieOptions.length > 0 && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
220
|
+
className: "poll-choices",
|
|
221
|
+
style: {
|
|
222
|
+
marginTop: '8px'
|
|
223
|
+
}
|
|
224
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
225
|
+
style: {
|
|
226
|
+
color: '#945c33',
|
|
227
|
+
borderTop: '1px solid #e1e1e1',
|
|
228
|
+
display: 'inline-block',
|
|
229
|
+
paddingTop: '8px',
|
|
230
|
+
width: '100%'
|
|
231
|
+
}
|
|
232
|
+
}, "Tie breaker"), /*#__PURE__*/_react.default.createElement(_FormControl.default, {
|
|
233
|
+
style: {
|
|
234
|
+
width: '100%'
|
|
235
|
+
}
|
|
236
|
+
}, /*#__PURE__*/_react.default.createElement(_RadioGroup.default, {
|
|
237
|
+
className: "poll-choice-radio-group",
|
|
238
|
+
value: tieBreakerVote ? tieBreakerVote : poll.tieBreakerOption ? poll.tieBreakerOption : '',
|
|
239
|
+
onChange: e => {
|
|
240
|
+
setTieBreakerVote(e.target.value);
|
|
241
|
+
}
|
|
242
|
+
}, pollOptions))), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
243
|
+
className: "vote-button",
|
|
244
|
+
variant: "outlined",
|
|
245
|
+
onClick: () => {
|
|
246
|
+
const hasVoted = poll.tieBreakerOption;
|
|
247
|
+
poll.tieBreakerOption = tieBreakerVote ? tieBreakerVote : '';
|
|
248
|
+
props.submitPollVoteHandler(poll);
|
|
249
|
+
if (!hasVoted) {
|
|
250
|
+
_SocketManager.default.emitEvent(_VCEventType.VCEventType.SYSTEM_EVENT, {
|
|
251
|
+
systemEventType: 'TIE_BREAKER_POLL_VOTE',
|
|
252
|
+
recipients: props.pollParticipantIDs,
|
|
253
|
+
data: {
|
|
254
|
+
pollId: poll.id
|
|
255
|
+
}
|
|
256
|
+
}).catch(() => {});
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}, "Submit tie breaker Vote"))) : /*#__PURE__*/_react.default.createElement("div", {
|
|
210
260
|
className: "poll-footer"
|
|
211
261
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
212
262
|
style: {
|
package/dist/js/Calendar.js
CHANGED
|
@@ -152,6 +152,7 @@ class Calendar {
|
|
|
152
152
|
description: event.extendedProps.description,
|
|
153
153
|
status: event.extendedProps.status,
|
|
154
154
|
host: event.extendedProps.host,
|
|
155
|
+
chairPersonId: event.chairPersonId ? event.chairPersonId : event.extendedProps.host.id,
|
|
155
156
|
attendees: event.extendedProps.attendees,
|
|
156
157
|
privacyType: event.extendedProps.privacyType,
|
|
157
158
|
documents: event.extendedProps.documents,
|
package/package.json
CHANGED