feature(layout): Use layout push as a boolean option

This commit is contained in:
Lucas Zawacki 2021-12-14 18:25:15 +00:00
parent 7b5049f14c
commit 65c376531e
5 changed files with 37 additions and 15 deletions

View File

@ -263,10 +263,14 @@ class App extends Component {
});
if (pushLayoutToEveryone) {
LayoutService.setMeetingLayout(settingsLayout);
LayoutService.setMeetingLayout(selectedLayout);
}
}
if (pushLayoutToEveryone && !prevProps.pushLayoutToEveryone) {
LayoutService.setMeetingLayout(selectedLayout);
}
if (mountRandomUserModal) mountModal(<RandomUserSelectContainer />);
if (prevProps.currentUserEmoji.status !== currentUserEmoji.status) {

View File

@ -184,7 +184,7 @@ export default injectIntl(withModalMounter(withTracker(({ intl, baseControls })
}).fetch();
const AppSettings = Settings.application;
const { selectedLayout } = AppSettings;
const { selectedLayout, pushLayout } = AppSettings;
const { viewScreenshare } = Settings.dataSaving;
const shouldShowExternalVideo = MediaService.shouldShowExternalVideo();
const shouldShowScreenshare = MediaService.shouldShowScreenshare()
@ -217,8 +217,7 @@ export default injectIntl(withModalMounter(withTracker(({ intl, baseControls })
isPresenter: currentUser?.presenter,
meetingLayout: layout,
selectedLayout,
settingsLayout: selectedLayout?.replace('Push', ''),
pushLayoutToEveryone: selectedLayout?.includes('Push'),
pushLayoutToEveryone: pushLayout,
audioAlertEnabled: AppSettings.chatAudioAlerts,
pushAlertEnabled: AppSettings.chatPushAlerts,
shouldShowScreenshare,

View File

@ -73,6 +73,10 @@ const intlMessages = defineMessages({
id: 'app.submenu.application.layoutOptionLabel',
description: 'layout options',
},
pushLayoutLabel: {
id: 'app.submenu.application.pushLayoutLabel',
description: 'push layout togle',
},
customLayout: {
id: 'app.layout.style.custom',
description: 'label for custom layout style',
@ -321,19 +325,9 @@ class ApplicationMenu extends BaseMenu {
}
renderChangeLayout() {
const { intl, isModerator } = this.props;
const { intl, isModerator, showToggleLabel, displaySettingsStatus } = this.props;
const { settings } = this.state;
if (isModerator) {
const pushLayouts = {
CUSTOM_PUSH: 'customPush',
SMART_PUSH: 'smartPush',
PRESENTATION_FOCUS_PUSH: 'presentationFocusPush',
VIDEO_FOCUS_PUSH: 'videoFocusPush',
};
Object.assign(LAYOUT_TYPE, pushLayouts);
}
return (
<>
<Styled.Row>
@ -359,6 +353,29 @@ class ApplicationMenu extends BaseMenu {
</Styled.FormElementRight>
</Styled.Col>
</Styled.Row>
{ isModerator ?
(<Styled.Row>
<Styled.Col>
<Styled.FormElement>
<Styled.Label>
{intl.formatMessage(intlMessages.pushLayoutLabel)}
</Styled.Label>
</Styled.FormElement>
</Styled.Col>
<Styled.Col>
<Styled.FormElementRight>
{displaySettingsStatus(settings.pushLayout)}
<Toggle
icons={false}
defaultChecked={settings.pushLayout}
onChange={() => this.handleToggle('pushLayout')}
ariaLabel={intl.formatMessage(intlMessages.pushLayoutLabel)}
showToggleLabel={showToggleLabel}
/>
</Styled.FormElementRight>
</Styled.Col>
</Styled.Row>
) : null }
</>
);
}

View File

@ -381,6 +381,7 @@
"app.submenu.application.noLocaleOptionLabel": "No active locales",
"app.submenu.application.paginationEnabledLabel": "Video pagination",
"app.submenu.application.layoutOptionLabel": "Layout type",
"app.submenu.application.pushLayoutLabel": "Push layout",
"app.submenu.notification.SectionTitle": "Notifications",
"app.submenu.notification.Desc": "Define how and what you will be notified.",
"app.submenu.notification.audioAlertLabel": "Audio Alerts",

View File

@ -376,6 +376,7 @@
"app.submenu.application.noLocaleOptionLabel": "Não existem esquemas de idiomas disponíveis",
"app.submenu.application.paginationEnabledLabel": "Paginação de vídeo",
"app.submenu.application.layoutOptionLabel": "Tipo de layout",
"app.submenu.application.pushLayoutLabel": "Replicar layout",
"app.submenu.notification.SectionTitle": "Notificações",
"app.submenu.notification.Desc": "Defina suas notificações.",
"app.submenu.notification.audioAlertLabel": "Alertas de áudio",