소스 검색

feat(prejoin) allow disabling prejoin display name editing (#11575)

master
Avram Tudor 3 년 전
부모
커밋
0c44b9a478
No account linked to committer's email address
5개의 변경된 파일66개의 추가작업 그리고 8개의 파일을 삭제
  1. 5
    0
      config.js
  2. 13
    0
      css/premeeting/_prejoin.scss
  3. 1
    0
      react/features/base/config/configWhitelist.js
  4. 37
    8
      react/features/prejoin/components/Prejoin.js
  5. 10
    0
      react/features/prejoin/functions.js

+ 5
- 0
config.js 파일 보기

@@ -495,6 +495,11 @@ var config = {
495 495
     // Hides add breakout room button
496 496
     // hideAddRoomButton: false,
497 497
 
498
+    // Hides the participant name editing field in the prejoin screen.
499
+    // If requireDisplayName is also set as true, a name should still be provided through
500
+    // either the jwt or the userInfo from the iframe api init object in order for this to have an effect.
501
+    // hidePrejoinDisplayName: false,
502
+
498 503
     // Require users to always specify a display name.
499 504
     // requireDisplayName: true,
500 505
 

+ 13
- 0
css/premeeting/_prejoin.scss 파일 보기

@@ -3,6 +3,19 @@
3 3
         width: 100%;
4 4
     }
5 5
 
6
+    &-avatar {
7
+        margin: 8px auto 16px;
8
+
9
+        &-name {
10
+            color: white;
11
+            font-size: 16px;
12
+            font-weight: 600;
13
+            line-height: 26px;
14
+            margin-bottom: 32px;
15
+            text-align: center;
16
+        }
17
+    }
18
+
6 19
     &-error {
7 20
         background-color: #E04757;
8 21
         border-radius: 6px;

+ 1
- 0
react/features/base/config/configWhitelist.js 파일 보기

@@ -169,6 +169,7 @@ export default [
169 169
     'hideConferenceSubject',
170 170
     'hideDisplayName',
171 171
     'hideDominantSpeakerBadge',
172
+    'hidePrejoinDisplayName',
172 173
     'hideRecordingLabel',
173 174
     'hideParticipantsStats',
174 175
     'hideConferenceTimer',

+ 37
- 8
react/features/prejoin/components/Prejoin.js 파일 보기

@@ -3,11 +3,13 @@
3 3
 import InlineDialog from '@atlaskit/inline-dialog';
4 4
 import React, { Component } from 'react';
5 5
 
6
+import { Avatar } from '../../base/avatar';
6 7
 import { getRoomName } from '../../base/conference';
7 8
 import { isNameReadOnly } from '../../base/config';
8 9
 import { translate } from '../../base/i18n';
9 10
 import { IconArrowDown, IconArrowUp, IconPhone, IconVolumeOff } from '../../base/icons';
10 11
 import { isVideoMutedByUser } from '../../base/media';
12
+import { getLocalParticipant } from '../../base/participants';
11 13
 import { ActionButton, InputField, PreMeetingScreen } from '../../base/premeeting';
12 14
 import { connect } from '../../base/redux';
13 15
 import { getDisplayName, updateSettings } from '../../base/settings';
@@ -21,7 +23,8 @@ import {
21 23
     isDeviceStatusVisible,
22 24
     isDisplayNameRequired,
23 25
     isJoinByPhoneButtonVisible,
24
-    isJoinByPhoneDialogVisible
26
+    isJoinByPhoneDialogVisible,
27
+    isPrejoinDisplayNameVisible
25 28
 } from '../functions';
26 29
 
27 30
 import DropdownButton from './DropdownButton';
@@ -29,6 +32,11 @@ import JoinByPhoneDialog from './dialogs/JoinByPhoneDialog';
29 32
 
30 33
 type Props = {
31 34
 
35
+    /**
36
+     * Indicates whether the display  name is editable.
37
+     */
38
+    canEditDisplayName: boolean,
39
+
32 40
     /**
33 41
      * Flag signaling if the device status is visible or not.
34 42
      */
@@ -59,6 +67,11 @@ type Props = {
59 67
      */
60 68
     updateSettings: Function,
61 69
 
70
+    /**
71
+     * Local participant id.
72
+     */
73
+    participantId: string,
74
+
62 75
     /**
63 76
      * The prejoin config.
64 77
      */
@@ -145,6 +158,8 @@ class Prejoin extends Component<Props, State> {
145 158
         this._showDialogKeyPress = this._showDialogKeyPress.bind(this);
146 159
         this._onJoinKeyPress = this._onJoinKeyPress.bind(this);
147 160
         this._getExtraJoinButtons = this._getExtraJoinButtons.bind(this);
161
+
162
+        this.showDisplayNameField = props.canEditDisplayName || props.showErrorOnJoin;
148 163
     }
149 164
     _onJoinButtonClick: () => void;
150 165
 
@@ -330,6 +345,7 @@ class Prejoin extends Component<Props, State> {
330 345
             joinConference,
331 346
             joinConferenceWithoutAudio,
332 347
             name,
348
+            participantId,
333 349
             prejoinConfig,
334 350
             readOnlyName,
335 351
             showCameraPreview,
@@ -360,7 +376,7 @@ class Prejoin extends Component<Props, State> {
360 376
                 <div
361 377
                     className = 'prejoin-input-area'
362 378
                     data-testid = 'prejoin.screen'>
363
-                    <InputField
379
+                    {this.showDisplayNameField ? (<InputField
364 380
                         autoComplete = { 'name' }
365 381
                         autoFocus = { true }
366 382
                         className = { showError ? 'error' : '' }
@@ -370,6 +386,16 @@ class Prejoin extends Component<Props, State> {
370 386
                         placeHolder = { t('dialog.enterDisplayName') }
371 387
                         readOnly = { readOnlyName }
372 388
                         value = { name } />
389
+                    ) : (
390
+                        <>
391
+                            <Avatar
392
+                                className = 'prejoin-avatar'
393
+                                displayName = { name }
394
+                                participantId = { participantId }
395
+                                size = { 72 } />
396
+                            <div className = 'prejoin-avatar-name'>{name}</div>
397
+                        </>
398
+                    )}
373 399
 
374 400
                     {showError && <div
375 401
                         className = 'prejoin-error'
@@ -423,18 +449,21 @@ class Prejoin extends Component<Props, State> {
423 449
 function mapStateToProps(state): Object {
424 450
     const name = getDisplayName(state);
425 451
     const showErrorOnJoin = isDisplayNameRequired(state) && !name;
452
+    const { id: participantId } = getLocalParticipant(state);
426 453
 
427 454
     return {
428
-        name,
455
+        canEditDisplayName: isPrejoinDisplayNameVisible(state),
429 456
         deviceStatusVisible: isDeviceStatusVisible(state),
430
-        roomName: getRoomName(state),
431
-        showDialog: isJoinByPhoneDialogVisible(state),
432
-        showErrorOnJoin,
433 457
         hasJoinByPhoneButton: isJoinByPhoneButtonVisible(state),
458
+        name,
459
+        participantId,
460
+        prejoinConfig: state['features/base/config'].prejoinConfig,
434 461
         readOnlyName: isNameReadOnly(state),
462
+        roomName: getRoomName(state),
435 463
         showCameraPreview: !isVideoMutedByUser(state),
436
-        videoTrack: getLocalJitsiVideoTrack(state),
437
-        prejoinConfig: state['features/base/config'].prejoinConfig
464
+        showDialog: isJoinByPhoneDialogVisible(state),
465
+        showErrorOnJoin,
466
+        videoTrack: getLocalJitsiVideoTrack(state)
438 467
     };
439 468
 }
440 469
 

+ 10
- 0
react/features/prejoin/functions.js 파일 보기

@@ -36,6 +36,16 @@ export function isDisplayNameRequired(state: Object): boolean {
36 36
         || state['features/base/config'].requireDisplayName;
37 37
 }
38 38
 
39
+/**
40
+ * Selector for determining if the prejoin display name field is visible.
41
+ *
42
+ * @param {Object} state - The state of the app.
43
+ * @returns {boolean}
44
+ */
45
+export function isPrejoinDisplayNameVisible(state: Object): boolean {
46
+    return !state['features/base/config'].hidePrejoinDisplayName;
47
+}
48
+
39 49
 /**
40 50
  * Returns the text for the prejoin status bar.
41 51
  *

Loading…
취소
저장