-
Notifications
You must be signed in to change notification settings - Fork 867
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] Create data source selectable menu using context menu and allow it to be consumed by plugins via Nav bar #6035
Comments
Thanks Lu.
Can you please consider having this as an additional prop to know which component to mount, i.e., |
Hi @RamakrishnaChilaka, for readonly, we will need to have a separate component for plugins to use since the behavior would be different for readonly and selectable based on current requirement. We can go through how it would look like in the plugin you work on and see if we can make it easy to consume on your side |
+1 for not mixing the two components into one by following single responsibility principle. actually, datasource context component might be more suitable name for second component base on requirement we know now. Though name is a little bit longer than readonly |
Got it, Thanks Lu, Huan. Summarising offline discussion with Lu regarding passing dataSourceLabel as well to We need this because, Taking an example use case: |
+1. Also adding context from security plugin perspective. Since we are going with a top nav menu header registration model, each individual tab will create a new instance of the ClusterSelector/DataSource Context component. Thus, we need some way to manage state within our plugin and be able to render the picker with a specific datasource selected. Thus, what ever datasource one is looking at for one tab will persist as they click to different tabs. Another use case where this may be helpful - some actions such as creation tabs where we are not allowing users to change cluster - I think is impossible to do without being able to pass in cluster selector (since it would default to local cluster with the picker disabled today). |
@BionIT, Currently, @derek-ho, I believe, as data source id is unique across data sources, it can be used to identify which option to show as label in read-only mode. |
Is your feature request related to a problem? Please describe.
In #5717, we implemented a data source picker in order to unify the experience when selecting data source in devtools, tutorial, etc. Based on requirement to place a data source selector into the navigation bar, we need to implement a new component based on context menu and be able to be consumed by external plugins via TopNavMenu.
Describe the solution you'd like
Implement a new component using context menu and allow external plugins to consume via TopNavMenu. The use of picker will be controlled by
showDataSourceMenu
property which is a boolean. We should also expose dataSourceMenuConfig which will contain customize options, eg, default option, disabled, filterFn, etcThere will be 2 states(read only vs selectable) for the data source selector in the nav bar, plugins need to decide which state to use based on which page user is at
Describe alternatives you've considered
Instead of having the selector in the nav bar, we can just let consumers to use the regular combo box based picker in the page.
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: