mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 11:22:31 +00:00
feat(prejoin) show error when trying to join and name is required
This commit is contained in:
committed by
Дамян Минков
parent
c3329ec931
commit
10c2652a4f
1
.gitignore
vendored
1
.gitignore
vendored
@@ -84,3 +84,4 @@ android/app/google-services.json
|
|||||||
ios/app/dropbox.key
|
ios/app/dropbox.key
|
||||||
ios/app/GoogleService-Info.plist
|
ios/app/GoogleService-Info.plist
|
||||||
|
|
||||||
|
.vscode
|
||||||
|
|||||||
@@ -39,6 +39,16 @@
|
|||||||
margin-bottom: 14px;
|
margin-bottom: 14px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&-error {
|
||||||
|
color: white;
|
||||||
|
background-color: rgba(229, 75, 75, 0.5);
|
||||||
|
width: 100%;
|
||||||
|
padding: 3px;
|
||||||
|
margin-top: 4px;
|
||||||
|
font-size: 13px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@mixin name-placeholder {
|
@mixin name-placeholder {
|
||||||
|
|||||||
@@ -520,6 +520,7 @@
|
|||||||
"errorDialOutDisconnected": "Could not dial out. Disconnected",
|
"errorDialOutDisconnected": "Could not dial out. Disconnected",
|
||||||
"errorDialOutFailed": "Could not dial out. Call failed",
|
"errorDialOutFailed": "Could not dial out. Call failed",
|
||||||
"errorDialOutStatus": "Error getting dial out status",
|
"errorDialOutStatus": "Error getting dial out status",
|
||||||
|
"errorMissingName": "Please enter your name to join the meeting",
|
||||||
"errorStatusCode": "Error dialing out, status code: {{status}}",
|
"errorStatusCode": "Error dialing out, status code: {{status}}",
|
||||||
"errorValidation": "Number validation failed",
|
"errorValidation": "Number validation failed",
|
||||||
"iWantToDialIn": "I want to dial in",
|
"iWantToDialIn": "I want to dial in",
|
||||||
|
|||||||
@@ -48,11 +48,6 @@ type Props = {
|
|||||||
*/
|
*/
|
||||||
hasJoinByPhoneButton: boolean,
|
hasJoinByPhoneButton: boolean,
|
||||||
|
|
||||||
/**
|
|
||||||
* If join button is disabled or not.
|
|
||||||
*/
|
|
||||||
joinButtonDisabled: boolean,
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Joins the current meeting.
|
* Joins the current meeting.
|
||||||
*/
|
*/
|
||||||
@@ -98,6 +93,11 @@ type Props = {
|
|||||||
*/
|
*/
|
||||||
showCameraPreview: boolean,
|
showCameraPreview: boolean,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If should show an error when joining without a name.
|
||||||
|
*/
|
||||||
|
showErrorOnJoin: boolean,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Flag signaling the visibility of join label, input and buttons
|
* Flag signaling the visibility of join label, input and buttons
|
||||||
*/
|
*/
|
||||||
@@ -131,6 +131,11 @@ type Props = {
|
|||||||
|
|
||||||
type State = {
|
type State = {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Flag controlling the visibility of the error label.
|
||||||
|
*/
|
||||||
|
showError: boolean,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Flag controlling the visibility of the 'join by phone' buttons.
|
* Flag controlling the visibility of the 'join by phone' buttons.
|
||||||
*/
|
*/
|
||||||
@@ -161,16 +166,38 @@ class Prejoin extends Component<Props, State> {
|
|||||||
super(props);
|
super(props);
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
|
showError: false,
|
||||||
showJoinByPhoneButtons: false
|
showJoinByPhoneButtons: false
|
||||||
};
|
};
|
||||||
|
|
||||||
this._closeDialog = this._closeDialog.bind(this);
|
this._closeDialog = this._closeDialog.bind(this);
|
||||||
this._showDialog = this._showDialog.bind(this);
|
this._showDialog = this._showDialog.bind(this);
|
||||||
|
this._onJoinButtonClick = this._onJoinButtonClick.bind(this);
|
||||||
this._onToggleButtonClick = this._onToggleButtonClick.bind(this);
|
this._onToggleButtonClick = this._onToggleButtonClick.bind(this);
|
||||||
this._onDropdownClose = this._onDropdownClose.bind(this);
|
this._onDropdownClose = this._onDropdownClose.bind(this);
|
||||||
this._onOptionsClick = this._onOptionsClick.bind(this);
|
this._onOptionsClick = this._onOptionsClick.bind(this);
|
||||||
this._setName = this._setName.bind(this);
|
this._setName = this._setName.bind(this);
|
||||||
}
|
}
|
||||||
|
_onJoinButtonClick: () => void;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handler for the join button.
|
||||||
|
*
|
||||||
|
* @param {Object} e - The synthetic event.
|
||||||
|
* @returns {void}
|
||||||
|
*/
|
||||||
|
_onJoinButtonClick() {
|
||||||
|
if (this.props.showErrorOnJoin) {
|
||||||
|
this.setState({
|
||||||
|
showError: true
|
||||||
|
});
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.setState({ showError: false });
|
||||||
|
this.props.joinConference();
|
||||||
|
}
|
||||||
|
|
||||||
_onToggleButtonClick: () => void;
|
_onToggleButtonClick: () => void;
|
||||||
|
|
||||||
@@ -258,7 +285,6 @@ class Prejoin extends Component<Props, State> {
|
|||||||
*/
|
*/
|
||||||
render() {
|
render() {
|
||||||
const {
|
const {
|
||||||
joinButtonDisabled,
|
|
||||||
hasJoinByPhoneButton,
|
hasJoinByPhoneButton,
|
||||||
joinConference,
|
joinConference,
|
||||||
joinConferenceWithoutAudio,
|
joinConferenceWithoutAudio,
|
||||||
@@ -272,8 +298,8 @@ class Prejoin extends Component<Props, State> {
|
|||||||
videoTrack
|
videoTrack
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
const { _closeDialog, _onDropdownClose, _onOptionsClick, _setName, _showDialog } = this;
|
const { _closeDialog, _onDropdownClose, _onJoinButtonClick, _onOptionsClick, _setName, _showDialog } = this;
|
||||||
const { showJoinByPhoneButtons } = this.state;
|
const { showJoinByPhoneButtons, showError } = this.state;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PreMeetingScreen
|
<PreMeetingScreen
|
||||||
@@ -294,6 +320,10 @@ class Prejoin extends Component<Props, State> {
|
|||||||
placeHolder = { t('dialog.enterDisplayName') }
|
placeHolder = { t('dialog.enterDisplayName') }
|
||||||
value = { name } />
|
value = { name } />
|
||||||
|
|
||||||
|
{showError && <div
|
||||||
|
className = 'prejoin-error'
|
||||||
|
data-testid = 'prejoin.errorMessage'>{t('prejoin.errorMissingName')}</div>}
|
||||||
|
|
||||||
<div className = 'prejoin-preview-dropdown-container'>
|
<div className = 'prejoin-preview-dropdown-container'>
|
||||||
<InlineDialog
|
<InlineDialog
|
||||||
content = { <div className = 'prejoin-preview-dropdown-btns'>
|
content = { <div className = 'prejoin-preview-dropdown-btns'>
|
||||||
@@ -319,9 +349,8 @@ class Prejoin extends Component<Props, State> {
|
|||||||
isOpen = { showJoinByPhoneButtons }
|
isOpen = { showJoinByPhoneButtons }
|
||||||
onClose = { _onDropdownClose }>
|
onClose = { _onDropdownClose }>
|
||||||
<ActionButton
|
<ActionButton
|
||||||
disabled = { joinButtonDisabled }
|
|
||||||
hasOptions = { true }
|
hasOptions = { true }
|
||||||
onClick = { joinConference }
|
onClick = { _onJoinButtonClick }
|
||||||
onOptionsClick = { _onOptionsClick }
|
onOptionsClick = { _onOptionsClick }
|
||||||
testId = 'prejoin.joinMeeting'
|
testId = 'prejoin.joinMeeting'
|
||||||
type = 'primary'>
|
type = 'primary'>
|
||||||
@@ -383,7 +412,7 @@ class Prejoin extends Component<Props, State> {
|
|||||||
*/
|
*/
|
||||||
function mapStateToProps(state, ownProps): Object {
|
function mapStateToProps(state, ownProps): Object {
|
||||||
const name = getDisplayName(state);
|
const name = getDisplayName(state);
|
||||||
const joinButtonDisabled = isDisplayNameRequired(state) && !name;
|
const showErrorOnJoin = isDisplayNameRequired(state) && !name;
|
||||||
const { showJoinActions } = ownProps;
|
const { showJoinActions } = ownProps;
|
||||||
const isInviteButtonEnabled = isButtonEnabled('invite');
|
const isInviteButtonEnabled = isButtonEnabled('invite');
|
||||||
|
|
||||||
@@ -397,11 +426,11 @@ function mapStateToProps(state, ownProps): Object {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
buttonIsToggled: isPrejoinSkipped(state),
|
buttonIsToggled: isPrejoinSkipped(state),
|
||||||
joinButtonDisabled,
|
|
||||||
name,
|
name,
|
||||||
deviceStatusVisible: isDeviceStatusVisible(state),
|
deviceStatusVisible: isDeviceStatusVisible(state),
|
||||||
roomName: getRoomName(state),
|
roomName: getRoomName(state),
|
||||||
showDialog: isJoinByPhoneDialogVisible(state),
|
showDialog: isJoinByPhoneDialogVisible(state),
|
||||||
|
showErrorOnJoin,
|
||||||
hasJoinByPhoneButton: isJoinByPhoneButtonVisible(state),
|
hasJoinByPhoneButton: isJoinByPhoneButtonVisible(state),
|
||||||
showCameraPreview: !isVideoMutedByUser(state),
|
showCameraPreview: !isVideoMutedByUser(state),
|
||||||
showConferenceInfo,
|
showConferenceInfo,
|
||||||
|
|||||||
Reference in New Issue
Block a user