mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Fix document URLs in the query analytics view (#134685)
* Fix document URLs in the query analytics view * [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix' * Remove engine prop from QueryClick Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
b2ef47b2d8
commit
f59fd4a343
3 changed files with 5 additions and 6 deletions
|
@ -22,7 +22,6 @@ describe('QueryClicksTable', () => {
|
|||
{
|
||||
key: 'some-document',
|
||||
document: {
|
||||
engine: 'some-engine',
|
||||
id: 'some-document',
|
||||
},
|
||||
tags: ['tagA'],
|
||||
|
@ -31,7 +30,6 @@ describe('QueryClicksTable', () => {
|
|||
{
|
||||
key: 'another-document',
|
||||
document: {
|
||||
engine: 'another-engine',
|
||||
id: 'another-document',
|
||||
},
|
||||
tags: ['tagB'],
|
||||
|
@ -57,7 +55,7 @@ describe('QueryClicksTable', () => {
|
|||
'/app/enterprise_search/engines/some-engine/documents/some-document'
|
||||
);
|
||||
expect(wrapper.find(EuiLink).last().prop('href')).toEqual(
|
||||
'/app/enterprise_search/engines/another-engine/documents/another-document'
|
||||
'/app/enterprise_search/engines/some-engine/documents/another-document'
|
||||
);
|
||||
// deleted-document should not have a link
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { EuiLinkTo } from '../../../../../shared/react_router_helpers';
|
||||
import { ENGINE_DOCUMENT_DETAIL_PATH } from '../../../../routes';
|
||||
import { DOCUMENTS_TITLE } from '../../../documents';
|
||||
import { generateEnginePath } from '../../../engine';
|
||||
import { generateEnginePath, EngineLogic } from '../../../engine';
|
||||
|
||||
import { QueryClick } from '../../types';
|
||||
|
||||
|
@ -25,6 +25,8 @@ interface Props {
|
|||
type Columns = Array<EuiBasicTableColumn<QueryClick>>;
|
||||
|
||||
export const QueryClicksTable: React.FC<Props> = ({ items }) => {
|
||||
const { engineName } = EngineLogic.values;
|
||||
|
||||
const DOCUMENT_COLUMN = {
|
||||
...FIRST_COLUMN_PROPS,
|
||||
field: 'document',
|
||||
|
@ -33,7 +35,7 @@ export const QueryClicksTable: React.FC<Props> = ({ items }) => {
|
|||
return document ? (
|
||||
<EuiLinkTo
|
||||
to={generateEnginePath(ENGINE_DOCUMENT_DETAIL_PATH, {
|
||||
engineName: document.engine,
|
||||
engineName,
|
||||
documentId: document.id,
|
||||
})}
|
||||
>
|
||||
|
|
|
@ -15,7 +15,6 @@ export interface Query {
|
|||
export interface QueryClick extends Query {
|
||||
document?: {
|
||||
id: string;
|
||||
engine: string;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue