remove lock from local settings

This commit is contained in:
Joao Siebel 2019-08-02 10:00:08 -03:00
parent b06274c58a
commit 44c660cf48
6 changed files with 1 additions and 282 deletions

View File

@ -73,14 +73,6 @@ const propTypes = {
fontSize: PropTypes.string,
locale: PropTypes.string,
}).isRequired,
participants: PropTypes.shape({
layout: PropTypes.bool,
lockAll: PropTypes.bool,
microphone: PropTypes.bool,
muteAll: PropTypes.bool,
privateChat: PropTypes.bool,
publicChat: PropTypes.bool,
}).isRequired,
updateSettings: PropTypes.func.isRequired,
availableLocales: PropTypes.objectOf(PropTypes.array).isRequired,
mountModal: PropTypes.func.isRequired,
@ -95,19 +87,17 @@ class Settings extends Component {
super(props);
const {
dataSaving, participants, application,
dataSaving, application,
} = props;
this.state = {
current: {
dataSaving: _.clone(dataSaving),
application: _.clone(application),
participants: _.clone(participants),
},
saved: {
dataSaving: _.clone(dataSaving),
application: _.clone(application),
participants: _.clone(participants),
},
selectedTab: 0,
};
@ -202,14 +192,6 @@ class Settings extends Component {
handleUpdateSettings={this.handleUpdateSettings}
/>
</TabPanel>
{/* { isModerator ? */}
{/* <TabPanel className={styles.tabPanel}> */}
{/* <Participants */}
{/* settings={this.state.current.participants} */}
{/* handleUpdateSettings={this.handleUpdateSettings} */}
{/* /> */}
{/* </TabPanel> */}
{/* : null } */}
</Tabs>
);
}

View File

@ -17,7 +17,6 @@ export default withTracker(() => ({
audio: SettingsService.audio,
dataSaving: SettingsService.dataSaving,
application: SettingsService.application,
participants: SettingsService.participants,
updateSettings,
availableLocales: getAvailableLocales(),
isModerator: getUserRoles() === 'MODERATOR',

View File

@ -1,236 +0,0 @@
import React from 'react';
import Toggle from '/imports/ui/components/switch/component';
import Checkbox from '/imports/ui/components/checkbox/component';
import cx from 'classnames';
import { defineMessages, injectIntl } from 'react-intl';
import _ from 'lodash';
import BaseMenu from '../base/component';
import { styles } from '../styles';
const intlMessages = defineMessages({
participantsTitle: {
id: 'app.userList.participantsTitle',
description: 'heading label for participants submenu',
},
muteAllLabel: {
id: 'app.submenu.participants.muteAllLabel',
description: 'label for participants submenu mute section',
},
lockAllLabel: {
id: 'app.submenu.participants.lockAllLabel',
description: 'label for participants submenu lock section',
},
lockItemLabel: {
id: 'app.submenu.participants.lockItemLabel',
description: 'label for locking option',
},
lockCamDesc: {
id: 'app.submenu.participants.lockCamDesc',
description: 'lock webcam description',
},
lockMicDesc: {
id: 'app.submenu.participants.lockMicDesc',
description: 'lock Mic description',
},
lockPublicChatDesc: {
id: 'app.submenu.participants.lockPublicChatDesc',
description: 'lock public chat description',
},
lockPrivateChatDesc: {
id: 'app.submenu.participants.lockPrivateChatDesc',
description: 'lock private chat description',
},
lockLayoutDesc: {
id: 'app.submenu.participants.lockLayoutDesc',
description: 'lock layout description',
},
lockMicAriaLabel: {
id: 'app.submenu.participants.lockMicAriaLabel',
description: 'lock mic aria lable ',
},
lockCamAriaLabel: {
id: 'app.submenu.participants.lockCamAriaLabel',
description: 'lock webcam aria label',
},
lockPublicChatAriaLabel: {
id: 'app.submenu.participants.lockPublicChatAriaLabel',
description: 'lock public chat aria label',
},
lockPrivateChatAriaLabel: {
id: 'app.submenu.participants.lockPrivateChatAriaLabel',
description: 'lock private chat aria label',
},
lockLayoutAriaLabel: {
id: 'app.submenu.participants.lockLayoutAriaLabel',
description: 'lock layout aria label',
},
lockMicLabel: {
id: 'app.submenu.participants.lockMicLabel',
description: 'lock mic visible label',
},
lockCamLabel: {
id: 'app.submenu.participants.lockCamLabel',
description: 'lock webcam visible label',
},
lockPublicChatLabel: {
id: 'app.submenu.participants.lockPublicChatLabel',
description: 'lock public chat visible label',
},
lockPrivateChatLabel: {
id: 'app.submenu.participants.lockPrivateChatLabel',
description: 'lock private chat visible label',
},
lockLayoutLabel: {
id: 'app.submenu.participants.lockLayoutLabel',
description: 'lock layout visible lable',
},
});
class ApplicationMenu extends BaseMenu {
constructor(props) {
super(props);
this.state = {
settings: props.settings,
};
this.handleUpdateSettings = props.handleUpdateSettings;
}
getLockItems() {
const { intl } = this.props;
return [
{
key: 'webcam',
label: intl.formatMessage(intlMessages.lockCamLabel),
ariaLabelledBy: 'webcamLabel',
ariaDescribedBy: 'webcamDesc',
ariaLabel: intl.formatMessage(intlMessages.lockCamAriaLabel),
ariaDesc: intl.formatMessage(intlMessages.lockCamDesc),
},
{
key: 'microphone',
label: intl.formatMessage(intlMessages.lockMicLabel),
ariaLabelledBy: 'micLabel',
ariaDescribedBy: 'micDesc',
ariaLabel: intl.formatMessage(intlMessages.lockMicAriaLabel),
ariaDesc: intl.formatMessage(intlMessages.lockMicDesc),
},
{
key: 'publicChat',
ariaLabelledBy: 'pubChatLabel',
ariaDescribedBy: 'pubChatDesc',
ariaLabel: intl.formatMessage(intlMessages.lockPublicChatAriaLabel),
ariaDesc: intl.formatMessage(intlMessages.lockPublicChatDesc),
label: intl.formatMessage(intlMessages.lockPublicChatLabel),
},
{
key: 'privateChat',
label: intl.formatMessage(intlMessages.lockPrivateChatLabel),
ariaLabelledBy: 'privChatLabel',
ariaDescribedBy: 'privChatDesc',
ariaLabel: intl.formatMessage(intlMessages.lockPrivateChatAriaLabel),
ariaDesc: intl.formatMessage(intlMessages.lockPrivateChatDesc),
},
{
key: 'layout',
ariaLabelledBy: 'layoutLabel',
ariaDescribedBy: 'layoutDesc',
ariaLabel: intl.formatMessage(intlMessages.lockLayoutAriaLabel),
ariaDesc: intl.formatMessage(intlMessages.lockLayoutDesc),
label: intl.formatMessage(intlMessages.lockLayoutLabel),
},
];
}
render() {
const { intl } = this.props;
return (
<div className={styles.tabContent}>
<div className={styles.header}>
<h3 className={styles.title}>{intl.formatMessage(intlMessages.participantsTitle)}</h3>
</div>
<div className={styles.form}>
<div className={styles.row}>
<div className={styles.col}>
<div className={styles.formElement}>
<div className={styles.label}>
{intl.formatMessage(intlMessages.muteAllLabel)}
</div>
</div>
</div>
<div className={styles.col}>
<div
className={cx(styles.formElement, styles.pullContentRight)}
>
<Toggle
icons={false}
defaultChecked={this.state.settings.muteAll}
onChange={() => this.handleToggle('muteAll')}
ariaLabelledBy={'muteLabel'}
ariaLabel={intl.formatMessage(intlMessages.muteAllLabel)}
/>
</div>
</div>
</div>
<div className={styles.row}>
<div className={styles.col}>
<div className={styles.formElement}>
<div className={styles.label}>
{intl.formatMessage(intlMessages.lockAllLabel)}
</div>
</div>
</div>
<div className={styles.col}>
<div className={cx(styles.formElement, styles.pullContentRight)}>
<Toggle
icons={false}
defaultChecked={this.state.settings.lockAll}
onChange={() => this.handleToggle('lockAll')}
ariaLabelledBy={'lockLabel'}
ariaLabel={intl.formatMessage(intlMessages.lockAllLabel)}
/>
</div>
</div>
</div>
{this.getLockItems().map((item, i) => this.renderLockItem(item, i))}
</div>
</div>
);
}
renderLockItem({ label, key, ariaLabel, ariaLabelledBy, ariaDesc, ariaDescribedBy }, i) {
const formControlId = _.uniqueId('from-key-');
return (
<div key={i} className={cx(styles.row, styles.spacedLeft)}>
<div className={styles.col}>
<div className={styles.formElement}>
<label htmlFor={formControlId} className={styles.label}>
{label}
</label>
</div>
</div>
<div className={styles.col}>
<div
className={cx(styles.formElement, styles.pullContentRight)}
>
<Checkbox
keyValue={key}
onChange={this.handleToggle}
checked={this.state.settings[key]}
ariaLabel={ariaLabel}
ariaLabelledBy={ariaLabelledBy}
ariaDesc={ariaDesc}
ariaDescribedBy={ariaDescribedBy}
id={formControlId}
/>
</div>
</div>
</div>
);
}
}
export default injectIntl(ApplicationMenu);

View File

@ -7,7 +7,6 @@ const SETTINGS = [
'audio',
'video',
'cc',
'participants',
'dataSaving',
];

View File

@ -37,13 +37,6 @@ public:
dataSaving:
viewParticipantsWebcams: true
viewScreenshare: true
participants:
muteAll: false
lockAll: false
microphone: false
publicChat: false
privateChat: false
layout: false
shortcuts:
openOptions:
accesskey: O

View File

@ -283,24 +283,6 @@
"app.submenu.video.videoQualityLabel": "Video quality",
"app.submenu.video.qualityOptionLabel": "Choose the video quality",
"app.submenu.video.participantsCamLabel": "Viewing participants webcams",
"app.submenu.participants.muteAllLabel": "Mute all except the presenter",
"app.submenu.participants.lockAllLabel": "Lock all viewers",
"app.submenu.participants.lockItemLabel": "Viewers {0}",
"app.submenu.participants.lockMicDesc": "Disables the microphone for all locked viewers",
"app.submenu.participants.lockCamDesc": "Disables the webcam for all locked viewers",
"app.submenu.participants.lockPublicChatDesc": "Disables public chat for all locked viewers",
"app.submenu.participants.lockPrivateChatDesc": "Disables private chat for all locked viewers",
"app.submenu.participants.lockLayoutDesc": "Locks layout for all locked viewers",
"app.submenu.participants.lockMicAriaLabel": "Microphone lock",
"app.submenu.participants.lockCamAriaLabel": "Webcam lock",
"app.submenu.participants.lockPublicChatAriaLabel": "Public chat lock",
"app.submenu.participants.lockPrivateChatAriaLabel": "Private chat lock",
"app.submenu.participants.lockLayoutAriaLabel": "Layout lock",
"app.submenu.participants.lockMicLabel": "Microphone",
"app.submenu.participants.lockCamLabel": "Webcam",
"app.submenu.participants.lockPublicChatLabel": "Public chat",
"app.submenu.participants.lockPrivateChatLabel": "Private chat",
"app.submenu.participants.lockLayoutLabel": "Layout",
"app.settings.applicationTab.label": "Application",
"app.settings.audioTab.label": "Audio",
"app.settings.videoTab.label": "Video",