Merge pull request #19080 from ramonlsouza/issue-12614
feat: leave meeting button
This commit is contained in:
commit
1b61900548
@ -64,6 +64,7 @@ const currentParameters = [
|
|||||||
'bbb_hide_actions_bar',
|
'bbb_hide_actions_bar',
|
||||||
'bbb_hide_nav_bar',
|
'bbb_hide_nav_bar',
|
||||||
'bbb_change_layout',
|
'bbb_change_layout',
|
||||||
|
'bbb_direct_leave_button',
|
||||||
];
|
];
|
||||||
|
|
||||||
function valueParser(val) {
|
function valueParser(val) {
|
||||||
|
@ -42,6 +42,7 @@ import {
|
|||||||
btnDangerBorder,
|
btnDangerBorder,
|
||||||
btnDangerColor,
|
btnDangerColor,
|
||||||
btnDangerBg,
|
btnDangerBg,
|
||||||
|
btnDangerBgHover,
|
||||||
btnDarkBorder,
|
btnDarkBorder,
|
||||||
btnDarkColor,
|
btnDarkColor,
|
||||||
btnDarkBg,
|
btnDarkBg,
|
||||||
@ -924,6 +925,7 @@ const Button = styled(BaseButton)`
|
|||||||
&:hover,
|
&:hover,
|
||||||
.buttonWrapper:hover & {
|
.buttonWrapper:hover & {
|
||||||
color: ${btnDangerColor};
|
color: ${btnDangerColor};
|
||||||
|
background-color: ${btnDangerBgHover};
|
||||||
}
|
}
|
||||||
`}
|
`}
|
||||||
|
|
||||||
|
@ -14,6 +14,7 @@ import browserInfo from '/imports/utils/browserInfo';
|
|||||||
import deviceInfo from '/imports/utils/deviceInfo';
|
import deviceInfo from '/imports/utils/deviceInfo';
|
||||||
import { PANELS, ACTIONS } from '../layout/enums';
|
import { PANELS, ACTIONS } from '../layout/enums';
|
||||||
import { isEqual } from 'radash';
|
import { isEqual } from 'radash';
|
||||||
|
import LeaveMeetingButton from './leave-meeting-button/component';
|
||||||
|
|
||||||
const intlMessages = defineMessages({
|
const intlMessages = defineMessages({
|
||||||
toggleUserListLabel: {
|
toggleUserListLabel: {
|
||||||
@ -36,6 +37,10 @@ const intlMessages = defineMessages({
|
|||||||
id: 'app.createBreakoutRoom.room',
|
id: 'app.createBreakoutRoom.room',
|
||||||
description: 'default breakout room name',
|
description: 'default breakout room name',
|
||||||
},
|
},
|
||||||
|
leaveMeetingLabel: {
|
||||||
|
id: 'app.navBar.leaveMeetingBtnLabel',
|
||||||
|
description: 'Leave meeting button label',
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const propTypes = {
|
const propTypes = {
|
||||||
@ -170,6 +175,8 @@ class NavBar extends Component {
|
|||||||
isPinned,
|
isPinned,
|
||||||
sidebarNavigation,
|
sidebarNavigation,
|
||||||
currentUserId,
|
currentUserId,
|
||||||
|
isDirectLeaveButtonEnabled,
|
||||||
|
isMeteorConnected,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
const hasNotification = hasUnreadMessages || (hasUnreadNotes && !isPinned);
|
const hasNotification = hasUnreadMessages || (hasUnreadNotes && !isPinned);
|
||||||
@ -245,7 +252,13 @@ class NavBar extends Component {
|
|||||||
</Styled.Center>
|
</Styled.Center>
|
||||||
<Styled.Right>
|
<Styled.Right>
|
||||||
{ConnectionStatusService.isEnabled() ? <ConnectionStatusButton /> : null}
|
{ConnectionStatusService.isEnabled() ? <ConnectionStatusButton /> : null}
|
||||||
<SettingsDropdownContainer amIModerator={amIModerator} />
|
{isDirectLeaveButtonEnabled && isMeteorConnected
|
||||||
|
? <LeaveMeetingButton label={intl.formatMessage(intlMessages.leaveMeetingLabel)}/>
|
||||||
|
: null}
|
||||||
|
<SettingsDropdownContainer
|
||||||
|
amIModerator={amIModerator}
|
||||||
|
isDirectLeaveButtonEnabled={isDirectLeaveButtonEnabled}
|
||||||
|
/>
|
||||||
</Styled.Right>
|
</Styled.Right>
|
||||||
</Styled.Top>
|
</Styled.Top>
|
||||||
<Styled.Bottom>
|
<Styled.Bottom>
|
||||||
|
@ -114,6 +114,11 @@ export default withTracker(() => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const IS_DIRECT_LEAVE_BUTTON_ENABLED = getFromUserSettings(
|
||||||
|
'bbb_direct_leave_button',
|
||||||
|
PUBLIC_CONFIG.app.defaultSettings.application.directLeaveButton,
|
||||||
|
);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
isPinned: NotesService.isSharedNotesPinned(),
|
isPinned: NotesService.isSharedNotesPinned(),
|
||||||
currentUserId: Auth.userID,
|
currentUserId: Auth.userID,
|
||||||
@ -123,5 +128,7 @@ export default withTracker(() => {
|
|||||||
breakoutName,
|
breakoutName,
|
||||||
meetingName,
|
meetingName,
|
||||||
unread,
|
unread,
|
||||||
|
isDirectLeaveButtonEnabled: IS_DIRECT_LEAVE_BUTTON_ENABLED,
|
||||||
|
isMeteorConnected: Meteor.status().connected,
|
||||||
};
|
};
|
||||||
})(NavBarContainer);
|
})(NavBarContainer);
|
@ -0,0 +1,34 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import Styled from './styles';
|
||||||
|
import { makeCall } from '/imports/ui/services/api';
|
||||||
|
|
||||||
|
// Set the logout code to 680 because it's not a real code and can be matched on the other side
|
||||||
|
const LOGOUT_CODE = '680';
|
||||||
|
|
||||||
|
const propTypes = {
|
||||||
|
label: PropTypes.string.isRequired,
|
||||||
|
};
|
||||||
|
|
||||||
|
const LeaveMeetingButton = ({ label }) => {
|
||||||
|
const leaveSession = () => {
|
||||||
|
makeCall('userLeftMeeting');
|
||||||
|
// we don't check askForFeedbackOnLogout here,
|
||||||
|
// it is checked in meeting-ended component
|
||||||
|
Session.set('codeError', LOGOUT_CODE);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Styled.LeaveButton
|
||||||
|
label={label}
|
||||||
|
color="danger"
|
||||||
|
size="lg"
|
||||||
|
onClick={() => leaveSession()}
|
||||||
|
icon="logout"
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
LeaveMeetingButton.propTypes = propTypes;
|
||||||
|
|
||||||
|
export default LeaveMeetingButton;
|
@ -0,0 +1,13 @@
|
|||||||
|
import styled from 'styled-components';
|
||||||
|
import Button from '/imports/ui/components/common/button/component';
|
||||||
|
|
||||||
|
const LeaveButton = styled(Button)`
|
||||||
|
border-radius: 1.1rem;
|
||||||
|
font-size: 1rem;
|
||||||
|
line-height: 1.1rem;
|
||||||
|
font-weight: 400;
|
||||||
|
`;
|
||||||
|
|
||||||
|
export default {
|
||||||
|
LeaveButton,
|
||||||
|
};
|
@ -118,6 +118,7 @@ const propTypes = {
|
|||||||
audioCaptionsActive: PropTypes.bool.isRequired,
|
audioCaptionsActive: PropTypes.bool.isRequired,
|
||||||
audioCaptionsSet: PropTypes.func.isRequired,
|
audioCaptionsSet: PropTypes.func.isRequired,
|
||||||
isMobile: PropTypes.bool.isRequired,
|
isMobile: PropTypes.bool.isRequired,
|
||||||
|
isDirectLeaveButtonEnabled: PropTypes.bool.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
const defaultProps = {
|
const defaultProps = {
|
||||||
@ -243,7 +244,7 @@ class SettingsDropdown extends PureComponent {
|
|||||||
renderMenuItems() {
|
renderMenuItems() {
|
||||||
const {
|
const {
|
||||||
intl, amIModerator, isBreakoutRoom, isMeteorConnected, audioCaptionsEnabled,
|
intl, amIModerator, isBreakoutRoom, isMeteorConnected, audioCaptionsEnabled,
|
||||||
audioCaptionsActive, audioCaptionsSet, isMobile,
|
audioCaptionsActive, audioCaptionsSet, isMobile, isDirectLeaveButtonEnabled,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
const { isIos } = deviceInfo;
|
const { isIos } = deviceInfo;
|
||||||
@ -341,7 +342,7 @@ class SettingsDropdown extends PureComponent {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
if (allowLogoutSetting && isMeteorConnected) {
|
if (allowLogoutSetting && isMeteorConnected && !isDirectLeaveButtonEnabled) {
|
||||||
this.menuItems.push(
|
this.menuItems.push(
|
||||||
{
|
{
|
||||||
key: 'list-item-logout',
|
key: 'list-item-logout',
|
||||||
|
@ -64,6 +64,7 @@ const btnWarningBg = `var(--btn-warning-bg, ${colorWarning})`;
|
|||||||
const btnDangerBorder = `var(--btn-danger-border, ${colorDanger})`;
|
const btnDangerBorder = `var(--btn-danger-border, ${colorDanger})`;
|
||||||
const btnDangerColor = `var(--btn-danger-color, ${colorWhite})`;
|
const btnDangerColor = `var(--btn-danger-color, ${colorWhite})`;
|
||||||
const btnDangerBg = `var(--btn-danger-bg, ${colorDanger})`;
|
const btnDangerBg = `var(--btn-danger-bg, ${colorDanger})`;
|
||||||
|
const btnDangerBgHover = 'var(--btn-danger-bg-hover, #C61C1C)';
|
||||||
|
|
||||||
const btnDarkBorder = `var(--btn-dark-border, ${colorDanger})`;
|
const btnDarkBorder = `var(--btn-dark-border, ${colorDanger})`;
|
||||||
const btnDarkColor = `var(--btn-dark-color, ${colorWhite})`;
|
const btnDarkColor = `var(--btn-dark-color, ${colorWhite})`;
|
||||||
@ -171,6 +172,7 @@ export {
|
|||||||
btnDangerBorder,
|
btnDangerBorder,
|
||||||
btnDangerColor,
|
btnDangerColor,
|
||||||
btnDangerBg,
|
btnDangerBg,
|
||||||
|
btnDangerBgHover,
|
||||||
btnDarkBorder,
|
btnDarkBorder,
|
||||||
btnDarkColor,
|
btnDarkColor,
|
||||||
btnDarkBg,
|
btnDarkBg,
|
||||||
|
@ -200,6 +200,7 @@ public:
|
|||||||
paginationEnabled: true
|
paginationEnabled: true
|
||||||
whiteboardToolbarAutoHide: false
|
whiteboardToolbarAutoHide: false
|
||||||
autoCloseReactionsBar: true
|
autoCloseReactionsBar: true
|
||||||
|
directLeaveButton: false
|
||||||
darkTheme: false
|
darkTheme: false
|
||||||
# fallbackLocale: if the locale the client is loaded in does not have a
|
# fallbackLocale: if the locale the client is loaded in does not have a
|
||||||
# translation a string, it will use the translation from the locale
|
# translation a string, it will use the translation from the locale
|
||||||
|
@ -436,6 +436,7 @@
|
|||||||
"app.muteWarning.label": "Click {0} to unmute yourself.",
|
"app.muteWarning.label": "Click {0} to unmute yourself.",
|
||||||
"app.muteWarning.disableMessage": "Mute alerts disabled until unmute",
|
"app.muteWarning.disableMessage": "Mute alerts disabled until unmute",
|
||||||
"app.muteWarning.tooltip": "Click to close and disable warning until next unmute",
|
"app.muteWarning.tooltip": "Click to close and disable warning until next unmute",
|
||||||
|
"app.navBar.leaveMeetingBtnLabel": "Leave",
|
||||||
"app.navBar.settingsDropdown.optionsLabel": "Options",
|
"app.navBar.settingsDropdown.optionsLabel": "Options",
|
||||||
"app.navBar.settingsDropdown.fullscreenLabel": "Fullscreen Application",
|
"app.navBar.settingsDropdown.fullscreenLabel": "Fullscreen Application",
|
||||||
"app.navBar.settingsDropdown.settingsLabel": "Settings",
|
"app.navBar.settingsDropdown.settingsLabel": "Settings",
|
||||||
|
@ -1432,6 +1432,7 @@ Useful tools for development:
|
|||||||
| `userdata-bbb_skip_check_audio_on_first_join=` | (Introduced in BigBlueButton 2.3) If set to `true`, the user will not see the "echo test" when sharing audio for the first time in the session. If the user stops sharing, next time they try to share audio the echo test window will be displayed, allowing for configuration changes to be made prior to sharing audio again | `false` |
|
| `userdata-bbb_skip_check_audio_on_first_join=` | (Introduced in BigBlueButton 2.3) If set to `true`, the user will not see the "echo test" when sharing audio for the first time in the session. If the user stops sharing, next time they try to share audio the echo test window will be displayed, allowing for configuration changes to be made prior to sharing audio again | `false` |
|
||||||
| `userdata-bbb_override_default_locale=` | (Introduced in BigBlueButton 2.3) If set to `de`, the user's browser preference will be ignored - the client will be shown in 'de' (i.e. German) regardless of the otherwise preferred locale 'en' (or other) | `null` |
|
| `userdata-bbb_override_default_locale=` | (Introduced in BigBlueButton 2.3) If set to `de`, the user's browser preference will be ignored - the client will be shown in 'de' (i.e. German) regardless of the otherwise preferred locale 'en' (or other) | `null` |
|
||||||
| `userdata-bbb_hide_presentation_on_join` | (Introduced in BigBlueButton 2.6) If set to `true` it will make the user enter the meeting with presentation minimized (Only for non-presenters), not peremanent. | `false` |
|
| `userdata-bbb_hide_presentation_on_join` | (Introduced in BigBlueButton 2.6) If set to `true` it will make the user enter the meeting with presentation minimized (Only for non-presenters), not peremanent. | `false` |
|
||||||
|
| `userdata-bbb_direct_leave_button` | (Introduced in BigBlueButton 2.7) If set to `true` it will make a button to leave the meeting appear to the left of the Options menu. | `false` |
|
||||||
|
|
||||||
#### Branding parameters
|
#### Branding parameters
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user