-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This was causing console errors. I factored out the column headers to their own component, and moved all table rows to be under a tbody. This alleviates the console warnings.
- Loading branch information
1 parent
1d58266
commit 82f7b21
Showing
9 changed files
with
94 additions
and
67 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
...tions/app_search/components/result_settings/result_settings_table/column_headers.test.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,21 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import React from 'react'; | ||
|
||
import { shallow } from 'enzyme'; | ||
|
||
import { EuiTableHeaderCell } from '@elastic/eui'; | ||
|
||
import { ColumnHeaders } from './column_headers'; | ||
|
||
describe('ColumnHeaders', () => { | ||
it('renders', () => { | ||
const wrapper = shallow(<ColumnHeaders />); | ||
expect(wrapper.find(EuiTableHeaderCell).length).toBe(3); | ||
}); | ||
}); |
52 changes: 52 additions & 0 deletions
52
...plications/app_search/components/result_settings/result_settings_table/column_headers.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,52 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import React from 'react'; | ||
|
||
import { EuiIconTip, EuiTableHeader, EuiTableHeaderCell } from '@elastic/eui'; | ||
import { i18n } from '@kbn/i18n'; | ||
|
||
export const ColumnHeaders: React.FC = () => { | ||
return ( | ||
<EuiTableHeader className="resultSettingsTable__columnLabels"> | ||
<EuiTableHeaderCell align="left" /> | ||
<EuiTableHeaderCell align="center" colSpan={2}> | ||
{i18n.translate('xpack.enterpriseSearch.appSearch.engine.resultSettings.table.rawTitle', { | ||
defaultMessage: 'Raw', | ||
})} | ||
<EuiIconTip | ||
position="top" | ||
content={i18n.translate( | ||
'xpack.enterpriseSearch.appSearch.engine.resultSettings.table.rawTooltip', | ||
{ | ||
defaultMessage: | ||
'A raw field is an exact representation of a field value. Must be at least 20 characters. Defaults to the entire field.', | ||
} | ||
)} | ||
/> | ||
</EuiTableHeaderCell> | ||
<EuiTableHeaderCell align="center" colSpan={3}> | ||
{i18n.translate( | ||
'xpack.enterpriseSearch.appSearch.engine.resultSettings.table.highlightingTitle', | ||
{ | ||
defaultMessage: 'Highlighting', | ||
} | ||
)} | ||
<EuiIconTip | ||
position="top" | ||
content={i18n.translate( | ||
'xpack.enterpriseSearch.appSearch.engine.resultSettings.table.highlightingTooltip', | ||
{ | ||
defaultMessage: | ||
'A snippet is an escaped representaiton of a field value. Query matches are encapsulated in <em> tags for highlighting. Fallback will look for a snippet match, but fallback to an escaped raw value if none is found. Range is between 20-1000. Defaults to 100.', | ||
} | ||
)} | ||
/> | ||
</EuiTableHeaderCell> | ||
</EuiTableHeader> | ||
); | ||
}; |
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
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
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
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