Skip to content

Add loading indicator and counter to query result#8212

Merged
abbyhu2000 merged 5 commits intoopensearch-project:mainfrom
abbyhu2000:loading_query_result
Sep 20, 2024
Merged

Add loading indicator and counter to query result#8212
abbyhu2000 merged 5 commits intoopensearch-project:mainfrom
abbyhu2000:loading_query_result

Conversation

@abbyhu2000
Copy link
Copy Markdown
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

@codecov
Copy link
Copy Markdown

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.

Comment thread src/plugins/data/public/query/query_string/language_service/lib/query_result.tsx Outdated
Comment thread src/plugins/discover/public/application/view_components/utils/use_search.ts Outdated
Comment thread yarn.lock Outdated
abbyhu2000 and others added 3 commits September 19, 2024 22:46
Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>
Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>
@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 <abigailhu2000@gmail.com>
Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
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 <abigailhu2000@gmail.com>

* Changeset file for PR #8212 created/updated

* add unit tests

Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>

* address comments

Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>

* update snapshot

Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>

---------

Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>
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 <abigailhu2000@gmail.com>

* Changeset file for PR #8212 created/updated

* add unit tests

Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>

* address comments

Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>

* update snapshot

Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>

---------

Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>
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 <abigailhu2000@gmail.com>
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 <abigailhu2000@gmail.com>
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 <abigailhu2000@gmail.com>

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

* add unit tests

Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>

* address comments

Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>

* update snapshot

Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>

---------

Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
virajsanghvi pushed a commit to virajsanghvi/OpenSearch-Dashboards that referenced this pull request Sep 24, 2024
…#8212)

* add loading indicator and counter to query result

Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>

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

* add unit tests

Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>

* address comments

Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>

* update snapshot

Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>

---------

Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
abbyhu2000 added a commit to abbyhu2000/OpenSearch-Dashboards that referenced this pull request Sep 24, 2024
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