-
Notifications
You must be signed in to change notification settings - Fork 915
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
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. 🚨 Try these New Features:
|
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
@kavilla @ashwin-pc could one of you merge the PR? I don't seem to have the permissions to do so. |
* Change origin of query string management functions. Signed-off-by: AWSHurneyt <[email protected]> * Added try/catch block. Signed-off-by: AWSHurneyt <[email protected]> * Changed source of query string management functions. Signed-off-by: AWSHurneyt <[email protected]> * Fixed typo. Signed-off-by: AWSHurneyt <[email protected]> * Fixed import. Signed-off-by: AWSHurneyt <[email protected]> * Fix lint errors. Signed-off-by: AWSHurneyt <[email protected]> * Fixed lint error. Signed-off-by: AWSHurneyt <[email protected]> * Fixed test mocks. Signed-off-by: AWSHurneyt <[email protected]> --------- Signed-off-by: AWSHurneyt <[email protected]> (cherry picked from commit 5740259) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…8887) * Change origin of query string management functions. * Added try/catch block. * Changed source of query string management functions. * Fixed typo. * Fixed import. * Fix lint errors. * Fixed lint error. * Fixed test mocks. --------- (cherry picked from commit 5740259) Signed-off-by: AWSHurneyt <[email protected]> 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>
…ch-project#8864) * Change origin of query string management functions. Signed-off-by: AWSHurneyt <[email protected]> * Added try/catch block. Signed-off-by: AWSHurneyt <[email protected]> * Changed source of query string management functions. Signed-off-by: AWSHurneyt <[email protected]> * Fixed typo. Signed-off-by: AWSHurneyt <[email protected]> * Fixed import. Signed-off-by: AWSHurneyt <[email protected]> * Fix lint errors. Signed-off-by: AWSHurneyt <[email protected]> * Fixed lint error. Signed-off-by: AWSHurneyt <[email protected]> * Fixed test mocks. Signed-off-by: AWSHurneyt <[email protected]> --------- Signed-off-by: AWSHurneyt <[email protected]>
…ch-project#8864) * Change origin of query string management functions. Signed-off-by: AWSHurneyt <[email protected]> * Added try/catch block. Signed-off-by: AWSHurneyt <[email protected]> * Changed source of query string management functions. Signed-off-by: AWSHurneyt <[email protected]> * Fixed typo. Signed-off-by: AWSHurneyt <[email protected]> * Fixed import. Signed-off-by: AWSHurneyt <[email protected]> * Fix lint errors. Signed-off-by: AWSHurneyt <[email protected]> * Fixed lint error. Signed-off-by: AWSHurneyt <[email protected]> * Fixed test mocks. Signed-off-by: AWSHurneyt <[email protected]> --------- Signed-off-by: AWSHurneyt <[email protected]> Signed-off-by: Federico Silva <[email protected]>
Description
Issues Resolved
Screenshot
Testing the changes
Changelog
Check List
yarn test:jest
yarn test:jest_integration