fix(av-moderation) Fix text on stop video dialog

Show correct text on stop participant's video dialog when moderation is on
This commit is contained in:
Robert Pintilii 2021-11-03 14:16:11 +02:00 committed by GitHub
commit c2e55339d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 38 additions and 10 deletions

View File

@ -268,12 +268,12 @@
"muteEveryoneStartMuted": "Everyone starts muted from now on", "muteEveryoneStartMuted": "Everyone starts muted from now on",
"muteParticipantBody": "You won't be able to unmute them, but they can unmute themselves at any time.", "muteParticipantBody": "You won't be able to unmute them, but they can unmute themselves at any time.",
"muteParticipantButton": "Mute", "muteParticipantButton": "Mute",
"muteParticipantDialog": "Are you sure you want to mute this participant? You won't be able to unmute them, but they can unmute themselves at any time.",
"muteParticipantsVideoDialog": "Are you sure you want to turn off this participant's camera? You won't be able to turn the camera back on, but they can turn it back on at any time.", "muteParticipantsVideoDialog": "Are you sure you want to turn off this participant's camera? You won't be able to turn the camera back on, but they can turn it back on at any time.",
"muteParticipantTitle": "Mute this participant?", "muteParticipantsVideoDialogModerationOn": "Are you sure you want to turn off this participant's camera? You won't be able to turn the camera back on and neither will they.",
"muteParticipantsVideoButton": "Stop video", "muteParticipantsVideoButton": "Stop video",
"muteParticipantsVideoTitle": "Disable camera of this participant?", "muteParticipantsVideoTitle": "Disable camera of this participant?",
"muteParticipantsVideoBody": "You won't be able to turn the camera back on, but they can turn it back on at any time.", "muteParticipantsVideoBody": "You won't be able to turn the camera back on, but they can turn it back on at any time.",
"muteParticipantsVideoBodyModerationOn": "You won't be able to turn the camera back on and neither will they.",
"noDropboxToken": "No valid Dropbox token", "noDropboxToken": "No valid Dropbox token",
"Ok": "OK", "Ok": "OK",
"password": "Password", "password": "Password",

View File

@ -3,6 +3,7 @@
import { Component } from 'react'; import { Component } from 'react';
import { rejectParticipantVideo } from '../../av-moderation/actions'; import { rejectParticipantVideo } from '../../av-moderation/actions';
import { isEnabledFromState } from '../../av-moderation/functions';
import { MEDIA_TYPE } from '../../base/media'; import { MEDIA_TYPE } from '../../base/media';
import { muteRemote } from '../actions'; import { muteRemote } from '../actions';
@ -17,6 +18,11 @@ export type Props = {
*/ */
dispatch: Function, dispatch: Function,
/**
* Whether or not video moderation is on.
*/
isVideoModerationOn: boolean,
/** /**
* The ID of the remote participant to be muted. * The ID of the remote participant to be muted.
*/ */
@ -65,3 +71,17 @@ export default class AbstractMuteRemoteParticipantsVideoDialog<P:Props = Props,
return true; return true;
} }
} }
/**
* Maps (parts of) the redux state to the associated
* {@code AbstractDialogContainer}'s props.
*
* @param {Object} state - The redux state.
* @private
* @returns {Object}
*/
export function abstractMapStateToProps(state: Object) {
return {
isVideoModerationOn: isEnabledFromState(MEDIA_TYPE.VIDEO, state)
};
}

View File

@ -5,8 +5,9 @@ import React from 'react';
import { ConfirmDialog } from '../../../base/dialog'; import { ConfirmDialog } from '../../../base/dialog';
import { translate } from '../../../base/i18n'; import { translate } from '../../../base/i18n';
import { connect } from '../../../base/redux'; import { connect } from '../../../base/redux';
import AbstractMuteRemoteParticipantsVideoDialog import AbstractMuteRemoteParticipantsVideoDialog, {
from '../AbstractMuteRemoteParticipantsVideoDialog'; abstractMapStateToProps
} from '../AbstractMuteRemoteParticipantsVideoDialog';
/** /**
* Dialog to confirm a remote participant's video stop action. * Dialog to confirm a remote participant's video stop action.
@ -21,7 +22,10 @@ class MuteRemoteParticipantsVideoDialog extends AbstractMuteRemoteParticipantsVi
render() { render() {
return ( return (
<ConfirmDialog <ConfirmDialog
contentKey = 'dialog.muteParticipantsVideoDialog' contentKey = { this.props.isVideoModerationOn
? 'dialog.muteParticipantsVideoDialogModerationOn'
: 'dialog.muteParticipantsVideoDialog'
}
onSubmit = { this._onSubmit } /> onSubmit = { this._onSubmit } />
); );
} }
@ -29,4 +33,4 @@ class MuteRemoteParticipantsVideoDialog extends AbstractMuteRemoteParticipantsVi
_onSubmit: () => boolean; _onSubmit: () => boolean;
} }
export default translate(connect()(MuteRemoteParticipantsVideoDialog)); export default translate(connect(abstractMapStateToProps)(MuteRemoteParticipantsVideoDialog));

View File

@ -5,8 +5,9 @@ import React from 'react';
import { Dialog } from '../../../base/dialog'; import { Dialog } from '../../../base/dialog';
import { translate } from '../../../base/i18n'; import { translate } from '../../../base/i18n';
import { connect } from '../../../base/redux'; import { connect } from '../../../base/redux';
import AbstractMuteRemoteParticipantsVideoDialog import AbstractMuteRemoteParticipantsVideoDialog, {
from '../AbstractMuteRemoteParticipantsVideoDialog'; abstractMapStateToProps
} from '../AbstractMuteRemoteParticipantsVideoDialog';
/** /**
* A React Component with the contents for a dialog that asks for confirmation * A React Component with the contents for a dialog that asks for confirmation
@ -29,7 +30,10 @@ class MuteRemoteParticipantsVideoDialog extends AbstractMuteRemoteParticipantsVi
titleKey = 'dialog.muteParticipantsVideoTitle' titleKey = 'dialog.muteParticipantsVideoTitle'
width = 'small'> width = 'small'>
<div> <div>
{ this.props.t('dialog.muteParticipantsVideoBody') } {this.props.t(this.props.isVideoModerationOn
? 'dialog.muteParticipantsVideoBodyModerationOn'
: 'dialog.muteParticipantsVideoBody'
) }
</div> </div>
</Dialog> </Dialog>
); );
@ -38,4 +42,4 @@ class MuteRemoteParticipantsVideoDialog extends AbstractMuteRemoteParticipantsVi
_onSubmit: () => boolean; _onSubmit: () => boolean;
} }
export default translate(connect()(MuteRemoteParticipantsVideoDialog)); export default translate(connect(abstractMapStateToProps)(MuteRemoteParticipantsVideoDialog));