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

[Data Explorer][Discover 2.0] Append popout icon to oui link for doc viewer links #4855

Merged
merged 2 commits into from
Aug 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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)",
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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",
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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)",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -24,10 +24,12 @@ export function DocViewerLinks(renderProps: DocViewLinkRenderProps) {
});

return (
<EuiFlexGroup gutterSize="xs" justifyContent="flexEnd">
<EuiFlexGroup gutterSize="m" justifyContent="flexEnd">
{listItems.map((item, index) => (
<EuiFlexItem key={index} grow={false}>
<EuiListGroupItem {...item} />
<EuiLink href={item.href} target="_blank" style={{ fontWeight: 'normal' }}>
{item.label}
</EuiLink>
</EuiFlexItem>
))}
</EuiFlexGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand All @@ -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']);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down
Loading