浏览代码

feat(av-moderation) id and aria-label updates for av-moderation test (#9592)

* feat(av-moderation) raised hand ask to unmute aria-label

* feat(av-moderation) fixed test

* feat(av-moderation) added id for notification buttons

* feat(av-moderation) fixed lint error

* feat(av-moderation) added id for non raised hand participant

* feat(av-moderation) added extra id naming for ask to unmute button and participant items

* feat(av-moderation) fixed lint errors

* feat(av-moderation) changed id to participantID

* feat(av-moderation) removed semicolon

* squash: Drop unused id for participantItem.

* squash: Drop unused fields for raisedHand.

Co-authored-by: Дамян Минков <damencho@jitsi.org>
factor2
Calinteodor 4 年前
父节点
当前提交
e40d4a48b8
没有帐户链接到提交者的电子邮件

+ 10
- 4
react/features/notifications/components/web/NotificationButton.js 查看文件

21
     className: string,
21
     className: string,
22
 
22
 
23
     /**
23
     /**
24
-     * The `data-testid` used for the button.
24
+     * CSS id of the button.
25
      */
25
      */
26
-    testId: string,
26
+    id?: string,
27
 
27
 
28
     /**
28
     /**
29
      * The participant.
29
      * The participant.
30
      */
30
      */
31
-    participant: Object
31
+    participant: Object,
32
+
33
+    /**
34
+     * The `data-testid` used for the button.
35
+     */
36
+    testId: string
32
 }
37
 }
33
 
38
 
34
 /**
39
 /**
36
  *
41
  *
37
  * @returns {React$Element<'button'>}
42
  * @returns {React$Element<'button'>}
38
  */
43
  */
