mirror of
https://github.com/lensapp/lens.git
synced 2024-12-01 10:37:09 +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:
parent
897e289514
commit
723cfe8ae8
@ -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),
|
||||
}),
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user