Skip to content

Commit

Permalink
Remove unnecessary aria labels
Browse files Browse the repository at this point in the history
Signed-off-by: abbyhu2000 <[email protected]>
  • Loading branch information
abbyhu2000 committed Jun 7, 2024
1 parent 3400e2a commit 96c2781
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 43 deletions.
1 change: 1 addition & 0 deletions docs/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@
- [Opensearch dashboards.release notes 1.3.13](../release-notes/opensearch-dashboards.release-notes-1.3.13.md)
- [Opensearch dashboards.release notes 1.3.14](../release-notes/opensearch-dashboards.release-notes-1.3.14.md)
- [Opensearch dashboards.release notes 1.3.15](../release-notes/opensearch-dashboards.release-notes-1.3.15.md)
- [Opensearch dashboards.release notes 1.3.17](../release-notes/opensearch-dashboards.release-notes-1.3.17.md)
- [Opensearch dashboards.release notes 1.3.2](../release-notes/opensearch-dashboards.release-notes-1.3.2.md)
- [Opensearch dashboards.release notes 1.3.3](../release-notes/opensearch-dashboards.release-notes-1.3.3.md)
- [Opensearch dashboards.release notes 1.3.5](../release-notes/opensearch-dashboards.release-notes-1.3.5.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function LegacyQueryLanguageSwitcher(props: Props) {
className="euiFormControlLayout__append dqlQueryBar__languageSwitcherButton"
data-test-subj={'switchQueryLanguageButton'}
aria-label={i18n.translate('data.query.queryBar.switchQueryLanguageButtonLabel', {
defaultMessage: 'Query language switch button',
defaultMessage: 'Change query language',
})}
>
{props.language === 'lucene' ? luceneLabel : dqlLabel}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ export default function QueryBarTopRow(props: QueryBarTopRowProps) {
onClick={onClickSubmitButton}
data-test-subj="querySubmitButton"
aria-label={i18n.translate('data.query.queryBar.querySubmitButtonLabel', {
defaultMessage: 'Submit query button',
defaultMessage: 'Submit query',
})}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,6 @@ export const DataGridTable = ({
data-title={title}
data-description={description}
data-test-subj="discoverTable"
aria-label={i18n.translate('discover.dataGrid.discoverTableLabel', {
defaultMessage: 'Discover table',
})}
className="eui-xScrollWithShadows"
>
<EuiPanel hasBorder={false} hasShadow={false} {...tablePanelProps}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,21 +72,12 @@ const TableCellUI = ({
);

return isTimeField ? (
<td
data-test-subj="docTableField"
aria-label={i18n.translate('discover.defaultTable.docTableFieldLabel', {
defaultMessage: 'Discover table field',
})}
className="osdDocTableCell eui-textNoWrap"
>
<td data-test-subj="docTableField" className="osdDocTableCell eui-textNoWrap">
{content}
</td>
) : (
<td
data-test-subj="docTableField"
aria-label={i18n.translate('discover.defaultTable.docTableFieldLabel', {
defaultMessage: 'Discover table field',
})}
className="osdDocTableCell eui-textBreakAll eui-textBreakWord"
>
<div className="osdDocTable__limitedHeight">{content}</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import './_table_header.scss';

import { i18n } from '@osd/i18n';
import React from 'react';
import { IndexPattern } from '../../../opensearch_dashboards_services';
import { TableHeaderColumn } from './table_header_column';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,15 @@ export function TableHeaderColumn({
];

return (
<th data-test-subj="docTableHeaderField" className="docTableHeaderField">
<span
data-test-subj={`docTableHeader-${name}`}
aria-label={i18n.translate('discover.defaultTable.docTableHeaderLabel', {
defaultMessage: `Discover table column: ${name}`,
})}
>
<th
data-test-subj="docTableHeaderField"
className="docTableHeaderField"
role="columnheader"
aria-label={i18n.translate('discover.defaultTable.docTableHeaderLabel', {
defaultMessage: `Discover table column: ${name}`,
})}
>
<span data-test-subj={`docTableHeader-${name}`}>
{displayName}
{buttons
.filter((button) => button.active)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const TableRowUI = ({
onClick={handleExpanding}
iconType={isExpanded ? 'arrowDown' : 'arrowRight'}
aria-label={i18n.translate('discover.defaultTable.docTableExpandToggleColumnLabel', {
defaultMessage: `Toggle for expanding row details`,
defaultMessage: `Toggle row details`,
})}
data-test-subj="docTableExpandToggleColumn"
/>
Expand Down Expand Up @@ -144,10 +144,6 @@ const TableRowUI = ({
</EuiFlexItem>
<EuiFlexItem>
<h4
data-test-subj="docTableRowDetailsTitle"
aria-label={i18n.translate('discover.defaultTable.docTableRowDetailsTitleLabel', {
defaultMessage: 'Discover table row details',
})}
className="euiTitle euiTitle--xsmall"
i18n-id="discover.docTable.tableRow.detailHeading"
i18n-default-message="Expanded document"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ export function DocViewerLinks(renderProps: DocViewLinkRenderProps) {
'data-test-subj': `docTableRowAction`,
...props,
href: generateCb ? generateCb(renderProps).url : href,
'aria-label': i18n.translate('discover.docViewerLinks.docTableRowActionLabel', {
defaultMessage: 'Discover table row action',
}),
};

return listItem;
Expand All @@ -36,7 +33,6 @@ export function DocViewerLinks(renderProps: DocViewLinkRenderProps) {
target="_blank"
style={{ fontWeight: 'normal' }}
data-test-subj={`${item['data-test-subj']}-${index}`}
aria-label={item['aria-label']}
>
{item.label}
</EuiLink>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,7 @@ export function DocViewTableRow({
});

return (
<tr
key={field}
data-test-subj={`tableDocViewRow-${field}`}
aria-label={i18n.translate('discover.tble.tableDocViewRowLabel', {
defaultMessage: `Discover table field: ${field}`,
})}
>
<tr key={field} data-test-subj={`tableDocViewRow-${field}`}>
{typeof onFilter === 'function' && (
<td className="osdDocViewer__buttons">
<DocViewTableRowBtnFilterAdd
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const getTopNavLinks = (
},
testId: 'discoverNewButton',
ariaLabel: i18n.translate('discover.topNav.discoverNewButtonLabel', {
defaultMessage: `New discover button`,
defaultMessage: `New Search`,
}),
};

Expand All @@ -73,7 +73,7 @@ export const getTopNavLinks = (
}),
testId: 'discoverSaveButton',
ariaLabel: i18n.translate('discover.topNav.discoverSaveButtonLabel', {
defaultMessage: `Save discover button`,
defaultMessage: `Save search`,
}),
run: async () => {
const onSave = async ({
Expand Down Expand Up @@ -172,7 +172,7 @@ export const getTopNavLinks = (
}),
testId: 'discoverOpenButton',
ariaLabel: i18n.translate('discover.topNav.discoverOpenButtonLabel', {
defaultMessage: `Open discover button`,
defaultMessage: `Open Saved Search`,
}),
run: () => {
const flyoutSession = services.overlays.openFlyout(
Expand Down Expand Up @@ -202,7 +202,7 @@ export const getTopNavLinks = (
}),
testId: 'shareTopNavButton',
ariaLabel: i18n.translate('discover.topNav.discoverShareButtonLabel', {
defaultMessage: `Share discover button`,
defaultMessage: `Share search`,
}),
run: async (anchorElement) => {
const state: DiscoverState = store!.getState().discover; // store is defined before the view is loaded
Expand Down Expand Up @@ -237,7 +237,7 @@ export const getTopNavLinks = (
}),
testId: 'openInspectorButton',
ariaLabel: i18n.translate('discover.topNav.discoverInspectorButtonLabel', {
defaultMessage: `Inspect discover button`,
defaultMessage: `Open Inspector for search`,
}),
run() {
inspector.open(inspectorAdapters, {
Expand Down

0 comments on commit 96c2781

Please sign in to comment.