Skip to content

Commit

Permalink
added aria-labels to dropdowns
Browse files Browse the repository at this point in the history
  • Loading branch information
Advitya17 committed Nov 14, 2023
1 parent f726163 commit 36119ac
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions libs/core-ui/src/lib/Cohort/ShiftCohort/ShiftCohort.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ export class ShiftCohort extends React.Component<
options={this.state.options}
styles={dropdownStyles}
onChange={this.onChange}
ariaLabel="Cohort list"
/>
<CohortStats
temporaryCohort={this.state.savedCohorts[this.state.selectedCohort]}
Expand Down
3 changes: 3 additions & 0 deletions libs/core-ui/src/lib/components/OverallMetricChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ export class OverallMetricChart extends React.PureComponent<
selectedKey={this.state.selectedCohortIndex}
onChange={this.setSelectedCohort}
id={"modelPerformanceCohortPicker"}
ariaLabel={
localization.Interpret.DatasetExplorer.datasetCohortDropdown
}
/>
</div>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ export class FeatureBalanceMeasuresChart extends React.PureComponent<
options={labelOptions}
selectedKey={this.state.selectedLabelIndex}
onChange={this.setSelectedLabel}
ariaLabel="Positive label dropdown"
/>
</Stack.Item>
</Stack>
Expand All @@ -135,6 +136,7 @@ export class FeatureBalanceMeasuresChart extends React.PureComponent<
options={featureOptions}
selectedKey={this.state.selectedFeatureIndex}
onChange={this.setSelectedFeature}
ariaLabel="Feature dropdown"
/>
</Stack.Item>
</Stack>
Expand All @@ -153,6 +155,7 @@ export class FeatureBalanceMeasuresChart extends React.PureComponent<
options={measureOptions}
selectedKey={this.state.selectedMeasureIndex}
onChange={this.setSelectedMeasure}
ariaLabel="Measure dropdown"
/>
</Stack.Item>
</Stack>
Expand Down
3 changes: 3 additions & 0 deletions libs/fairness/src/lib/Controls/DropdownBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export class DropdownBar extends React.PureComponent<IDropdownBarProps> {
options={featureOptions}
disabled={false}
onChange={this.props.parentFeatureChanged}
ariaLabel="Sensitive feature dropdown"
/>
<Dropdown
id="performanceMetricDropdown"
Expand All @@ -67,6 +68,7 @@ export class DropdownBar extends React.PureComponent<IDropdownBarProps> {
options={performanceDropDown}
disabled={false}
onChange={this.props.parentPerformanceChanged}
ariaLabel="Performance metric dropdown"
/>
<Dropdown
style={{ minWidth: "240px" }}
Expand All @@ -78,6 +80,7 @@ export class DropdownBar extends React.PureComponent<IDropdownBarProps> {
options={fairnessDropdown}
disabled={false}
onChange={this.props.parentFairnessChanged}
ariaLabel="Fairness metric dropdown"
/>
</Stack>
);
Expand Down
1 change: 1 addition & 0 deletions libs/fairness/src/lib/Controls/ReportChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ export class ReportChart extends React.Component<IReportChartProps, IState> {
options={displayOptions}
disabled={false}
onChange={this.onChange}
ariaLabel="Chart selection dropdown"
/>
{this.state.chartKey === performanceKey && (
<PerformancePlot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ export class DataCharacteristics extends React.Component<
options={this.state.labelTypeDropdownOptions}
selectedKey={this.state.labelType}
onChange={this.onLabelTypeChange}
ariaLabel="Label type dropdown"
/>
</Stack.Item>
<Stack.Item>
Expand All @@ -118,6 +119,7 @@ export class DataCharacteristics extends React.Component<
}
onChange={this.onLabelVisibilitySelect}
multiSelect
ariaLabel="Label visibility dropdown"
/>
</Stack.Item>
</Stack>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export class PageSizeSelectors extends React.Component<IPageSizeSelectorsProps>
defaultSelectedKey="3"
options={NumRowsOptions}
onChange={this.props.onNumRowsSelect}
ariaLabel="Number of rows per page"
/>
</Stack.Item>
</Stack>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,12 @@ export class AddTabButton extends React.Component<
<Dropdown
options={this.props.availableTabs}
onChange={this.onChange}
ariaLabel="Add dashboard component"
/>
<PrimaryButton
onClick={this.addTab}
text={localization.ModelAssessment.AddingTab.AddButtonText}
ariaLabel="Add dashboard button"
/>
</Stack>
</Callout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ export class ShiftCohort extends React.Component<
selectedKey={this.state.selectedCohort}
options={this.state.options}
onChange={this.onChange}
ariaLabel="Time series selection dropdown"
/>
<CohortEditorFilterList
compositeFilters={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ export class ChartConfigurationFlyout extends React.Component<
.chartConfigDatasetCohortSelectionPlaceholder
}
disabled={!this.state.datasetCohortViewIsNewlySelected}
ariaLabel="Dataset cohort dropdown"
/>
{this.props.featureBasedCohorts.length > 0 && (
<Dropdown
Expand All @@ -250,6 +251,7 @@ export class ChartConfigurationFlyout extends React.Component<
.chartConfigFeatureBasedCohortSelectionPlaceholder
}
disabled={this.state.datasetCohortViewIsNewlySelected}
ariaLabel="Feature cohort dropdown"
/>
)}
</Stack>
Expand Down

0 comments on commit 36119ac

Please sign in to comment.