-
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.
[App Search] Add a Result Component (#85046)
- Loading branch information
1 parent
a4caffa
commit 31a1cc0
Showing
32 changed files
with
923 additions
and
48 deletions.
There are no files selected for viewing
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
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
7 changes: 7 additions & 0 deletions
7
x-pack/plugins/enterprise_search/public/applications/app_search/components/library/index.ts
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,7 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
export { Library } from './library'; |
178 changes: 178 additions & 0 deletions
178
...k/plugins/enterprise_search/public/applications/app_search/components/library/library.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,178 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { | ||
EuiSpacer, | ||
EuiPageHeader, | ||
EuiPageHeaderSection, | ||
EuiTitle, | ||
EuiPageContentBody, | ||
EuiPageContent, | ||
} from '@elastic/eui'; | ||
import React from 'react'; | ||
|
||
import { SetAppSearchChrome as SetPageChrome } from '../../../shared/kibana_chrome'; | ||
import { Result } from '../result/result'; | ||
|
||
export const Library: React.FC = () => { | ||
const props = { | ||
result: { | ||
id: { | ||
raw: '1', | ||
}, | ||
_meta: { | ||
id: '1', | ||
scopedId: '1', | ||
score: 100, | ||
engine: 'my-engine', | ||
}, | ||
title: { | ||
raw: 'A title', | ||
}, | ||
description: { | ||
raw: 'A description', | ||
}, | ||
states: { | ||
raw: ['Pennsylvania', 'Ohio'], | ||
}, | ||
visitors: { | ||
raw: 1000, | ||
}, | ||
size: { | ||
raw: 200, | ||
}, | ||
length: { | ||
raw: 100, | ||
}, | ||
}, | ||
}; | ||
|
||
return ( | ||
<> | ||
<SetPageChrome trail={['Library']} /> | ||
<EuiPageHeader> | ||
<EuiPageHeaderSection> | ||
<EuiTitle size="l"> | ||
<h1>Library</h1> | ||
</EuiTitle> | ||
</EuiPageHeaderSection> | ||
</EuiPageHeader> | ||
<EuiPageContent> | ||
<EuiPageContentBody> | ||
<EuiTitle size="m"> | ||
<h2>Result</h2> | ||
</EuiTitle> | ||
<EuiSpacer /> | ||
|
||
<EuiTitle size="s"> | ||
<h3>5 or more fields</h3> | ||
</EuiTitle> | ||
<EuiSpacer /> | ||
<Result {...props} /> | ||
<EuiSpacer /> | ||
|
||
<EuiTitle size="s"> | ||
<h3>5 or less fields</h3> | ||
</EuiTitle> | ||
<EuiSpacer /> | ||
<Result | ||
{...{ | ||
result: { | ||
id: props.result.id, | ||
_meta: props.result._meta, | ||
title: props.result.title, | ||
description: props.result.description, | ||
}, | ||
}} | ||
/> | ||
<EuiSpacer /> | ||
|
||
<EuiTitle size="s"> | ||
<h3>With just an id</h3> | ||
</EuiTitle> | ||
<EuiSpacer /> | ||
<Result | ||
{...{ | ||
result: { | ||
...props.result, | ||
_meta: { | ||
id: '1', | ||
scopedId: '1', | ||
score: 100, | ||
engine: 'my-engine', | ||
}, | ||
}, | ||
}} | ||
/> | ||
<EuiSpacer /> | ||
|
||
<EuiTitle size="s"> | ||
<h3>With an id and a score</h3> | ||
</EuiTitle> | ||
<EuiSpacer /> | ||
<Result | ||
{...{ | ||
showScore: true, | ||
result: { | ||
...props.result, | ||
_meta: { | ||
id: '1', | ||
scopedId: '1', | ||
score: 100, | ||
engine: 'my-engine', | ||
}, | ||
}, | ||
}} | ||
/> | ||
<EuiSpacer /> | ||
|
||
<EuiTitle size="s"> | ||
<h3>With an id and a score and an engine</h3> | ||
</EuiTitle> | ||
<EuiSpacer /> | ||
<Result | ||
{...{ | ||
showScore: true, | ||
result: { | ||
...props.result, | ||
_meta: { | ||
id: '1', | ||
scopedId: '2', | ||
score: 100, | ||
engine: 'my-engine', | ||
}, | ||
}, | ||
}} | ||
/> | ||
<EuiSpacer /> | ||
|
||
<EuiTitle size="s"> | ||
<h3>With a long id, a long engine name, a long field key, and a long value</h3> | ||
</EuiTitle> | ||
<EuiSpacer /> | ||
<Result | ||
{...{ | ||
result: { | ||
...props.result, | ||
'this-description-is-a-really-really-really-really-really-really-really-really-really-really-really-really-really-really-really-really-really-really-really-really-really-really-really-really-long-key': { | ||
raw: | ||
'Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?', | ||
}, | ||
_meta: { | ||
id: 'my-id-is-a-really-long-id-yes-it-is', | ||
scopedId: '2', | ||
score: 100, | ||
engine: 'my-engine-is-a-really-long-engin-name-yes-it-is', | ||
}, | ||
}, | ||
}} | ||
/> | ||
<EuiSpacer /> | ||
</EuiPageContentBody> | ||
</EuiPageContent> | ||
</> | ||
); | ||
}; |
File renamed without changes.
Oops, something went wrong.