Add query result and time to the query editor footer#7951
Add query result and time to the query editor footer#7951kavilla merged 6 commits intoopensearch-project:mainfrom
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. |
kavilla
left a comment
There was a problem hiding this comment.
generally looks good. just clean up
src/plugins/data/public/query/query_string/language_service/query_result.tsx
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
Show resolved
Hide resolved
| anchorPosition={'downRight'} | ||
| > | ||
| <EuiPopoverTitle>ERRORS</EuiPopoverTitle> | ||
| <div style={{ width: '250px' }}> |
src/plugins/data/public/query/query_string/language_service/query_result.tsx
Outdated
Show resolved
Hide resolved
| 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.
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?
| bucketInterval?: TimechartHeaderBucketInterval | {}; | ||
| chartData?: Chart; | ||
| title?: string; | ||
| statusBody?: { |
There was a problem hiding this comment.
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.
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
|
|
||
| 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.
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.
src/plugins/discover/public/application/view_components/utils/use_search.ts
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.
A lot of components depend on this hook working as expected, we should add some tests here
|
|
||
| export class UiService implements Plugin<IUiSetup, IUiStart> { | ||
| enhancementsConfig: ConfigSchema['enhancements']; | ||
| private queryStatus$ = new BehaviorSubject<QueryStatus>({ status: ResultStatus.READY }); |
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:jestyarn test:jest_integration