瀏覽代碼

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,14 +21,19 @@ type Props = {
21 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 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,7 +41,7 @@ type Props = {
36 41
  *
37 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 45
     const dispatch = useDispatch();
41 46
     const onClick = useCallback(() => dispatch(action(participant.id)), [ dispatch, participant ]);
42 47
 
@@ -44,6 +49,7 @@ export default function({ action, children, className, testId, participant }: Pr
44 49
         <button
45 50
             className = { className }
46 51
             data-testid = { testId }
52
+            id = { id }
47 53
             onClick = { onClick }
48 54
             type = 'button'>
49 55
             { children }

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

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

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

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

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

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

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

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

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

@@ -161,6 +161,7 @@ export default function ParticipantItem({
161 161
 
162 162
     return (
163 163
         <ParticipantContainer
164
+            id = { `participant-item-${participantID}` }
164 165
             isHighlighted = { isHighlighted }
165 166
             onMouseLeave = { onLeave }
166 167
             trigger = { actionsTrigger }>

Loading…
取消
儲存