2018-11-09 02:55:12 +08:00
|
|
|
import React, { Component } from 'react';
|
|
|
|
import { defineMessages, injectIntl } from 'react-intl';
|
|
|
|
import Button from '/imports/ui/components/button/component';
|
|
|
|
import Toggle from '/imports/ui/components/switch/component';
|
|
|
|
import cx from 'classnames';
|
|
|
|
import ModalBase from '/imports/ui/components/modal/base/component';
|
|
|
|
import { styles } from './styles';
|
|
|
|
|
|
|
|
const intlMessages = defineMessages({
|
|
|
|
lockViewersTitle: {
|
|
|
|
id: 'app.lock-viewers.title',
|
|
|
|
description: 'lock-viewers title',
|
|
|
|
},
|
|
|
|
closeLabel: {
|
|
|
|
id: 'app.shortcut-help.closeLabel',
|
|
|
|
description: 'label for close button',
|
|
|
|
},
|
|
|
|
closeDesc: {
|
|
|
|
id: 'app.shortcut-help.closeDesc',
|
|
|
|
description: 'description for close button',
|
|
|
|
},
|
|
|
|
lockViewersDescription: {
|
|
|
|
id: 'app.lock-viewers.description',
|
|
|
|
description: 'description for lock viewers feature',
|
|
|
|
},
|
|
|
|
featuresLable: {
|
|
|
|
id: 'app.lock-viewers.featuresLable',
|
|
|
|
description: 'features label',
|
|
|
|
},
|
|
|
|
lockStatusLabel: {
|
|
|
|
id: 'app.lock-viewers.lockStatusLabel',
|
|
|
|
description: 'description for close button',
|
|
|
|
},
|
|
|
|
webcamLabel: {
|
|
|
|
id: 'app.lock-viewers.webcamLabel',
|
|
|
|
description: 'description for close button',
|
|
|
|
},
|
|
|
|
otherViewersWebcamLabel: {
|
|
|
|
id: 'app.lock-viewers.otherViewersWebcamLabel',
|
|
|
|
description: 'description for close button',
|
|
|
|
},
|
|
|
|
microphoneLable: {
|
|
|
|
id: 'app.lock-viewers.microphoneLable',
|
|
|
|
description: 'description for close button',
|
|
|
|
},
|
|
|
|
publicChatLabel: {
|
|
|
|
id: 'app.lock-viewers.PublicChatLabel',
|
|
|
|
description: 'description for close button',
|
|
|
|
},
|
|
|
|
privateChatLable: {
|
|
|
|
id: 'app.lock-viewers.PrivateChatLable',
|
|
|
|
description: 'description for close button',
|
|
|
|
},
|
|
|
|
layoutLable: {
|
|
|
|
id: 'app.lock-viewers.Layout',
|
|
|
|
description: 'description for close button',
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
class LockViewersComponent extends Component {
|
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
|
|
|
const {
|
|
|
|
closeModal,
|
|
|
|
toggleLockSettings,
|
|
|
|
toggleWebcamsOnlyForModerator,
|
|
|
|
} = props;
|
2018-11-10 06:03:25 +08:00
|
|
|
|
2018-11-09 02:55:12 +08:00
|
|
|
this.closeModal = closeModal;
|
|
|
|
this.toggleLockSettings = toggleLockSettings;
|
|
|
|
this.toggleWebcamsOnlyForModerator = toggleWebcamsOnlyForModerator;
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
2018-11-17 03:17:17 +08:00
|
|
|
const { intl, meeting } = this.props;
|
2018-11-09 02:55:12 +08:00
|
|
|
|
|
|
|
return (
|
|
|
|
<ModalBase
|
|
|
|
overlayClassName={styles.overlay}
|
|
|
|
className={styles.modal}
|
|
|
|
onRequestClose={this.closeModal}
|
|
|
|
>
|
2018-11-15 02:04:23 +08:00
|
|
|
|
2018-11-10 06:03:25 +08:00
|
|
|
<div className={styles.container}>
|
|
|
|
<div className={styles.header}>
|
2018-11-09 02:55:12 +08:00
|
|
|
<div className={styles.title}>{intl.formatMessage(intlMessages.lockViewersTitle)}</div>
|
2018-11-15 02:04:23 +08:00
|
|
|
<Button
|
|
|
|
data-test="modalBaseCloseButton"
|
|
|
|
className={styles.closeBtn}
|
|
|
|
label={intl.formatMessage(intlMessages.closeLabel)}
|
|
|
|
icon="close"
|
|
|
|
size="md"
|
|
|
|
hideLabel
|
|
|
|
onClick={this.closeModal}
|
|
|
|
/>
|
2018-11-09 02:55:12 +08:00
|
|
|
</div>
|
|
|
|
<div className={styles.description}>
|
|
|
|
{`${intl.formatMessage(intlMessages.lockViewersDescription)}`}
|
|
|
|
</div>
|
2018-11-15 02:04:23 +08:00
|
|
|
|
2018-11-09 02:55:12 +08:00
|
|
|
<div className={styles.form}>
|
2018-11-15 02:04:23 +08:00
|
|
|
<header className={styles.subHeader}>
|
2018-11-09 02:55:12 +08:00
|
|
|
<div className={styles.bold}>{intl.formatMessage(intlMessages.featuresLable)}</div>
|
|
|
|
<div className={styles.bold}>{intl.formatMessage(intlMessages.lockStatusLabel)}</div>
|
|
|
|
</header>
|
|
|
|
<div className={styles.row}>
|
|
|
|
<div className={styles.col} aria-hidden="true">
|
|
|
|
<div className={styles.formElement}>
|
2018-11-10 06:03:25 +08:00
|
|
|
<div className={styles.label}>
|
2018-11-09 02:55:12 +08:00
|
|
|
{intl.formatMessage(intlMessages.webcamLabel)}
|
2018-11-10 06:03:25 +08:00
|
|
|
</div>
|
2018-11-09 02:55:12 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className={styles.col}>
|
|
|
|
<div className={cx(styles.formElement, styles.pullContentRight)}>
|
|
|
|
<Toggle
|
|
|
|
icons={false}
|
|
|
|
defaultChecked={meeting.lockSettingsProp.disableCam}
|
|
|
|
onChange={() => {
|
2018-11-10 06:03:25 +08:00
|
|
|
meeting.lockSettingsProp.disableCam =
|
|
|
|
!meeting.lockSettingsProp.disableCam;
|
|
|
|
this.toggleLockSettings(meeting);
|
|
|
|
}}
|
2018-11-09 02:55:12 +08:00
|
|
|
ariaLabel={intl.formatMessage(intlMessages.webcamLabel)}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className={styles.row}>
|
|
|
|
<div className={styles.col} aria-hidden="true">
|
|
|
|
<div className={styles.formElement}>
|
2018-11-10 06:03:25 +08:00
|
|
|
<div className={styles.label}>
|
2018-11-09 02:55:12 +08:00
|
|
|
{intl.formatMessage(intlMessages.otherViewersWebcamLabel)}
|
2018-11-10 06:03:25 +08:00
|
|
|
</div>
|
2018-11-09 02:55:12 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className={styles.col}>
|
|
|
|
<div className={cx(styles.formElement, styles.pullContentRight)}>
|
|
|
|
<Toggle
|
|
|
|
icons={false}
|
2018-11-10 06:03:25 +08:00
|
|
|
defaultChecked={meeting.usersProp.webcamsOnlyForModerator}
|
2018-11-09 02:55:12 +08:00
|
|
|
onChange={() => {
|
2018-11-10 06:03:25 +08:00
|
|
|
meeting.usersProp.webcamsOnlyForModerator =
|
|
|
|
!meeting.usersProp.webcamsOnlyForModerator;
|
|
|
|
this.toggleWebcamsOnlyForModerator(meeting);
|
|
|
|
}}
|
2018-11-09 02:55:12 +08:00
|
|
|
ariaLabel={intl.formatMessage(intlMessages.otherViewersWebcamLabel)}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className={styles.row}>
|
|
|
|
<div className={styles.col} aria-hidden="true">
|
|
|
|
<div className={styles.formElement}>
|
2018-11-10 06:03:25 +08:00
|
|
|
<div className={styles.label}>
|
2018-11-09 02:55:12 +08:00
|
|
|
{intl.formatMessage(intlMessages.microphoneLable)}
|
2018-11-10 06:03:25 +08:00
|
|
|
</div>
|
2018-11-09 02:55:12 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className={styles.col}>
|
|
|
|
<div className={cx(styles.formElement, styles.pullContentRight)}>
|
|
|
|
<Toggle
|
|
|
|
icons={false}
|
|
|
|
defaultChecked={meeting.lockSettingsProp.disableMic}
|
|
|
|
onChange={() => {
|
2018-11-10 06:03:25 +08:00
|
|
|
meeting.lockSettingsProp.disableMic =
|
|
|
|
!meeting.lockSettingsProp.disableMic;
|
|
|
|
this.toggleLockSettings(meeting);
|
|
|
|
}}
|
2018-11-09 02:55:12 +08:00
|
|
|
ariaLabel={intl.formatMessage(intlMessages.microphoneLable)}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className={styles.row}>
|
|
|
|
<div className={styles.col} aria-hidden="true">
|
|
|
|
<div className={styles.formElement}>
|
2018-11-10 06:03:25 +08:00
|
|
|
<div className={styles.label}>
|
2018-11-09 02:55:12 +08:00
|
|
|
{intl.formatMessage(intlMessages.publicChatLabel)}
|
2018-11-10 06:03:25 +08:00
|
|
|
</div>
|
2018-11-09 02:55:12 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className={styles.col}>
|
|
|
|
<div className={cx(styles.formElement, styles.pullContentRight)}>
|
|
|
|
<Toggle
|
|
|
|
icons={false}
|
|
|
|
defaultChecked={meeting.lockSettingsProp.disablePubChat}
|
|
|
|
onChange={() => {
|
2018-11-10 06:03:25 +08:00
|
|
|
meeting.lockSettingsProp.disablePubChat =
|
|
|
|
!meeting.lockSettingsProp.disablePubChat;
|
|
|
|
this.toggleLockSettings(meeting);
|
|
|
|
}}
|
2018-11-09 02:55:12 +08:00
|
|
|
ariaLabel={intl.formatMessage(intlMessages.publicChatLabel)}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className={styles.row}>
|
|
|
|
<div className={styles.col} aria-hidden="true">
|
|
|
|
<div className={styles.formElement}>
|
2018-11-10 06:03:25 +08:00
|
|
|
<div className={styles.label}>
|
2018-11-09 02:55:12 +08:00
|
|
|
{intl.formatMessage(intlMessages.privateChatLable)}
|
2018-11-10 06:03:25 +08:00
|
|
|
</div>
|
2018-11-09 02:55:12 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className={styles.col}>
|
|
|
|
<div className={cx(styles.formElement, styles.pullContentRight)}>
|
|
|
|
<Toggle
|
|
|
|
icons={false}
|
|
|
|
defaultChecked={meeting.lockSettingsProp.disablePrivChat}
|
|
|
|
onChange={() => {
|
2018-11-10 06:03:25 +08:00
|
|
|
meeting.lockSettingsProp.disablePrivChat =
|
|
|
|
!meeting.lockSettingsProp.disablePrivChat;
|
|
|
|
this.toggleLockSettings(meeting);
|
|
|
|
}}
|
2018-11-09 02:55:12 +08:00
|
|
|
ariaLabel={intl.formatMessage(intlMessages.privateChatLable)}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className={styles.row}>
|
|
|
|
<div className={styles.col} aria-hidden="true">
|
|
|
|
<div className={styles.formElement}>
|
2018-11-10 06:03:25 +08:00
|
|
|
<div className={styles.label}>
|
2018-11-09 02:55:12 +08:00
|
|
|
{intl.formatMessage(intlMessages.layoutLable)}
|
2018-11-10 06:03:25 +08:00
|
|
|
</div>
|
2018-11-09 02:55:12 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className={styles.col}>
|
|
|
|
<div className={cx(styles.formElement, styles.pullContentRight)}>
|
|
|
|
<Toggle
|
|
|
|
icons={false}
|
|
|
|
defaultChecked={meeting.lockSettingsProp.lockedLayout}
|
|
|
|
onChange={() => {
|
2018-11-10 06:03:25 +08:00
|
|
|
meeting.lockSettingsProp.lockedLayout =
|
|
|
|
!meeting.lockSettingsProp.lockedLayout;
|
|
|
|
this.toggleLockSettings(meeting);
|
|
|
|
}}
|
2018-11-09 02:55:12 +08:00
|
|
|
ariaLabel={intl.formatMessage(intlMessages.layoutLable)}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</ModalBase>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default injectIntl(LockViewersComponent);
|