-
Notifications
You must be signed in to change notification settings - Fork 885
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
[MD]Read hideLocalCluster setting from yml and set in data source selector and data source menu #6361
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added comments, in the recording, we can also show the local cluster should not be an option any more in the drop down when hidelocalcluster prop is set true
</EuiHeaderLinks> | ||
</MountPointPortal> | ||
); | ||
} | ||
return <DataSourceMenu {...props} />; | ||
return <DataSourceMenu {...props} hideLocalCluster={hideLocalCluster} />; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we missed adding the uiSettings option here in 726fb0e, could you help to add uiSettings here, to test, please use the example plugin for top nav menu https://github.com/opensearch-project/OpenSearch-Dashboards/blob/main/examples/multiple_data_source_examples/public/components/data_source_via_top_nav_menu.tsx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added. However when I tried to test it by using DataSourceSelectable
for top nav menu, it doesn't show "default" label for any options, Here's the recording.
iShot_2024-04-08_00.11.24.mp4
I think the issue is with that in top_nav_menu.tsx, DataSourceMenu
is not obtained by calling the dataSourceManagement.ui.getDataSourceMenu<DataSourceSelectableConfig>();
, but through a direct import as below code suggests.
OpenSearch-Dashboards/src/plugins/navigation/public/top_nav_menu/top_nav_menu.tsx
Line 44 in a0eaf84
import { DataSourceMenu, DataSourceMenuProps } from '../../../data_source_management/public'; |
Therefore, even I added the uiSetting
to createDataSourceMenu()
, it makes no difference for top nav menu use case, because ui.getDataSourceMenu
API is never called, and uiSetting
is never being passed through.
To solve this, we may want to make change to retrieve DataSourceMenu
through the ui.getDataSourceMenu
in top_nav_menu.tsx. This also brings up another issue with dev_tool and tutorial plugin, should they also change the way how they consume data source selector, to have consistent behavior? @BionIT What do you think? I can file an issue if it makes sense
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, yeah, could you help to cut an issue for that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, updated the recording |
…ector and data source menu Signed-off-by: Zhongnan Su <szhongna@amazon.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6361 +/- ##
===========================================
- Coverage 67.56% 54.53% -13.04%
===========================================
Files 3379 2271 -1108
Lines 65894 44499 -21395
Branches 10660 8276 -2384
===========================================
- Hits 44522 24268 -20254
+ Misses 18774 18469 -305
+ Partials 2598 1762 -836
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
...ata_source_management/public/components/data_source_selector/create_data_source_selector.tsx
Outdated
Show resolved
Hide resolved
Signed-off-by: Zhongnan Su <szhongna@amazon.com>
…ector and data source menu (#6361) * [MD]Read hideLocalCluster setting from yml and set in data source selector and data source menu Signed-off-by: Zhongnan Su <szhongna@amazon.com> * improve naming Signed-off-by: Zhongnan Su <szhongna@amazon.com> --------- Signed-off-by: Zhongnan Su <szhongna@amazon.com> (cherry picked from commit b4130aa) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md
…ector and data source menu (#6361) (#6374) * [MD]Read hideLocalCluster setting from yml and set in data source selector and data source menu Signed-off-by: Zhongnan Su <szhongna@amazon.com> * improve naming Signed-off-by: Zhongnan Su <szhongna@amazon.com> --------- Signed-off-by: Zhongnan Su <szhongna@amazon.com> (cherry picked from commit b4130aa) 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>
Description
data_source.hideLocalCluster
setting fromopensearch_dashboards.yml
, and always use this value to decide if to hide local cluster inDataSourceSelector
andDataSourceMenu
. This is expected behaviour because hide/show local cluster in data source visual components should be consistent across anywhere that consumes those components.hideLocalHost
an optional property ofDataSourceSelector
andDataSourceMenu
Issues Resolved
#6336
Screenshot
iShot_2024-04-08_00.34.05.mp4
Testing the changes
Check List
yarn test:jest
yarn test:jest_integration