Skip to content
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

Use currently selected data source when no source attached to saved query #8883

Conversation

amsiglan
Copy link
Collaborator

@amsiglan amsiglan commented Nov 16, 2024

Description

Opening a saved query that has no dataset stored with it, resets the currently selected dataset in the picker which breaks the query experience since the user will need to reselect the dataset which will then reset the query.

This PR adds a check for this case and retains the currently selected dataset

Testing the changes

Tested using local setup

Screen.Recording.2024-11-18.at.9.02.20.PM.mov

Changelog

  • fix: Retain currently selected dataset when opening saved query without dataset info

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

Copy link

codecov bot commented Nov 16, 2024

Codecov Report

Attention: Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 60.86%. Comparing base (5740259) to head (7e06e55).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...ui/saved_query_flyouts/open_saved_query_flyout.tsx 0.00% 1 Missing ⚠️
...c/plugins/data/public/ui/search_bar/search_bar.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8883   +/-   ##
=======================================
  Coverage   60.85%   60.86%           
=======================================
  Files        3802     3802           
  Lines       91062    91052   -10     
  Branches    14376    14370    -6     
=======================================
  Hits        55419    55419           
+ Misses      32104    32094   -10     
  Partials     3539     3539           
Flag Coverage Δ
Linux_1 29.01% <0.00%> (ø)
Linux_2 56.39% <ø> (ø)
Linux_3 37.87% <33.33%> (+<0.01%) ⬆️
Linux_4 29.00% <0.00%> (ø)
Windows_1 29.02% <0.00%> (ø)
Windows_2 56.34% <ø> (ø)
Windows_3 37.88% <33.33%> (+<0.01%) ⬆️
Windows_4 29.00% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

Signed-off-by: Amardeepsingh Siglani <[email protected]>
@amsiglan amsiglan force-pushed the avoid-resetting-dataset-on-saved-query-load branch from 7638610 to ff39b6d Compare November 19, 2024 01:04
kavilla
kavilla previously approved these changes Nov 19, 2024
Copy link
Collaborator

@virajsanghvi virajsanghvi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Were there not tests for most of these files? What is our plan to address?

Can you share a video/gif of the experience to help validate these changes?

@amsiglan
Copy link
Collaborator Author

amsiglan commented Nov 19, 2024

Were there not tests for most of these files? What is our plan to address?

Can you share a video/gif of the experience to help validate these changes?

Added video showing:

  • No option to store dataset
  • Not changing the selected dataset on query load

For the tests, we do have tests for Open flyout but not for Save flyout, will add it to our follow up tasks document

Signed-off-by: Amardeepsingh Siglani <[email protected]>
Copy link
Collaborator

@virajsanghvi virajsanghvi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approving assuming it passes ci

@kavilla kavilla merged commit a8d383b into opensearch-project:main Nov 19, 2024
74 of 75 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Nov 19, 2024
…uery (#8883)

Opening a saved query that has no dataset stored with it, resets the currently selected dataset in the picker which breaks the query experience since the user will need to reselect the dataset which will then reset the query.

* use currently selected data source when no source attached to saved query

Signed-off-by: Amardeepsingh Siglani <[email protected]>

* Changeset file for PR #8883 created/updated

* refactored fix

Signed-off-by: Amardeepsingh Siglani <[email protected]>

* revert license change

Signed-off-by: Amardeepsingh Siglani <[email protected]>

---------

Signed-off-by: Amardeepsingh Siglani <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
(cherry picked from commit a8d383b)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
raintygao pushed a commit to raintygao/OpenSearch-Dashboards that referenced this pull request Nov 20, 2024
…uery (opensearch-project#8883)

Opening a saved query that has no dataset stored with it, resets the currently selected dataset in the picker which breaks the query experience since the user will need to reselect the dataset which will then reset the query.

* use currently selected data source when no source attached to saved query

Signed-off-by: Amardeepsingh Siglani <[email protected]>

* Changeset file for PR opensearch-project#8883 created/updated

* refactored fix

Signed-off-by: Amardeepsingh Siglani <[email protected]>

* revert license change

Signed-off-by: Amardeepsingh Siglani <[email protected]>

---------

Signed-off-by: Amardeepsingh Siglani <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants