Skip to content

Commit

Permalink
fix switch context on cluster overview (kyma-project#2360)
Browse files Browse the repository at this point in the history
* fix switch context on cluster overview

* bump

* remove clg
  • Loading branch information
mrCherry97 authored Feb 23, 2023
1 parent 60126d3 commit 8843941
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 20 deletions.
2 changes: 1 addition & 1 deletion resources/web/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spec:
spec:
containers:
- name: busola
image: eu.gcr.io/kyma-project/busola-web:PR-2361
image: eu.gcr.io/kyma-project/busola-web:PR-2360
imagePullPolicy: Always
resources:
requests:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,26 +214,41 @@ function createResults(context: CommandPaletteContext): Result[] {
};

if (resourceType === 'namespaces' && ['-a', '*', 'all'].includes(name)) {
return [
{
label: t('navigation.all-namespaces'),
category: resourceTypeText,
query: matchedNode.resourceType,
onActivate: () =>
sendNamespaceSwitchMessage('-all-', activeClusterName!, navigate),
customActionText: t('command-palette.item-actions.switch'),
},
{
label: t('navigation.all-namespaces'),
category: resourceTypeText,
query: matchedNode.resourceType,
onActivate: () => {
const pathname = `/cluster/${activeClusterName}/namespaces/-all-`;
navigate(pathname);
if (window.location.pathname.includes('namespaces')) {
return [
{
label: t('navigation.all-namespaces'),
category: resourceTypeText,
query: matchedNode.resourceType,
onActivate: () =>
sendNamespaceSwitchMessage('-all-', activeClusterName!, navigate),
customActionText: t('command-palette.item-actions.switch'),
},
},
linkToList,
];
{
label: t('navigation.all-namespaces'),
category: resourceTypeText,
query: matchedNode.resourceType,
onActivate: () => {
const pathname = `/cluster/${activeClusterName}/namespaces/-all-`;
navigate(pathname);
},
},
linkToList,
];
} else {
return [
{
label: t('navigation.all-namespaces'),
category: resourceTypeText,
query: matchedNode.resourceType,
onActivate: () => {
const pathname = `/cluster/${activeClusterName}/namespaces/-all-`;
navigate(pathname);
},
},
linkToList,
];
}
}

let resources = resourceCache[resourceType];
Expand Down

0 comments on commit 8843941

Please sign in to comment.