Skip to content

Commit 82be70d

Browse files
committed
Add ARIA labels to various unlabelled mock dropdowns
1 parent f0d0195 commit 82be70d

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

src/components/mock/handler-selection.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ export const HandlerSelector = inject('rulesStore', 'accountStore')(observer((p:
184184
ruleType: RuleType,
185185
availableHandlers: Array<HandlerClass>,
186186
value: Handler,
187+
handlerIndex: number,
187188
onChange: (handler: Handler) => void
188189
}) => {
189190
let [ allowedHandlers, needProHandlers ] = _.partition(
@@ -197,6 +198,11 @@ export const HandlerSelector = inject('rulesStore', 'accountStore')(observer((p:
197198
);
198199

199200
return <HandlerSelect
201+
aria-label={
202+
p.handlerIndex === 0
203+
? "Select how matching requests should be handled"
204+
: "Select the next step in how matching requests should be handled"
205+
}
200206
value={getHandlerKey(p.value)}
201207
onChange={(event) => {
202208
const handlerKey = event.target.value as AvailableHandlerKey;

src/components/mock/matcher-selection.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ export const InitialMatcherRow = React.forwardRef((p: {
8181
return <MatcherRow>
8282
<MatcherInputsContainer>
8383
<Select
84+
aria-label="Select the base matcher for this rule"
8485
ref={ref}
8586
value={getMatcherKey(p.matcher)}
8687
onChange={(event) => {
@@ -235,6 +236,7 @@ export class NewMatcherRow extends React.Component<{
235236
return <MatcherRow>
236237
<MatcherInputsContainer>
237238
<Select
239+
aria-label="Select another type of matcher to add to this rule"
238240
onChange={this.selectMatcher}
239241
value={getMatcherKey(matcherClass) ?? ''}
240242
ref={this.dropdownRef}
@@ -267,6 +269,7 @@ export class NewMatcherRow extends React.Component<{
267269
</MatcherInputsContainer>
268270

269271
<MatcherButton
272+
aria-label="Add this matcher to the rule"
270273
disabled={!draftMatchers.length || invalidMatcherState}
271274
onClick={saveMatcher}
272275
>

src/components/mock/mock-rule-row.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,8 @@ class HandlerStepSection extends React.Component<{
707707
getPro,
708708
ruleType,
709709
availableHandlers,
710-
handler
710+
handler,
711+
handlerIndex
711712
} = this.props;
712713

713714
const shownHandler = this.demoHandler ?? handler;
@@ -722,6 +723,7 @@ class HandlerStepSection extends React.Component<{
722723
ruleType={ruleType}
723724
onChange={this.updateHandler}
724725
availableHandlers={availableHandlers}
726+
handlerIndex={handlerIndex}
725727
/>
726728

727729
{ isHandlerDemo

0 commit comments

Comments
 (0)