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

[Multiple Datasource] Add data source aggregated view to show all compatible data sources or only show used data sources #6129

Merged
merged 7 commits into from
Mar 16, 2024

Conversation

BionIT
Copy link
Collaborator

@BionIT BionIT commented Mar 13, 2024

Description

This change is based on requirement to show readonly view for all compatible connected data sources in the navigation bar, and also is capable of showing only the data sources passed by the plugins

Issues Resolved

Screenshot

readonlyaggregatedview.mp4

Testing the changes

The following were performed in the recording above:

  1. enable data source plugin
  2. change prop to not display all compatible data sources and pass in active data source ids should show the info icon and clicking on it, will show drop down with title called SELECTED DATA SOURCES, the button should show the number of active/used data sources
  3. change prop to display all compatible data sources and remove active data source ids should show the info icon and clicking on it, will show drop down with title called DATA SOURCES followed by number of compatible data sources and display them.

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: Lu Yu <[email protected]>
Copy link

codecov bot commented Mar 13, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 10 lines in your changes are missing coverage. Please review.

Project coverage is 67.22%. Comparing base (8c4f49a) to head (8f555f2).

Files Patch % Lines
...ce_aggregated_view/data_source_aggregated_view.tsx 84.37% 2 Missing and 3 partials ⚠️
...c/components/data_source_menu/data_source_menu.tsx 0.00% 4 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6129      +/-   ##
==========================================
+ Coverage   67.20%   67.22%   +0.01%     
==========================================
  Files        3333     3334       +1     
  Lines       64565    64602      +37     
  Branches    10391    10402      +11     
==========================================
+ Hits        43394    43430      +36     
+ Misses      18638    18635       -3     
- Partials     2533     2537       +4     
Flag Coverage Δ
Linux_1 31.69% <ø> (ø)
Linux_2 55.45% <ø> (ø)
Linux_3 ?
Linux_4 34.95% <0.00%> (-0.04%) ⬇️
Windows_1 31.72% <ø> (?)
Windows_2 55.41% <ø> (ø)
Windows_3 44.71% <75.00%> (+0.03%) ⬆️
Windows_4 34.95% <0.00%> (-0.04%) ⬇️

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.

@ruanyl ruanyl added the multiple datasource multiple datasource project label Mar 13, 2024
@BionIT BionIT added the v2.14.0 label Mar 15, 2024
}
})
.catch(() => {
this.props.notifications.addWarning(
Copy link
Member

Choose a reason for hiding this comment

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

We catch warning notifications here, but we didn't change the component state, do we need to set state to reflect the error condition?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If there is error, this will show a toast about the error

Comment on lines +59 to 61
if (!showDataSourceSelectable && !showDataSourceView && !showDataSourceAggregatedView) {
return null;
}
Copy link
Collaborator

@AMoo-Miki AMoo-Miki Mar 21, 2024

Choose a reason for hiding this comment

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

These 3 boolean values are used to control the appearance of this component. If it was just one variable, it would have been acceptable but anything more than one variable controlling how exclusively something is rendered is wrong. This has to be changed to a single ENUM variable.

PS: this piece of code cannot remain in the repo as is.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for the comment! Will address this in #6239 if the proposed change looks good @AMoo-Miki

opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 25, 2024
…patible data sources or only show used data sources (#6129)

* add data source aggregated view to show all compatible data sources or only used data sources

Signed-off-by: Lu Yu <[email protected]>

* add change log

Signed-off-by: Lu Yu <[email protected]>

* address comments and add more tests

Signed-off-by: Lu Yu <[email protected]>

---------

Signed-off-by: Lu Yu <[email protected]>
(cherry picked from commit 05abf5e)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md
BionIT pushed a commit that referenced this pull request Mar 25, 2024
…patible data sources or only show used data sources (#6129) (#6264)

* add data source aggregated view to show all compatible data sources or only used data sources

Signed-off-by: Lu Yu <[email protected]>

* add change log

Signed-off-by: Lu Yu <[email protected]>

* address comments and add more tests

Signed-off-by: Lu Yu <[email protected]>

---------

Signed-off-by: Lu Yu <[email protected]>
(cherry picked from commit 05abf5e)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md

Co-authored-by: github-actions[bot] <github-actions[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.

7 participants