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

[Discover] Set ownfocus to false when displaying the document flyout #108646

Merged
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 @@ -17,6 +17,7 @@ export const gridStyle = {

export const pageSizeArr = [25, 50, 100, 250];
export const defaultPageSize = 100;
export const defaultTimeColumnWidth = 190;
export const toolbarVisibility = {
showColumnSelector: {
allowHide: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ describe('Discover grid columns ', function () {
],
"display": "Time (timestamp)",
"id": "timestamp",
"initialWidth": 180,
"initialWidth": 190,
"isSortable": true,
"schema": "datetime",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ import { i18n } from '@kbn/i18n';
import { EuiDataGridColumn, EuiScreenReaderOnly } from '@elastic/eui';
import { ExpandButton } from './discover_grid_expand_button';
import { DiscoverGridSettings } from './types';
import { IndexPattern } from '../../../../../data/common/index_patterns/index_patterns';
import type { IndexPattern } from '../../../../../data/common';
import { buildCellActions } from './discover_grid_cell_actions';
import { getSchemaByKbnType } from './discover_grid_schema';
import { SelectButton } from './discover_grid_document_selection';
import { defaultTimeColumnWidth } from './constants';

export function getLeadControlColumns() {
return [
Expand Down Expand Up @@ -88,7 +89,7 @@ export function buildEuiGridColumn(

if (column.id === indexPattern.timeFieldName) {
column.display = `${timeString} (${indexPattern.timeFieldName})`;
column.initialWidth = 180;
column.initialWidth = defaultTimeColumnWidth;
}
if (columnWidth > 0) {
column.initialWidth = Number(columnWidth);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ export function DiscoverGridFlyout({
size="m"
data-test-subj="docTableDetailsFlyout"
onKeyDown={onKeyDown}
ownFocus={false}
>
<EuiFlyoutHeader hasBorder>
<EuiTitle
Expand Down Expand Up @@ -169,7 +170,7 @@ export function DiscoverGridFlyout({
</EuiFlexItem>
)}
{activePage !== -1 && (
<EuiFlexItem>
<EuiFlexItem data-test-subj={`dscDocNavigationPage-${activePage}`}>
<EuiPagination
aria-label={i18n.translate('discover.grid.flyout.documentNavigation', {
defaultMessage: 'Document navigation',
Expand Down
10 changes: 10 additions & 0 deletions test/functional/apps/discover/_data_grid_doc_table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,16 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
});
});

it('should allow paginating docs in the flyout by clicking in the doc table', async function () {
await retry.try(async function () {
await dataGrid.clickRowToggle({ rowIndex: rowToInspect - 1 });
await testSubjects.exists(`dscDocNavigationPage0`);
await dataGrid.clickRowToggle({ rowIndex: rowToInspect });
await testSubjects.exists(`dscDocNavigationPage1`);
await dataGrid.closeFlyout();
});
});

it('should show allow adding columns from the detail panel', async function () {
await retry.try(async function () {
await dataGrid.clickRowToggle({ isAnchorRow: false, rowIndex: rowToInspect - 1 });
Expand Down