1
0
mirror of https://github.com/lensapp/lens.git synced 2024-09-11 09:25:26 +03:00

fix: The command pallet command for navigating to Custom Resource Definitions should navigate to the correct route

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2023-05-15 14:32:01 -04:00 committed by Gabriel Accettola
parent 897e289514
commit 723cfe8ae8

View File

@ -34,13 +34,13 @@ import navigateToDaemonsetsInjectable from "../../../../common/front-end-routing
import navigateToStatefulsetsInjectable from "../../../../common/front-end-routing/routes/cluster/workloads/statefulsets/navigate-to-statefulsets.injectable";
import navigateToJobsInjectable from "../../../../common/front-end-routing/routes/cluster/workloads/jobs/navigate-to-jobs.injectable";
import navigateToCronJobsInjectable from "../../../../common/front-end-routing/routes/cluster/workloads/cron-jobs/navigate-to-cron-jobs.injectable";
import navigateToCustomResourcesInjectable from "../../../../common/front-end-routing/routes/cluster/custom-resources/navigate-to-custom-resources.injectable";
import navigateToEntitySettingsInjectable from "../../../../common/front-end-routing/routes/entity-settings/navigate-to-entity-settings.injectable";
// TODO: Importing from features is not OK. Make commands to comply with Open Closed Principle to allow moving implementation under a feature
import navigateToPreferencesInjectable from "../../../../features/preferences/common/navigate-to-preferences.injectable";
import type { HasCatalogEntitySettingItems } from "../../entity-settings/has-settings.injectable";
import hasCatalogEntitySettingItemsInjectable from "../../entity-settings/has-settings.injectable";
import navigateToCustomResourceDefinitionsInjectable from "../../../../common/front-end-routing/routes/cluster/custom-resources/navigate-to-custom-resource-definitions.injectable";
export function isKubernetesClusterActive(context: CommandContext): boolean {
return context.entity?.kind === "KubernetesCluster";
@ -71,7 +71,7 @@ interface Dependencies {
navigateToStatefulsets: () => void;
navigateToJobs: () => void;
navigateToCronJobs: () => void;
navigateToCustomResources: () => void;
navigateToCustomResourceDefinitions: () => void;
navigateToEntitySettings: (entityId: string) => void;
}
@ -206,7 +206,7 @@ function getInternalCommands(dependencies: Dependencies): CommandRegistration[]
id: "cluster.viewCustomResourceDefinitions",
title: "Cluster: View Custom Resource Definitions",
isActive: isKubernetesClusterActive,
action: () => dependencies.navigateToCustomResources(),
action: () => dependencies.navigateToCustomResourceDefinitions(),
},
{
id: "entity.viewSettings",
@ -278,7 +278,7 @@ const internalCommandsInjectable = getInjectable({
navigateToStatefulsets: di.inject(navigateToStatefulsetsInjectable),
navigateToJobs: di.inject(navigateToJobsInjectable),
navigateToCronJobs: di.inject(navigateToCronJobsInjectable),
navigateToCustomResources: di.inject(navigateToCustomResourcesInjectable),
navigateToCustomResourceDefinitions: di.inject(navigateToCustomResourceDefinitionsInjectable),
navigateToEntitySettings: di.inject(navigateToEntitySettingsInjectable),
}),
});