-
Notifications
You must be signed in to change notification settings - Fork 920
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
Fix running recent query button #8252
Fix running recent query button #8252
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8252 +/- ##
=======================================
Coverage 64.11% 64.11%
=======================================
Files 3744 3744
Lines 88862 88864 +2
Branches 13852 13852
=======================================
+ Hits 56975 56978 +3
+ Misses 31273 31272 -1
Partials 614 614
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@@ -51,7 +51,10 @@ export function RecentQueriesTable({ | |||
icon: 'play', | |||
type: 'icon', | |||
onClick: (item: RecentQueryTableItem) => { | |||
onClickRecentQuery(recentQueries[item.id].query, recentQueries[item.id].timeRange); | |||
onClickRecentQuery( |
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.
to mind explaining this part a little bit? like how this fixes the problem?
without knowing too much about the implementation, for me this basically looks for the query and assumes its the same query which might not be accurate still i think.
i dont think we show this feature for DQL but in the case of DQL the query could actually just be
""
for multiple queries for different index patterns. And this logic to me would find the first query that is ""
and assume that is the recent query.
in SQL and PPL we dont limit what they type so technically they could select data_logs
and in SQL it would be SELECT * FROM data_logs
and then they type it SELECT * FROM eccomerce
and then select the eccommerce sample data. so then the query editor says SELECT * FROM eccomerce
which query is the right query here.
i think the solution here should be assigning a GUID or using the timestamp of execution as the identifier. then the RecentQueryTableItem.id
should be just the id of that GUID or timestamp
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.
make sense. i revised it to use uuid
Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>
Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>
ca35b38
to
e21530a
Compare
@@ -13,6 +13,7 @@ import { | |||
import { EditorInstance } from '../../../ui/query_editor/editors'; | |||
|
|||
export interface RecentQueryItem { | |||
id: number; |
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 think it's a string now right ?
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.
Will fix in later PR
* Fix click on recent query switching language Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com> * change to use uuid as identifier Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com> * Changeset file for PR #8252 created/updated --------- Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> (cherry picked from commit 2f36eaf) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Fix click on recent query switching language Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com> * change to use uuid as identifier Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com> * Changeset file for PR #8252 created/updated --------- Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> (cherry picked from commit 2f36eaf) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Fix click on recent query switching language * change to use uuid as identifier * Changeset file for PR #8252 created/updated --------- (cherry picked from commit 2f36eaf) 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> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
* Fix click on recent query switching language * change to use uuid as identifier * Changeset file for PR #8252 created/updated --------- (cherry picked from commit 2f36eaf) 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> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
* Fix click on recent query switching language Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com> * change to use uuid as identifier Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com> * Changeset file for PR opensearch-project#8252 created/updated --------- Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
…-project#8280) * Fix click on recent query switching language * change to use uuid as identifier * Changeset file for PR opensearch-project#8252 created/updated --------- (cherry picked from commit 2f36eaf) 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> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Description
Fix the bug of running recent query jump to another language.
Issues Resolved
Screenshot
Testing the changes
Changelog
Check List
yarn test:jest
yarn test:jest_integration