bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/modal/random-user/component.jsx

205 lines
6.3 KiB
React
Raw Normal View History

import React, { Component } from 'react';
import { defineMessages, injectIntl } from 'react-intl';
import PropTypes from 'prop-types';
import Modal from '/imports/ui/components/modal/simple/component';
import Button from '/imports/ui/components/button/component';
Fancy random viewer selection (#11297) * Revert "Delete bbb-icons-ori.woff" This reverts commit 84937a0d076f79076d8df201e3edb278374df0d0. * Revert "Add files via upload" This reverts commit 391434445ab286a160fde63533fa843175e9e8a0. * Revert "Delete bbb-icons.woff" This reverts commit 7c245c666d9adc7a8a1b1dc88b01bce749109b2f. * Revert "Add files via upload" This reverts commit 6f8c764c4bc35d646d9691cec8298d0ad3b98b11. * Revert "Delete tmp.woff" This reverts commit 5141e653599b4d83ddff6123ed59c1e4eb4d18e0. * Revert "Add files via upload" This reverts commit c8f7b17b0483910b6fa2750b2138cc3895e57145. * Revert "Create tmp.woff" This reverts commit 73c45065944d96f7779971b3535943c96feb2897. * Revert "Delete bbb-icons.woff" This reverts commit 9d01d58527bac04ebbf9be61140a13e7e14d7cc8. * Revert "Revert "Delete bbb-icons.woff"" This reverts commit d221d290cd5ad33b3c455b09f9da36d5788ee152. * Revert "Revert "Revert "Delete bbb-icons.woff""" This reverts commit c415ff02d1bd710e6f8804667c69d3c7d2e4caf1. * Revert "Revert "Delete bbb-icons.woff"" This reverts commit d221d290cd5ad33b3c455b09f9da36d5788ee152. * Revert "Revert "Create tmp.woff"" This reverts commit 267dc412d561c3d2eac49959e4b0ada77b8364bd. * Revert "Delete bbb-icons-ori.woff" This reverts commit 84937a0d076f79076d8df201e3edb278374df0d0. * Revert "Delete bbb-icons.woff" This reverts commit 7c245c666d9adc7a8a1b1dc88b01bce749109b2f. * Revert "Add files via upload" This reverts commit 6f8c764c4bc35d646d9691cec8298d0ad3b98b11. * Revert "Add files via upload" This reverts commit c8f7b17b0483910b6fa2750b2138cc3895e57145. * Revert "Create tmp.woff" This reverts commit 73c45065944d96f7779971b3535943c96feb2897. * Revert "Delete bbb-icons.woff" This reverts commit 9d01d58527bac04ebbf9be61140a13e7e14d7cc8. * Revert "Revert "Delete bbb-icons.woff"" This reverts commit 64a48f2bd6d76ca7fe31bc606682700ec1078592. * Revert "Revert "Revert "Delete bbb-icons.woff""" This reverts commit 9d1b4a068ae4de2ca3ad2e842884c910e16af0b9. * Revert "Revert "Revert "Revert "Delete bbb-icons.woff"""" This reverts commit b60491d933c2c984a5a64fa162026430d5f51485. * Revert "Revert "Revert "Revert "Revert "Delete bbb-icons.woff""""" This reverts commit 16e357091d558afe07bf17c7fedaa13ac8905f27. * Revert "Revert "Revert "Revert "Revert "Revert "Delete bbb-icons.woff"""""" This reverts commit e0b70f20554884f7c9e64104a3f942d3d09bfe24. * Revert "Revert "Revert "Revert "Revert "Revert "Revert "Delete bbb-icons.woff""""""" This reverts commit 7b1bde97edbed7985beb63646d39c3ddc82138e6. * Update UsersMgs.scala * Update selectRandomViewer.js * Update clearRandomlySelectedUser.js * Update addMeeting.js * Update updateRandomViewer.js * Update component.jsx * Update container.jsx * Update component.jsx * Update container.jsx * Update styles.scss * Update en.json * Update SelectRandomViewerReqMsgHdlr.scala * code simplification * in case only one person to be selected * Update en.json * Create en.json * Update en.json * Update component.jsx * Update styles.scss * Update en.json * Update updateRandomViewer.js Fix a typo * Update component.jsx When the presenter is moved to a viewer, in the modal of ex-presenter "somebody is selected" should be displayed. Before this modification, "somebody is the only viewer" was displayed. * add a comment explaining why a condition is needed. * Update en.json * Update en.json * revert (due to the rename UserMgs -> UserMsgs) * Update UsersMsgs.scala
2021-04-15 23:12:10 +08:00
import AudioService from '/imports/ui/components/audio/service';
import { styles } from './styles';
const SELECT_RANDOM_USER_COUNTDOWN = Meteor.settings.public.selectRandomUser.countdown;
const messages = defineMessages({
noViewers: {
id: 'app.modal.randomUser.noViewers.description',
description: 'Label displayed when no viewers are avaiable',
},
selected: {
id: 'app.modal.randomUser.selected.description',
description: 'Label shown to the selected user',
},
randUserTitle: {
id: 'app.modal.randomUser.title',
description: 'Modal title label',
},
Fancy random viewer selection (#11297) * Revert "Delete bbb-icons-ori.woff" This reverts commit 84937a0d076f79076d8df201e3edb278374df0d0. * Revert "Add files via upload" This reverts commit 391434445ab286a160fde63533fa843175e9e8a0. * Revert "Delete bbb-icons.woff" This reverts commit 7c245c666d9adc7a8a1b1dc88b01bce749109b2f. * Revert "Add files via upload" This reverts commit 6f8c764c4bc35d646d9691cec8298d0ad3b98b11. * Revert "Delete tmp.woff" This reverts commit 5141e653599b4d83ddff6123ed59c1e4eb4d18e0. * Revert "Add files via upload" This reverts commit c8f7b17b0483910b6fa2750b2138cc3895e57145. * Revert "Create tmp.woff" This reverts commit 73c45065944d96f7779971b3535943c96feb2897. * Revert "Delete bbb-icons.woff" This reverts commit 9d01d58527bac04ebbf9be61140a13e7e14d7cc8. * Revert "Revert "Delete bbb-icons.woff"" This reverts commit d221d290cd5ad33b3c455b09f9da36d5788ee152. * Revert "Revert "Revert "Delete bbb-icons.woff""" This reverts commit c415ff02d1bd710e6f8804667c69d3c7d2e4caf1. * Revert "Revert "Delete bbb-icons.woff"" This reverts commit d221d290cd5ad33b3c455b09f9da36d5788ee152. * Revert "Revert "Create tmp.woff"" This reverts commit 267dc412d561c3d2eac49959e4b0ada77b8364bd. * Revert "Delete bbb-icons-ori.woff" This reverts commit 84937a0d076f79076d8df201e3edb278374df0d0. * Revert "Delete bbb-icons.woff" This reverts commit 7c245c666d9adc7a8a1b1dc88b01bce749109b2f. * Revert "Add files via upload" This reverts commit 6f8c764c4bc35d646d9691cec8298d0ad3b98b11. * Revert "Add files via upload" This reverts commit c8f7b17b0483910b6fa2750b2138cc3895e57145. * Revert "Create tmp.woff" This reverts commit 73c45065944d96f7779971b3535943c96feb2897. * Revert "Delete bbb-icons.woff" This reverts commit 9d01d58527bac04ebbf9be61140a13e7e14d7cc8. * Revert "Revert "Delete bbb-icons.woff"" This reverts commit 64a48f2bd6d76ca7fe31bc606682700ec1078592. * Revert "Revert "Revert "Delete bbb-icons.woff""" This reverts commit 9d1b4a068ae4de2ca3ad2e842884c910e16af0b9. * Revert "Revert "Revert "Revert "Delete bbb-icons.woff"""" This reverts commit b60491d933c2c984a5a64fa162026430d5f51485. * Revert "Revert "Revert "Revert "Revert "Delete bbb-icons.woff""""" This reverts commit 16e357091d558afe07bf17c7fedaa13ac8905f27. * Revert "Revert "Revert "Revert "Revert "Revert "Delete bbb-icons.woff"""""" This reverts commit e0b70f20554884f7c9e64104a3f942d3d09bfe24. * Revert "Revert "Revert "Revert "Revert "Revert "Revert "Delete bbb-icons.woff""""""" This reverts commit 7b1bde97edbed7985beb63646d39c3ddc82138e6. * Update UsersMgs.scala * Update selectRandomViewer.js * Update clearRandomlySelectedUser.js * Update addMeeting.js * Update updateRandomViewer.js * Update component.jsx * Update container.jsx * Update component.jsx * Update container.jsx * Update styles.scss * Update en.json * Update SelectRandomViewerReqMsgHdlr.scala * code simplification * in case only one person to be selected * Update en.json * Create en.json * Update en.json * Update component.jsx * Update styles.scss * Update en.json * Update updateRandomViewer.js Fix a typo * Update component.jsx When the presenter is moved to a viewer, in the modal of ex-presenter "somebody is selected" should be displayed. Before this modification, "somebody is the only viewer" was displayed. * add a comment explaining why a condition is needed. * Update en.json * Update en.json * revert (due to the rename UserMgs -> UserMsgs) * Update UsersMsgs.scala
2021-04-15 23:12:10 +08:00
whollbeSelected: {
id: 'app.modal.randomUser.who',
description: 'Label shown during the selection',
},
onlyOneViewerTobeSelected: {
id: 'app.modal.randomUser.alone',
description: 'Label shown when only one viewer to be selected',
},
reselect: {
id: 'app.modal.randomUser.reselect.label',
description: 'select new random user button label',
},
ariaModalTitle: {
id: 'app.modal.randomUser.ariaLabel.title',
description: 'modal title displayed to screen reader',
},
});
const propTypes = {
intl: PropTypes.shape({
formatMessage: PropTypes.func.isRequired,
}).isRequired,
mountModal: PropTypes.func.isRequired,
numAvailableViewers: PropTypes.number.isRequired,
randomUserReq: PropTypes.func.isRequired,
};
class RandomUserSelect extends Component {
constructor(props) {
super(props);
if (props.currentUser.presenter) {
props.randomUserReq();
}
if(SELECT_RANDOM_USER_COUNTDOWN) {
this.state = {
count: 0,
};
this.play = this.play.bind(this);
}
Fancy random viewer selection (#11297) * Revert "Delete bbb-icons-ori.woff" This reverts commit 84937a0d076f79076d8df201e3edb278374df0d0. * Revert "Add files via upload" This reverts commit 391434445ab286a160fde63533fa843175e9e8a0. * Revert "Delete bbb-icons.woff" This reverts commit 7c245c666d9adc7a8a1b1dc88b01bce749109b2f. * Revert "Add files via upload" This reverts commit 6f8c764c4bc35d646d9691cec8298d0ad3b98b11. * Revert "Delete tmp.woff" This reverts commit 5141e653599b4d83ddff6123ed59c1e4eb4d18e0. * Revert "Add files via upload" This reverts commit c8f7b17b0483910b6fa2750b2138cc3895e57145. * Revert "Create tmp.woff" This reverts commit 73c45065944d96f7779971b3535943c96feb2897. * Revert "Delete bbb-icons.woff" This reverts commit 9d01d58527bac04ebbf9be61140a13e7e14d7cc8. * Revert "Revert "Delete bbb-icons.woff"" This reverts commit d221d290cd5ad33b3c455b09f9da36d5788ee152. * Revert "Revert "Revert "Delete bbb-icons.woff""" This reverts commit c415ff02d1bd710e6f8804667c69d3c7d2e4caf1. * Revert "Revert "Delete bbb-icons.woff"" This reverts commit d221d290cd5ad33b3c455b09f9da36d5788ee152. * Revert "Revert "Create tmp.woff"" This reverts commit 267dc412d561c3d2eac49959e4b0ada77b8364bd. * Revert "Delete bbb-icons-ori.woff" This reverts commit 84937a0d076f79076d8df201e3edb278374df0d0. * Revert "Delete bbb-icons.woff" This reverts commit 7c245c666d9adc7a8a1b1dc88b01bce749109b2f. * Revert "Add files via upload" This reverts commit 6f8c764c4bc35d646d9691cec8298d0ad3b98b11. * Revert "Add files via upload" This reverts commit c8f7b17b0483910b6fa2750b2138cc3895e57145. * Revert "Create tmp.woff" This reverts commit 73c45065944d96f7779971b3535943c96feb2897. * Revert "Delete bbb-icons.woff" This reverts commit 9d01d58527bac04ebbf9be61140a13e7e14d7cc8. * Revert "Revert "Delete bbb-icons.woff"" This reverts commit 64a48f2bd6d76ca7fe31bc606682700ec1078592. * Revert "Revert "Revert "Delete bbb-icons.woff""" This reverts commit 9d1b4a068ae4de2ca3ad2e842884c910e16af0b9. * Revert "Revert "Revert "Revert "Delete bbb-icons.woff"""" This reverts commit b60491d933c2c984a5a64fa162026430d5f51485. * Revert "Revert "Revert "Revert "Revert "Delete bbb-icons.woff""""" This reverts commit 16e357091d558afe07bf17c7fedaa13ac8905f27. * Revert "Revert "Revert "Revert "Revert "Revert "Delete bbb-icons.woff"""""" This reverts commit e0b70f20554884f7c9e64104a3f942d3d09bfe24. * Revert "Revert "Revert "Revert "Revert "Revert "Revert "Delete bbb-icons.woff""""""" This reverts commit 7b1bde97edbed7985beb63646d39c3ddc82138e6. * Update UsersMgs.scala * Update selectRandomViewer.js * Update clearRandomlySelectedUser.js * Update addMeeting.js * Update updateRandomViewer.js * Update component.jsx * Update container.jsx * Update component.jsx * Update container.jsx * Update styles.scss * Update en.json * Update SelectRandomViewerReqMsgHdlr.scala * code simplification * in case only one person to be selected * Update en.json * Create en.json * Update en.json * Update component.jsx * Update styles.scss * Update en.json * Update updateRandomViewer.js Fix a typo * Update component.jsx When the presenter is moved to a viewer, in the modal of ex-presenter "somebody is selected" should be displayed. Before this modification, "somebody is the only viewer" was displayed. * add a comment explaining why a condition is needed. * Update en.json * Update en.json * revert (due to the rename UserMgs -> UserMsgs) * Update UsersMsgs.scala
2021-04-15 23:12:10 +08:00
}
iterateSelection() {
if (this.props.mappedRandomlySelectedUsers.length > 1) {
const that = this;
Fancy random viewer selection (#11297) * Revert "Delete bbb-icons-ori.woff" This reverts commit 84937a0d076f79076d8df201e3edb278374df0d0. * Revert "Add files via upload" This reverts commit 391434445ab286a160fde63533fa843175e9e8a0. * Revert "Delete bbb-icons.woff" This reverts commit 7c245c666d9adc7a8a1b1dc88b01bce749109b2f. * Revert "Add files via upload" This reverts commit 6f8c764c4bc35d646d9691cec8298d0ad3b98b11. * Revert "Delete tmp.woff" This reverts commit 5141e653599b4d83ddff6123ed59c1e4eb4d18e0. * Revert "Add files via upload" This reverts commit c8f7b17b0483910b6fa2750b2138cc3895e57145. * Revert "Create tmp.woff" This reverts commit 73c45065944d96f7779971b3535943c96feb2897. * Revert "Delete bbb-icons.woff" This reverts commit 9d01d58527bac04ebbf9be61140a13e7e14d7cc8. * Revert "Revert "Delete bbb-icons.woff"" This reverts commit d221d290cd5ad33b3c455b09f9da36d5788ee152. * Revert "Revert "Revert "Delete bbb-icons.woff""" This reverts commit c415ff02d1bd710e6f8804667c69d3c7d2e4caf1. * Revert "Revert "Delete bbb-icons.woff"" This reverts commit d221d290cd5ad33b3c455b09f9da36d5788ee152. * Revert "Revert "Create tmp.woff"" This reverts commit 267dc412d561c3d2eac49959e4b0ada77b8364bd. * Revert "Delete bbb-icons-ori.woff" This reverts commit 84937a0d076f79076d8df201e3edb278374df0d0. * Revert "Delete bbb-icons.woff" This reverts commit 7c245c666d9adc7a8a1b1dc88b01bce749109b2f. * Revert "Add files via upload" This reverts commit 6f8c764c4bc35d646d9691cec8298d0ad3b98b11. * Revert "Add files via upload" This reverts commit c8f7b17b0483910b6fa2750b2138cc3895e57145. * Revert "Create tmp.woff" This reverts commit 73c45065944d96f7779971b3535943c96feb2897. * Revert "Delete bbb-icons.woff" This reverts commit 9d01d58527bac04ebbf9be61140a13e7e14d7cc8. * Revert "Revert "Delete bbb-icons.woff"" This reverts commit 64a48f2bd6d76ca7fe31bc606682700ec1078592. * Revert "Revert "Revert "Delete bbb-icons.woff""" This reverts commit 9d1b4a068ae4de2ca3ad2e842884c910e16af0b9. * Revert "Revert "Revert "Revert "Delete bbb-icons.woff"""" This reverts commit b60491d933c2c984a5a64fa162026430d5f51485. * Revert "Revert "Revert "Revert "Revert "Delete bbb-icons.woff""""" This reverts commit 16e357091d558afe07bf17c7fedaa13ac8905f27. * Revert "Revert "Revert "Revert "Revert "Revert "Delete bbb-icons.woff"""""" This reverts commit e0b70f20554884f7c9e64104a3f942d3d09bfe24. * Revert "Revert "Revert "Revert "Revert "Revert "Revert "Delete bbb-icons.woff""""""" This reverts commit 7b1bde97edbed7985beb63646d39c3ddc82138e6. * Update UsersMgs.scala * Update selectRandomViewer.js * Update clearRandomlySelectedUser.js * Update addMeeting.js * Update updateRandomViewer.js * Update component.jsx * Update container.jsx * Update component.jsx * Update container.jsx * Update styles.scss * Update en.json * Update SelectRandomViewerReqMsgHdlr.scala * code simplification * in case only one person to be selected * Update en.json * Create en.json * Update en.json * Update component.jsx * Update styles.scss * Update en.json * Update updateRandomViewer.js Fix a typo * Update component.jsx When the presenter is moved to a viewer, in the modal of ex-presenter "somebody is selected" should be displayed. Before this modification, "somebody is the only viewer" was displayed. * add a comment explaining why a condition is needed. * Update en.json * Update en.json * revert (due to the rename UserMgs -> UserMsgs) * Update UsersMsgs.scala
2021-04-15 23:12:10 +08:00
setTimeout(delay(that.props.mappedRandomlySelectedUsers, 1), that.props.mappedRandomlySelectedUsers[1][1]);
function delay(arr, num) {
that.setState({
count: num,
});
if (num < that.props.mappedRandomlySelectedUsers.length - 1) {
setTimeout(() => { delay(arr, num + 1); }, arr[num + 1][1]);
Fancy random viewer selection (#11297) * Revert "Delete bbb-icons-ori.woff" This reverts commit 84937a0d076f79076d8df201e3edb278374df0d0. * Revert "Add files via upload" This reverts commit 391434445ab286a160fde63533fa843175e9e8a0. * Revert "Delete bbb-icons.woff" This reverts commit 7c245c666d9adc7a8a1b1dc88b01bce749109b2f. * Revert "Add files via upload" This reverts commit 6f8c764c4bc35d646d9691cec8298d0ad3b98b11. * Revert "Delete tmp.woff" This reverts commit 5141e653599b4d83ddff6123ed59c1e4eb4d18e0. * Revert "Add files via upload" This reverts commit c8f7b17b0483910b6fa2750b2138cc3895e57145. * Revert "Create tmp.woff" This reverts commit 73c45065944d96f7779971b3535943c96feb2897. * Revert "Delete bbb-icons.woff" This reverts commit 9d01d58527bac04ebbf9be61140a13e7e14d7cc8. * Revert "Revert "Delete bbb-icons.woff"" This reverts commit d221d290cd5ad33b3c455b09f9da36d5788ee152. * Revert "Revert "Revert "Delete bbb-icons.woff""" This reverts commit c415ff02d1bd710e6f8804667c69d3c7d2e4caf1. * Revert "Revert "Delete bbb-icons.woff"" This reverts commit d221d290cd5ad33b3c455b09f9da36d5788ee152. * Revert "Revert "Create tmp.woff"" This reverts commit 267dc412d561c3d2eac49959e4b0ada77b8364bd. * Revert "Delete bbb-icons-ori.woff" This reverts commit 84937a0d076f79076d8df201e3edb278374df0d0. * Revert "Delete bbb-icons.woff" This reverts commit 7c245c666d9adc7a8a1b1dc88b01bce749109b2f. * Revert "Add files via upload" This reverts commit 6f8c764c4bc35d646d9691cec8298d0ad3b98b11. * Revert "Add files via upload" This reverts commit c8f7b17b0483910b6fa2750b2138cc3895e57145. * Revert "Create tmp.woff" This reverts commit 73c45065944d96f7779971b3535943c96feb2897. * Revert "Delete bbb-icons.woff" This reverts commit 9d01d58527bac04ebbf9be61140a13e7e14d7cc8. * Revert "Revert "Delete bbb-icons.woff"" This reverts commit 64a48f2bd6d76ca7fe31bc606682700ec1078592. * Revert "Revert "Revert "Delete bbb-icons.woff""" This reverts commit 9d1b4a068ae4de2ca3ad2e842884c910e16af0b9. * Revert "Revert "Revert "Revert "Delete bbb-icons.woff"""" This reverts commit b60491d933c2c984a5a64fa162026430d5f51485. * Revert "Revert "Revert "Revert "Revert "Delete bbb-icons.woff""""" This reverts commit 16e357091d558afe07bf17c7fedaa13ac8905f27. * Revert "Revert "Revert "Revert "Revert "Revert "Delete bbb-icons.woff"""""" This reverts commit e0b70f20554884f7c9e64104a3f942d3d09bfe24. * Revert "Revert "Revert "Revert "Revert "Revert "Revert "Delete bbb-icons.woff""""""" This reverts commit 7b1bde97edbed7985beb63646d39c3ddc82138e6. * Update UsersMgs.scala * Update selectRandomViewer.js * Update clearRandomlySelectedUser.js * Update addMeeting.js * Update updateRandomViewer.js * Update component.jsx * Update container.jsx * Update component.jsx * Update container.jsx * Update styles.scss * Update en.json * Update SelectRandomViewerReqMsgHdlr.scala * code simplification * in case only one person to be selected * Update en.json * Create en.json * Update en.json * Update component.jsx * Update styles.scss * Update en.json * Update updateRandomViewer.js Fix a typo * Update component.jsx When the presenter is moved to a viewer, in the modal of ex-presenter "somebody is selected" should be displayed. Before this modification, "somebody is the only viewer" was displayed. * add a comment explaining why a condition is needed. * Update en.json * Update en.json * revert (due to the rename UserMgs -> UserMsgs) * Update UsersMsgs.scala
2021-04-15 23:12:10 +08:00
}
}
}
}
componentDidMount() {
if (SELECT_RANDOM_USER_COUNTDOWN && !this.props.currentUser.presenter) {
Fancy random viewer selection (#11297) * Revert "Delete bbb-icons-ori.woff" This reverts commit 84937a0d076f79076d8df201e3edb278374df0d0. * Revert "Add files via upload" This reverts commit 391434445ab286a160fde63533fa843175e9e8a0. * Revert "Delete bbb-icons.woff" This reverts commit 7c245c666d9adc7a8a1b1dc88b01bce749109b2f. * Revert "Add files via upload" This reverts commit 6f8c764c4bc35d646d9691cec8298d0ad3b98b11. * Revert "Delete tmp.woff" This reverts commit 5141e653599b4d83ddff6123ed59c1e4eb4d18e0. * Revert "Add files via upload" This reverts commit c8f7b17b0483910b6fa2750b2138cc3895e57145. * Revert "Create tmp.woff" This reverts commit 73c45065944d96f7779971b3535943c96feb2897. * Revert "Delete bbb-icons.woff" This reverts commit 9d01d58527bac04ebbf9be61140a13e7e14d7cc8. * Revert "Revert "Delete bbb-icons.woff"" This reverts commit d221d290cd5ad33b3c455b09f9da36d5788ee152. * Revert "Revert "Revert "Delete bbb-icons.woff""" This reverts commit c415ff02d1bd710e6f8804667c69d3c7d2e4caf1. * Revert "Revert "Delete bbb-icons.woff"" This reverts commit d221d290cd5ad33b3c455b09f9da36d5788ee152. * Revert "Revert "Create tmp.woff"" This reverts commit 267dc412d561c3d2eac49959e4b0ada77b8364bd. * Revert "Delete bbb-icons-ori.woff" This reverts commit 84937a0d076f79076d8df201e3edb278374df0d0. * Revert "Delete bbb-icons.woff" This reverts commit 7c245c666d9adc7a8a1b1dc88b01bce749109b2f. * Revert "Add files via upload" This reverts commit 6f8c764c4bc35d646d9691cec8298d0ad3b98b11. * Revert "Add files via upload" This reverts commit c8f7b17b0483910b6fa2750b2138cc3895e57145. * Revert "Create tmp.woff" This reverts commit 73c45065944d96f7779971b3535943c96feb2897. * Revert "Delete bbb-icons.woff" This reverts commit 9d01d58527bac04ebbf9be61140a13e7e14d7cc8. * Revert "Revert "Delete bbb-icons.woff"" This reverts commit 64a48f2bd6d76ca7fe31bc606682700ec1078592. * Revert "Revert "Revert "Delete bbb-icons.woff""" This reverts commit 9d1b4a068ae4de2ca3ad2e842884c910e16af0b9. * Revert "Revert "Revert "Revert "Delete bbb-icons.woff"""" This reverts commit b60491d933c2c984a5a64fa162026430d5f51485. * Revert "Revert "Revert "Revert "Revert "Delete bbb-icons.woff""""" This reverts commit 16e357091d558afe07bf17c7fedaa13ac8905f27. * Revert "Revert "Revert "Revert "Revert "Revert "Delete bbb-icons.woff"""""" This reverts commit e0b70f20554884f7c9e64104a3f942d3d09bfe24. * Revert "Revert "Revert "Revert "Revert "Revert "Revert "Delete bbb-icons.woff""""""" This reverts commit 7b1bde97edbed7985beb63646d39c3ddc82138e6. * Update UsersMgs.scala * Update selectRandomViewer.js * Update clearRandomlySelectedUser.js * Update addMeeting.js * Update updateRandomViewer.js * Update component.jsx * Update container.jsx * Update component.jsx * Update container.jsx * Update styles.scss * Update en.json * Update SelectRandomViewerReqMsgHdlr.scala * code simplification * in case only one person to be selected * Update en.json * Create en.json * Update en.json * Update component.jsx * Update styles.scss * Update en.json * Update updateRandomViewer.js Fix a typo * Update component.jsx When the presenter is moved to a viewer, in the modal of ex-presenter "somebody is selected" should be displayed. Before this modification, "somebody is the only viewer" was displayed. * add a comment explaining why a condition is needed. * Update en.json * Update en.json * revert (due to the rename UserMgs -> UserMsgs) * Update UsersMsgs.scala
2021-04-15 23:12:10 +08:00
this.iterateSelection();
}
}
componentDidUpdate(prevProps, prevState) {
if(SELECT_RANDOM_USER_COUNTDOWN) {
if (this.props.currentUser.presenter && this.state.count == 0) {
this.iterateSelection();
}
if (prevState.count !== this.state.count) {
this.play();
}
}
}
Fancy random viewer selection (#11297) * Revert "Delete bbb-icons-ori.woff" This reverts commit 84937a0d076f79076d8df201e3edb278374df0d0. * Revert "Add files via upload" This reverts commit 391434445ab286a160fde63533fa843175e9e8a0. * Revert "Delete bbb-icons.woff" This reverts commit 7c245c666d9adc7a8a1b1dc88b01bce749109b2f. * Revert "Add files via upload" This reverts commit 6f8c764c4bc35d646d9691cec8298d0ad3b98b11. * Revert "Delete tmp.woff" This reverts commit 5141e653599b4d83ddff6123ed59c1e4eb4d18e0. * Revert "Add files via upload" This reverts commit c8f7b17b0483910b6fa2750b2138cc3895e57145. * Revert "Create tmp.woff" This reverts commit 73c45065944d96f7779971b3535943c96feb2897. * Revert "Delete bbb-icons.woff" This reverts commit 9d01d58527bac04ebbf9be61140a13e7e14d7cc8. * Revert "Revert "Delete bbb-icons.woff"" This reverts commit d221d290cd5ad33b3c455b09f9da36d5788ee152. * Revert "Revert "Revert "Delete bbb-icons.woff""" This reverts commit c415ff02d1bd710e6f8804667c69d3c7d2e4caf1. * Revert "Revert "Delete bbb-icons.woff"" This reverts commit d221d290cd5ad33b3c455b09f9da36d5788ee152. * Revert "Revert "Create tmp.woff"" This reverts commit 267dc412d561c3d2eac49959e4b0ada77b8364bd. * Revert "Delete bbb-icons-ori.woff" This reverts commit 84937a0d076f79076d8df201e3edb278374df0d0. * Revert "Delete bbb-icons.woff" This reverts commit 7c245c666d9adc7a8a1b1dc88b01bce749109b2f. * Revert "Add files via upload" This reverts commit 6f8c764c4bc35d646d9691cec8298d0ad3b98b11. * Revert "Add files via upload" This reverts commit c8f7b17b0483910b6fa2750b2138cc3895e57145. * Revert "Create tmp.woff" This reverts commit 73c45065944d96f7779971b3535943c96feb2897. * Revert "Delete bbb-icons.woff" This reverts commit 9d01d58527bac04ebbf9be61140a13e7e14d7cc8. * Revert "Revert "Delete bbb-icons.woff"" This reverts commit 64a48f2bd6d76ca7fe31bc606682700ec1078592. * Revert "Revert "Revert "Delete bbb-icons.woff""" This reverts commit 9d1b4a068ae4de2ca3ad2e842884c910e16af0b9. * Revert "Revert "Revert "Revert "Delete bbb-icons.woff"""" This reverts commit b60491d933c2c984a5a64fa162026430d5f51485. * Revert "Revert "Revert "Revert "Revert "Delete bbb-icons.woff""""" This reverts commit 16e357091d558afe07bf17c7fedaa13ac8905f27. * Revert "Revert "Revert "Revert "Revert "Revert "Delete bbb-icons.woff"""""" This reverts commit e0b70f20554884f7c9e64104a3f942d3d09bfe24. * Revert "Revert "Revert "Revert "Revert "Revert "Revert "Delete bbb-icons.woff""""""" This reverts commit 7b1bde97edbed7985beb63646d39c3ddc82138e6. * Update UsersMgs.scala * Update selectRandomViewer.js * Update clearRandomlySelectedUser.js * Update addMeeting.js * Update updateRandomViewer.js * Update component.jsx * Update container.jsx * Update component.jsx * Update container.jsx * Update styles.scss * Update en.json * Update SelectRandomViewerReqMsgHdlr.scala * code simplification * in case only one person to be selected * Update en.json * Create en.json * Update en.json * Update component.jsx * Update styles.scss * Update en.json * Update updateRandomViewer.js Fix a typo * Update component.jsx When the presenter is moved to a viewer, in the modal of ex-presenter "somebody is selected" should be displayed. Before this modification, "somebody is the only viewer" was displayed. * add a comment explaining why a condition is needed. * Update en.json * Update en.json * revert (due to the rename UserMgs -> UserMsgs) * Update UsersMsgs.scala
2021-04-15 23:12:10 +08:00
play() {
AudioService.playAlertSound(`${Meteor.settings.public.app.cdn
+ Meteor.settings.public.app.basename
+ Meteor.settings.public.app.instanceId}`
+ '/resources/sounds/Poll.mp3');
}
reselect() {
if(SELECT_RANDOM_USER_COUNTDOWN) {
this.setState({
count: 0,
});
}
Fancy random viewer selection (#11297) * Revert "Delete bbb-icons-ori.woff" This reverts commit 84937a0d076f79076d8df201e3edb278374df0d0. * Revert "Add files via upload" This reverts commit 391434445ab286a160fde63533fa843175e9e8a0. * Revert "Delete bbb-icons.woff" This reverts commit 7c245c666d9adc7a8a1b1dc88b01bce749109b2f. * Revert "Add files via upload" This reverts commit 6f8c764c4bc35d646d9691cec8298d0ad3b98b11. * Revert "Delete tmp.woff" This reverts commit 5141e653599b4d83ddff6123ed59c1e4eb4d18e0. * Revert "Add files via upload" This reverts commit c8f7b17b0483910b6fa2750b2138cc3895e57145. * Revert "Create tmp.woff" This reverts commit 73c45065944d96f7779971b3535943c96feb2897. * Revert "Delete bbb-icons.woff" This reverts commit 9d01d58527bac04ebbf9be61140a13e7e14d7cc8. * Revert "Revert "Delete bbb-icons.woff"" This reverts commit d221d290cd5ad33b3c455b09f9da36d5788ee152. * Revert "Revert "Revert "Delete bbb-icons.woff""" This reverts commit c415ff02d1bd710e6f8804667c69d3c7d2e4caf1. * Revert "Revert "Delete bbb-icons.woff"" This reverts commit d221d290cd5ad33b3c455b09f9da36d5788ee152. * Revert "Revert "Create tmp.woff"" This reverts commit 267dc412d561c3d2eac49959e4b0ada77b8364bd. * Revert "Delete bbb-icons-ori.woff" This reverts commit 84937a0d076f79076d8df201e3edb278374df0d0. * Revert "Delete bbb-icons.woff" This reverts commit 7c245c666d9adc7a8a1b1dc88b01bce749109b2f. * Revert "Add files via upload" This reverts commit 6f8c764c4bc35d646d9691cec8298d0ad3b98b11. * Revert "Add files via upload" This reverts commit c8f7b17b0483910b6fa2750b2138cc3895e57145. * Revert "Create tmp.woff" This reverts commit 73c45065944d96f7779971b3535943c96feb2897. * Revert "Delete bbb-icons.woff" This reverts commit 9d01d58527bac04ebbf9be61140a13e7e14d7cc8. * Revert "Revert "Delete bbb-icons.woff"" This reverts commit 64a48f2bd6d76ca7fe31bc606682700ec1078592. * Revert "Revert "Revert "Delete bbb-icons.woff""" This reverts commit 9d1b4a068ae4de2ca3ad2e842884c910e16af0b9. * Revert "Revert "Revert "Revert "Delete bbb-icons.woff"""" This reverts commit b60491d933c2c984a5a64fa162026430d5f51485. * Revert "Revert "Revert "Revert "Revert "Delete bbb-icons.woff""""" This reverts commit 16e357091d558afe07bf17c7fedaa13ac8905f27. * Revert "Revert "Revert "Revert "Revert "Revert "Delete bbb-icons.woff"""""" This reverts commit e0b70f20554884f7c9e64104a3f942d3d09bfe24. * Revert "Revert "Revert "Revert "Revert "Revert "Revert "Delete bbb-icons.woff""""""" This reverts commit 7b1bde97edbed7985beb63646d39c3ddc82138e6. * Update UsersMgs.scala * Update selectRandomViewer.js * Update clearRandomlySelectedUser.js * Update addMeeting.js * Update updateRandomViewer.js * Update component.jsx * Update container.jsx * Update component.jsx * Update container.jsx * Update styles.scss * Update en.json * Update SelectRandomViewerReqMsgHdlr.scala * code simplification * in case only one person to be selected * Update en.json * Create en.json * Update en.json * Update component.jsx * Update styles.scss * Update en.json * Update updateRandomViewer.js Fix a typo * Update component.jsx When the presenter is moved to a viewer, in the modal of ex-presenter "somebody is selected" should be displayed. Before this modification, "somebody is the only viewer" was displayed. * add a comment explaining why a condition is needed. * Update en.json * Update en.json * revert (due to the rename UserMgs -> UserMsgs) * Update UsersMsgs.scala
2021-04-15 23:12:10 +08:00
this.props.randomUserReq();
}
render() {
const {
intl,
mountModal,
numAvailableViewers,
currentUser,
clearRandomlySelectedUser,
Fancy random viewer selection (#11297) * Revert "Delete bbb-icons-ori.woff" This reverts commit 84937a0d076f79076d8df201e3edb278374df0d0. * Revert "Add files via upload" This reverts commit 391434445ab286a160fde63533fa843175e9e8a0. * Revert "Delete bbb-icons.woff" This reverts commit 7c245c666d9adc7a8a1b1dc88b01bce749109b2f. * Revert "Add files via upload" This reverts commit 6f8c764c4bc35d646d9691cec8298d0ad3b98b11. * Revert "Delete tmp.woff" This reverts commit 5141e653599b4d83ddff6123ed59c1e4eb4d18e0. * Revert "Add files via upload" This reverts commit c8f7b17b0483910b6fa2750b2138cc3895e57145. * Revert "Create tmp.woff" This reverts commit 73c45065944d96f7779971b3535943c96feb2897. * Revert "Delete bbb-icons.woff" This reverts commit 9d01d58527bac04ebbf9be61140a13e7e14d7cc8. * Revert "Revert "Delete bbb-icons.woff"" This reverts commit d221d290cd5ad33b3c455b09f9da36d5788ee152. * Revert "Revert "Revert "Delete bbb-icons.woff""" This reverts commit c415ff02d1bd710e6f8804667c69d3c7d2e4caf1. * Revert "Revert "Delete bbb-icons.woff"" This reverts commit d221d290cd5ad33b3c455b09f9da36d5788ee152. * Revert "Revert "Create tmp.woff"" This reverts commit 267dc412d561c3d2eac49959e4b0ada77b8364bd. * Revert "Delete bbb-icons-ori.woff" This reverts commit 84937a0d076f79076d8df201e3edb278374df0d0. * Revert "Delete bbb-icons.woff" This reverts commit 7c245c666d9adc7a8a1b1dc88b01bce749109b2f. * Revert "Add files via upload" This reverts commit 6f8c764c4bc35d646d9691cec8298d0ad3b98b11. * Revert "Add files via upload" This reverts commit c8f7b17b0483910b6fa2750b2138cc3895e57145. * Revert "Create tmp.woff" This reverts commit 73c45065944d96f7779971b3535943c96feb2897. * Revert "Delete bbb-icons.woff" This reverts commit 9d01d58527bac04ebbf9be61140a13e7e14d7cc8. * Revert "Revert "Delete bbb-icons.woff"" This reverts commit 64a48f2bd6d76ca7fe31bc606682700ec1078592. * Revert "Revert "Revert "Delete bbb-icons.woff""" This reverts commit 9d1b4a068ae4de2ca3ad2e842884c910e16af0b9. * Revert "Revert "Revert "Revert "Delete bbb-icons.woff"""" This reverts commit b60491d933c2c984a5a64fa162026430d5f51485. * Revert "Revert "Revert "Revert "Revert "Delete bbb-icons.woff""""" This reverts commit 16e357091d558afe07bf17c7fedaa13ac8905f27. * Revert "Revert "Revert "Revert "Revert "Revert "Delete bbb-icons.woff"""""" This reverts commit e0b70f20554884f7c9e64104a3f942d3d09bfe24. * Revert "Revert "Revert "Revert "Revert "Revert "Revert "Delete bbb-icons.woff""""""" This reverts commit 7b1bde97edbed7985beb63646d39c3ddc82138e6. * Update UsersMgs.scala * Update selectRandomViewer.js * Update clearRandomlySelectedUser.js * Update addMeeting.js * Update updateRandomViewer.js * Update component.jsx * Update container.jsx * Update component.jsx * Update container.jsx * Update styles.scss * Update en.json * Update SelectRandomViewerReqMsgHdlr.scala * code simplification * in case only one person to be selected * Update en.json * Create en.json * Update en.json * Update component.jsx * Update styles.scss * Update en.json * Update updateRandomViewer.js Fix a typo * Update component.jsx When the presenter is moved to a viewer, in the modal of ex-presenter "somebody is selected" should be displayed. Before this modification, "somebody is the only viewer" was displayed. * add a comment explaining why a condition is needed. * Update en.json * Update en.json * revert (due to the rename UserMgs -> UserMsgs) * Update UsersMsgs.scala
2021-04-15 23:12:10 +08:00
mappedRandomlySelectedUsers,
} = this.props;
const counter = SELECT_RANDOM_USER_COUNTDOWN ? this.state.count : 0;
if (mappedRandomlySelectedUsers.length < counter + 1) return null;
Fancy random viewer selection (#11297) * Revert "Delete bbb-icons-ori.woff" This reverts commit 84937a0d076f79076d8df201e3edb278374df0d0. * Revert "Add files via upload" This reverts commit 391434445ab286a160fde63533fa843175e9e8a0. * Revert "Delete bbb-icons.woff" This reverts commit 7c245c666d9adc7a8a1b1dc88b01bce749109b2f. * Revert "Add files via upload" This reverts commit 6f8c764c4bc35d646d9691cec8298d0ad3b98b11. * Revert "Delete tmp.woff" This reverts commit 5141e653599b4d83ddff6123ed59c1e4eb4d18e0. * Revert "Add files via upload" This reverts commit c8f7b17b0483910b6fa2750b2138cc3895e57145. * Revert "Create tmp.woff" This reverts commit 73c45065944d96f7779971b3535943c96feb2897. * Revert "Delete bbb-icons.woff" This reverts commit 9d01d58527bac04ebbf9be61140a13e7e14d7cc8. * Revert "Revert "Delete bbb-icons.woff"" This reverts commit d221d290cd5ad33b3c455b09f9da36d5788ee152. * Revert "Revert "Revert "Delete bbb-icons.woff""" This reverts commit c415ff02d1bd710e6f8804667c69d3c7d2e4caf1. * Revert "Revert "Delete bbb-icons.woff"" This reverts commit d221d290cd5ad33b3c455b09f9da36d5788ee152. * Revert "Revert "Create tmp.woff"" This reverts commit 267dc412d561c3d2eac49959e4b0ada77b8364bd. * Revert "Delete bbb-icons-ori.woff" This reverts commit 84937a0d076f79076d8df201e3edb278374df0d0. * Revert "Delete bbb-icons.woff" This reverts commit 7c245c666d9adc7a8a1b1dc88b01bce749109b2f. * Revert "Add files via upload" This reverts commit 6f8c764c4bc35d646d9691cec8298d0ad3b98b11. * Revert "Add files via upload" This reverts commit c8f7b17b0483910b6fa2750b2138cc3895e57145. * Revert "Create tmp.woff" This reverts commit 73c45065944d96f7779971b3535943c96feb2897. * Revert "Delete bbb-icons.woff" This reverts commit 9d01d58527bac04ebbf9be61140a13e7e14d7cc8. * Revert "Revert "Delete bbb-icons.woff"" This reverts commit 64a48f2bd6d76ca7fe31bc606682700ec1078592. * Revert "Revert "Revert "Delete bbb-icons.woff""" This reverts commit 9d1b4a068ae4de2ca3ad2e842884c910e16af0b9. * Revert "Revert "Revert "Revert "Delete bbb-icons.woff"""" This reverts commit b60491d933c2c984a5a64fa162026430d5f51485. * Revert "Revert "Revert "Revert "Revert "Delete bbb-icons.woff""""" This reverts commit 16e357091d558afe07bf17c7fedaa13ac8905f27. * Revert "Revert "Revert "Revert "Revert "Revert "Delete bbb-icons.woff"""""" This reverts commit e0b70f20554884f7c9e64104a3f942d3d09bfe24. * Revert "Revert "Revert "Revert "Revert "Revert "Revert "Delete bbb-icons.woff""""""" This reverts commit 7b1bde97edbed7985beb63646d39c3ddc82138e6. * Update UsersMgs.scala * Update selectRandomViewer.js * Update clearRandomlySelectedUser.js * Update addMeeting.js * Update updateRandomViewer.js * Update component.jsx * Update container.jsx * Update component.jsx * Update container.jsx * Update styles.scss * Update en.json * Update SelectRandomViewerReqMsgHdlr.scala * code simplification * in case only one person to be selected * Update en.json * Create en.json * Update en.json * Update component.jsx * Update styles.scss * Update en.json * Update updateRandomViewer.js Fix a typo * Update component.jsx When the presenter is moved to a viewer, in the modal of ex-presenter "somebody is selected" should be displayed. Before this modification, "somebody is the only viewer" was displayed. * add a comment explaining why a condition is needed. * Update en.json * Update en.json * revert (due to the rename UserMgs -> UserMsgs) * Update UsersMsgs.scala
2021-04-15 23:12:10 +08:00
const selectedUser = SELECT_RANDOM_USER_COUNTDOWN ? mappedRandomlySelectedUsers[counter][0] :
mappedRandomlySelectedUsers[mappedRandomlySelectedUsers.length - 1][0];
const countDown = SELECT_RANDOM_USER_COUNTDOWN ?
mappedRandomlySelectedUsers.length - this.state.count - 1 : 0;
let viewElement;
Fancy random viewer selection (#11297) * Revert "Delete bbb-icons-ori.woff" This reverts commit 84937a0d076f79076d8df201e3edb278374df0d0. * Revert "Add files via upload" This reverts commit 391434445ab286a160fde63533fa843175e9e8a0. * Revert "Delete bbb-icons.woff" This reverts commit 7c245c666d9adc7a8a1b1dc88b01bce749109b2f. * Revert "Add files via upload" This reverts commit 6f8c764c4bc35d646d9691cec8298d0ad3b98b11. * Revert "Delete tmp.woff" This reverts commit 5141e653599b4d83ddff6123ed59c1e4eb4d18e0. * Revert "Add files via upload" This reverts commit c8f7b17b0483910b6fa2750b2138cc3895e57145. * Revert "Create tmp.woff" This reverts commit 73c45065944d96f7779971b3535943c96feb2897. * Revert "Delete bbb-icons.woff" This reverts commit 9d01d58527bac04ebbf9be61140a13e7e14d7cc8. * Revert "Revert "Delete bbb-icons.woff"" This reverts commit d221d290cd5ad33b3c455b09f9da36d5788ee152. * Revert "Revert "Revert "Delete bbb-icons.woff""" This reverts commit c415ff02d1bd710e6f8804667c69d3c7d2e4caf1. * Revert "Revert "Delete bbb-icons.woff"" This reverts commit d221d290cd5ad33b3c455b09f9da36d5788ee152. * Revert "Revert "Create tmp.woff"" This reverts commit 267dc412d561c3d2eac49959e4b0ada77b8364bd. * Revert "Delete bbb-icons-ori.woff" This reverts commit 84937a0d076f79076d8df201e3edb278374df0d0. * Revert "Delete bbb-icons.woff" This reverts commit 7c245c666d9adc7a8a1b1dc88b01bce749109b2f. * Revert "Add files via upload" This reverts commit 6f8c764c4bc35d646d9691cec8298d0ad3b98b11. * Revert "Add files via upload" This reverts commit c8f7b17b0483910b6fa2750b2138cc3895e57145. * Revert "Create tmp.woff" This reverts commit 73c45065944d96f7779971b3535943c96feb2897. * Revert "Delete bbb-icons.woff" This reverts commit 9d01d58527bac04ebbf9be61140a13e7e14d7cc8. * Revert "Revert "Delete bbb-icons.woff"" This reverts commit 64a48f2bd6d76ca7fe31bc606682700ec1078592. * Revert "Revert "Revert "Delete bbb-icons.woff""" This reverts commit 9d1b4a068ae4de2ca3ad2e842884c910e16af0b9. * Revert "Revert "Revert "Revert "Delete bbb-icons.woff"""" This reverts commit b60491d933c2c984a5a64fa162026430d5f51485. * Revert "Revert "Revert "Revert "Revert "Delete bbb-icons.woff""""" This reverts commit 16e357091d558afe07bf17c7fedaa13ac8905f27. * Revert "Revert "Revert "Revert "Revert "Revert "Delete bbb-icons.woff"""""" This reverts commit e0b70f20554884f7c9e64104a3f942d3d09bfe24. * Revert "Revert "Revert "Revert "Revert "Revert "Revert "Delete bbb-icons.woff""""""" This reverts commit 7b1bde97edbed7985beb63646d39c3ddc82138e6. * Update UsersMgs.scala * Update selectRandomViewer.js * Update clearRandomlySelectedUser.js * Update addMeeting.js * Update updateRandomViewer.js * Update component.jsx * Update container.jsx * Update component.jsx * Update container.jsx * Update styles.scss * Update en.json * Update SelectRandomViewerReqMsgHdlr.scala * code simplification * in case only one person to be selected * Update en.json * Create en.json * Update en.json * Update component.jsx * Update styles.scss * Update en.json * Update updateRandomViewer.js Fix a typo * Update component.jsx When the presenter is moved to a viewer, in the modal of ex-presenter "somebody is selected" should be displayed. Before this modification, "somebody is the only viewer" was displayed. * add a comment explaining why a condition is needed. * Update en.json * Update en.json * revert (due to the rename UserMgs -> UserMsgs) * Update UsersMsgs.scala
2021-04-15 23:12:10 +08:00
const amISelectedUser = currentUser.userId === selectedUser.userId;
if (numAvailableViewers < 1 || (currentUser.presenter && amISelectedUser)) { // there's no viewers to select from,
// or when you are the presenter but selected, which happens when the presenter ability is passed to somebody
// and people are entering and leaving the meeting
// display modal informing presenter that there's no viewers to select from
viewElement = (
<div className={styles.modalViewContainer}>
<div className={styles.modalViewTitle}>
{intl.formatMessage(messages.randUserTitle)}
</div>
<div data-test="noViewersSelectedMessage">
{intl.formatMessage(messages.noViewers)}
</div>
</div>
);
} else { // viewers are available
if (!selectedUser) return null; // rendering triggered before selectedUser is available
// display modal with random user selection
viewElement = (
<div className={styles.modalViewContainer}>
<div className={styles.modalViewTitle}>
Fancy random viewer selection (#11297) * Revert "Delete bbb-icons-ori.woff" This reverts commit 84937a0d076f79076d8df201e3edb278374df0d0. * Revert "Add files via upload" This reverts commit 391434445ab286a160fde63533fa843175e9e8a0. * Revert "Delete bbb-icons.woff" This reverts commit 7c245c666d9adc7a8a1b1dc88b01bce749109b2f. * Revert "Add files via upload" This reverts commit 6f8c764c4bc35d646d9691cec8298d0ad3b98b11. * Revert "Delete tmp.woff" This reverts commit 5141e653599b4d83ddff6123ed59c1e4eb4d18e0. * Revert "Add files via upload" This reverts commit c8f7b17b0483910b6fa2750b2138cc3895e57145. * Revert "Create tmp.woff" This reverts commit 73c45065944d96f7779971b3535943c96feb2897. * Revert "Delete bbb-icons.woff" This reverts commit 9d01d58527bac04ebbf9be61140a13e7e14d7cc8. * Revert "Revert "Delete bbb-icons.woff"" This reverts commit d221d290cd5ad33b3c455b09f9da36d5788ee152. * Revert "Revert "Revert "Delete bbb-icons.woff""" This reverts commit c415ff02d1bd710e6f8804667c69d3c7d2e4caf1. * Revert "Revert "Delete bbb-icons.woff"" This reverts commit d221d290cd5ad33b3c455b09f9da36d5788ee152. * Revert "Revert "Create tmp.woff"" This reverts commit 267dc412d561c3d2eac49959e4b0ada77b8364bd. * Revert "Delete bbb-icons-ori.woff" This reverts commit 84937a0d076f79076d8df201e3edb278374df0d0. * Revert "Delete bbb-icons.woff" This reverts commit 7c245c666d9adc7a8a1b1dc88b01bce749109b2f. * Revert "Add files via upload" This reverts commit 6f8c764c4bc35d646d9691cec8298d0ad3b98b11. * Revert "Add files via upload" This reverts commit c8f7b17b0483910b6fa2750b2138cc3895e57145. * Revert "Create tmp.woff" This reverts commit 73c45065944d96f7779971b3535943c96feb2897. * Revert "Delete bbb-icons.woff" This reverts commit 9d01d58527bac04ebbf9be61140a13e7e14d7cc8. * Revert "Revert "Delete bbb-icons.woff"" This reverts commit 64a48f2bd6d76ca7fe31bc606682700ec1078592. * Revert "Revert "Revert "Delete bbb-icons.woff""" This reverts commit 9d1b4a068ae4de2ca3ad2e842884c910e16af0b9. * Revert "Revert "Revert "Revert "Delete bbb-icons.woff"""" This reverts commit b60491d933c2c984a5a64fa162026430d5f51485. * Revert "Revert "Revert "Revert "Revert "Delete bbb-icons.woff""""" This reverts commit 16e357091d558afe07bf17c7fedaa13ac8905f27. * Revert "Revert "Revert "Revert "Revert "Revert "Delete bbb-icons.woff"""""" This reverts commit e0b70f20554884f7c9e64104a3f942d3d09bfe24. * Revert "Revert "Revert "Revert "Revert "Revert "Revert "Delete bbb-icons.woff""""""" This reverts commit 7b1bde97edbed7985beb63646d39c3ddc82138e6. * Update UsersMgs.scala * Update selectRandomViewer.js * Update clearRandomlySelectedUser.js * Update addMeeting.js * Update updateRandomViewer.js * Update component.jsx * Update container.jsx * Update component.jsx * Update container.jsx * Update styles.scss * Update en.json * Update SelectRandomViewerReqMsgHdlr.scala * code simplification * in case only one person to be selected * Update en.json * Create en.json * Update en.json * Update component.jsx * Update styles.scss * Update en.json * Update updateRandomViewer.js Fix a typo * Update component.jsx When the presenter is moved to a viewer, in the modal of ex-presenter "somebody is selected" should be displayed. Before this modification, "somebody is the only viewer" was displayed. * add a comment explaining why a condition is needed. * Update en.json * Update en.json * revert (due to the rename UserMgs -> UserMsgs) * Update UsersMsgs.scala
2021-04-15 23:12:10 +08:00
{countDown == 0
? amISelectedUser
? `${intl.formatMessage(messages.selected)}`
: numAvailableViewers == 1 && currentUser.presenter
? `${intl.formatMessage(messages.onlyOneViewerTobeSelected)}`
: `${intl.formatMessage(messages.randUserTitle)}`
: `${intl.formatMessage(messages.whollbeSelected)} ${countDown}`}
</div>
<div aria-hidden className={styles.modalAvatar} style={{ backgroundColor: `${selectedUser.color}` }}>
{selectedUser.name.slice(0, 2)}
</div>
<div className={styles.selectedUserName} data-test="selectedUserName">
{selectedUser.name}
</div>
Fancy random viewer selection (#11297) * Revert "Delete bbb-icons-ori.woff" This reverts commit 84937a0d076f79076d8df201e3edb278374df0d0. * Revert "Add files via upload" This reverts commit 391434445ab286a160fde63533fa843175e9e8a0. * Revert "Delete bbb-icons.woff" This reverts commit 7c245c666d9adc7a8a1b1dc88b01bce749109b2f. * Revert "Add files via upload" This reverts commit 6f8c764c4bc35d646d9691cec8298d0ad3b98b11. * Revert "Delete tmp.woff" This reverts commit 5141e653599b4d83ddff6123ed59c1e4eb4d18e0. * Revert "Add files via upload" This reverts commit c8f7b17b0483910b6fa2750b2138cc3895e57145. * Revert "Create tmp.woff" This reverts commit 73c45065944d96f7779971b3535943c96feb2897. * Revert "Delete bbb-icons.woff" This reverts commit 9d01d58527bac04ebbf9be61140a13e7e14d7cc8. * Revert "Revert "Delete bbb-icons.woff"" This reverts commit d221d290cd5ad33b3c455b09f9da36d5788ee152. * Revert "Revert "Revert "Delete bbb-icons.woff""" This reverts commit c415ff02d1bd710e6f8804667c69d3c7d2e4caf1. * Revert "Revert "Delete bbb-icons.woff"" This reverts commit d221d290cd5ad33b3c455b09f9da36d5788ee152. * Revert "Revert "Create tmp.woff"" This reverts commit 267dc412d561c3d2eac49959e4b0ada77b8364bd. * Revert "Delete bbb-icons-ori.woff" This reverts commit 84937a0d076f79076d8df201e3edb278374df0d0. * Revert "Delete bbb-icons.woff" This reverts commit 7c245c666d9adc7a8a1b1dc88b01bce749109b2f. * Revert "Add files via upload" This reverts commit 6f8c764c4bc35d646d9691cec8298d0ad3b98b11. * Revert "Add files via upload" This reverts commit c8f7b17b0483910b6fa2750b2138cc3895e57145. * Revert "Create tmp.woff" This reverts commit 73c45065944d96f7779971b3535943c96feb2897. * Revert "Delete bbb-icons.woff" This reverts commit 9d01d58527bac04ebbf9be61140a13e7e14d7cc8. * Revert "Revert "Delete bbb-icons.woff"" This reverts commit 64a48f2bd6d76ca7fe31bc606682700ec1078592. * Revert "Revert "Revert "Delete bbb-icons.woff""" This reverts commit 9d1b4a068ae4de2ca3ad2e842884c910e16af0b9. * Revert "Revert "Revert "Revert "Delete bbb-icons.woff"""" This reverts commit b60491d933c2c984a5a64fa162026430d5f51485. * Revert "Revert "Revert "Revert "Revert "Delete bbb-icons.woff""""" This reverts commit 16e357091d558afe07bf17c7fedaa13ac8905f27. * Revert "Revert "Revert "Revert "Revert "Revert "Delete bbb-icons.woff"""""" This reverts commit e0b70f20554884f7c9e64104a3f942d3d09bfe24. * Revert "Revert "Revert "Revert "Revert "Revert "Revert "Delete bbb-icons.woff""""""" This reverts commit 7b1bde97edbed7985beb63646d39c3ddc82138e6. * Update UsersMgs.scala * Update selectRandomViewer.js * Update clearRandomlySelectedUser.js * Update addMeeting.js * Update updateRandomViewer.js * Update component.jsx * Update container.jsx * Update component.jsx * Update container.jsx * Update styles.scss * Update en.json * Update SelectRandomViewerReqMsgHdlr.scala * code simplification * in case only one person to be selected * Update en.json * Create en.json * Update en.json * Update component.jsx * Update styles.scss * Update en.json * Update updateRandomViewer.js Fix a typo * Update component.jsx When the presenter is moved to a viewer, in the modal of ex-presenter "somebody is selected" should be displayed. Before this modification, "somebody is the only viewer" was displayed. * add a comment explaining why a condition is needed. * Update en.json * Update en.json * revert (due to the rename UserMgs -> UserMsgs) * Update UsersMsgs.scala
2021-04-15 23:12:10 +08:00
{currentUser.presenter
&& countDown == 0
&& (
<Button
label={intl.formatMessage(messages.reselect)}
color="primary"
size="md"
className={styles.selectBtn}
Fancy random viewer selection (#11297) * Revert "Delete bbb-icons-ori.woff" This reverts commit 84937a0d076f79076d8df201e3edb278374df0d0. * Revert "Add files via upload" This reverts commit 391434445ab286a160fde63533fa843175e9e8a0. * Revert "Delete bbb-icons.woff" This reverts commit 7c245c666d9adc7a8a1b1dc88b01bce749109b2f. * Revert "Add files via upload" This reverts commit 6f8c764c4bc35d646d9691cec8298d0ad3b98b11. * Revert "Delete tmp.woff" This reverts commit 5141e653599b4d83ddff6123ed59c1e4eb4d18e0. * Revert "Add files via upload" This reverts commit c8f7b17b0483910b6fa2750b2138cc3895e57145. * Revert "Create tmp.woff" This reverts commit 73c45065944d96f7779971b3535943c96feb2897. * Revert "Delete bbb-icons.woff" This reverts commit 9d01d58527bac04ebbf9be61140a13e7e14d7cc8. * Revert "Revert "Delete bbb-icons.woff"" This reverts commit d221d290cd5ad33b3c455b09f9da36d5788ee152. * Revert "Revert "Revert "Delete bbb-icons.woff""" This reverts commit c415ff02d1bd710e6f8804667c69d3c7d2e4caf1. * Revert "Revert "Delete bbb-icons.woff"" This reverts commit d221d290cd5ad33b3c455b09f9da36d5788ee152. * Revert "Revert "Create tmp.woff"" This reverts commit 267dc412d561c3d2eac49959e4b0ada77b8364bd. * Revert "Delete bbb-icons-ori.woff" This reverts commit 84937a0d076f79076d8df201e3edb278374df0d0. * Revert "Delete bbb-icons.woff" This reverts commit 7c245c666d9adc7a8a1b1dc88b01bce749109b2f. * Revert "Add files via upload" This reverts commit 6f8c764c4bc35d646d9691cec8298d0ad3b98b11. * Revert "Add files via upload" This reverts commit c8f7b17b0483910b6fa2750b2138cc3895e57145. * Revert "Create tmp.woff" This reverts commit 73c45065944d96f7779971b3535943c96feb2897. * Revert "Delete bbb-icons.woff" This reverts commit 9d01d58527bac04ebbf9be61140a13e7e14d7cc8. * Revert "Revert "Delete bbb-icons.woff"" This reverts commit 64a48f2bd6d76ca7fe31bc606682700ec1078592. * Revert "Revert "Revert "Delete bbb-icons.woff""" This reverts commit 9d1b4a068ae4de2ca3ad2e842884c910e16af0b9. * Revert "Revert "Revert "Revert "Delete bbb-icons.woff"""" This reverts commit b60491d933c2c984a5a64fa162026430d5f51485. * Revert "Revert "Revert "Revert "Revert "Delete bbb-icons.woff""""" This reverts commit 16e357091d558afe07bf17c7fedaa13ac8905f27. * Revert "Revert "Revert "Revert "Revert "Revert "Delete bbb-icons.woff"""""" This reverts commit e0b70f20554884f7c9e64104a3f942d3d09bfe24. * Revert "Revert "Revert "Revert "Revert "Revert "Revert "Delete bbb-icons.woff""""""" This reverts commit 7b1bde97edbed7985beb63646d39c3ddc82138e6. * Update UsersMgs.scala * Update selectRandomViewer.js * Update clearRandomlySelectedUser.js * Update addMeeting.js * Update updateRandomViewer.js * Update component.jsx * Update container.jsx * Update component.jsx * Update container.jsx * Update styles.scss * Update en.json * Update SelectRandomViewerReqMsgHdlr.scala * code simplification * in case only one person to be selected * Update en.json * Create en.json * Update en.json * Update component.jsx * Update styles.scss * Update en.json * Update updateRandomViewer.js Fix a typo * Update component.jsx When the presenter is moved to a viewer, in the modal of ex-presenter "somebody is selected" should be displayed. Before this modification, "somebody is the only viewer" was displayed. * add a comment explaining why a condition is needed. * Update en.json * Update en.json * revert (due to the rename UserMgs -> UserMsgs) * Update UsersMsgs.scala
2021-04-15 23:12:10 +08:00
onClick={() => this.reselect()}
data-test="selectAgainRadomUser"
/>
)}
</div>
);
}
return (
<Modal
hideBorder
onRequestClose={() => {
if (currentUser.presenter) clearRandomlySelectedUser();
mountModal(null);
}}
contentLabel={intl.formatMessage(messages.ariaModalTitle)}
>
{viewElement}
</Modal>
);
}
}
RandomUserSelect.propTypes = propTypes;
export default injectIntl(RandomUserSelect);