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

[workspace]add 2 step loading in 'Associate data sources' modal #8999

Conversation

Qxisylolo
Copy link
Contributor

@Qxisylolo Qxisylolo commented Dec 3, 2024

Description

This pr addresses the issue where a single data source has numerous connections, causing it to take more than 20 seconds to list the available data sources.
When a data source has numerous dqc connections, it will display the data source first with a badge 'loading' which will be replaced by '+n related' after dqc connections are completely loaded

Screenshot(updated)

2024-12-31.14.41.32.mov

Testing the changes

Changelog

  • feat: Add two-steps loading for associating data sources

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

Signed-off-by: Qxisylolo <[email protected]>
@Qxisylolo Qxisylolo changed the title add 2 step loading [workspace]add 2 step loading in 'Associate data sources' modal Dec 3, 2024
Copy link

codecov bot commented Dec 3, 2024

Codecov Report

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

Project coverage is 60.94%. Comparing base (f06a478) to head (58c3407).
Report is 31 commits behind head on main.

Files with missing lines Patch % Lines
...urce_association/association_data_source_modal.tsx 85.71% 2 Missing and 3 partials ⚠️
src/plugins/workspace/public/utils.ts 66.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8999      +/-   ##
==========================================
+ Coverage   60.86%   60.94%   +0.08%     
==========================================
  Files        3808     3809       +1     
  Lines       91209    91297      +88     
  Branches    14410    14416       +6     
==========================================
+ Hits        55514    55641     +127     
+ Misses      32154    32097      -57     
- Partials     3541     3559      +18     
Flag Coverage Δ
Linux_1 28.99% <82.92%> (-0.03%) ⬇️
Linux_2 56.45% <ø> (+0.06%) ⬆️
Linux_3 37.96% <ø> (?)
Linux_4 29.03% <ø> (+0.01%) ⬆️
Windows_1 29.01% <82.92%> (-0.03%) ⬇️
Windows_2 56.40% <ø> (+0.06%) ⬆️
Windows_3 37.97% <ø> (+0.03%) ⬆️
Windows_4 29.03% <ø> (+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.

Signed-off-by: Qxisylolo <[email protected]>
@Qxisylolo Qxisylolo force-pushed the feat/delay_in-_loading_data_sources branch from a3c139c to 9b4259d Compare December 11, 2024 10:28
@@ -25,7 +25,11 @@ import {
import { FormattedMessage } from 'react-intl';
import { i18n } from '@osd/i18n';

import { getDataSourcesList, fetchDataSourceConnections } from '../../utils';
Copy link
Member

Choose a reason for hiding this comment

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

I think we can remove function fetchDataSourceConnections if it's not used anymore.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fetchDataSourceConnections is also required in DataSourceTable, so perhaps we should keep it.

ruanyl
ruanyl previously approved these changes Dec 24, 2024
Signed-off-by: Qxisylolo <[email protected]>
Signed-off-by: Qxisylolo <[email protected]>
Signed-off-by: Qxisylolo <[email protected]>
Hailong-am
Hailong-am previously approved these changes Jan 3, 2025
selectedConnectionIds.includes(connection.id)
? ('on' as const)
: undefined,
prepend: <ConnectionIcon connection={connection} logos={logos} />,
Copy link
Collaborator

Choose a reason for hiding this comment

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

do we need to keep the style of indent 16px?

Copy link
Contributor Author

@Qxisylolo Qxisylolo Jan 3, 2025

Choose a reason for hiding this comment

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

Thanks for the comment, I think the indent is set by default in eui.

Signed-off-by: Qxisylolo <[email protected]>
Signed-off-by: Qxisylolo <[email protected]>
@SuZhou-Joe SuZhou-Joe merged commit eff5b27 into opensearch-project:main Jan 9, 2025
73 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jan 9, 2025
* add 2 step loading

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

* Changeset file for PR #8999 created/updated

* ifx ut

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

* resolve comments

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

* delete functions

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

* separately fetch dqc

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

* small mistakes

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

* dqc should not show data source without dqc

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

* fix tests

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

* new update

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

* delete non-used import

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

* delete if

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

* add try catch

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

---------

Signed-off-by: Qxisylolo <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Co-authored-by: Yulong Ruan <[email protected]>
(cherry picked from commit eff5b27)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
SuZhou-Joe pushed a commit that referenced this pull request Jan 9, 2025
… (#9163)

* add 2 step loading



* Changeset file for PR #8999 created/updated

* ifx ut



* resolve comments



* delete functions



* separately fetch dqc



* small mistakes



* dqc should not show data source without dqc



* fix tests



* new update



* delete non-used import



* delete if



* add try catch



---------




(cherry picked from commit eff5b27)

Signed-off-by: Qxisylolo <[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>
Co-authored-by: Yulong Ruan <[email protected]>
AMoo-Miki pushed a commit to AMoo-Miki/OpenSearch-Dashboards that referenced this pull request Jan 10, 2025
…search-project#8999)

* add 2 step loading

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

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

* ifx ut

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

* resolve comments

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

* delete functions

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

* separately fetch dqc

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

* small mistakes

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

* dqc should not show data source without dqc

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

* fix tests

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

* new update

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

* delete non-used import

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

* delete if

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

* add try catch

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

---------

Signed-off-by: Qxisylolo <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Co-authored-by: Yulong Ruan <[email protected]>
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.

6 participants