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. |
| type: 'icon', | ||
| onClick: (item: RecentQueryTableItem) => { | ||
| onClickRecentQuery(recentQueries[item.id].query, recentQueries[item.id].timeRange); | ||
| onClickRecentQuery( |
There was a problem hiding this comment.
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.
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
| import { EditorInstance } from '../../../ui/query_editor/editors'; | ||
|
|
||
| export interface RecentQueryItem { | ||
| id: number; |
There was a problem hiding this comment.
Nit: I think it's a string now right ?
* 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:jestyarn test:jest_integration