-
Notifications
You must be signed in to change notification settings - Fork 916
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
Add query result and time to the query editor footer #7951
Conversation
❌ Empty Changelog SectionThe Changelog section in your PR description is empty. Please add a valid changelog entry or entries. If you did add a changelog entry, check to make sure that it was not accidentally included inside the comment block in the Changelog section. |
24d3d55
to
6844332
Compare
❌ Empty Changelog SectionThe Changelog section in your PR description is empty. Please add a valid changelog entry or entries. If you did add a changelog entry, check to make sure that it was not accidentally included inside the comment block in the Changelog section. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
generally looks good. just clean up
src/plugins/data/public/query/query_string/language_service/query_result.tsx
Outdated
Show resolved
Hide resolved
src/plugins/data/public/query/query_string/language_service/query_result.tsx
Outdated
Show resolved
Hide resolved
src/plugins/data/public/query/query_string/language_service/query_result.tsx
Outdated
Show resolved
Hide resolved
src/plugins/data/public/query/query_string/language_service/query_result.tsx
Outdated
Show resolved
Hide resolved
src/plugins/data/public/query/query_string/language_service/query_result.tsx
Outdated
Show resolved
Hide resolved
anchorPosition={'downRight'} | ||
> | ||
<EuiPopoverTitle>ERRORS</EuiPopoverTitle> | ||
<div style={{ width: '250px' }}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a stylesheet
src/plugins/data/public/query/query_string/language_service/query_result.tsx
Outdated
Show resolved
Hide resolved
@@ -34,7 +34,7 @@ export interface TopNavProps { | |||
|
|||
export const TopNav = ({ opts, showSaveQuery, isEnhancementsEnabled }: TopNavProps) => { | |||
const { services } = useOpenSearchDashboards<DiscoverViewServices>(); | |||
const { inspectorAdapters, savedSearch, indexPattern } = useDiscoverContext(); | |||
const { data$, inspectorAdapters, savedSearch, indexPattern } = useDiscoverContext(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we only require do we think we should maybe just create a new observable that this listens to instead of subscribing to a lot of data in the top nav?
@@ -50,6 +51,10 @@ export interface SearchData { | |||
bucketInterval?: TimechartHeaderBucketInterval | {}; | |||
chartData?: Chart; | |||
title?: string; | |||
statusBody?: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
i still think maybe we maybe we can:
status: ResultStatus | DetailedResultStatus
and then the DetailedResultStatus
is
status: ResultStatus,
message: string,
statusCode?: number,
elapsedMs?: number,
src/plugins/data/public/query/query_string/language_service/query_result.tsx
Outdated
Show resolved
Hide resolved
|
||
if (queryStatus.status === 'ready') { | ||
return ( | ||
<EuiButtonEmpty iconSide="left" iconType={'checkInCircleEmpty'} size="xs" onClick={() => {}}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it expected that clicking on this button doesn't do anything?
src/plugins/discover/public/application/view_components/canvas/top_nav.tsx
Show resolved
Hide resolved
f1a273a
to
8051384
Compare
Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>
Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>
815a4a2
to
ac754c4
Compare
Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>
src/plugins/data/public/query/query_string/language_service/query_result.tsx
Outdated
Show resolved
Hide resolved
@@ -24,6 +27,7 @@ export interface UiServiceStartDependencies { | |||
|
|||
export class UiService implements Plugin<IUiSetup, IUiStart> { | |||
enhancementsConfig: ConfigSchema['enhancements']; | |||
private queryStatus$ = new BehaviorSubject<QueryStatus>({ status: ResultStatus.READY }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not do this. This would mean that we are duplicating state information in multiple places and no longer have a single source of truth. If we forget to set or clear the status correctly, the UI could show both an error and the correct result at the same time, which could lead to bugs. If we are afraid of prop drilling, lets use react context within the TopNav of the data plugin, but not have 2 places that have the same state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need this now?
src/plugins/discover/public/application/view_components/utils/use_search.ts
Outdated
Show resolved
Hide resolved
Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>
Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>
src/plugins/query_enhancements/server/search/ppl_search_strategy.ts
Outdated
Show resolved
Hide resolved
@@ -42,16 +42,9 @@ export const removeKeyword = (queryString: string | undefined) => { | |||
}; | |||
|
|||
export const handleFacetError = (response: any) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add a test for this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A lot of components depend on this hook working as expected, we should add some tests here
@@ -24,6 +27,7 @@ export interface UiServiceStartDependencies { | |||
|
|||
export class UiService implements Plugin<IUiSetup, IUiStart> { | |||
enhancementsConfig: ConfigSchema['enhancements']; | |||
private queryStatus$ = new BehaviorSubject<QueryStatus>({ status: ResultStatus.READY }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need this now?
Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>
* add query result to the footer Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com> * fix unit test Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com> * conditional language Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com> * native language still use toast Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com> * refactor to not use two states Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com> * address comments Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com> --------- Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com> (cherry picked from commit 7e8612f) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* add query result to the footer Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com> * fix unit test Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com> * conditional language Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com> * native language still use toast Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com> * refactor to not use two states Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com> * address comments Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com> --------- Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com> (cherry picked from commit 7e8612f) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* add query result to the footer * fix unit test * conditional language * native language still use toast * refactor to not use two states * address comments --------- (cherry picked from commit 7e8612f) Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* add query result to the footer * fix unit test * conditional language * native language still use toast * refactor to not use two states * address comments --------- (cherry picked from commit 7e8612f) Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…ect#7951) * add query result to the footer Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com> * fix unit test Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com> * conditional language Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com> * native language still use toast Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com> * refactor to not use two states Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com> * address comments Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com> --------- Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>
Description
Add query result and query execution time to the query editor footer.
TODO:
Issues Resolved
Screenshot
Screen.Recording.2024-09-03.at.11.36.07.AM.mov
Testing the changes
Changelog
Check List
yarn test:jest
yarn test:jest_integration