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

Add loading indicator and counter to query result #8212

Merged
merged 5 commits into from
Sep 20, 2024

Conversation

abbyhu2000
Copy link
Member

@abbyhu2000 abbyhu2000 commented Sep 17, 2024

Description

  • when a query takes longer than 3s to complete, a loading indicator will appear after 3s and will also show a time counter; the completion time will show in seconds.
  • when a query takes less than 1s to complete, the completion time will be shown in miliseconds.

Issues Resolved

Screenshot

Screen.Recording.2024-09-17.at.2.58.10.PM.mov

Testing the changes

Changelog

  • feat: Add loading indicator and counter to query result

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 Sep 17, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 7 lines in your changes missing coverage. Please review.

Project coverage is 64.06%. Comparing base (cea972f) to head (fec2623).
Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
...query_string/language_service/lib/query_result.tsx 70.00% 6 Missing ⚠️
...ic/application/view_components/utils/use_search.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8212   +/-   ##
=======================================
  Coverage   64.05%   64.06%           
=======================================
  Files        3741     3741           
  Lines       88682    88702   +20     
  Branches    13817    13822    +5     
=======================================
+ Hits        56809    56829   +20     
  Misses      31261    31261           
  Partials      612      612           
Flag Coverage Δ
Linux_1 30.04% <4.76%> (-0.01%) ⬇️
Linux_2 58.85% <ø> (ø)
Linux_3 40.36% <66.66%> (+0.02%) ⬆️
Linux_4 31.42% <5.00%> (-0.01%) ⬇️
Windows_1 30.05% <4.76%> (-0.01%) ⬇️
Windows_2 58.80% <ø> (ø)
Windows_3 40.36% <66.66%> (+0.02%) ⬆️
Windows_4 31.42% <5.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.

yarn.lock Outdated Show resolved Hide resolved
@abbyhu2000 abbyhu2000 force-pushed the loading_query_result branch 3 times, most recently from 687d610 to ba73d87 Compare September 19, 2024 22:48
Signed-off-by: abbyhu2000 <[email protected]>
Signed-off-by: abbyhu2000 <[email protected]>
Copy link
Member

@ashwin-pc ashwin-pc left a comment

Choose a reason for hiding this comment

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

Nice!

const getTime = () => {
const time = new Date().getTime() - props.queryStatus.startTime!;
if (time > BUFFER_TIME) {
setElapsedTime(time);
Copy link
Member

Choose a reason for hiding this comment

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

Its rounded down to seconds so that should not be a problem. Take a look at the video attached Miki :)

@abbyhu2000
Copy link
Member Author

Link checker failure not related:

* [404] [http://sites.google.com/site/murmurhash/](http://sites.google.com/site/murmurhash/) | Failed: Network error: Not Found 

@abbyhu2000 abbyhu2000 merged commit 27ba36c into opensearch-project:main Sep 20, 2024
66 of 67 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Sep 20, 2024
* add loading indicator and counter to query result

Signed-off-by: abbyhu2000 <[email protected]>

* Changeset file for PR #8212 created/updated

* add unit tests

Signed-off-by: abbyhu2000 <[email protected]>

* address comments

Signed-off-by: abbyhu2000 <[email protected]>

* update snapshot

Signed-off-by: abbyhu2000 <[email protected]>

---------

Signed-off-by: abbyhu2000 <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
(cherry picked from commit 27ba36c)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
opensearch-trigger-bot bot pushed a commit that referenced this pull request Sep 20, 2024
* add loading indicator and counter to query result

Signed-off-by: abbyhu2000 <[email protected]>

* Changeset file for PR #8212 created/updated

* add unit tests

Signed-off-by: abbyhu2000 <[email protected]>

* address comments

Signed-off-by: abbyhu2000 <[email protected]>

* update snapshot

Signed-off-by: abbyhu2000 <[email protected]>

---------

Signed-off-by: abbyhu2000 <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
(cherry picked from commit 27ba36c)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
abbyhu2000 pushed a commit that referenced this pull request Sep 20, 2024
* add loading indicator and counter to query result



* Changeset file for PR #8212 created/updated

* add unit tests



* address comments



* update snapshot



---------



(cherry picked from commit 27ba36c)

Signed-off-by: abbyhu2000 <[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>
abbyhu2000 pushed a commit that referenced this pull request Sep 20, 2024
* add loading indicator and counter to query result



* Changeset file for PR #8212 created/updated

* add unit tests



* address comments



* update snapshot



---------



(cherry picked from commit 27ba36c)

Signed-off-by: abbyhu2000 <[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>
amsiglan pushed a commit to amsiglan/OpenSearch-Dashboards that referenced this pull request Sep 20, 2024
…#8212)

* add loading indicator and counter to query result

Signed-off-by: abbyhu2000 <[email protected]>

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

* add unit tests

Signed-off-by: abbyhu2000 <[email protected]>

* address comments

Signed-off-by: abbyhu2000 <[email protected]>

* update snapshot

Signed-off-by: abbyhu2000 <[email protected]>

---------

Signed-off-by: abbyhu2000 <[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.

5 participants