Kaynağa Gözat

feat(prejoin) show error when trying to join and name is required

master
Tudor-Ovidiu Avram 4 yıl önce
ebeveyn
işleme
10c2652a4f
4 değiştirilmiş dosya ile 53 ekleme ve 12 silme
  1. 1
    0
      .gitignore
  2. 10
    0
      css/_prejoin.scss
  3. 1
    0
      lang/main.json
  4. 41
    12
      react/features/prejoin/components/Prejoin.js

+ 1
- 0
.gitignore Dosyayı Görüntüle

84
 ios/app/dropbox.key
84
 ios/app/dropbox.key
85
 ios/app/GoogleService-Info.plist
85
 ios/app/GoogleService-Info.plist
86
 
86
 
87
+.vscode

+ 10
- 0
css/_prejoin.scss Dosyayı Görüntüle

39
         margin-bottom: 14px;
39
         margin-bottom: 14px;
40
         width: 100%;
40
         width: 100%;
41
     }
41
     }
42
+
43
+    &-error {
44
+        color: white;
45
+        background-color: rgba(229, 75, 75, 0.5);
46
+        width: 100%;
47
+        padding: 3px;
48
+        margin-top: 4px;
49
+        font-size: 13px;
50
+        text-align: center;
51
+    }
42
 }
52
 }
43
 
53
 
