Explorar el Código

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

Show correct text on stop participant's video dialog when moderation is on
master
robertpin hace 3 años
padre
commit
21d5b7bcd6

+ 2
- 2
lang/main.json Ver fichero

@@ -268,12 +268,12 @@
268 268
         "muteEveryoneStartMuted": "Everyone starts muted from now on",
269 269
         "muteParticipantBody": "You won't be able to unmute them, but they can unmute themselves at any time.",
270 270
         "muteParticipantButton": "Mute",
271
-        "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.",
272 271
         "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.",
273
-        "muteParticipantTitle": "Mute this participant?",
272
+        "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.",
274 273
         "muteParticipantsVideoButton": "Stop video",
275 274
         "muteParticipantsVideoTitle": "Disable camera of this participant?",
276 275
         "muteParticipantsVideoBody": "You won't be able to turn the camera back on, but they can turn it back on at any time.",
276
+        "muteParticipantsVideoBodyModerationOn": "You won't be able to turn the camera back on and neither will they.",
277 277
         "noDropboxToken": "No valid Dropbox token",
278 278
         "Ok": "OK",
279 279
         "password": "Password",

+ 20
- 0
react/features/video-menu/components/AbstractMuteRemoteParticipantsVideoDialog.js Ver fichero

@@ -3,6 +3,7 @@
3 3
 import { Component } from 'react';
4 4
 
5 5
 import { rejectParticipantVideo } from '../../av-moderation/actions';
6
+import { isEnabledFromState } from '../../av-moderation/functions';
6 7
 import { MEDIA_TYPE } from '../../base/media';
7 8
 import { muteRemote } from '../actions';
8 9
 
@@ -17,6 +18,11 @@ export type Props = {
17 18
      */
18 19
     dispatch: Function,
19 20
 
21
+    /**
22
+     * Whether or not video moderation is on.
23
+     */
24
+    isVideoModerationOn: boolean,
25
+
20 26
     /**
21 27
      * The ID of the remote participant to be muted.
22 28
      */
@@ -65,3 +71,17 @@ export default class AbstractMuteRemoteParticipantsVideoDialog<P:Props = Props,
65 71
         return true;
66 72
     }
67 73
 }
74
+
75
+/**
76
+ * Maps (parts of) the redux state to the associated
77
+ * {@code AbstractDialogContainer}'s props.
78
+ *
79
+ * @param {Object} state - The redux state.
80
+ * @private
81
+ * @returns {Object}
82
+ */
83
+export function abstractMapStateToProps(state: Object) {
84
+    return {
85
+        isVideoModerationOn: isEnabledFromState(MEDIA_TYPE.VIDEO, state)
86
+    };
87
+}

+ 8
- 4
react/features/video-menu/components/native/MuteRemoteParticipantsVideoDialog.js Ver fichero

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

+ 8
- 4
react/features/video-menu/components/web/MuteRemoteParticipantsVideoDialog.js Ver fichero

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

Loading…
Cancelar
Guardar