-
Notifications
You must be signed in to change notification settings - Fork 894
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
Adjusted source of QueryStringManager functions for flyout. #8864
base: main
Are you sure you want to change the base?
Adjusted source of QueryStringManager functions for flyout. #8864
Conversation
Signed-off-by: AWSHurneyt <[email protected]>
Signed-off-by: AWSHurneyt <[email protected]>
ℹ️ Manual Changeset Creation ReminderPlease ensure manual commit for changeset file 8864.yml under folder changelogs/fragments to complete this PR. If you want to use the available OpenSearch Changeset Bot App to avoid manual creation of changeset file you can install it in your forked repository following this link. For more information about formatting of changeset files, please visit OpenSearch Auto Changeset and Release Notes Tool. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8864 +/- ##
==========================================
+ Coverage 60.92% 60.94% +0.01%
==========================================
Files 3800 3800
Lines 90841 90881 +40
Branches 14313 14323 +10
==========================================
+ Hits 55343 55384 +41
+ Misses 31978 31968 -10
- Partials 3520 3529 +9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
src/plugins/data/public/ui/saved_query_flyouts/open_saved_query_flyout.tsx
Outdated
Show resolved
Hide resolved
Signed-off-by: AWSHurneyt <[email protected]>
Signed-off-by: AWSHurneyt <[email protected]>
Signed-off-by: AWSHurneyt <[email protected]>
Signed-off-by: AWSHurneyt <[email protected]>
Signed-off-by: AWSHurneyt <[email protected]>
thank you so much! one more thing, we use a changelog bot to generate changelog fragment and then release notes. do you mind updating the PR description. in this case i think it can be i think regardless it might fail the ci check because it's detecting commits t hat had a changelog fragment |
❌ Changelog Entry Missing HyphenChangelog entries must begin with a hyphen (-). |
setSavedQueries(mutableSavedQueries); | ||
const allQueries = await savedQueryService.getAllSavedQueries(); | ||
const mutableSavedQueries = allQueries.filter((q) => !q.attributes.isTemplate); | ||
if (currentTabIdRef.current === 'mutable-saved-queries') { |
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 this required? line 89 should be covering it 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.
@jowg-amazon could you clarify?
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 were noticing that the getAllSavedQueries call can take a little while to return. If a user switches tabs before this call is finished, we were seeing that setSavedQueries(mutableSavedQueries)
was overwriting the saved queries incorrectly. This check makes sure that we're still on the mutable saved queries tab.
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.
instead of just have a state variable that sets a boolean if it hasTemplateQueries
, why don't we just have a state variable for templateQueries and a state variable mutableSavedQueries.
Or even more so just set saved queries to all queries and then in the component if the selected tab is template-saved-queries you filter out all the saved queries not matching template-saved-queries etc.
Signed-off-by: AWSHurneyt <[email protected]>
if (currentTabIdRef.current === 'mutable-saved-queries') { | ||
setSavedQueries(mutableSavedQueries); | ||
const allQueries = await savedQueryService.getAllSavedQueries(); |
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 refactor this component. we shouldn't need to fire a request to get all saved queries if the user opened saved queries and then switched to template queries and then switch back to saved queries and fire a request. we already have their saved queries
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.
Yes i think we already noticed the queries taking way longer to show up than they should
if (currentTabIdRef.current === 'mutable-saved-queries') { | ||
setSavedQueries(mutableSavedQueries); | ||
const allQueries = await savedQueryService.getAllSavedQueries(); |
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.
Yes i think we already noticed the queries taking way longer to show up than they should
Description
Issues Resolved
Screenshot
Testing the changes
Changelog
Check List
yarn test:jest
yarn test:jest_integration