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

frontend: Sidebar/VersionButton: Add support for multiple clusters #2491

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

illume
Copy link
Collaborator

@illume illume commented Oct 30, 2024

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"

Signed-off-by: René Dudfield <[email protected]>
Co-authored-by: René Dudfield <[email protected]>
Signed-off-by: Joaquim Rocha <[email protected]>
@dosubot dosubot bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Oct 30, 2024
@illume illume added frontend Issues related to the frontend multi Multi cluster aggregated view labels Oct 30, 2024
Comment on lines +58 to +73
// 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,
// },
// };
Copy link
Collaborator

Choose a reason for hiding this comment

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

Meant to delete?

Copy link
Collaborator Author

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.

Comment on lines +81 to +89
// 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: '',
// },
// };
Copy link
Collaborator

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({
Copy link
Collaborator

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?

@illume illume marked this pull request as draft November 4, 2024 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend Issues related to the frontend multi Multi cluster aggregated view size:XXL This PR changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants