diff --git a/src/plugins/discover/public/application/components/data_grid/data_grid_table_columns.test.tsx b/src/plugins/discover/public/application/components/data_grid/data_grid_table_columns.test.tsx index 9a53bff57e16..3123b0a1a210 100644 --- a/src/plugins/discover/public/application/components/data_grid/data_grid_table_columns.test.tsx +++ b/src/plugins/discover/public/application/components/data_grid/data_grid_table_columns.test.tsx @@ -57,9 +57,12 @@ describe('Testing buildDataGridColumns function ', () => { Array [ Object { "actions": Object { - "showHide": true, - "showMoveLeft": false, - "showMoveRight": false, + "showHide": Object { + "iconType": "cross", + "label": "Remove column", + }, + "showMoveLeft": true, + "showMoveRight": true, }, "cellActions": undefined, "display": undefined, @@ -69,9 +72,12 @@ describe('Testing buildDataGridColumns function ', () => { }, Object { "actions": Object { - "showHide": true, - "showMoveLeft": false, - "showMoveRight": false, + "showHide": Object { + "iconType": "cross", + "label": "Remove column", + }, + "showMoveLeft": true, + "showMoveRight": true, }, "cellActions": undefined, "display": undefined, @@ -98,9 +104,9 @@ describe('Testing buildDataGridColumns function ', () => { Array [ Object { "actions": Object { - "showHide": true, - "showMoveLeft": false, - "showMoveRight": false, + "showHide": false, + "showMoveLeft": true, + "showMoveRight": true, }, "cellActions": undefined, "display": "Time (order_date)", @@ -111,9 +117,12 @@ describe('Testing buildDataGridColumns function ', () => { }, Object { "actions": Object { - "showHide": true, - "showMoveLeft": false, - "showMoveRight": false, + "showHide": Object { + "iconType": "cross", + "label": "Remove column", + }, + "showMoveLeft": true, + "showMoveRight": true, }, "cellActions": undefined, "display": undefined, @@ -123,9 +132,12 @@ describe('Testing buildDataGridColumns function ', () => { }, Object { "actions": Object { - "showHide": true, - "showMoveLeft": false, - "showMoveRight": false, + "showHide": Object { + "iconType": "cross", + "label": "Remove column", + }, + "showMoveLeft": true, + "showMoveRight": true, }, "cellActions": undefined, "display": undefined, @@ -135,9 +147,9 @@ describe('Testing buildDataGridColumns function ', () => { }, Object { "actions": Object { - "showHide": true, - "showMoveLeft": false, - "showMoveRight": false, + "showHide": false, + "showMoveLeft": true, + "showMoveRight": true, }, "cellActions": undefined, "display": "Source", @@ -162,9 +174,12 @@ describe('Testing buildDataGridColumns function ', () => { Array [ Object { "actions": Object { - "showHide": true, - "showMoveLeft": false, - "showMoveRight": false, + "showHide": Object { + "iconType": "cross", + "label": "Remove column", + }, + "showMoveLeft": true, + "showMoveRight": true, }, "cellActions": undefined, "display": undefined, @@ -174,9 +189,12 @@ describe('Testing buildDataGridColumns function ', () => { }, Object { "actions": Object { - "showHide": true, - "showMoveLeft": false, - "showMoveRight": false, + "showHide": Object { + "iconType": "cross", + "label": "Remove column", + }, + "showMoveLeft": true, + "showMoveRight": true, }, "cellActions": undefined, "display": undefined, @@ -186,9 +204,9 @@ describe('Testing buildDataGridColumns function ', () => { }, Object { "actions": Object { - "showHide": true, - "showMoveLeft": false, - "showMoveRight": false, + "showHide": false, + "showMoveLeft": true, + "showMoveRight": true, }, "cellActions": undefined, "display": "Time (order_date)", diff --git a/src/plugins/discover/public/application/components/doc_viewer_links/__snapshots__/doc_viewer_links.test.tsx.snap b/src/plugins/discover/public/application/components/doc_viewer_links/__snapshots__/doc_viewer_links.test.tsx.snap index 2a3b5a3aa998..075cafd37471 100644 --- a/src/plugins/discover/public/application/components/doc_viewer_links/__snapshots__/doc_viewer_links.test.tsx.snap +++ b/src/plugins/discover/public/application/components/doc_viewer_links/__snapshots__/doc_viewer_links.test.tsx.snap @@ -2,37 +2,47 @@ exports[`Dont Render if generateCb.hide 1`] = ` `; exports[`Render with 2 different links 1`] = ` - + style={ + Object { + "fontWeight": "normal", + } + } + target="_blank" + > + generateCb link + - + style={ + Object { + "fontWeight": "normal", + } + } + target="_blank" + > + href link + `; diff --git a/src/plugins/discover/public/application/components/doc_viewer_links/doc_viewer_links.tsx b/src/plugins/discover/public/application/components/doc_viewer_links/doc_viewer_links.tsx index f529273991a0..ea4262814bb4 100644 --- a/src/plugins/discover/public/application/components/doc_viewer_links/doc_viewer_links.tsx +++ b/src/plugins/discover/public/application/components/doc_viewer_links/doc_viewer_links.tsx @@ -4,7 +4,7 @@ */ import React from 'react'; -import { EuiFlexGroup, EuiFlexItem, EuiListGroupItem, EuiListGroupItemProps } from '@elastic/eui'; +import { EuiFlexGroup, EuiFlexItem, EuiListGroupItemProps, EuiLink } from '@elastic/eui'; import { getDocViewsLinksRegistry } from '../../../opensearch_dashboards_services'; import { DocViewLinkRenderProps } from '../../doc_views_links/doc_views_links_types'; @@ -24,10 +24,12 @@ export function DocViewerLinks(renderProps: DocViewLinkRenderProps) { }); return ( - + {listItems.map((item, index) => ( - + + {item.label} + ))} diff --git a/src/plugins/discover/public/application/utils/state_management/common.test.ts b/src/plugins/discover/public/application/utils/state_management/common.test.ts index c1190f891648..64a2dba99dd4 100644 --- a/src/plugins/discover/public/application/utils/state_management/common.test.ts +++ b/src/plugins/discover/public/application/utils/state_management/common.test.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { addColumn, removeColumn, reorderColumn, setColumns } from './common'; +import { addColumn, removeColumn, reorderColumn } from './common'; describe('commonUtils', () => { it('should handle addColumn', () => { @@ -22,12 +22,4 @@ describe('commonUtils', () => { 'column1', ]); }); - - it('should handle setColumns', () => { - expect(setColumns('timeField', ['timeField', 'column1', 'column2'])).toEqual([ - 'column1', - 'column2', - ]); - expect(setColumns(undefined, ['column1', 'column2'])).toEqual(['column1', 'column2']); - }); }); diff --git a/src/plugins/discover/public/application/utils/state_management/discover_slice.test.tsx b/src/plugins/discover/public/application/utils/state_management/discover_slice.test.tsx index 1e2e4ab46a55..cbfc9c3769b0 100644 --- a/src/plugins/discover/public/application/utils/state_management/discover_slice.test.tsx +++ b/src/plugins/discover/public/application/utils/state_management/discover_slice.test.tsx @@ -58,7 +58,7 @@ describe('discoverSlice', () => { it('should handle setColumns', () => { const action = { type: 'discover/setColumns', - payload: { timeField: 'timeField', columns: ['timeField', 'column1', 'column2'] }, + payload: { columns: ['column1', 'column2'] }, }; const result = discoverSlice.reducer(initialState, action); expect(result.columns).toEqual(['column1', 'column2']);