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

[Discover] Dataset search on page load issues #8871

Merged
merged 5 commits into from
Nov 15, 2024

Conversation

kavilla
Copy link
Member

@kavilla kavilla commented Nov 15, 2024

Description

Required a double click on search and then also potentially loading issue.

Issues Resolved

n/a

Screenshot

Testing the changes

Unit tests. Also was able to recreate the bug. Switch the index pattern type config to not search on page load then switch off settings. I was able to run into the bug that required me to click twice to actually get results

Changelog

  • fix: Search on page load out of sync state when clicking submit.

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
Contributor

❌ Empty Changelog Section

The Changelog section in your PR description is empty. Please add a valid changelog entry or entries. If you did add a changelog entry, check to make sure that it was not accidentally included inside the comment block in the Changelog section.

Required a double click on search and then also potentially loading issue.

Issue
n/a

Signed-off-by: Kawika Avilla <[email protected]>
Signed-off-by: Kawika Avilla <[email protected]>
Signed-off-by: Kawika Avilla <[email protected]>
@kavilla kavilla force-pushed the kavilla/searchonloaddataset branch from 5cb3eb1 to 87f7cc7 Compare November 15, 2024 00:58
Copy link

codecov bot commented Nov 15, 2024

Codecov Report

Attention: Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 60.94%. Comparing base (bca4f5c) to head (71a26e2).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...ic/application/view_components/utils/use_search.ts 80.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8871   +/-   ##
=======================================
  Coverage   60.93%   60.94%           
=======================================
  Files        3800     3800           
  Lines       90880    90878    -2     
  Branches    14324    14324           
=======================================
  Hits        55382    55382           
+ Misses      31969    31968    -1     
+ Partials     3529     3528    -1     
Flag Coverage Δ
Linux_1 29.01% <0.00%> (+<0.01%) ⬆️
Linux_2 56.39% <ø> (ø)
Linux_3 37.92% <80.00%> (+<0.01%) ⬆️
Linux_4 29.00% <0.00%> (+<0.01%) ⬆️
Windows_1 29.02% <0.00%> (+<0.01%) ⬆️
Windows_2 56.34% <ø> (ø)
Windows_3 37.92% <80.00%> (-0.01%) ⬇️
Windows_4 29.00% <0.00%> (+<0.01%) ⬆️

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.

// A saved search is created on every page load, so we check the ID to see if we're loading a
// previously saved search or if it is just transient
return (
services.uiSettings.get(SEARCH_ON_PAGE_LOAD_SETTING) ||
datasetPreference ||
uiSettings.get(SEARCH_ON_PAGE_LOAD_SETTING) ||
Copy link
Collaborator

Choose a reason for hiding this comment

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

why repeat this when part of datasetPreference assignment above?

Copy link
Member

Choose a reason for hiding this comment

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

+1

Copy link
Member Author

Choose a reason for hiding this comment

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

i believe i was just over thinking. in terms of code it is redundant but i was little bit worried that return true if undefined isn't the most accurate depiction of what should happen.

but with fresh eyes that doesn't really make sense. in terms of the ci taking an hour, could this be a fast follow?

Copy link
Collaborator

Choose a reason for hiding this comment

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

sure, approving

// A saved search is created on every page load, so we check the ID to see if we're loading a
// previously saved search or if it is just transient
return (
services.uiSettings.get(SEARCH_ON_PAGE_LOAD_SETTING) ||
datasetPreference ||
uiSettings.get(SEARCH_ON_PAGE_LOAD_SETTING) ||
Copy link
Collaborator

Choose a reason for hiding this comment

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

sure, approving

@kavilla kavilla merged commit 42df421 into opensearch-project:main Nov 15, 2024
69 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Nov 15, 2024
* Dataset search on page load issues

Required a double click on search and then also potentially loading issue.

Issue
n/a

Signed-off-by: Kawika Avilla <[email protected]>

* Clean up dependencies

Signed-off-by: Kawika Avilla <[email protected]>

* Addresses issue

Signed-off-by: Kawika Avilla <[email protected]>

* add some tests

Signed-off-by: Kawika Avilla <[email protected]>

* Changeset file for PR #8871 created/updated

---------

Signed-off-by: Kawika Avilla <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
(cherry picked from commit 42df421)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
abbyhu2000 pushed a commit that referenced this pull request Nov 15, 2024
* Dataset search on page load issues

Required a double click on search and then also potentially loading issue.

Issue
n/a



* Clean up dependencies



* Addresses issue



* add some tests



* Changeset file for PR #8871 created/updated

---------



(cherry picked from commit 42df421)

Signed-off-by: Kawika Avilla <[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>
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