diff --git a/packages/core/src/features/preferences/renderer/preferences-route-component-for-legacy-extensions.injectable.ts b/packages/core/src/features/preferences/renderer/preferences-route-component-for-legacy-extensions.injectable.ts index 981c4b3c84..6fc57407dd 100644 --- a/packages/core/src/features/preferences/renderer/preferences-route-component-for-legacy-extensions.injectable.ts +++ b/packages/core/src/features/preferences/renderer/preferences-route-component-for-legacy-extensions.injectable.ts @@ -2,20 +2,14 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectable } from "@ogre-tools/injectable"; -import { routeSpecificComponentInjectionToken } from "../../../renderer/routes/route-specific-component-injection-token"; +import { getRouteSpecificComponentInjectable } from "../../../renderer/routes/route-specific-component-injection-token"; import preferencesRouteForLegacyExtensions from "../common/preferences-route-for-legacy-extensions.injectable"; import { Preferences } from "./preferences"; -const preferencesRouteComponentInjectable = getInjectable({ +const preferencesRouteComponentInjectable = getRouteSpecificComponentInjectable({ id: "preferences-route-component-for-legacy-extensions", - - instantiate: (di) => ({ - route: di.inject(preferencesRouteForLegacyExtensions), - Component: Preferences, - }), - - injectionToken: routeSpecificComponentInjectionToken, + routeInjectable: preferencesRouteForLegacyExtensions, + Component: Preferences, }); export default preferencesRouteComponentInjectable; diff --git a/packages/core/src/features/preferences/renderer/preferences-route-component.injectable.ts b/packages/core/src/features/preferences/renderer/preferences-route-component.injectable.ts index 5e90d51acc..fa502dd90a 100644 --- a/packages/core/src/features/preferences/renderer/preferences-route-component.injectable.ts +++ b/packages/core/src/features/preferences/renderer/preferences-route-component.injectable.ts @@ -2,20 +2,14 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectable } from "@ogre-tools/injectable"; -import { routeSpecificComponentInjectionToken } from "../../../renderer/routes/route-specific-component-injection-token"; +import { getRouteSpecificComponentInjectable } from "../../../renderer/routes/route-specific-component-injection-token"; import { Preferences } from "./preferences"; import preferencesRouteInjectable from "../common/preferences-route.injectable"; -const preferencesRouteComponentInjectable = getInjectable({ +const preferencesRouteComponentInjectable = getRouteSpecificComponentInjectable({ id: "preferences-route-component", - - instantiate: (di) => ({ - route: di.inject(preferencesRouteInjectable), - Component: Preferences, - }), - - injectionToken: routeSpecificComponentInjectionToken, + Component: Preferences, + routeInjectable: preferencesRouteInjectable, }); export default preferencesRouteComponentInjectable; diff --git a/packages/core/src/renderer/components/add-cluster/add-cluster-route-component.injectable.ts b/packages/core/src/renderer/components/add-cluster/add-cluster-route-component.injectable.ts index 5d41fd7b5b..4709554f06 100644 --- a/packages/core/src/renderer/components/add-cluster/add-cluster-route-component.injectable.ts +++ b/packages/core/src/renderer/components/add-cluster/add-cluster-route-component.injectable.ts @@ -2,20 +2,14 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectable } from "@ogre-tools/injectable"; import { AddCluster } from "./add-cluster"; -import { routeSpecificComponentInjectionToken } from "../../routes/route-specific-component-injection-token"; +import { getRouteSpecificComponentInjectable } from "../../routes/route-specific-component-injection-token"; import addClusterRouteInjectable from "../../../common/front-end-routing/routes/add-cluster/add-cluster-route.injectable"; -const addClusterRouteComponentInjectable = getInjectable({ +const addClusterRouteComponentInjectable = getRouteSpecificComponentInjectable({ id: "add-cluster-route-component", - - instantiate: (di) => ({ - route: di.inject(addClusterRouteInjectable), - Component: AddCluster, - }), - - injectionToken: routeSpecificComponentInjectionToken, + Component: AddCluster, + routeInjectable: addClusterRouteInjectable, }); export default addClusterRouteComponentInjectable; diff --git a/packages/core/src/renderer/components/catalog/catalog-route-component.injectable.ts b/packages/core/src/renderer/components/catalog/catalog-route-component.injectable.ts index feb450328f..910bf841d4 100644 --- a/packages/core/src/renderer/components/catalog/catalog-route-component.injectable.ts +++ b/packages/core/src/renderer/components/catalog/catalog-route-component.injectable.ts @@ -2,20 +2,14 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectable } from "@ogre-tools/injectable"; import { Catalog } from "./catalog"; import catalogRouteInjectable from "../../../common/front-end-routing/routes/catalog/catalog-route.injectable"; -import { routeSpecificComponentInjectionToken } from "../../routes/route-specific-component-injection-token"; +import { getRouteSpecificComponentInjectable } from "../../routes/route-specific-component-injection-token"; -const catalogRouteComponentInjectable = getInjectable({ +const catalogRouteComponentInjectable = getRouteSpecificComponentInjectable({ id: "catalog-route-component", - - instantiate: (di) => ({ - route: di.inject(catalogRouteInjectable), - Component: Catalog, - }), - - injectionToken: routeSpecificComponentInjectionToken, + Component: Catalog, + routeInjectable: catalogRouteInjectable, }); export default catalogRouteComponentInjectable; diff --git a/packages/core/src/renderer/components/cluster-manager/cluster-view-route-component.injectable.ts b/packages/core/src/renderer/components/cluster-manager/cluster-view-route-component.injectable.ts index 856f3647f0..3d6dad196c 100644 --- a/packages/core/src/renderer/components/cluster-manager/cluster-view-route-component.injectable.ts +++ b/packages/core/src/renderer/components/cluster-manager/cluster-view-route-component.injectable.ts @@ -2,20 +2,14 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectable } from "@ogre-tools/injectable"; import { ClusterView } from "./cluster-view"; import clusterViewRouteInjectable from "../../../common/front-end-routing/routes/cluster-view/cluster-view-route.injectable"; -import { routeSpecificComponentInjectionToken } from "../../routes/route-specific-component-injection-token"; +import { getRouteSpecificComponentInjectable } from "../../routes/route-specific-component-injection-token"; -const clusterViewRouteComponentInjectable = getInjectable({ +const clusterViewRouteComponentInjectable = getRouteSpecificComponentInjectable({ id: "cluster-view-route-component", - - instantiate: (di) => ({ - route: di.inject(clusterViewRouteInjectable), - Component: ClusterView, - }), - - injectionToken: routeSpecificComponentInjectionToken, + Component: ClusterView, + routeInjectable: clusterViewRouteInjectable, }); export default clusterViewRouteComponentInjectable; diff --git a/packages/core/src/renderer/components/cluster/cluster-overview-route-component.injectable.ts b/packages/core/src/renderer/components/cluster/cluster-overview-route-component.injectable.ts index 5f4e5516cd..c6a166eb11 100644 --- a/packages/core/src/renderer/components/cluster/cluster-overview-route-component.injectable.ts +++ b/packages/core/src/renderer/components/cluster/cluster-overview-route-component.injectable.ts @@ -2,20 +2,14 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectable } from "@ogre-tools/injectable"; -import { routeSpecificComponentInjectionToken } from "../../routes/route-specific-component-injection-token"; +import { getRouteSpecificComponentInjectable } from "../../routes/route-specific-component-injection-token"; import { ClusterOverview } from "./cluster-overview"; import clusterOverviewRouteInjectable from "../../../common/front-end-routing/routes/cluster/overview/cluster-overview-route.injectable"; -const clusterOverviewRouteComponentInjectable = getInjectable({ +const clusterOverviewRouteComponentInjectable = getRouteSpecificComponentInjectable({ id: "cluster-overview-route-component", - - instantiate: (di) => ({ - route: di.inject(clusterOverviewRouteInjectable), - Component: ClusterOverview, - }), - - injectionToken: routeSpecificComponentInjectionToken, + Component: ClusterOverview, + routeInjectable: clusterOverviewRouteInjectable, }); export default clusterOverviewRouteComponentInjectable; diff --git a/packages/core/src/renderer/components/config-horizontal-pod-autoscalers/route-component.injectable.ts b/packages/core/src/renderer/components/config-horizontal-pod-autoscalers/route-component.injectable.ts index a8b81ae0b1..e31deb3a09 100644 --- a/packages/core/src/renderer/components/config-horizontal-pod-autoscalers/route-component.injectable.ts +++ b/packages/core/src/renderer/components/config-horizontal-pod-autoscalers/route-component.injectable.ts @@ -2,20 +2,14 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectable } from "@ogre-tools/injectable"; -import { routeSpecificComponentInjectionToken } from "../../routes/route-specific-component-injection-token"; +import { getRouteSpecificComponentInjectable } from "../../routes/route-specific-component-injection-token"; import horizontalPodAutoscalersRouteInjectable from "../../../common/front-end-routing/routes/cluster/config/horizontal-pod-autoscalers/horizontal-pod-autoscalers-route.injectable"; import { HorizontalPodAutoscalers } from "./list-view"; -const horizontalPodAutoscalersRouteComponentInjectable = getInjectable({ +const horizontalPodAutoscalersRouteComponentInjectable = getRouteSpecificComponentInjectable({ id: "horizontal-pod-autoscalers-route-component", - - instantiate: (di) => ({ - route: di.inject(horizontalPodAutoscalersRouteInjectable), - Component: HorizontalPodAutoscalers, - }), - - injectionToken: routeSpecificComponentInjectionToken, + Component: HorizontalPodAutoscalers, + routeInjectable: horizontalPodAutoscalersRouteInjectable, }); export default horizontalPodAutoscalersRouteComponentInjectable; diff --git a/packages/core/src/renderer/components/config-leases/leases-route-component.injectable.ts b/packages/core/src/renderer/components/config-leases/leases-route-component.injectable.ts index ef0ffbf37d..145df92262 100644 --- a/packages/core/src/renderer/components/config-leases/leases-route-component.injectable.ts +++ b/packages/core/src/renderer/components/config-leases/leases-route-component.injectable.ts @@ -2,20 +2,14 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectable } from "@ogre-tools/injectable"; import { Leases } from "./leases"; import leasesRouteInjectable from "../../../common/front-end-routing/routes/cluster/config/leases/leases-route.injectable"; -import { routeSpecificComponentInjectionToken } from "../../routes/route-specific-component-injection-token"; +import { getRouteSpecificComponentInjectable } from "../../routes/route-specific-component-injection-token"; -const leasesRouteComponentInjectable = getInjectable({ +const leasesRouteComponentInjectable = getRouteSpecificComponentInjectable({ id: "leases-route-component", - - instantiate: (di) => ({ - route: di.inject(leasesRouteInjectable), - Component: Leases, - }), - - injectionToken: routeSpecificComponentInjectionToken, + routeInjectable: leasesRouteInjectable, + Component: Leases, }); export default leasesRouteComponentInjectable; diff --git a/packages/core/src/renderer/components/config-limit-ranges/limit-ranges-route-component.injectable.ts b/packages/core/src/renderer/components/config-limit-ranges/limit-ranges-route-component.injectable.ts index b79ffaa8f6..7dffc776f9 100644 --- a/packages/core/src/renderer/components/config-limit-ranges/limit-ranges-route-component.injectable.ts +++ b/packages/core/src/renderer/components/config-limit-ranges/limit-ranges-route-component.injectable.ts @@ -2,20 +2,14 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectable } from "@ogre-tools/injectable"; import { LimitRanges } from "./limit-ranges"; import limitRangesRouteInjectable from "../../../common/front-end-routing/routes/cluster/config/limit-ranges/limit-ranges-route.injectable"; -import { routeSpecificComponentInjectionToken } from "../../routes/route-specific-component-injection-token"; +import { getRouteSpecificComponentInjectable } from "../../routes/route-specific-component-injection-token"; -const limitRangesRouteComponentInjectable = getInjectable({ +const limitRangesRouteComponentInjectable = getRouteSpecificComponentInjectable({ id: "limit-ranges-route-component", - - instantiate: (di) => ({ - route: di.inject(limitRangesRouteInjectable), - Component: LimitRanges, - }), - - injectionToken: routeSpecificComponentInjectionToken, + Component: LimitRanges, + routeInjectable: limitRangesRouteInjectable, }); export default limitRangesRouteComponentInjectable; diff --git a/packages/core/src/renderer/components/config-maps/config-maps-route-component.injectable.ts b/packages/core/src/renderer/components/config-maps/config-maps-route-component.injectable.ts index fd9c7df320..28e053d7e2 100644 --- a/packages/core/src/renderer/components/config-maps/config-maps-route-component.injectable.ts +++ b/packages/core/src/renderer/components/config-maps/config-maps-route-component.injectable.ts @@ -2,20 +2,14 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectable } from "@ogre-tools/injectable"; import { ConfigMaps } from "./config-maps"; import configMapsRouteInjectable from "../../../common/front-end-routing/routes/cluster/config/config-maps/config-maps-route.injectable"; -import { routeSpecificComponentInjectionToken } from "../../routes/route-specific-component-injection-token"; +import { getRouteSpecificComponentInjectable } from "../../routes/route-specific-component-injection-token"; -const configMapsRouteComponentInjectable = getInjectable({ +const configMapsRouteComponentInjectable = getRouteSpecificComponentInjectable({ id: "config-maps-route-component", - - instantiate: (di) => ({ - route: di.inject(configMapsRouteInjectable), - Component: ConfigMaps, - }), - - injectionToken: routeSpecificComponentInjectionToken, + Component: ConfigMaps, + routeInjectable: configMapsRouteInjectable, }); export default configMapsRouteComponentInjectable; diff --git a/packages/core/src/renderer/components/config-mutating-webhook-configurations/mutating-webhook-configurations-route-component.injectable.ts b/packages/core/src/renderer/components/config-mutating-webhook-configurations/mutating-webhook-configurations-route-component.injectable.ts index 9f16b45cc6..6603213d09 100644 --- a/packages/core/src/renderer/components/config-mutating-webhook-configurations/mutating-webhook-configurations-route-component.injectable.ts +++ b/packages/core/src/renderer/components/config-mutating-webhook-configurations/mutating-webhook-configurations-route-component.injectable.ts @@ -2,23 +2,14 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectable } from "@ogre-tools/injectable"; -import { - routeSpecificComponentInjectionToken, -} from "../../routes/route-specific-component-injection-token"; -import mutatingWebhookConfigurationsRouteInjectable - from "../../../common/front-end-routing/routes/cluster/config/mutating-webhook-configurations/mutating-webhook-configurations-route.injectable"; +import { getRouteSpecificComponentInjectable } from "../../routes/route-specific-component-injection-token"; +import mutatingWebhookConfigurationsRouteInjectable from "../../../common/front-end-routing/routes/cluster/config/mutating-webhook-configurations/mutating-webhook-configurations-route.injectable"; import { MutatingWebhookConfigurations } from "./mutating-webhook-configurations"; -const mutatingWebhookConfigurationsRouteComponentInjectable = getInjectable({ +const mutatingWebhookConfigurationsRouteComponentInjectable = getRouteSpecificComponentInjectable({ id: "mutating-webhook-configuration-route-component", - - instantiate: (di) => ({ - route: di.inject(mutatingWebhookConfigurationsRouteInjectable), - Component: MutatingWebhookConfigurations, - }), - - injectionToken: routeSpecificComponentInjectionToken, + Component: MutatingWebhookConfigurations, + routeInjectable: mutatingWebhookConfigurationsRouteInjectable, }); export default mutatingWebhookConfigurationsRouteComponentInjectable; diff --git a/packages/core/src/renderer/components/config-pod-disruption-budgets/pod-disruption-budgets-route-component.injectable.ts b/packages/core/src/renderer/components/config-pod-disruption-budgets/pod-disruption-budgets-route-component.injectable.ts index e963b9408e..036892e4bb 100644 --- a/packages/core/src/renderer/components/config-pod-disruption-budgets/pod-disruption-budgets-route-component.injectable.ts +++ b/packages/core/src/renderer/components/config-pod-disruption-budgets/pod-disruption-budgets-route-component.injectable.ts @@ -2,20 +2,14 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectable } from "@ogre-tools/injectable"; import { PodDisruptionBudgets } from "./pod-disruption-budgets"; import podDisruptionBudgetsRouteInjectable from "../../../common/front-end-routing/routes/cluster/config/pod-disruption-budgets/pod-disruption-budgets-route.injectable"; -import { routeSpecificComponentInjectionToken } from "../../routes/route-specific-component-injection-token"; +import { getRouteSpecificComponentInjectable } from "../../routes/route-specific-component-injection-token"; -const podDisruptionBudgetsRouteComponentInjectable = getInjectable({ +const podDisruptionBudgetsRouteComponentInjectable = getRouteSpecificComponentInjectable({ id: "pod-disruption-budgets-route-component", - - instantiate: (di) => ({ - route: di.inject(podDisruptionBudgetsRouteInjectable), - Component: PodDisruptionBudgets, - }), - - injectionToken: routeSpecificComponentInjectionToken, + Component: PodDisruptionBudgets, + routeInjectable: podDisruptionBudgetsRouteInjectable, }); export default podDisruptionBudgetsRouteComponentInjectable; diff --git a/packages/core/src/renderer/components/config-priority-classes/priority-classes-route-component.injectable.ts b/packages/core/src/renderer/components/config-priority-classes/priority-classes-route-component.injectable.ts index 258d3eb336..eaeba91ebc 100644 --- a/packages/core/src/renderer/components/config-priority-classes/priority-classes-route-component.injectable.ts +++ b/packages/core/src/renderer/components/config-priority-classes/priority-classes-route-component.injectable.ts @@ -2,20 +2,14 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectable } from "@ogre-tools/injectable"; import { PriorityClasses } from "./priority-classes"; import priorityClassesRouteInjectable from "../../../common/front-end-routing/routes/cluster/config/priority-classes/priority-classes-route.injectable"; -import { routeSpecificComponentInjectionToken } from "../../routes/route-specific-component-injection-token"; +import { getRouteSpecificComponentInjectable } from "../../routes/route-specific-component-injection-token"; -const priorityClassesRouteComponentInjectable = getInjectable({ +const priorityClassesRouteComponentInjectable = getRouteSpecificComponentInjectable({ id: "priority-classes-route-component", - - instantiate: (di) => ({ - route: di.inject(priorityClassesRouteInjectable), - Component: PriorityClasses, - }), - - injectionToken: routeSpecificComponentInjectionToken, + Component: PriorityClasses, + routeInjectable: priorityClassesRouteInjectable, }); export default priorityClassesRouteComponentInjectable; diff --git a/packages/core/src/renderer/components/config-resource-quotas/resource-quotas-route-component.injectable.ts b/packages/core/src/renderer/components/config-resource-quotas/resource-quotas-route-component.injectable.ts index 8e138a7064..173b9e5905 100644 --- a/packages/core/src/renderer/components/config-resource-quotas/resource-quotas-route-component.injectable.ts +++ b/packages/core/src/renderer/components/config-resource-quotas/resource-quotas-route-component.injectable.ts @@ -2,22 +2,14 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectable } from "@ogre-tools/injectable"; import { ResourceQuotas } from "./resource-quotas"; import resourceQuotasRouteInjectable from "../../../common/front-end-routing/routes/cluster/config/resource-quotas/resource-quotas-route.injectable"; -import { - routeSpecificComponentInjectionToken, -} from "../../routes/route-specific-component-injection-token"; +import { getRouteSpecificComponentInjectable } from "../../routes/route-specific-component-injection-token"; -const resourceQuotasRouteComponentInjectable = getInjectable({ +const resourceQuotasRouteComponentInjectable = getRouteSpecificComponentInjectable({ id: "resource-quotas-route-component", - - instantiate: (di) => ({ - route: di.inject(resourceQuotasRouteInjectable), - Component: ResourceQuotas, - }), - - injectionToken: routeSpecificComponentInjectionToken, + Component: ResourceQuotas, + routeInjectable: resourceQuotasRouteInjectable, }); export default resourceQuotasRouteComponentInjectable; diff --git a/packages/core/src/renderer/components/config-secrets/secrets-route-component.injectable.ts b/packages/core/src/renderer/components/config-secrets/secrets-route-component.injectable.ts index 35dc02d5fe..6bfbc3accb 100644 --- a/packages/core/src/renderer/components/config-secrets/secrets-route-component.injectable.ts +++ b/packages/core/src/renderer/components/config-secrets/secrets-route-component.injectable.ts @@ -2,20 +2,14 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectable } from "@ogre-tools/injectable"; import { Secrets } from "./secrets"; import secretsRouteInjectable from "../../../common/front-end-routing/routes/cluster/config/secrets/secrets-route.injectable"; -import { routeSpecificComponentInjectionToken } from "../../routes/route-specific-component-injection-token"; +import { getRouteSpecificComponentInjectable } from "../../routes/route-specific-component-injection-token"; -const secretsRouteComponentInjectable = getInjectable({ +const secretsRouteComponentInjectable = getRouteSpecificComponentInjectable({ id: "secrets-route-component", - - instantiate: (di) => ({ - route: di.inject(secretsRouteInjectable), - Component: Secrets, - }), - - injectionToken: routeSpecificComponentInjectionToken, + Component: Secrets, + routeInjectable: secretsRouteInjectable, }); export default secretsRouteComponentInjectable; diff --git a/packages/core/src/renderer/components/config-validating-webhook-configurations/validating-webhook-configurations-route-component.injectable.ts b/packages/core/src/renderer/components/config-validating-webhook-configurations/validating-webhook-configurations-route-component.injectable.ts index 564c9b3c48..aa9e1ef0b4 100644 --- a/packages/core/src/renderer/components/config-validating-webhook-configurations/validating-webhook-configurations-route-component.injectable.ts +++ b/packages/core/src/renderer/components/config-validating-webhook-configurations/validating-webhook-configurations-route-component.injectable.ts @@ -2,23 +2,14 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectable } from "@ogre-tools/injectable"; -import { - routeSpecificComponentInjectionToken, -} from "../../routes/route-specific-component-injection-token"; -import validatingWebhookConfigurationsRouteInjectable - from "../../../common/front-end-routing/routes/cluster/config/validating-webhook-configurations/validating-webhook-configurations-route.injectable"; +import { getRouteSpecificComponentInjectable } from "../../routes/route-specific-component-injection-token"; +import validatingWebhookConfigurationsRouteInjectable from "../../../common/front-end-routing/routes/cluster/config/validating-webhook-configurations/validating-webhook-configurations-route.injectable"; import { ValidatingWebhookConfigurations } from "./validating-webhook-configurations"; -const validatingWebhookConfigurationsRouteComponentInjectable = getInjectable({ +const validatingWebhookConfigurationsRouteComponentInjectable = getRouteSpecificComponentInjectable({ id: "validating-webhook-configuration-route-component", - - instantiate: (di) => ({ - route: di.inject(validatingWebhookConfigurationsRouteInjectable), - Component: ValidatingWebhookConfigurations, - }), - - injectionToken: routeSpecificComponentInjectionToken, + Component: ValidatingWebhookConfigurations, + routeInjectable: validatingWebhookConfigurationsRouteInjectable, }); export default validatingWebhookConfigurationsRouteComponentInjectable; diff --git a/packages/core/src/renderer/components/config-vertical-pod-autoscalers/vertical-pod-autoscalers-route-component.injectable.ts b/packages/core/src/renderer/components/config-vertical-pod-autoscalers/vertical-pod-autoscalers-route-component.injectable.ts index 999a77e3d4..08cce88b31 100644 --- a/packages/core/src/renderer/components/config-vertical-pod-autoscalers/vertical-pod-autoscalers-route-component.injectable.ts +++ b/packages/core/src/renderer/components/config-vertical-pod-autoscalers/vertical-pod-autoscalers-route-component.injectable.ts @@ -2,20 +2,14 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectable } from "@ogre-tools/injectable"; -import { routeSpecificComponentInjectionToken } from "../../routes/route-specific-component-injection-token"; +import { getRouteSpecificComponentInjectable } from "../../routes/route-specific-component-injection-token"; import verticalPodAutoscalersRouteInjectable from "../../../common/front-end-routing/routes/cluster/config/vertical-pod-autoscalers/vertical-pod-autoscalers-route.injectable"; import { VerticalPodAutoscalers } from "./vpa"; -const verticalPodAutoscalersRouteComponentInjectable = getInjectable({ +const verticalPodAutoscalersRouteComponentInjectable = getRouteSpecificComponentInjectable({ id: "vertical-pod-autoscalers-route-component", - - instantiate: (di) => ({ - route: di.inject(verticalPodAutoscalersRouteInjectable), - Component: VerticalPodAutoscalers, - }), - - injectionToken: routeSpecificComponentInjectionToken, + Component: VerticalPodAutoscalers, + routeInjectable: verticalPodAutoscalersRouteInjectable, }); export default verticalPodAutoscalersRouteComponentInjectable; diff --git a/packages/core/src/renderer/components/custom-resources/route-component.injectable.ts b/packages/core/src/renderer/components/custom-resources/route-component.injectable.ts index dee6951404..4e999129cb 100644 --- a/packages/core/src/renderer/components/custom-resources/route-component.injectable.ts +++ b/packages/core/src/renderer/components/custom-resources/route-component.injectable.ts @@ -2,20 +2,14 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectable } from "@ogre-tools/injectable"; import { CustomResources } from "./view"; import customResourcesRouteInjectable from "../../../common/front-end-routing/routes/cluster/custom-resources/custom-resources-route.injectable"; -import { routeSpecificComponentInjectionToken } from "../../routes/route-specific-component-injection-token"; +import { getRouteSpecificComponentInjectable } from "../../routes/route-specific-component-injection-token"; -const customResourcesRouteComponentInjectable = getInjectable({ +const customResourcesRouteComponentInjectable = getRouteSpecificComponentInjectable({ id: "custom-resources-route-component", - - instantiate: (di) => ({ - route: di.inject(customResourcesRouteInjectable), - Component: CustomResources, - }), - - injectionToken: routeSpecificComponentInjectionToken, + Component: CustomResources, + routeInjectable: customResourcesRouteInjectable, }); export default customResourcesRouteComponentInjectable; diff --git a/packages/core/src/renderer/components/entity-settings/route-component.injectable.ts b/packages/core/src/renderer/components/entity-settings/route-component.injectable.ts index deedaca53a..9d6423555f 100644 --- a/packages/core/src/renderer/components/entity-settings/route-component.injectable.ts +++ b/packages/core/src/renderer/components/entity-settings/route-component.injectable.ts @@ -2,20 +2,14 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectable } from "@ogre-tools/injectable"; import { EntitySettingsRouteComponent } from "./entity-settings"; -import { routeSpecificComponentInjectionToken } from "../../routes/route-specific-component-injection-token"; +import { getRouteSpecificComponentInjectable } from "../../routes/route-specific-component-injection-token"; import entitySettingsRouteInjectable from "../../../common/front-end-routing/routes/entity-settings/entity-settings-route.injectable"; -const entitySettingsRouteComponentInjectable = getInjectable({ +const entitySettingsRouteComponentInjectable = getRouteSpecificComponentInjectable({ id: "entity-settings-route-component", - - instantiate: (di) => ({ - route: di.inject(entitySettingsRouteInjectable), - Component: EntitySettingsRouteComponent, - }), - - injectionToken: routeSpecificComponentInjectionToken, + Component: EntitySettingsRouteComponent, + routeInjectable: entitySettingsRouteInjectable, }); export default entitySettingsRouteComponentInjectable; diff --git a/packages/core/src/renderer/components/events/events-route-component.injectable.ts b/packages/core/src/renderer/components/events/events-route-component.injectable.ts index b9954b22c0..81737aa4d5 100644 --- a/packages/core/src/renderer/components/events/events-route-component.injectable.ts +++ b/packages/core/src/renderer/components/events/events-route-component.injectable.ts @@ -2,20 +2,14 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectable } from "@ogre-tools/injectable"; import { Events } from "./events"; import eventsRouteInjectable from "../../../common/front-end-routing/routes/cluster/events/events-route.injectable"; -import { routeSpecificComponentInjectionToken } from "../../routes/route-specific-component-injection-token"; +import { getRouteSpecificComponentInjectable } from "../../routes/route-specific-component-injection-token"; -const eventsRouteComponentInjectable = getInjectable({ +const eventsRouteComponentInjectable = getRouteSpecificComponentInjectable({ id: "events-route-component", - - instantiate: (di) => ({ - route: di.inject(eventsRouteInjectable), - Component: Events, - }), - - injectionToken: routeSpecificComponentInjectionToken, + Component: Events, + routeInjectable: eventsRouteInjectable, }); export default eventsRouteComponentInjectable; diff --git a/packages/core/src/renderer/components/extensions/extensions-route-component.injectable.ts b/packages/core/src/renderer/components/extensions/extensions-route-component.injectable.ts index aede3b340a..7d74766826 100644 --- a/packages/core/src/renderer/components/extensions/extensions-route-component.injectable.ts +++ b/packages/core/src/renderer/components/extensions/extensions-route-component.injectable.ts @@ -2,20 +2,14 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectable } from "@ogre-tools/injectable"; import { Extensions } from "./extensions"; import extensionsRouteInjectable from "../../../common/front-end-routing/routes/extensions/extensions-route.injectable"; -import { routeSpecificComponentInjectionToken } from "../../routes/route-specific-component-injection-token"; +import { getRouteSpecificComponentInjectable } from "../../routes/route-specific-component-injection-token"; -const extensionsRouteComponentInjectable = getInjectable({ +const extensionsRouteComponentInjectable = getRouteSpecificComponentInjectable({ id: "extensions-route-component", - - instantiate: (di) => ({ - route: di.inject(extensionsRouteInjectable), - Component: Extensions, - }), - - injectionToken: routeSpecificComponentInjectionToken, + Component: Extensions, + routeInjectable: extensionsRouteInjectable, }); export default extensionsRouteComponentInjectable; diff --git a/packages/core/src/renderer/components/helm-charts/helm-charts-route-component.injectable.ts b/packages/core/src/renderer/components/helm-charts/helm-charts-route-component.injectable.ts index 6cee1b1d42..8327c51430 100644 --- a/packages/core/src/renderer/components/helm-charts/helm-charts-route-component.injectable.ts +++ b/packages/core/src/renderer/components/helm-charts/helm-charts-route-component.injectable.ts @@ -2,20 +2,14 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectable } from "@ogre-tools/injectable"; import { HelmCharts } from "./helm-charts"; import helmChartsRouteInjectable from "../../../common/front-end-routing/routes/cluster/helm/charts/helm-charts-route.injectable"; -import { routeSpecificComponentInjectionToken } from "../../routes/route-specific-component-injection-token"; +import { getRouteSpecificComponentInjectable } from "../../routes/route-specific-component-injection-token"; -const helmChartsRouteComponentInjectable = getInjectable({ +const helmChartsRouteComponentInjectable = getRouteSpecificComponentInjectable({ id: "helm-charts-route-component", - - instantiate: (di) => ({ - route: di.inject(helmChartsRouteInjectable), - Component: HelmCharts, - }), - - injectionToken: routeSpecificComponentInjectionToken, + Component: HelmCharts, + routeInjectable: helmChartsRouteInjectable, }); export default helmChartsRouteComponentInjectable; diff --git a/packages/core/src/renderer/components/helm-releases/helm-releases-route-component.injectable.ts b/packages/core/src/renderer/components/helm-releases/helm-releases-route-component.injectable.ts index 8e08c2c093..87f25032e4 100644 --- a/packages/core/src/renderer/components/helm-releases/helm-releases-route-component.injectable.ts +++ b/packages/core/src/renderer/components/helm-releases/helm-releases-route-component.injectable.ts @@ -2,20 +2,14 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectable } from "@ogre-tools/injectable"; import { HelmReleases } from "./releases"; import helmReleasesRouteInjectable from "../../../common/front-end-routing/routes/cluster/helm/releases/helm-releases-route.injectable"; -import { routeSpecificComponentInjectionToken } from "../../routes/route-specific-component-injection-token"; +import { getRouteSpecificComponentInjectable } from "../../routes/route-specific-component-injection-token"; -const helmReleasesRouteComponentInjectable = getInjectable({ +const helmReleasesRouteComponentInjectable = getRouteSpecificComponentInjectable({ id: "helm-releases-route-component", - - instantiate: (di) => ({ - route: di.inject(helmReleasesRouteInjectable), - Component: HelmReleases, - }), - - injectionToken: routeSpecificComponentInjectionToken, + Component: HelmReleases, + routeInjectable: helmReleasesRouteInjectable, }); export default helmReleasesRouteComponentInjectable; diff --git a/packages/core/src/renderer/components/namespaces/namespaces-route-component.injectable.ts b/packages/core/src/renderer/components/namespaces/namespaces-route-component.injectable.ts index 3965510f1d..7277820a30 100644 --- a/packages/core/src/renderer/components/namespaces/namespaces-route-component.injectable.ts +++ b/packages/core/src/renderer/components/namespaces/namespaces-route-component.injectable.ts @@ -2,20 +2,14 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectable } from "@ogre-tools/injectable"; import { NamespacesRoute } from "./route"; import namespacesRouteInjectable from "../../../common/front-end-routing/routes/cluster/namespaces/namespaces-route.injectable"; -import { routeSpecificComponentInjectionToken } from "../../routes/route-specific-component-injection-token"; +import { getRouteSpecificComponentInjectable } from "../../routes/route-specific-component-injection-token"; -const namespacesRouteComponentInjectable = getInjectable({ +const namespacesRouteComponentInjectable = getRouteSpecificComponentInjectable({ id: "namespaces-route-component", - - instantiate: (di) => ({ - route: di.inject(namespacesRouteInjectable), - Component: NamespacesRoute, - }), - - injectionToken: routeSpecificComponentInjectionToken, + Component: NamespacesRoute, + routeInjectable: namespacesRouteInjectable, }); export default namespacesRouteComponentInjectable; diff --git a/packages/core/src/renderer/components/network-endpoints/endpoints-route-component.injectable.ts b/packages/core/src/renderer/components/network-endpoints/endpoints-route-component.injectable.ts index 0236e2be80..2974f7d5c7 100644 --- a/packages/core/src/renderer/components/network-endpoints/endpoints-route-component.injectable.ts +++ b/packages/core/src/renderer/components/network-endpoints/endpoints-route-component.injectable.ts @@ -2,20 +2,14 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectable } from "@ogre-tools/injectable"; import { Endpoints } from "./endpoints"; import endpointsRouteInjectable from "../../../common/front-end-routing/routes/cluster/network/endpoints/endpoints-route.injectable"; -import { routeSpecificComponentInjectionToken } from "../../routes/route-specific-component-injection-token"; +import { getRouteSpecificComponentInjectable } from "../../routes/route-specific-component-injection-token"; -const endpointsRouteComponentInjectable = getInjectable({ +const endpointsRouteComponentInjectable = getRouteSpecificComponentInjectable({ id: "endpoints-route-component", - - instantiate: (di) => ({ - route: di.inject(endpointsRouteInjectable), - Component: Endpoints, - }), - - injectionToken: routeSpecificComponentInjectionToken, + Component: Endpoints, + routeInjectable: endpointsRouteInjectable, }); export default endpointsRouteComponentInjectable; diff --git a/packages/core/src/renderer/components/network-ingresses/ingress-class-route-component.injectable.ts b/packages/core/src/renderer/components/network-ingresses/ingress-class-route-component.injectable.ts index eda5dd666b..b3dbc4d3fd 100644 --- a/packages/core/src/renderer/components/network-ingresses/ingress-class-route-component.injectable.ts +++ b/packages/core/src/renderer/components/network-ingresses/ingress-class-route-component.injectable.ts @@ -2,20 +2,14 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectable } from "@ogre-tools/injectable"; -import { routeSpecificComponentInjectionToken } from "../../routes/route-specific-component-injection-token"; +import { getRouteSpecificComponentInjectable } from "../../routes/route-specific-component-injection-token"; import ingressClassesRouteInjectable from "../../../common/front-end-routing/routes/cluster/network/ingress-class/ingress-classes-route.injectable"; import { IngressClasses } from "./ingress-classes"; -const ingressClassesRouteComponentInjectable = getInjectable({ +const ingressClassesRouteComponentInjectable = getRouteSpecificComponentInjectable({ id: "ingress-classes-route-component", - - instantiate: (di) => ({ - route: di.inject(ingressClassesRouteInjectable), - Component: IngressClasses, - }), - - injectionToken: routeSpecificComponentInjectionToken, + Component: IngressClasses, + routeInjectable: ingressClassesRouteInjectable, }); export default ingressClassesRouteComponentInjectable; diff --git a/packages/core/src/renderer/components/network-ingresses/ingresses-route-component.injectable.ts b/packages/core/src/renderer/components/network-ingresses/ingresses-route-component.injectable.ts index 17a015ad42..530390261c 100644 --- a/packages/core/src/renderer/components/network-ingresses/ingresses-route-component.injectable.ts +++ b/packages/core/src/renderer/components/network-ingresses/ingresses-route-component.injectable.ts @@ -2,20 +2,14 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectable } from "@ogre-tools/injectable"; import { Ingresses } from "./ingresses"; import ingressesRouteInjectable from "../../../common/front-end-routing/routes/cluster/network/ingresses/ingresses-route.injectable"; -import { routeSpecificComponentInjectionToken } from "../../routes/route-specific-component-injection-token"; +import { getRouteSpecificComponentInjectable } from "../../routes/route-specific-component-injection-token"; -const ingressesRouteComponentInjectable = getInjectable({ +const ingressesRouteComponentInjectable = getRouteSpecificComponentInjectable({ id: "ingresses-route-component", - - instantiate: (di) => ({ - route: di.inject(ingressesRouteInjectable), - Component: Ingresses, - }), - - injectionToken: routeSpecificComponentInjectionToken, + Component: Ingresses, + routeInjectable: ingressesRouteInjectable, }); export default ingressesRouteComponentInjectable; diff --git a/packages/core/src/renderer/components/network-policies/network-policies-route-component.injectable.ts b/packages/core/src/renderer/components/network-policies/network-policies-route-component.injectable.ts index 94d124d94a..6ca43ab9f0 100644 --- a/packages/core/src/renderer/components/network-policies/network-policies-route-component.injectable.ts +++ b/packages/core/src/renderer/components/network-policies/network-policies-route-component.injectable.ts @@ -2,20 +2,14 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectable } from "@ogre-tools/injectable"; import { NetworkPolicies } from "./network-policies"; import networkPoliciesRouteInjectable from "../../../common/front-end-routing/routes/cluster/network/network-policies/network-policies-route.injectable"; -import { routeSpecificComponentInjectionToken } from "../../routes/route-specific-component-injection-token"; +import { getRouteSpecificComponentInjectable } from "../../routes/route-specific-component-injection-token"; -const networkPoliciesRouteComponentInjectable = getInjectable({ +const networkPoliciesRouteComponentInjectable = getRouteSpecificComponentInjectable({ id: "network-policies-route-component", - - instantiate: (di) => ({ - route: di.inject(networkPoliciesRouteInjectable), - Component: NetworkPolicies, - }), - - injectionToken: routeSpecificComponentInjectionToken, + Component: NetworkPolicies, + routeInjectable: networkPoliciesRouteInjectable, }); export default networkPoliciesRouteComponentInjectable; diff --git a/packages/core/src/renderer/components/network-port-forwards/port-forwards-route-component.injectable.ts b/packages/core/src/renderer/components/network-port-forwards/port-forwards-route-component.injectable.ts index 01c5b3254f..21961321b1 100644 --- a/packages/core/src/renderer/components/network-port-forwards/port-forwards-route-component.injectable.ts +++ b/packages/core/src/renderer/components/network-port-forwards/port-forwards-route-component.injectable.ts @@ -2,20 +2,14 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectable } from "@ogre-tools/injectable"; import { PortForwards } from "./port-forwards"; import portForwardsRouteInjectable from "../../../common/front-end-routing/routes/cluster/network/port-forwards/port-forwards-route.injectable"; -import { routeSpecificComponentInjectionToken } from "../../routes/route-specific-component-injection-token"; +import { getRouteSpecificComponentInjectable } from "../../routes/route-specific-component-injection-token"; -const portForwardsRouteComponentInjectable = getInjectable({ +const portForwardsRouteComponentInjectable = getRouteSpecificComponentInjectable({ id: "port-forwards-route-component", - - instantiate: (di) => ({ - route: di.inject(portForwardsRouteInjectable), - Component: PortForwards, - }), - - injectionToken: routeSpecificComponentInjectionToken, + Component: PortForwards, + routeInjectable: portForwardsRouteInjectable, }); export default portForwardsRouteComponentInjectable; diff --git a/packages/core/src/renderer/components/network-services/services-route-component.injectable.ts b/packages/core/src/renderer/components/network-services/services-route-component.injectable.ts index c16b724e0a..b3be94568e 100644 --- a/packages/core/src/renderer/components/network-services/services-route-component.injectable.ts +++ b/packages/core/src/renderer/components/network-services/services-route-component.injectable.ts @@ -2,20 +2,14 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectable } from "@ogre-tools/injectable"; import { Services } from "./services"; import servicesRouteInjectable from "../../../common/front-end-routing/routes/cluster/network/services/services-route.injectable"; -import { routeSpecificComponentInjectionToken } from "../../routes/route-specific-component-injection-token"; +import { getRouteSpecificComponentInjectable } from "../../routes/route-specific-component-injection-token"; -const servicesRouteComponentInjectable = getInjectable({ +const servicesRouteComponentInjectable = getRouteSpecificComponentInjectable({ id: "services-route-component", - - instantiate: (di) => ({ - route: di.inject(servicesRouteInjectable), - Component: Services, - }), - - injectionToken: routeSpecificComponentInjectionToken, + Component: Services, + routeInjectable: servicesRouteInjectable, }); export default servicesRouteComponentInjectable; diff --git a/packages/core/src/renderer/components/nodes/nodes-route-component.injectable.ts b/packages/core/src/renderer/components/nodes/nodes-route-component.injectable.ts index 4db966406d..8be52af3d3 100644 --- a/packages/core/src/renderer/components/nodes/nodes-route-component.injectable.ts +++ b/packages/core/src/renderer/components/nodes/nodes-route-component.injectable.ts @@ -2,20 +2,14 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectable } from "@ogre-tools/injectable"; import { NodesRoute } from "./route"; import nodesRouteInjectable from "../../../common/front-end-routing/routes/cluster/nodes/nodes-route.injectable"; -import { routeSpecificComponentInjectionToken } from "../../routes/route-specific-component-injection-token"; +import { getRouteSpecificComponentInjectable } from "../../routes/route-specific-component-injection-token"; -const nodesRouteComponentInjectable = getInjectable({ +const nodesRouteComponentInjectable = getRouteSpecificComponentInjectable({ id: "nodes-route-component", - - instantiate: (di) => ({ - route: di.inject(nodesRouteInjectable), - Component: NodesRoute, - }), - - injectionToken: routeSpecificComponentInjectionToken, + Component: NodesRoute, + routeInjectable: nodesRouteInjectable, }); export default nodesRouteComponentInjectable; diff --git a/packages/core/src/renderer/components/pod-security-policies/pod-security-policies-route-component.injectable.ts b/packages/core/src/renderer/components/pod-security-policies/pod-security-policies-route-component.injectable.ts index 58b607e6d8..cfcbf05216 100644 --- a/packages/core/src/renderer/components/pod-security-policies/pod-security-policies-route-component.injectable.ts +++ b/packages/core/src/renderer/components/pod-security-policies/pod-security-policies-route-component.injectable.ts @@ -2,20 +2,14 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectable } from "@ogre-tools/injectable"; import { PodSecurityPolicies } from "./pod-security-policies"; import podSecurityPoliciesRouteInjectable from "../../../common/front-end-routing/routes/cluster/user-management/pod-security-policies/pod-security-policies-route.injectable"; -import { routeSpecificComponentInjectionToken } from "../../routes/route-specific-component-injection-token"; +import { getRouteSpecificComponentInjectable } from "../../routes/route-specific-component-injection-token"; -const podSecurityPoliciesRouteComponentInjectable = getInjectable({ +const podSecurityPoliciesRouteComponentInjectable = getRouteSpecificComponentInjectable({ id: "pod-security-policies-route-component", - - instantiate: (di) => ({ - route: di.inject(podSecurityPoliciesRouteInjectable), - Component: PodSecurityPolicies, - }), - - injectionToken: routeSpecificComponentInjectionToken, + Component: PodSecurityPolicies, + routeInjectable: podSecurityPoliciesRouteInjectable, }); export default podSecurityPoliciesRouteComponentInjectable; diff --git a/packages/core/src/renderer/components/storage-classes/storage-classes-route-component.injectable.ts b/packages/core/src/renderer/components/storage-classes/storage-classes-route-component.injectable.ts index c935983d78..c9664dfacf 100644 --- a/packages/core/src/renderer/components/storage-classes/storage-classes-route-component.injectable.ts +++ b/packages/core/src/renderer/components/storage-classes/storage-classes-route-component.injectable.ts @@ -2,20 +2,14 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectable } from "@ogre-tools/injectable"; import { StorageClasses } from "./storage-classes"; import storageClassesRouteInjectable from "../../../common/front-end-routing/routes/cluster/storage/storage-classes/storage-classes-route.injectable"; -import { routeSpecificComponentInjectionToken } from "../../routes/route-specific-component-injection-token"; +import { getRouteSpecificComponentInjectable } from "../../routes/route-specific-component-injection-token"; -const storageClassesRouteComponentInjectable = getInjectable({ +const storageClassesRouteComponentInjectable = getRouteSpecificComponentInjectable({ id: "storage-classes-route-component", - - instantiate: (di) => ({ - route: di.inject(storageClassesRouteInjectable), - Component: StorageClasses, - }), - - injectionToken: routeSpecificComponentInjectionToken, + Component: StorageClasses, + routeInjectable: storageClassesRouteInjectable, }); export default storageClassesRouteComponentInjectable; diff --git a/packages/core/src/renderer/components/storage-volume-claims/persistent-volume-claims-route-component.injectable.ts b/packages/core/src/renderer/components/storage-volume-claims/persistent-volume-claims-route-component.injectable.ts index 2c5cef3fcb..4052a6ecdf 100644 --- a/packages/core/src/renderer/components/storage-volume-claims/persistent-volume-claims-route-component.injectable.ts +++ b/packages/core/src/renderer/components/storage-volume-claims/persistent-volume-claims-route-component.injectable.ts @@ -2,20 +2,14 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectable } from "@ogre-tools/injectable"; import { PersistentVolumeClaims } from "./volume-claims"; import persistentVolumeClaimsRouteInjectable from "../../../common/front-end-routing/routes/cluster/storage/persistent-volume-claims/persistent-volume-claims-route.injectable"; -import { routeSpecificComponentInjectionToken } from "../../routes/route-specific-component-injection-token"; +import { getRouteSpecificComponentInjectable } from "../../routes/route-specific-component-injection-token"; -const persistentVolumeClaimsRouteComponentInjectable = getInjectable({ +const persistentVolumeClaimsRouteComponentInjectable = getRouteSpecificComponentInjectable({ id: "persistent-volume-claims-route-component", - - instantiate: (di) => ({ - route: di.inject(persistentVolumeClaimsRouteInjectable), - Component: PersistentVolumeClaims, - }), - - injectionToken: routeSpecificComponentInjectionToken, + Component: PersistentVolumeClaims, + routeInjectable: persistentVolumeClaimsRouteInjectable, }); export default persistentVolumeClaimsRouteComponentInjectable; diff --git a/packages/core/src/renderer/components/storage-volumes/persistent-volumes-route-component.injectable.ts b/packages/core/src/renderer/components/storage-volumes/persistent-volumes-route-component.injectable.ts index 4ef6443384..59f70bccf2 100644 --- a/packages/core/src/renderer/components/storage-volumes/persistent-volumes-route-component.injectable.ts +++ b/packages/core/src/renderer/components/storage-volumes/persistent-volumes-route-component.injectable.ts @@ -2,21 +2,15 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectable } from "@ogre-tools/injectable"; import { PersistentVolumes } from "./volumes"; import persistentVolumesRouteInjectable from "../../../common/front-end-routing/routes/cluster/storage/persistent-volumes/persistent-volumes-route.injectable"; -import { routeSpecificComponentInjectionToken } from "../../routes/route-specific-component-injection-token"; +import { getRouteSpecificComponentInjectable } from "../../routes/route-specific-component-injection-token"; -const persistentVolumesRouteComponentInjectable = getInjectable({ +const persistentVolumesRouteComponentInjectable = getRouteSpecificComponentInjectable({ id: "persistent-volumes-route-component", - - instantiate: (di) => ({ - route: di.inject(persistentVolumesRouteInjectable), - Component: PersistentVolumes, - }), - - injectionToken: routeSpecificComponentInjectionToken, + Component: PersistentVolumes, + routeInjectable: persistentVolumesRouteInjectable, }); export default persistentVolumesRouteComponentInjectable; diff --git a/packages/core/src/renderer/components/user-management/cluster-role-bindings/cluster-role-bindings-route-component.injectable.ts b/packages/core/src/renderer/components/user-management/cluster-role-bindings/cluster-role-bindings-route-component.injectable.ts index 47de616795..7c54ea043f 100644 --- a/packages/core/src/renderer/components/user-management/cluster-role-bindings/cluster-role-bindings-route-component.injectable.ts +++ b/packages/core/src/renderer/components/user-management/cluster-role-bindings/cluster-role-bindings-route-component.injectable.ts @@ -2,20 +2,14 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectable } from "@ogre-tools/injectable"; import { ClusterRoleBindings } from "./view"; import clusterRoleBindingsRouteInjectable from "../../../../common/front-end-routing/routes/cluster/user-management/cluster-role-bindings/cluster-role-bindings-route.injectable"; -import { routeSpecificComponentInjectionToken } from "../../../routes/route-specific-component-injection-token"; +import { getRouteSpecificComponentInjectable } from "../../../routes/route-specific-component-injection-token"; -const clusterRoleBindingsRouteComponentInjectable = getInjectable({ +const clusterRoleBindingsRouteComponentInjectable = getRouteSpecificComponentInjectable({ id: "cluster-role-bindings-route-component", - - instantiate: (di) => ({ - route: di.inject(clusterRoleBindingsRouteInjectable), - Component: ClusterRoleBindings, - }), - - injectionToken: routeSpecificComponentInjectionToken, + Component: ClusterRoleBindings, + routeInjectable: clusterRoleBindingsRouteInjectable, }); export default clusterRoleBindingsRouteComponentInjectable; diff --git a/packages/core/src/renderer/components/user-management/cluster-roles/cluster-roles-route-component.injectable.ts b/packages/core/src/renderer/components/user-management/cluster-roles/cluster-roles-route-component.injectable.ts index 829ae16baa..fdc79be32d 100644 --- a/packages/core/src/renderer/components/user-management/cluster-roles/cluster-roles-route-component.injectable.ts +++ b/packages/core/src/renderer/components/user-management/cluster-roles/cluster-roles-route-component.injectable.ts @@ -2,20 +2,14 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectable } from "@ogre-tools/injectable"; import { ClusterRoles } from "./view"; import clusterRolesRouteInjectable from "../../../../common/front-end-routing/routes/cluster/user-management/cluster-roles/cluster-roles-route.injectable"; -import { routeSpecificComponentInjectionToken } from "../../../routes/route-specific-component-injection-token"; +import { getRouteSpecificComponentInjectable } from "../../../routes/route-specific-component-injection-token"; -const clusterRolesRouteComponentInjectable = getInjectable({ +const clusterRolesRouteComponentInjectable = getRouteSpecificComponentInjectable({ id: "cluster-roles-route-component", - - instantiate: (di) => ({ - route: di.inject(clusterRolesRouteInjectable), - Component: ClusterRoles, - }), - - injectionToken: routeSpecificComponentInjectionToken, + Component: ClusterRoles, + routeInjectable: clusterRolesRouteInjectable, }); export default clusterRolesRouteComponentInjectable; diff --git a/packages/core/src/renderer/components/user-management/role-bindings/role-bindings-route-component.injectable.ts b/packages/core/src/renderer/components/user-management/role-bindings/role-bindings-route-component.injectable.ts index 4d0ccb4bca..e5c1ba10e4 100644 --- a/packages/core/src/renderer/components/user-management/role-bindings/role-bindings-route-component.injectable.ts +++ b/packages/core/src/renderer/components/user-management/role-bindings/role-bindings-route-component.injectable.ts @@ -2,20 +2,14 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectable } from "@ogre-tools/injectable"; import { RoleBindings } from "./view"; import roleBindingsRouteInjectable from "../../../../common/front-end-routing/routes/cluster/user-management/role-bindings/role-bindings-route.injectable"; -import { routeSpecificComponentInjectionToken } from "../../../routes/route-specific-component-injection-token"; +import { getRouteSpecificComponentInjectable } from "../../../routes/route-specific-component-injection-token"; -const roleBindingsRouteComponentInjectable = getInjectable({ +const roleBindingsRouteComponentInjectable = getRouteSpecificComponentInjectable({ id: "role-bindings-route-component", - - instantiate: (di) => ({ - route: di.inject(roleBindingsRouteInjectable), - Component: RoleBindings, - }), - - injectionToken: routeSpecificComponentInjectionToken, + Component: RoleBindings, + routeInjectable: roleBindingsRouteInjectable, }); export default roleBindingsRouteComponentInjectable; diff --git a/packages/core/src/renderer/components/user-management/roles/roles-route-component.injectable.ts b/packages/core/src/renderer/components/user-management/roles/roles-route-component.injectable.ts index 980b2499de..9dd465fb4c 100644 --- a/packages/core/src/renderer/components/user-management/roles/roles-route-component.injectable.ts +++ b/packages/core/src/renderer/components/user-management/roles/roles-route-component.injectable.ts @@ -2,20 +2,14 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectable } from "@ogre-tools/injectable"; import { Roles } from "./view"; import rolesRouteInjectable from "../../../../common/front-end-routing/routes/cluster/user-management/roles/roles-route.injectable"; -import { routeSpecificComponentInjectionToken } from "../../../routes/route-specific-component-injection-token"; +import { getRouteSpecificComponentInjectable } from "../../../routes/route-specific-component-injection-token"; -const rolesRouteComponentInjectable = getInjectable({ +const rolesRouteComponentInjectable = getRouteSpecificComponentInjectable({ id: "roles-route-component", - - instantiate: (di) => ({ - route: di.inject(rolesRouteInjectable), - Component: Roles, - }), - - injectionToken: routeSpecificComponentInjectionToken, + Component: Roles, + routeInjectable: rolesRouteInjectable, }); export default rolesRouteComponentInjectable; diff --git a/packages/core/src/renderer/components/user-management/service-accounts/service-accounts-route-component.injectable.ts b/packages/core/src/renderer/components/user-management/service-accounts/service-accounts-route-component.injectable.ts index 5903af5194..ae34335761 100644 --- a/packages/core/src/renderer/components/user-management/service-accounts/service-accounts-route-component.injectable.ts +++ b/packages/core/src/renderer/components/user-management/service-accounts/service-accounts-route-component.injectable.ts @@ -2,20 +2,14 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectable } from "@ogre-tools/injectable"; import { ServiceAccounts } from "./view"; import serviceAccountsRouteInjectable from "../../../../common/front-end-routing/routes/cluster/user-management/service-accounts/service-accounts-route.injectable"; -import { routeSpecificComponentInjectionToken } from "../../../routes/route-specific-component-injection-token"; +import { getRouteSpecificComponentInjectable } from "../../../routes/route-specific-component-injection-token"; -const serviceAccountsRouteComponentInjectable = getInjectable({ +const serviceAccountsRouteComponentInjectable = getRouteSpecificComponentInjectable({ id: "service-accounts-route-component", - - instantiate: (di) => ({ - route: di.inject(serviceAccountsRouteInjectable), - Component: ServiceAccounts, - }), - - injectionToken: routeSpecificComponentInjectionToken, + Component: ServiceAccounts, + routeInjectable: serviceAccountsRouteInjectable, }); export default serviceAccountsRouteComponentInjectable; diff --git a/packages/core/src/renderer/components/welcome/default-welcome-route-component.injectable.ts b/packages/core/src/renderer/components/welcome/default-welcome-route-component.injectable.ts index 5472c49787..3f826a847c 100644 --- a/packages/core/src/renderer/components/welcome/default-welcome-route-component.injectable.ts +++ b/packages/core/src/renderer/components/welcome/default-welcome-route-component.injectable.ts @@ -2,20 +2,14 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectable } from "@ogre-tools/injectable"; import { Welcome } from "./welcome"; import defaultWelcomeRouteInjectable from "../../../common/front-end-routing/routes/welcome/default-welcome-route.injectable"; -import { routeSpecificComponentInjectionToken } from "../../routes/route-specific-component-injection-token"; +import { getRouteSpecificComponentInjectable } from "../../routes/route-specific-component-injection-token"; -const defaultWelcomeRouteComponentInjectable = getInjectable({ +const defaultWelcomeRouteComponentInjectable = getRouteSpecificComponentInjectable({ id: "default-welcome-route-component", - - instantiate: (di) => ({ - route: di.inject(defaultWelcomeRouteInjectable), - Component: Welcome, - }), - - injectionToken: routeSpecificComponentInjectionToken, + Component: Welcome, + routeInjectable: defaultWelcomeRouteInjectable, }); export default defaultWelcomeRouteComponentInjectable; diff --git a/packages/core/src/renderer/components/workloads-cronjobs/cron-jobs-route-component.injectable.ts b/packages/core/src/renderer/components/workloads-cronjobs/cron-jobs-route-component.injectable.ts index 0a774177bd..bf8f498b2e 100644 --- a/packages/core/src/renderer/components/workloads-cronjobs/cron-jobs-route-component.injectable.ts +++ b/packages/core/src/renderer/components/workloads-cronjobs/cron-jobs-route-component.injectable.ts @@ -2,20 +2,14 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectable } from "@ogre-tools/injectable"; import { CronJobs } from "./cronjobs"; import cronJobsRouteInjectable from "../../../common/front-end-routing/routes/cluster/workloads/cron-jobs/cron-jobs-route.injectable"; -import { routeSpecificComponentInjectionToken } from "../../routes/route-specific-component-injection-token"; +import { getRouteSpecificComponentInjectable } from "../../routes/route-specific-component-injection-token"; -const cronJobsRouteComponentInjectable = getInjectable({ +const cronJobsRouteComponentInjectable = getRouteSpecificComponentInjectable({ id: "cron-jobs-route-component", - - instantiate: (di) => ({ - route: di.inject(cronJobsRouteInjectable), - Component: CronJobs, - }), - - injectionToken: routeSpecificComponentInjectionToken, + Component: CronJobs, + routeInjectable: cronJobsRouteInjectable, }); export default cronJobsRouteComponentInjectable; diff --git a/packages/core/src/renderer/components/workloads-daemonsets/daemonsets-route-component.injectable.ts b/packages/core/src/renderer/components/workloads-daemonsets/daemonsets-route-component.injectable.ts index 329c36943c..cdf732c543 100644 --- a/packages/core/src/renderer/components/workloads-daemonsets/daemonsets-route-component.injectable.ts +++ b/packages/core/src/renderer/components/workloads-daemonsets/daemonsets-route-component.injectable.ts @@ -2,20 +2,14 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectable } from "@ogre-tools/injectable"; import { DaemonSets } from "./daemonsets"; import daemonsetsRouteInjectable from "../../../common/front-end-routing/routes/cluster/workloads/daemonsets/daemonsets-route.injectable"; -import { routeSpecificComponentInjectionToken } from "../../routes/route-specific-component-injection-token"; +import { getRouteSpecificComponentInjectable } from "../../routes/route-specific-component-injection-token"; -const daemonsetsRouteComponentInjectable = getInjectable({ +const daemonsetsRouteComponentInjectable = getRouteSpecificComponentInjectable({ id: "daemonsets-route-component", - - instantiate: (di) => ({ - route: di.inject(daemonsetsRouteInjectable), - Component: DaemonSets, - }), - - injectionToken: routeSpecificComponentInjectionToken, + Component: DaemonSets, + routeInjectable: daemonsetsRouteInjectable, }); export default daemonsetsRouteComponentInjectable; diff --git a/packages/core/src/renderer/components/workloads-deployments/deployments-route-component.injectable.ts b/packages/core/src/renderer/components/workloads-deployments/deployments-route-component.injectable.ts index 65ec34acb2..43d041c8df 100644 --- a/packages/core/src/renderer/components/workloads-deployments/deployments-route-component.injectable.ts +++ b/packages/core/src/renderer/components/workloads-deployments/deployments-route-component.injectable.ts @@ -2,20 +2,14 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectable } from "@ogre-tools/injectable"; import { Deployments } from "./deployments"; import deploymentsRouteInjectable from "../../../common/front-end-routing/routes/cluster/workloads/deployments/deployments-route.injectable"; -import { routeSpecificComponentInjectionToken } from "../../routes/route-specific-component-injection-token"; +import { getRouteSpecificComponentInjectable } from "../../routes/route-specific-component-injection-token"; -const deploymentsRouteComponentInjectable = getInjectable({ +const deploymentsRouteComponentInjectable = getRouteSpecificComponentInjectable({ id: "deployments-route-component", - - instantiate: (di) => ({ - route: di.inject(deploymentsRouteInjectable), - Component: Deployments, - }), - - injectionToken: routeSpecificComponentInjectionToken, + Component: Deployments, + routeInjectable: deploymentsRouteInjectable, }); export default deploymentsRouteComponentInjectable; diff --git a/packages/core/src/renderer/components/workloads-jobs/jobs-route-component.injectable.ts b/packages/core/src/renderer/components/workloads-jobs/jobs-route-component.injectable.ts index e060cf95ee..5fb4e0c013 100644 --- a/packages/core/src/renderer/components/workloads-jobs/jobs-route-component.injectable.ts +++ b/packages/core/src/renderer/components/workloads-jobs/jobs-route-component.injectable.ts @@ -2,20 +2,14 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectable } from "@ogre-tools/injectable"; import { Jobs } from "./jobs"; import jobsRouteInjectable from "../../../common/front-end-routing/routes/cluster/workloads/jobs/jobs-route.injectable"; -import { routeSpecificComponentInjectionToken } from "../../routes/route-specific-component-injection-token"; +import { getRouteSpecificComponentInjectable } from "../../routes/route-specific-component-injection-token"; -const jobsRouteComponentInjectable = getInjectable({ +const jobsRouteComponentInjectable = getRouteSpecificComponentInjectable({ id: "jobs-route-component", - - instantiate: (di) => ({ - route: di.inject(jobsRouteInjectable), - Component: Jobs, - }), - - injectionToken: routeSpecificComponentInjectionToken, + Component: Jobs, + routeInjectable: jobsRouteInjectable, }); export default jobsRouteComponentInjectable; diff --git a/packages/core/src/renderer/components/workloads-overview/workloads-overview-route-component.injectable.ts b/packages/core/src/renderer/components/workloads-overview/workloads-overview-route-component.injectable.ts index 59a2a6d7ae..c7a1edbb69 100644 --- a/packages/core/src/renderer/components/workloads-overview/workloads-overview-route-component.injectable.ts +++ b/packages/core/src/renderer/components/workloads-overview/workloads-overview-route-component.injectable.ts @@ -2,20 +2,14 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectable } from "@ogre-tools/injectable"; import { WorkloadsOverview } from "./overview"; import workloadsOverviewRouteInjectable from "../../../common/front-end-routing/routes/cluster/workloads/overview/workloads-overview-route.injectable"; -import { routeSpecificComponentInjectionToken } from "../../routes/route-specific-component-injection-token"; +import { getRouteSpecificComponentInjectable } from "../../routes/route-specific-component-injection-token"; -const workloadsOverviewRouteComponentInjectable = getInjectable({ +const workloadsOverviewRouteComponentInjectable = getRouteSpecificComponentInjectable({ id: "workloads-overview-route-component", - - instantiate: (di) => ({ - route: di.inject(workloadsOverviewRouteInjectable), - Component: WorkloadsOverview, - }), - - injectionToken: routeSpecificComponentInjectionToken, + Component: WorkloadsOverview, + routeInjectable: workloadsOverviewRouteInjectable, }); export default workloadsOverviewRouteComponentInjectable; diff --git a/packages/core/src/renderer/components/workloads-pods/pods-route-component.injectable.ts b/packages/core/src/renderer/components/workloads-pods/pods-route-component.injectable.ts index 6ab45945cb..97de0cb753 100644 --- a/packages/core/src/renderer/components/workloads-pods/pods-route-component.injectable.ts +++ b/packages/core/src/renderer/components/workloads-pods/pods-route-component.injectable.ts @@ -2,20 +2,14 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectable } from "@ogre-tools/injectable"; import { Pods } from "./pods"; import podsRouteInjectable from "../../../common/front-end-routing/routes/cluster/workloads/pods/pods-route.injectable"; -import { routeSpecificComponentInjectionToken } from "../../routes/route-specific-component-injection-token"; +import { getRouteSpecificComponentInjectable } from "../../routes/route-specific-component-injection-token"; -const podsRouteComponentInjectable = getInjectable({ +const podsRouteComponentInjectable = getRouteSpecificComponentInjectable({ id: "pods-route-component", - - instantiate: (di) => ({ - route: di.inject(podsRouteInjectable), - Component: Pods, - }), - - injectionToken: routeSpecificComponentInjectionToken, + Component: Pods, + routeInjectable: podsRouteInjectable, }); export default podsRouteComponentInjectable; diff --git a/packages/core/src/renderer/components/workloads-replicasets/replicasets-route-component.injectable.ts b/packages/core/src/renderer/components/workloads-replicasets/replicasets-route-component.injectable.ts index 092d81f6d8..362f1524e7 100644 --- a/packages/core/src/renderer/components/workloads-replicasets/replicasets-route-component.injectable.ts +++ b/packages/core/src/renderer/components/workloads-replicasets/replicasets-route-component.injectable.ts @@ -2,20 +2,14 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectable } from "@ogre-tools/injectable"; import { ReplicaSets } from "./replicasets"; import replicasetsRouteInjectable from "../../../common/front-end-routing/routes/cluster/workloads/replicasets/replicasets-route.injectable"; -import { routeSpecificComponentInjectionToken } from "../../routes/route-specific-component-injection-token"; +import { getRouteSpecificComponentInjectable } from "../../routes/route-specific-component-injection-token"; -const replicasetsRouteComponentInjectable = getInjectable({ +const replicasetsRouteComponentInjectable = getRouteSpecificComponentInjectable({ id: "replicasets-route-component", - - instantiate: (di) => ({ - route: di.inject(replicasetsRouteInjectable), - Component: ReplicaSets, - }), - - injectionToken: routeSpecificComponentInjectionToken, + Component: ReplicaSets, + routeInjectable: replicasetsRouteInjectable, }); export default replicasetsRouteComponentInjectable; diff --git a/packages/core/src/renderer/components/workloads-replication-controllers/replication-controllers-route-component.injectable.ts b/packages/core/src/renderer/components/workloads-replication-controllers/replication-controllers-route-component.injectable.ts index 76b7365dfe..8f178853c2 100644 --- a/packages/core/src/renderer/components/workloads-replication-controllers/replication-controllers-route-component.injectable.ts +++ b/packages/core/src/renderer/components/workloads-replication-controllers/replication-controllers-route-component.injectable.ts @@ -2,20 +2,14 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectable } from "@ogre-tools/injectable"; import { ReplicationControllers } from "./replication-controllers"; -import { routeSpecificComponentInjectionToken } from "../../routes/route-specific-component-injection-token"; +import { getRouteSpecificComponentInjectable } from "../../routes/route-specific-component-injection-token"; import replicationControllersRouteInjectable from "../../../common/front-end-routing/routes/cluster/workloads/replication-controllers/route.injectable"; -const replicationControllersRouteComponentInjectable = getInjectable({ +const replicationControllersRouteComponentInjectable = getRouteSpecificComponentInjectable({ id: "replication-controller-route-component", - - instantiate: (di) => ({ - route: di.inject(replicationControllersRouteInjectable), - Component: ReplicationControllers, - }), - - injectionToken: routeSpecificComponentInjectionToken, + Component: ReplicationControllers, + routeInjectable: replicationControllersRouteInjectable, }); export default replicationControllersRouteComponentInjectable; diff --git a/packages/core/src/renderer/components/workloads-statefulsets/statefulsets-route-component.injectable.ts b/packages/core/src/renderer/components/workloads-statefulsets/statefulsets-route-component.injectable.ts index 0f461e4735..3a1e793c10 100644 --- a/packages/core/src/renderer/components/workloads-statefulsets/statefulsets-route-component.injectable.ts +++ b/packages/core/src/renderer/components/workloads-statefulsets/statefulsets-route-component.injectable.ts @@ -2,20 +2,14 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectable } from "@ogre-tools/injectable"; import { StatefulSets } from "./statefulsets"; import statefulsetsRouteInjectable from "../../../common/front-end-routing/routes/cluster/workloads/statefulsets/statefulsets-route.injectable"; -import { routeSpecificComponentInjectionToken } from "../../routes/route-specific-component-injection-token"; +import { getRouteSpecificComponentInjectable } from "../../routes/route-specific-component-injection-token"; -const statefulsetsRouteComponentInjectable = getInjectable({ +const statefulsetsRouteComponentInjectable = getRouteSpecificComponentInjectable({ id: "statefulsets-route-component", - - instantiate: (di) => ({ - route: di.inject(statefulsetsRouteInjectable), - Component: StatefulSets, - }), - - injectionToken: routeSpecificComponentInjectionToken, + Component: StatefulSets, + routeInjectable: statefulsetsRouteInjectable, }); export default statefulsetsRouteComponentInjectable; diff --git a/packages/core/src/renderer/routes/extension-route-registrator.injectable.tsx b/packages/core/src/renderer/routes/extension-route-registrator.injectable.tsx index 565e3b5998..e1a34cd242 100644 --- a/packages/core/src/renderer/routes/extension-route-registrator.injectable.tsx +++ b/packages/core/src/renderer/routes/extension-route-registrator.injectable.tsx @@ -12,7 +12,7 @@ import { isEmpty, matches } from "lodash/fp"; import { extensionRegistratorInjectionToken } from "../../extensions/extension-loader/extension-registrator-injection-token"; import { SiblingsInTabLayout } from "../components/layout/siblings-in-tab-layout"; import extensionPageParametersInjectable from "./extension-page-parameters.injectable"; -import { routeSpecificComponentInjectionToken } from "./route-specific-component-injection-token"; +import { getRouteSpecificComponentInjectable } from "./route-specific-component-injection-token"; import type { IComputedValue } from "mobx"; import { computed } from "mobx"; import { frontEndRouteInjectionToken } from "../../common/front-end-routing/front-end-route-injection-token"; @@ -62,65 +62,58 @@ const extensionRouteRegistratorInjectable = getInjectable({ export default extensionRouteRegistratorInjectable; -const toRouteInjectableFor = - ( - di: DiContainerForInjection, - extension: LensRendererExtension, - ) => - (clusterFrame: boolean, getIsEnabled: (registration: PageRegistration) => IComputedValue) => - (registration: PageRegistration) => { - const routeInjectable = getInjectable({ - id: `route-${registration.id ?? ""}-for-extension-${extension.sanitizedExtensionId}`, +const toRouteInjectableFor = (di: DiContainerForInjection, extension: LensRendererExtension) => ( + (clusterFrame: boolean, getIsEnabled: (registration: PageRegistration) => IComputedValue) => ( + (registration: PageRegistration) => { + const routeInjectable = getInjectable({ + id: `route-${registration.id ?? ""}-for-extension-${extension.sanitizedExtensionId}`, - instantiate: () => ({ - path: getExtensionRoutePath(extension, registration.id), - clusterFrame, - isEnabled: getIsEnabled(registration), - extension, - }), - - injectionToken: frontEndRouteInjectionToken, - }); - - const normalizedParams = di.inject(extensionPageParametersInjectable, { + instantiate: () => ({ + path: getExtensionRoutePath(extension, registration.id), + clusterFrame, + isEnabled: getIsEnabled(registration), extension, - registration, - }); + }), - const currentSidebarRegistration = extension.clusterPageMenus.find( - matches({ target: { pageId: registration.id }}), + injectionToken: frontEndRouteInjectionToken, + }); + + const normalizedParams = di.inject(extensionPageParametersInjectable, { + extension, + registration, + }); + + const currentSidebarRegistration = extension.clusterPageMenus.find( + matches({ target: { pageId: registration.id }}), + ); + + const siblingRegistrations = currentSidebarRegistration?.parentId + ? extension.clusterPageMenus.filter( + matches({ parentId: currentSidebarRegistration.parentId }), + ) + : []; + + const ObserverPage = observer(registration.components.Page); + + const Component = () => { + if (isEmpty(siblingRegistrations)) { + return ; + } + + return ( + + + ); - - const siblingRegistrations = currentSidebarRegistration?.parentId - ? extension.clusterPageMenus.filter( - matches({ parentId: currentSidebarRegistration.parentId }), - ) - : []; - - const ObserverPage = observer(registration.components.Page); - - const Component = () => { - if (isEmpty(siblingRegistrations)) { - return ; - } - - return ( - - - - ); - }; - - const routeSpecificComponentInjectable = getInjectable({ - id: `route-${registration.id ?? ""}-component-for-extension-${extension.sanitizedExtensionId}`, - - instantiate: (di) => ({ - route: di.inject(routeInjectable), - Component, - }), - - injectionToken: routeSpecificComponentInjectionToken, - }); - - return [routeInjectable, routeSpecificComponentInjectable]; }; + + const routeSpecificComponentInjectable = getRouteSpecificComponentInjectable({ + id: `route-${registration.id ?? ""}-component-for-extension-${extension.sanitizedExtensionId}`, + Component, + routeInjectable, + }); + + return [routeInjectable, routeSpecificComponentInjectable]; + } + ) +); diff --git a/packages/core/src/renderer/routes/route-specific-component-injection-token.ts b/packages/core/src/renderer/routes/route-specific-component-injection-token.ts index 9f0cf2f4e9..b1c4caeda6 100644 --- a/packages/core/src/renderer/routes/route-specific-component-injection-token.ts +++ b/packages/core/src/renderer/routes/route-specific-component-injection-token.ts @@ -2,12 +2,28 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import { getInjectionToken } from "@ogre-tools/injectable"; +import type { Injectable } from "@ogre-tools/injectable"; +import { getInjectable, getInjectionToken } from "@ogre-tools/injectable"; import type { Route } from "../../common/front-end-routing/front-end-route-injection-token"; export const routeSpecificComponentInjectionToken = getInjectionToken<{ route: Route; - Component: React.ElementType; + Component: React.ComponentType; }>({ id: "route-specific-component-injection-token", }); + +export interface GetRouteSpecificComponentOptions { + id: string; + routeInjectable: Injectable, Route, void>; + Component: Params extends object ? React.ComponentType : React.ComponentType; +} + +export const getRouteSpecificComponentInjectable = (options: GetRouteSpecificComponentOptions) => getInjectable({ + id: options.id, + instantiate: (di) => ({ + route: di.inject(options.routeInjectable), + Component: options.Component as React.ComponentType, + }), + injectionToken: routeSpecificComponentInjectionToken, +});