forked from opensearch-project/OpenSearch-Dashboards
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Data Explorer][Discover 2.0] Change to inspect icon and update hint msg
Issue Resolve opensearch-project#4826 opensearch-project#4825 Signed-off-by: ananzh <[email protected]>
- Loading branch information
Showing
4 changed files
with
39 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 0 additions & 27 deletions
27
...iscover/public/application/components/data_grid/data_grid_table_docview_expand_button.tsx
This file was deleted.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
...scover/public/application/components/data_grid/data_grid_table_docview_inspect_button.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import React from 'react'; | ||
import { i18n } from '@osd/i18n'; | ||
import { EuiToolTip, EuiButtonIcon, EuiDataGridCellValueElementProps } from '@elastic/eui'; | ||
import { useDataGridContext } from './data_grid_table_context'; | ||
|
||
export const DocViewInspectButton = ({ rowIndex }: EuiDataGridCellValueElementProps) => { | ||
const { inspectedHit, setInspectedHit, rows } = useDataGridContext(); | ||
const currentInspected = rows[rowIndex]; | ||
const isCurrentInspected = currentInspected === inspectedHit; | ||
const inspectHintMsg = i18n.translate('discover.docViews.table.inspectAriaLabel', { | ||
defaultMessage: 'Inspect document details', | ||
}); | ||
|
||
return ( | ||
<EuiToolTip content={inspectHintMsg}> | ||
<EuiButtonIcon | ||
onClick={() => setInspectedHit(isCurrentInspected ? undefined : currentInspected)} | ||
iconType={isCurrentInspected ? 'minimize' : 'inspect'} | ||
aria-label={inspectHintMsg} | ||
/> | ||
</EuiToolTip> | ||
); | ||
}; |