forked from opensearch-project/OpenSearch-Dashboards
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>
- Loading branch information
1 parent
c4f9ded
commit f6006d1
Showing
12 changed files
with
106 additions
and
5 deletions.
There are no files selected for viewing
54 changes: 54 additions & 0 deletions
54
src/plugins/data/public/query/query_string/language_service/query_result.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,54 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import './_recent_query.scss'; | ||
|
||
import { EuiButtonEmpty, EuiPopover, EuiText, EuiContextMenu, EuiPopoverTitle } from '@elastic/eui'; | ||
|
||
import React, { useState } from 'react'; | ||
import { SearchData } from '../../../../../discover/public'; | ||
|
||
export function QueryResult(props: { queryResult: SearchData }) { | ||
console.log('QueryResult', props.queryResult); | ||
const [isPopoverOpen, setPopover] = useState(false); | ||
const onButtonClick = () => { | ||
setPopover(!isPopoverOpen); | ||
}; | ||
|
||
const status = props.queryResult.status; | ||
|
||
if (status === 'ready') { | ||
return ( | ||
<EuiButtonEmpty iconSide="left" iconType={'checkInCircleEmpty'} size="xs" onClick={() => {}}> | ||
<EuiText size="xs" color="subdued"> | ||
{'Complete'} | ||
</EuiText> | ||
</EuiButtonEmpty> | ||
); | ||
} | ||
|
||
return ( | ||
<EuiPopover | ||
button={ | ||
<EuiButtonEmpty iconSide="left" iconType={'alert'} size="xs" onClick={onButtonClick}> | ||
<EuiText size="xs" color="subdued"> | ||
{'Error'} | ||
</EuiText> | ||
</EuiButtonEmpty> | ||
} | ||
isOpen={isPopoverOpen} | ||
closePopover={() => setPopover(false)} | ||
panelPaddingSize="none" | ||
anchorPosition={'downRight'} | ||
> | ||
<EuiPopoverTitle>Error message</EuiPopoverTitle> | ||
<div style={{ width: '250px' }}> | ||
<EuiText size="s"> | ||
{props.queryResult.errorMsg && props.queryResult.errorMsg.message} | ||
</EuiText> | ||
</div> | ||
</EuiPopover> | ||
); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ | |
|
||
export * from './canvas'; | ||
export * from './panel'; | ||
export * from './utils'; |
6 changes: 6 additions & 0 deletions
6
src/plugins/discover/public/application/view_components/utils/index.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,6 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
export { SearchData, ResultStatus } from './use_search'; |
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