-
Notifications
You must be signed in to change notification settings - Fork 163
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
frontend: Sidebar/VersionButton: Add support for multiple clusters #2491
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: René Dudfield <[email protected]> Co-authored-by: René Dudfield <[email protected]> Signed-off-by: Joaquim Rocha <[email protected]>
// export const InClusterSidebarOpen = Template.bind({}); | ||
// InClusterSidebarOpen.args = { | ||
// isSidebarOpen: true, | ||
// selected: { | ||
// item: 'cluster', | ||
// sidebar: DefaultSidebars.IN_CLUSTER, | ||
// }, | ||
// }; | ||
// export const InClusterSidebarClosed = Template.bind({}); | ||
// InClusterSidebarClosed.args = { | ||
// isSidebarOpen: false, | ||
// selected: { | ||
// item: 'cluster', | ||
// sidebar: DefaultSidebars.IN_CLUSTER, | ||
// }, | ||
// }; |
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.
Meant to delete?
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.
These tests fail. Didn't look into why.
// export const SelectedItemWithSidebarOmitted = Template.bind({}); | ||
// SelectedItemWithSidebarOmitted.args = { | ||
// selected: { | ||
// item: 'workloads', | ||
// // This is what happens internally when plugins only set a selected name, not a selected sidebar. | ||
// // i.e. it will use the in-cluster sidebar by default. | ||
// sidebar: '', | ||
// }, | ||
// }; |
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.
Meant to delete?
@@ -62,49 +74,134 @@ export default function VersionButton() { | |||
]; | |||
} | |||
|
|||
const { data: clusterVersion } = useQuery({ |
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.
Maybe we should change by useQueries?
Note: Can someone please take this over?
This is causing some failing tests, see states which are commented out.
Probably this could be refactored to use the redux store for the version info so it's easier to test.
Because this component is included in the sidebar.
Or there's a different approach here: 85bdc1f
How to test
put two cluster context names in the URL eg, instead of "minikube" put "minikube+cluster1"