2019-01-18 00:33:43 +08:00
|
|
|
import React from 'react';
|
2018-11-09 02:55:12 +08:00
|
|
|
import { defineMessages, injectIntl } from 'react-intl';
|
|
|
|
import Toggle from '/imports/ui/components/switch/component';
|
|
|
|
import cx from 'classnames';
|
2018-12-03 14:01:19 +08:00
|
|
|
import Modal from '/imports/ui/components/modal/simple/component';
|
2019-03-30 02:22:52 +08:00
|
|
|
import NoteService from '/imports/ui/components/note/service';
|
2018-11-09 02:55:12 +08:00
|
|
|
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',
|
|
|
|
},
|
2019-03-29 02:47:11 +08:00
|
|
|
notesLabel: {
|
|
|
|
id: 'app.lock-viewers.notesLabel',
|
|
|
|
description: 'description for close button',
|
|
|
|
},
|
2019-05-08 21:16:00 +08:00
|
|
|
ariaModalTitle: {
|
2019-05-08 22:08:47 +08:00
|
|
|
id: 'app.lock-viewers.ariaTitle',
|
2019-05-08 21:16:00 +08:00
|
|
|
description: 'aria label for modal title',
|
|
|
|
},
|
2018-11-09 02:55:12 +08:00
|
|
|
});
|
|
|
|
|
2019-01-18 00:33:43 +08:00
|
|
|
class LockViewersComponent extends React.PureComponent {
|
|
|
|
render() {
|
2018-11-09 02:55:12 +08:00
|
|
|
const {
|
2019-01-18 00:33:43 +08:00
|
|
|
intl,
|
|
|
|
meeting,
|
2018-11-09 02:55:12 +08:00
|
|
|
closeModal,
|
|
|
|
toggleLockSettings,
|
|
|
|
toggleWebcamsOnlyForModerator,
|
2019-01-18 00:33:43 +08:00
|
|
|
} = this.props;
|
2018-11-09 02:55:12 +08:00
|
|
|
|
|
|
|
return (
|
2018-12-03 14:01:19 +08:00
|
|
|
<Modal
|
2018-11-09 02:55:12 +08:00
|
|
|
overlayClassName={styles.overlay}
|
|
|
|
className={styles.modal}
|
2019-01-18 00:33:43 +08:00
|
|
|
onRequestClose={closeModal}
|
2018-12-03 14:01:19 +08:00
|
|
|
hideBorder
|
2019-05-08 21:16:00 +08:00
|
|
|
contentLabel={intl.formatMessage(intlMessages.ariaModalTitle)}
|
2018-11-09 02:55:12 +08:00
|
|
|
>
|
2018-11-15 02:04:23 +08:00
|
|
|
|
2018-11-10 06:03:25 +08:00
|
|
|
<div className={styles.container}>
|
|
|
|
<div className={styles.header}>
|
2019-05-02 05:13:13 +08:00
|
|
|
<h2 className={styles.title}>{intl.formatMessage(intlMessages.lockViewersTitle)}</h2>
|
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}
|
2019-04-04 01:23:31 +08:00
|
|
|
defaultChecked={meeting.lockSettingsProps.disableCam}
|
2018-11-09 02:55:12 +08:00
|
|
|
onChange={() => {
|
2019-04-04 01:23:31 +08:00
|
|
|
meeting.lockSettingsProps.disableCam = !meeting.lockSettingsProps.disableCam;
|
2019-01-18 00:33:43 +08:00
|
|
|
toggleLockSettings(meeting);
|
2018-11-10 06:03:25 +08:00
|
|
|
}}
|
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={() => {
|
2019-01-18 00:33:43 +08:00
|
|
|
meeting.usersProp.webcamsOnlyForModerator = !meeting.usersProp.webcamsOnlyForModerator;
|
|
|
|
toggleWebcamsOnlyForModerator(meeting);
|
2018-11-10 06:03:25 +08:00
|
|
|
}}
|
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}
|
2019-04-04 01:23:31 +08:00
|
|
|
defaultChecked={meeting.lockSettingsProps.disableMic}
|
2018-11-09 02:55:12 +08:00
|
|
|
onChange={() => {
|
2019-04-04 01:23:31 +08:00
|
|
|
meeting.lockSettingsProps.disableMic = !meeting.lockSettingsProps.disableMic;
|
2019-01-18 00:33:43 +08:00
|
|
|
toggleLockSettings(meeting);
|
2018-11-10 06:03:25 +08:00
|
|
|
}}
|
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}
|
2019-04-10 21:44:34 +08:00
|
|
|
defaultChecked={meeting.lockSettingsProps.disablePublicChat}
|
2018-11-09 02:55:12 +08:00
|
|
|
onChange={() => {
|
2019-04-10 21:44:34 +08:00
|
|
|
meeting.lockSettingsProps.disablePublicChat = !meeting.lockSettingsProps.disablePublicChat;
|
2019-01-18 00:33:43 +08:00
|
|
|
toggleLockSettings(meeting);
|
2018-11-10 06:03:25 +08:00
|
|
|
}}
|
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}
|
2019-04-10 21:44:34 +08:00
|
|
|
defaultChecked={meeting.lockSettingsProps.disablePrivateChat}
|
2018-11-09 02:55:12 +08:00
|
|
|
onChange={() => {
|
2019-04-10 21:44:34 +08:00
|
|
|
meeting.lockSettingsProps.disablePrivateChat = !meeting.lockSettingsProps.disablePrivateChat;
|
2019-01-18 00:33:43 +08:00
|
|
|
toggleLockSettings(meeting);
|
2018-11-10 06:03:25 +08:00
|
|
|
}}
|
2018-11-09 02:55:12 +08:00
|
|
|
ariaLabel={intl.formatMessage(intlMessages.privateChatLable)}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2019-03-30 02:22:52 +08:00
|
|
|
{ NoteService.isEnabled() ?
|
2019-03-29 02:47:11 +08:00
|
|
|
(<div className={styles.row}>
|
|
|
|
<div className={styles.col} aria-hidden="true">
|
|
|
|
<div className={styles.formElement}>
|
|
|
|
<div className={styles.label}>
|
|
|
|
{intl.formatMessage(intlMessages.notesLabel)}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className={styles.col}>
|
|
|
|
<div className={cx(styles.formElement, styles.pullContentRight)}>
|
|
|
|
<Toggle
|
|
|
|
icons={false}
|
2019-03-30 02:22:52 +08:00
|
|
|
defaultChecked={meeting.lockSettingsProps.disableNote}
|
2019-03-29 02:47:11 +08:00
|
|
|
onChange={() => {
|
2019-03-30 02:22:52 +08:00
|
|
|
meeting.lockSettingsProps.disableNote = !meeting.lockSettingsProps.disableNote;
|
2019-03-29 02:47:11 +08:00
|
|
|
toggleLockSettings(meeting);
|
|
|
|
}}
|
|
|
|
ariaLabel={intl.formatMessage(intlMessages.notesLabel)}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>)
|
|
|
|
: null
|
|
|
|
}
|
2018-11-09 02:55:12 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
2018-12-03 14:01:19 +08:00
|
|
|
</Modal>
|
2018-11-09 02:55:12 +08:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default injectIntl(LockViewersComponent);
|