44
 @mixin name-placeholder {
54
 @mixin name-placeholder {

+ 1
- 0
lang/main.json Dosyayı Görüntüle

520
         "errorDialOutDisconnected": "Could not dial out. Disconnected",
520
         "errorDialOutDisconnected": "Could not dial out. Disconnected",
521
         "errorDialOutFailed": "Could not dial out. Call failed",
521
         "errorDialOutFailed": "Could not dial out. Call failed",
522
         "errorDialOutStatus": "Error getting dial out status",
522
         "errorDialOutStatus": "Error getting dial out status",
523
+        "errorMissingName": "Please enter your name to join the meeting",
523
         "errorStatusCode": "Error dialing out, status code: {{status}}",
524
         "errorStatusCode": "Error dialing out, status code: {{status}}",
524
         "errorValidation": "Number validation failed",
525
         "errorValidation": "Number validation failed",
525
         "iWantToDialIn": "I want to dial in",
526
         "iWantToDialIn": "I want to dial in",

+ 41
- 12
react/features/prejoin/components/Prejoin.js Dosyayı Görüntüle

48
      */
48
      */
49
     hasJoinByPhoneButton: boolean,
49
     hasJoinByPhoneButton: boolean,
50
 
50
 
51
-    /**
52
-     * If join button is disabled or not.
53
-     */
54
-    joinButtonDisabled: boolean,
55
-
56
     /**
51
     /**
57
      * Joins the current meeting.
52
      * Joins the current meeting.
58
      */
53
      */
98
      */
93
      */
99
     showCameraPreview: boolean,
94
     showCameraPreview: boolean,
100
 
95
 
96
+    /**
97
+     * If should show an error when joining without a name.
98
+     */
99
+    showErrorOnJoin: boolean,
100
+
101
     /**
101
     /**
102
      * Flag signaling the visibility of join label, input and buttons
102
      * Flag signaling the visibility of join label, input and buttons
103
      */
103
      */
131
 
131
 
132
 type State = {
132
 type State = {
133
 
133
 
134
+    /**
135
+     * Flag controlling the visibility of the error label.
136
+     */
137
+    showError: boolean,
138
+
134
     /**
139
     /**
135
      * Flag controlling the visibility of the 'join by phone' buttons.
140
      * Flag controlling the visibility of the 'join by phone' buttons.
136
      */
141
      */
161
         super(props);
166
         super(props);
162
 
167
 
163
         this.state = {
168
         this.state = {
169
+            showError: false,
164
             showJoinByPhoneButtons: false
170
             showJoinByPhoneButtons: false
165
         };
171
         };
166
 
172
 
167
         this._closeDialog = this._closeDialog.bind(this);
173
         this._closeDialog = this._closeDialog.bind(this);
168
         this._showDialog = this._showDialog.bind(this);
174
         this._showDialog = this._showDialog.bind(this);
175
+        this._onJoinButtonClick = this._onJoinButtonClick.bind(this);
169
         this._onToggleButtonClick = this._onToggleButtonClick.bind(this);
176
         this._onToggleButtonClick = this._onToggleButtonClick.bind(this);
170
         this._onDropdownClose = this._onDropdownClose.bind(this);
177
         this._onDropdownClose = this._onDropdownClose.bind(this);
171
         this._onOptionsClick = this._onOptionsClick.bind(this);
178
         this._onOptionsClick = this._onOptionsClick.bind(this);
172
         this._setName = this._setName.bind(this);
179
         this._setName = this._setName.bind(this);
173
     }
180
     }
181
+    _onJoinButtonClick: () => void;
182
+
183
+    /**
184
+     * Handler for the join button.
185
+     *
186
+     * @param {Object} e - The synthetic event.
187
+     * @returns {void}
188
+     */
189
+    _onJoinButtonClick() {
190
+        if (this.props.showErrorOnJoin) {
191
+            this.setState({
192
+                showError: true
193
+            });
194
+
195
+            return;
196
+        }
197
+
198
+        this.setState({ showError: false });
199
+        this.props.joinConference();
200
+    }
174
 
201
 
175
     _onToggleButtonClick: () => void;
202
     _onToggleButtonClick: () => void;
176
 
203
 
258
      */
285
      */
259
     render() {
286
     render() {
260
         const {
287
         const {
261
-            joinButtonDisabled,
262
             hasJoinByPhoneButton,
288
             hasJoinByPhoneButton,
263
             joinConference,
289
             joinConference,
264
             joinConferenceWithoutAudio,
290
             joinConferenceWithoutAudio,
272
             videoTrack
298
             videoTrack
273
         } = this.props;
299
         } = this.props;
274
 
300
 
275
-        const { _closeDialog, _onDropdownClose, _onOptionsClick, _setName, _showDialog } = this;
276
-        const { showJoinByPhoneButtons } = this.state;
301
+        const { _closeDialog, _onDropdownClose, _onJoinButtonClick, _onOptionsClick, _setName, _showDialog } = this;
302
+        const { showJoinByPhoneButtons, showError } = this.state;
277
 
303
 
278
         return (
304
         return (
279
             <PreMeetingScreen
305
             <PreMeetingScreen
294
                                 placeHolder = { t('dialog.enterDisplayName') }
320
                                 placeHolder = { t('dialog.enterDisplayName') }
295
                                 value = { name } />
321
                                 value = { name } />
296
 
322
 
323
+                            {showError && <div
324
+                                className = 'prejoin-error'
325
+                                data-testid = 'prejoin.errorMessage'>{t('prejoin.errorMissingName')}</div>}
326
+
297
                             <div className = 'prejoin-preview-dropdown-container'>
327
                             <div className = 'prejoin-preview-dropdown-container'>
298
                                 <InlineDialog
328
                                 <InlineDialog
299
                                     content = { <div className = 'prejoin-preview-dropdown-btns'>
329
                                     content = { <div className = 'prejoin-preview-dropdown-btns'>
319
                                     isOpen = { showJoinByPhoneButtons }
349
                                     isOpen = { showJoinByPhoneButtons }
320
                                     onClose = { _onDropdownClose }>
350
                                     onClose = { _onDropdownClose }>
321
                                     <ActionButton
351
                                     <ActionButton
322
-                                        disabled = { joinButtonDisabled }
323
                                         hasOptions = { true }
352
                                         hasOptions = { true }
324
-                                        onClick = { joinConference }
353
+                                        onClick = { _onJoinButtonClick }
325
                                         onOptionsClick = { _onOptionsClick }
354
                                         onOptionsClick = { _onOptionsClick }
326
                                         testId = 'prejoin.joinMeeting'
355
                                         testId = 'prejoin.joinMeeting'
327
                                         type = 'primary'>
356
                                         type = 'primary'>
383
  */
412
  */
384
 function mapStateToProps(state, ownProps): Object {
413
 function mapStateToProps(state, ownProps): Object {
385
     const name = getDisplayName(state);
414
     const name = getDisplayName(state);
386
-    const joinButtonDisabled = isDisplayNameRequired(state) && !name;
415
+    const showErrorOnJoin = isDisplayNameRequired(state) && !name;
387
     const { showJoinActions } = ownProps;
416
     const { showJoinActions } = ownProps;
388
     const isInviteButtonEnabled = isButtonEnabled('invite');
417
     const isInviteButtonEnabled = isButtonEnabled('invite');
389
 
418
 
397
 
426
 
398
     return {
427
     return {
399
         buttonIsToggled: isPrejoinSkipped(state),
428
         buttonIsToggled: isPrejoinSkipped(state),
400
-        joinButtonDisabled,
401
         name,
429
         name,
402
         deviceStatusVisible: isDeviceStatusVisible(state),
430
         deviceStatusVisible: isDeviceStatusVisible(state),
403
         roomName: getRoomName(state),
431
         roomName: getRoomName(state),
404
         showDialog: isJoinByPhoneDialogVisible(state),
432
         showDialog: isJoinByPhoneDialogVisible(state),
433
+        showErrorOnJoin,
405
         hasJoinByPhoneButton: isJoinByPhoneButtonVisible(state),
434
         hasJoinByPhoneButton: isJoinByPhoneButtonVisible(state),
406
         showCameraPreview: !isVideoMutedByUser(state),
435
         showCameraPreview: !isVideoMutedByUser(state),
407
         showConferenceInfo,
436
         showConferenceInfo,

Loading…
İptal
Kaydet