From ce6a7510d3f52ec61fa5f9de6890cfc7c5a62d9e Mon Sep 17 00:00:00 2001 From: abbyhu2000 Date: Fri, 7 Jun 2024 22:41:16 +0000 Subject: [PATCH] Remove unnecessary aria labels Signed-off-by: abbyhu2000 --- docs/_sidebar.md | 1 + .../legacy_language_switcher.tsx | 2 +- .../ui/query_string_input/query_bar_top_row.tsx | 2 +- .../components/data_grid/data_grid_table.tsx | 3 --- .../default_discover_table/table_cell.tsx | 11 +---------- .../default_discover_table/table_header.tsx | 9 ++++++++- .../table_header_column.tsx | 16 +++++++++------- .../default_discover_table/table_row.tsx | 6 +----- .../doc_viewer_links/doc_viewer_links.tsx | 4 ---- .../application/components/table/table_row.tsx | 8 +------- .../components/top_nav/get_top_nav_links.tsx | 10 +++++----- 11 files changed, 28 insertions(+), 44 deletions(-) diff --git a/docs/_sidebar.md b/docs/_sidebar.md index ceac62858ca..7136a39c608 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -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) diff --git a/src/plugins/data/public/ui/query_string_input/legacy_language_switcher.tsx b/src/plugins/data/public/ui/query_string_input/legacy_language_switcher.tsx index eb96bbed2c6..3a786cfd07f 100644 --- a/src/plugins/data/public/ui/query_string_input/legacy_language_switcher.tsx +++ b/src/plugins/data/public/ui/query_string_input/legacy_language_switcher.tsx @@ -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} diff --git a/src/plugins/data/public/ui/query_string_input/query_bar_top_row.tsx b/src/plugins/data/public/ui/query_string_input/query_bar_top_row.tsx index beaad7902b6..1af8c0d5d1e 100644 --- a/src/plugins/data/public/ui/query_string_input/query_bar_top_row.tsx +++ b/src/plugins/data/public/ui/query_string_input/query_bar_top_row.tsx @@ -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', })} /> ); diff --git a/src/plugins/discover/public/application/components/data_grid/data_grid_table.tsx b/src/plugins/discover/public/application/components/data_grid/data_grid_table.tsx index 7bcc0a63130..d76ee6216fc 100644 --- a/src/plugins/discover/public/application/components/data_grid/data_grid_table.tsx +++ b/src/plugins/discover/public/application/components/data_grid/data_grid_table.tsx @@ -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" > diff --git a/src/plugins/discover/public/application/components/default_discover_table/table_cell.tsx b/src/plugins/discover/public/application/components/default_discover_table/table_cell.tsx index 8713644949e..faebb3f78fd 100644 --- a/src/plugins/discover/public/application/components/default_discover_table/table_cell.tsx +++ b/src/plugins/discover/public/application/components/default_discover_table/table_cell.tsx @@ -72,21 +72,12 @@ const TableCellUI = ({ ); return isTimeField ? ( - + {content} ) : (
{content}
diff --git a/src/plugins/discover/public/application/components/default_discover_table/table_header.tsx b/src/plugins/discover/public/application/components/default_discover_table/table_header.tsx index 1a7a1ad17f7..e6841b07520 100644 --- a/src/plugins/discover/public/application/components/default_discover_table/table_header.tsx +++ b/src/plugins/discover/public/application/components/default_discover_table/table_header.tsx @@ -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'; @@ -38,7 +39,13 @@ export function TableHeader({ sortOrder, }: Props) { return ( - + {displayedColumns.map((col) => { return ( diff --git a/src/plugins/discover/public/application/components/default_discover_table/table_header_column.tsx b/src/plugins/discover/public/application/components/default_discover_table/table_header_column.tsx index d8c6ca01148..a3e17c30d99 100644 --- a/src/plugins/discover/public/application/components/default_discover_table/table_header_column.tsx +++ b/src/plugins/discover/public/application/components/default_discover_table/table_header_column.tsx @@ -168,13 +168,15 @@ export function TableHeaderColumn({ ]; return ( - - + + {displayName} {buttons .filter((button) => button.active) diff --git a/src/plugins/discover/public/application/components/default_discover_table/table_row.tsx b/src/plugins/discover/public/application/components/default_discover_table/table_row.tsx index c15e81292c8..305af69a28b 100644 --- a/src/plugins/discover/public/application/components/default_discover_table/table_row.tsx +++ b/src/plugins/discover/public/application/components/default_discover_table/table_row.tsx @@ -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" /> @@ -144,10 +144,6 @@ const TableRowUI = ({

{item.label} diff --git a/src/plugins/discover/public/application/components/table/table_row.tsx b/src/plugins/discover/public/application/components/table/table_row.tsx index 7906f411e3d..c5921033858 100644 --- a/src/plugins/discover/public/application/components/table/table_row.tsx +++ b/src/plugins/discover/public/application/components/table/table_row.tsx @@ -79,13 +79,7 @@ export function DocViewTableRow({ }); return ( - + {typeof onFilter === 'function' && ( { const onSave = async ({ @@ -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( @@ -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 @@ -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, {