39
-export default function({ action, children, className, testId, participant }: Props) {
44
+export default function({ action, children, className, participant, id, testId }: Props) {
40
     const dispatch = useDispatch();
45
     const dispatch = useDispatch();
41
     const onClick = useCallback(() => dispatch(action(participant.id)), [ dispatch, participant ]);
46
     const onClick = useCallback(() => dispatch(action(participant.id)), [ dispatch, participant ]);
42
 
47
 
44
         <button
49
         <button
45
             className = { className }
50
             className = { className }
46
             data-testid = { testId }
51
             data-testid = { testId }
52
+            id = { id }
47
             onClick = { onClick }
53
             onClick = { onClick }
48
             type = 'button'>
54
             type = 'button'>
49
             { children }
55
             { children }

+ 2
- 0
react/features/notifications/components/web/NotificationWithParticipants.js 查看文件

80
                     { <NotificationButton
80
                     { <NotificationButton
81
                         action = { onApprove }
81
                         action = { onApprove }
82
                         className = 'primary'
82
                         className = 'primary'
83
+                        id = 'unmute-button'
83
                         participant = { p }
84
                         participant = { p }
84
                         testId = { `${testIdPrefix}.allow` }>
85
                         testId = { `${testIdPrefix}.allow` }>
85
                         { approveButtonText }
86
                         { approveButtonText }
87
                     { <NotificationButton
88
                     { <NotificationButton
88
                         action = { onReject }
89
                         action = { onReject }
89
                         className = 'borderLess'
90
                         className = 'borderLess'
91
+                        id = 'dismiss-button'
90
                         participant = { p }
92
                         participant = { p }
91
                         testId = { `${testIdPrefix}.reject` }>
93
                         testId = { `${testIdPrefix}.reject` }>
92
                         { rejectButtonText }
94
                         { rejectButtonText }

+ 6
- 5
react/features/participants-pane/components/AskToUnmuteButton.js 查看文件

15
     askUnmuteText: string,
15
     askUnmuteText: string,
16
 
16
 
17
     /**
17
     /**
18
-     * Participant id.
18
+     * Participant participantID.
19
      */
19
      */
20
-    id: string
20
+    participantID: string,
21
 }
21
 }
22
 
22
 
23
 /**
23
 /**
26
  * @param {Object} participant - Participant reference.
26
  * @param {Object} participant - Participant reference.
27
  * @returns {React$Element<'button'>}
27
  * @returns {React$Element<'button'>}
28
  */
28
  */
29
-export default function AskToUnmuteButton({ id, askUnmuteText }: Props) {
29
+export default function AskToUnmuteButton({ askUnmuteText, participantID }: Props) {
30
     const dispatch = useDispatch();
30
     const dispatch = useDispatch();
31
     const askToUnmute = useCallback(() => {
31
     const askToUnmute = useCallback(() => {
32
-        dispatch(approveParticipant(id));
33
-    }, [ dispatch, id ]);
32
+        dispatch(approveParticipant(participantID));
33
+    }, [ dispatch, participantID ]);
34
 
34
 
35
     return (
35
     return (
36
         <QuickActionButton
36
         <QuickActionButton
37
+            aria-label = { `unmute-${participantID}` }
37
             onClick = { askToUnmute }
38
             onClick = { askToUnmute }
38
             primary = { true }
39
             primary = { true }
39
             theme = {{
40
             theme = {{

+ 2
- 2
react/features/participants-pane/components/FooterContextMenu.js 查看文件

90
                     </div>
90
                     </div>
91
                     { isModerationEnabled ? (
91
                     { isModerationEnabled ? (
92
                         <ContextMenuItem
92
                         <ContextMenuItem
93
-                            id = 'participants-pane-context-menu-start-moderation'
93
+                            id = 'participants-pane-context-menu-stop-moderation'
94
                             onClick = { disable }>
94
                             onClick = { disable }>
95
                             <span className = { classes.paddedAction }>
95
                             <span className = { classes.paddedAction }>
96
                                 { t('participantsPane.actions.startModeration') }
96
                                 { t('participantsPane.actions.startModeration') }
98
                         </ContextMenuItem>
98
                         </ContextMenuItem>
99
                     ) : (
99
                     ) : (
100
                         <ContextMenuItem
100
                         <ContextMenuItem
101
-                            id = 'participants-pane-context-menu-stop-moderation'
101
+                            id = 'participants-pane-context-menu-start-moderation'
102
                             onClick = { enable }>
102
                             onClick = { enable }>
103
                             <Icon
103
                             <Icon
104
                                 size = { 20 }
104
                                 size = { 20 }

+ 9
- 1
react/features/participants-pane/components/ParticipantQuickAction.js 查看文件

9
 
9
 
10
 type Props = {
10
 type Props = {
11
 
11
 
12
+    /**
13
+     * The translated ask unmute aria label.
14
+     */
15
+    ariaLabel?: boolean,
16
+
12
     /**
17
     /**
13
      * The translated "ask unmute" text.
18
      * The translated "ask unmute" text.
14
      */
19
      */
24
      */
29
      */
25
     muteAudio: Function,
30
     muteAudio: Function,
26
 
31
 
32
+    /**
33
+     * Label for mute participant button.
34
+     */
27
     muteParticipantButtonText: string,
35
     muteParticipantButtonText: string,
28
 
36
 
29
     /**
37
     /**
59
         return (
67
         return (
60
             <AskToUnmuteButton
68
             <AskToUnmuteButton
61
                 askUnmuteText = { askUnmuteText }
69
                 askUnmuteText = { askUnmuteText }
62
-                id = { participantID } />
70
+                participantID = { participantID } />
63
         );
71
         );
64
     }
72
     }
65
     default: {
73
     default: {

+ 1
- 0
react/features/participants-pane/components/web/ParticipantItem.js 查看文件

161
 
161
 
162
     return (
162
     return (
163
         <ParticipantContainer
163
         <ParticipantContainer
164
+            id = { `participant-item-${participantID}` }
164
             isHighlighted = { isHighlighted }
165
             isHighlighted = { isHighlighted }
165
             onMouseLeave = { onLeave }
166
             onMouseLeave = { onLeave }
166
             trigger = { actionsTrigger }>
167
             trigger = { actionsTrigger }>

正在加载...
取消
保存