Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added aria-labels for sliders and checkboxes/DetailsList #2419

Merged
merged 13 commits into from
Nov 21, 2023
1 change: 1 addition & 0 deletions libs/core-ui/src/lib/Cohort/CohortList/CohortList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ export class CohortList extends React.Component<
selectionPreservedOnEmptyClick
checkboxVisibility={CheckboxVisibility.hidden}
onRenderItemColumn={this.renderItemColumn}
ariaLabel={localization.Core.ShiftCohort.cohortList}
/>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ export class CohortBar extends React.Component<
items={this.props.cohorts}
selectionMode={SelectionMode.none}
columns={columns}
ariaLabel={localization.Core.ShiftCohort.cohortList}
/>
</Panel>
))}
Expand Down
2 changes: 1 addition & 1 deletion libs/core-ui/src/lib/Cohort/ShiftCohort/ShiftCohort.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export class ShiftCohort extends React.Component<
maxWidth={1000}
>
<Dropdown
placeholder="Select a cohort"
placeholder={localization.Core.ShiftCohort.selectCohort}
label={localization.Core.ShiftCohort.cohortList}
selectedKey={this.state.selectedCohort}
options={this.state.options}
Expand Down
1 change: 1 addition & 0 deletions libs/counterfactuals/src/lib/CounterfactualList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ export class CounterfactualList extends React.Component<
onRenderItemColumn={this.renderItemColumn}
onRenderRow={this.renderRow}
onRenderDetailsFooter={this.onRenderDetailsFooter}
ariaLabel={localization.Counterfactuals.AriaLabel}
/>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,14 @@ export class AggregateBalanceMeasuresTable extends React.PureComponent<IAggregat
selectionMode={SelectionMode.none}
layoutMode={DetailsListLayoutMode.justified}
checkboxVisibility={CheckboxVisibility.hidden}
ariaLabelForSelectAllCheckbox={
localization.ModelAssessment.ModelOverview.featureConfiguration
.selectAllRowsAriaLabel
}
ariaLabel={
localization.ModelAssessment.ModelOverview.featureConfiguration
.flyoutAriaLabel
}
/>
</Stack.Item>
</Stack>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ export class CohortToolBar extends React.Component<
<Text
className={classNames.errorMessage}
variant="mediumPlus"
aria-label={this.state.errorMessage}
>
{this.state.errorMessage}
</Text>
Expand All @@ -130,10 +131,20 @@ export class CohortToolBar extends React.Component<
<PrimaryButton
onClick={this.addCohortWrapper(true)}
text={localization.InterpretVision.Cohort.saveAndSwitch}
ariaLabel={
this.state.errorMessage
? this.state.errorMessage
: localization.InterpretVision.Cohort.saveAndSwitch
}
/>
<DefaultButton
onClick={this.addCohortWrapper(false)}
text={localization.InterpretVision.Cohort.saveAndClose}
ariaLabel={
this.state.errorMessage
? this.state.errorMessage
: localization.InterpretVision.Cohort.saveAndClose
}
/>
</DialogFooter>
</Stack.Item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ export class TableList extends React.Component<
selection={this._selection}
setKey="set"
onItemInvoked={this.props.selectItem}
ariaLabel={
localization.InterpretVision.Dashboard.tabOptionSecond
}
/>
</MarqueeSelection>
</Stack.Item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export class VisionExplanationDashboardCommon extends React.Component<
min={20}
id="dataExplorerThumbnailSize"
className={this.props.classNames.slider}
ariaLabel={localization.InterpretVision.Dashboard.thumbnailSize}
label={localization.InterpretVision.Dashboard.thumbnailSize}
defaultValue={50}
showValue={false}
Expand Down
5 changes: 5 additions & 0 deletions libs/localization/src/lib/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@
}
},
"Counterfactuals": {
"AriaLabel": "Counterfactual",
"CurrentTreatment": "Current treatment",
"EffectLowerBound": "CI lower",
"EffectOfTreatment": "Effect of recommendation",
Expand Down Expand Up @@ -1915,7 +1916,11 @@
"flyoutHeader": "Choose your features",
"flyoutSubHeader": "Along which features would you like to evaluate your model's fairness?",
"flyoutDescription": "Fairness is evaluated in terms of disparities in your model's behavior. We will split your data according to values of each selected feature, and evaluate how your model's performance metrics differ across these splits.",
"selectAllRowsAriaLabel": "Select all rows",
"flyoutAriaLabel": "Aggregate balance measures",
"featureColumnHeader": "Features",
"featureSelectionAriaLabel": "Feature selection table",
"metricSelectionAriaLabel": "Metric selection table",
"groupsColumnHeader": "Groups",
"categoricalGroupsCountRemark": "This feature has {0} unique values.",
"continuousGroupsCountRemark": "This feature is continuous and split into {0} bins.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export class CohortList extends React.Component<
selectionMode={SelectionMode.none}
checkboxVisibility={CheckboxVisibility.hidden}
onRenderItemColumn={this.renderItemColumn}
ariaLabel={localization.Core.ShiftCohort.cohortList}
/>
{this.state.currentEditCohort && (
<CohortEditor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,14 @@ export class FeatureConfigurationFlyout extends React.Component<
selectionMode={SelectionMode.multiple}
selection={this._selection}
checkboxVisibility={CheckboxVisibility.always}
ariaLabelForSelectAllCheckbox={
localization.ModelAssessment.ModelOverview.featureConfiguration
.selectAllRowsAriaLabel
}
ariaLabel={
localization.ModelAssessment.ModelOverview.featureConfiguration
.featureSelectionAriaLabel
}
/>
</Stack>
</Panel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,14 @@ export class MetricConfigurationFlyout extends React.Component<
selectionMode={SelectionMode.multiple}
selection={this._selection}
checkboxVisibility={CheckboxVisibility.always}
ariaLabelForSelectAllCheckbox={
localization.ModelAssessment.ModelOverview.featureConfiguration
.selectAllRowsAriaLabel
}
ariaLabel={
localization.ModelAssessment.ModelOverview.featureConfiguration
.metricSelectionAriaLabel
}
/>
</Stack>
</Panel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ export class ObjectDetectionWidgets extends React.PureComponent<IObjectDetection
/>
<Slider
id="modelOverviewIoUThreshold"
ariaLabel={
localization.ModelAssessment.ModelOverview.iouThresholdDropdown.name
}
label={
localization.ModelAssessment.ModelOverview.iouThresholdDropdown.name
}
Expand Down
Loading