1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

chore: Use a helper to fix type errors from routeSpecificComponent

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2023-05-03 11:52:10 -04:00
parent 6642aef44a
commit 048ed7d143
52 changed files with 271 additions and 570 deletions

View File

@ -2,20 +2,14 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable"; import { getRouteSpecificComponentInjectable } from "../../../renderer/routes/route-specific-component-injection-token";
import { routeSpecificComponentInjectionToken } from "../../../renderer/routes/route-specific-component-injection-token";
import preferencesRouteForLegacyExtensions from "../common/preferences-route-for-legacy-extensions.injectable"; import preferencesRouteForLegacyExtensions from "../common/preferences-route-for-legacy-extensions.injectable";
import { Preferences } from "./preferences"; import { Preferences } from "./preferences";
const preferencesRouteComponentInjectable = getInjectable({ const preferencesRouteComponentInjectable = getRouteSpecificComponentInjectable({
id: "preferences-route-component-for-legacy-extensions", id: "preferences-route-component-for-legacy-extensions",
routeInjectable: preferencesRouteForLegacyExtensions,
instantiate: (di) => ({ Component: Preferences,
route: di.inject(preferencesRouteForLegacyExtensions),
Component: Preferences,
}),
injectionToken: routeSpecificComponentInjectionToken,
}); });
export default preferencesRouteComponentInjectable; export default preferencesRouteComponentInjectable;

View File

@ -2,20 +2,14 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable"; import { getRouteSpecificComponentInjectable } from "../../../renderer/routes/route-specific-component-injection-token";
import { routeSpecificComponentInjectionToken } from "../../../renderer/routes/route-specific-component-injection-token";
import { Preferences } from "./preferences"; import { Preferences } from "./preferences";
import preferencesRouteInjectable from "../common/preferences-route.injectable"; import preferencesRouteInjectable from "../common/preferences-route.injectable";
const preferencesRouteComponentInjectable = getInjectable({ const preferencesRouteComponentInjectable = getRouteSpecificComponentInjectable({
id: "preferences-route-component", id: "preferences-route-component",
Component: Preferences,
instantiate: (di) => ({ routeInjectable: preferencesRouteInjectable,
route: di.inject(preferencesRouteInjectable),
Component: Preferences,
}),
injectionToken: routeSpecificComponentInjectionToken,
}); });
export default preferencesRouteComponentInjectable; export default preferencesRouteComponentInjectable;

View File

@ -2,20 +2,14 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable";
import { AddCluster } from "./add-cluster"; 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"; 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", id: "add-cluster-route-component",
Component: AddCluster,
instantiate: (di) => ({ routeInjectable: addClusterRouteInjectable,
route: di.inject(addClusterRouteInjectable),
Component: AddCluster,
}),
injectionToken: routeSpecificComponentInjectionToken,
}); });
export default addClusterRouteComponentInjectable; export default addClusterRouteComponentInjectable;

View File

@ -2,20 +2,14 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable";
import { Catalog } from "./catalog"; import { Catalog } from "./catalog";
import catalogRouteInjectable from "../../../common/front-end-routing/routes/catalog/catalog-route.injectable"; 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", id: "catalog-route-component",
Component: Catalog,
instantiate: (di) => ({ routeInjectable: catalogRouteInjectable,
route: di.inject(catalogRouteInjectable),
Component: Catalog,
}),
injectionToken: routeSpecificComponentInjectionToken,
}); });
export default catalogRouteComponentInjectable; export default catalogRouteComponentInjectable;

View File

@ -2,20 +2,14 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable";
import { ClusterView } from "./cluster-view"; import { ClusterView } from "./cluster-view";
import clusterViewRouteInjectable from "../../../common/front-end-routing/routes/cluster-view/cluster-view-route.injectable"; 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", id: "cluster-view-route-component",
Component: ClusterView,
instantiate: (di) => ({ routeInjectable: clusterViewRouteInjectable,
route: di.inject(clusterViewRouteInjectable),
Component: ClusterView,
}),
injectionToken: routeSpecificComponentInjectionToken,
}); });
export default clusterViewRouteComponentInjectable; export default clusterViewRouteComponentInjectable;

View File

@ -2,20 +2,14 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable"; import { getRouteSpecificComponentInjectable } from "../../routes/route-specific-component-injection-token";
import { routeSpecificComponentInjectionToken } from "../../routes/route-specific-component-injection-token";
import { ClusterOverview } from "./cluster-overview"; import { ClusterOverview } from "./cluster-overview";
import clusterOverviewRouteInjectable from "../../../common/front-end-routing/routes/cluster/overview/cluster-overview-route.injectable"; 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", id: "cluster-overview-route-component",
Component: ClusterOverview,
instantiate: (di) => ({ routeInjectable: clusterOverviewRouteInjectable,
route: di.inject(clusterOverviewRouteInjectable),
Component: ClusterOverview,
}),
injectionToken: routeSpecificComponentInjectionToken,
}); });
export default clusterOverviewRouteComponentInjectable; export default clusterOverviewRouteComponentInjectable;

View File

@ -2,20 +2,14 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable"; import { getRouteSpecificComponentInjectable } from "../../routes/route-specific-component-injection-token";
import { routeSpecificComponentInjectionToken } 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 horizontalPodAutoscalersRouteInjectable from "../../../common/front-end-routing/routes/cluster/config/horizontal-pod-autoscalers/horizontal-pod-autoscalers-route.injectable";
import { HorizontalPodAutoscalers } from "./list-view"; import { HorizontalPodAutoscalers } from "./list-view";
const horizontalPodAutoscalersRouteComponentInjectable = getInjectable({ const horizontalPodAutoscalersRouteComponentInjectable = getRouteSpecificComponentInjectable({
id: "horizontal-pod-autoscalers-route-component", id: "horizontal-pod-autoscalers-route-component",
Component: HorizontalPodAutoscalers,
instantiate: (di) => ({ routeInjectable: horizontalPodAutoscalersRouteInjectable,
route: di.inject(horizontalPodAutoscalersRouteInjectable),
Component: HorizontalPodAutoscalers,
}),
injectionToken: routeSpecificComponentInjectionToken,
}); });
export default horizontalPodAutoscalersRouteComponentInjectable; export default horizontalPodAutoscalersRouteComponentInjectable;

View File

@ -2,20 +2,14 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable";
import { Leases } from "./leases"; import { Leases } from "./leases";
import leasesRouteInjectable from "../../../common/front-end-routing/routes/cluster/config/leases/leases-route.injectable"; 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", id: "leases-route-component",
routeInjectable: leasesRouteInjectable,
instantiate: (di) => ({ Component: Leases,
route: di.inject(leasesRouteInjectable),
Component: Leases,
}),
injectionToken: routeSpecificComponentInjectionToken,
}); });
export default leasesRouteComponentInjectable; export default leasesRouteComponentInjectable;

View File

@ -2,20 +2,14 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable";
import { LimitRanges } from "./limit-ranges"; import { LimitRanges } from "./limit-ranges";
import limitRangesRouteInjectable from "../../../common/front-end-routing/routes/cluster/config/limit-ranges/limit-ranges-route.injectable"; 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", id: "limit-ranges-route-component",
Component: LimitRanges,
instantiate: (di) => ({ routeInjectable: limitRangesRouteInjectable,
route: di.inject(limitRangesRouteInjectable),
Component: LimitRanges,
}),
injectionToken: routeSpecificComponentInjectionToken,
}); });
export default limitRangesRouteComponentInjectable; export default limitRangesRouteComponentInjectable;

View File

@ -2,20 +2,14 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable";
import { ConfigMaps } from "./config-maps"; import { ConfigMaps } from "./config-maps";
import configMapsRouteInjectable from "../../../common/front-end-routing/routes/cluster/config/config-maps/config-maps-route.injectable"; 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", id: "config-maps-route-component",
Component: ConfigMaps,
instantiate: (di) => ({ routeInjectable: configMapsRouteInjectable,
route: di.inject(configMapsRouteInjectable),
Component: ConfigMaps,
}),
injectionToken: routeSpecificComponentInjectionToken,
}); });
export default configMapsRouteComponentInjectable; export default configMapsRouteComponentInjectable;

View File

@ -2,23 +2,14 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable"; import { getRouteSpecificComponentInjectable } from "../../routes/route-specific-component-injection-token";
import { import mutatingWebhookConfigurationsRouteInjectable from "../../../common/front-end-routing/routes/cluster/config/mutating-webhook-configurations/mutating-webhook-configurations-route.injectable";
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 { MutatingWebhookConfigurations } from "./mutating-webhook-configurations"; import { MutatingWebhookConfigurations } from "./mutating-webhook-configurations";
const mutatingWebhookConfigurationsRouteComponentInjectable = getInjectable({ const mutatingWebhookConfigurationsRouteComponentInjectable = getRouteSpecificComponentInjectable({
id: "mutating-webhook-configuration-route-component", id: "mutating-webhook-configuration-route-component",
Component: MutatingWebhookConfigurations,
instantiate: (di) => ({ routeInjectable: mutatingWebhookConfigurationsRouteInjectable,
route: di.inject(mutatingWebhookConfigurationsRouteInjectable),
Component: MutatingWebhookConfigurations,
}),
injectionToken: routeSpecificComponentInjectionToken,
}); });
export default mutatingWebhookConfigurationsRouteComponentInjectable; export default mutatingWebhookConfigurationsRouteComponentInjectable;

View File

@ -2,20 +2,14 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * 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 { PodDisruptionBudgets } from "./pod-disruption-budgets";
import podDisruptionBudgetsRouteInjectable from "../../../common/front-end-routing/routes/cluster/config/pod-disruption-budgets/pod-disruption-budgets-route.injectable"; 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", id: "pod-disruption-budgets-route-component",
Component: PodDisruptionBudgets,
instantiate: (di) => ({ routeInjectable: podDisruptionBudgetsRouteInjectable,
route: di.inject(podDisruptionBudgetsRouteInjectable),
Component: PodDisruptionBudgets,
}),
injectionToken: routeSpecificComponentInjectionToken,
}); });
export default podDisruptionBudgetsRouteComponentInjectable; export default podDisruptionBudgetsRouteComponentInjectable;

View File

@ -2,20 +2,14 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable";
import { PriorityClasses } from "./priority-classes"; import { PriorityClasses } from "./priority-classes";
import priorityClassesRouteInjectable from "../../../common/front-end-routing/routes/cluster/config/priority-classes/priority-classes-route.injectable"; 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", id: "priority-classes-route-component",
Component: PriorityClasses,
instantiate: (di) => ({ routeInjectable: priorityClassesRouteInjectable,
route: di.inject(priorityClassesRouteInjectable),
Component: PriorityClasses,
}),
injectionToken: routeSpecificComponentInjectionToken,
}); });
export default priorityClassesRouteComponentInjectable; export default priorityClassesRouteComponentInjectable;

View File

@ -2,22 +2,14 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable";
import { ResourceQuotas } from "./resource-quotas"; import { ResourceQuotas } from "./resource-quotas";
import resourceQuotasRouteInjectable from "../../../common/front-end-routing/routes/cluster/config/resource-quotas/resource-quotas-route.injectable"; import resourceQuotasRouteInjectable from "../../../common/front-end-routing/routes/cluster/config/resource-quotas/resource-quotas-route.injectable";
import { import { getRouteSpecificComponentInjectable } from "../../routes/route-specific-component-injection-token";
routeSpecificComponentInjectionToken,
} from "../../routes/route-specific-component-injection-token";
const resourceQuotasRouteComponentInjectable = getInjectable({ const resourceQuotasRouteComponentInjectable = getRouteSpecificComponentInjectable({
id: "resource-quotas-route-component", id: "resource-quotas-route-component",
Component: ResourceQuotas,
instantiate: (di) => ({ routeInjectable: resourceQuotasRouteInjectable,
route: di.inject(resourceQuotasRouteInjectable),
Component: ResourceQuotas,
}),
injectionToken: routeSpecificComponentInjectionToken,
}); });
export default resourceQuotasRouteComponentInjectable; export default resourceQuotasRouteComponentInjectable;

View File

@ -2,20 +2,14 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable";
import { Secrets } from "./secrets"; import { Secrets } from "./secrets";
import secretsRouteInjectable from "../../../common/front-end-routing/routes/cluster/config/secrets/secrets-route.injectable"; 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", id: "secrets-route-component",
Component: Secrets,
instantiate: (di) => ({ routeInjectable: secretsRouteInjectable,
route: di.inject(secretsRouteInjectable),
Component: Secrets,
}),
injectionToken: routeSpecificComponentInjectionToken,
}); });
export default secretsRouteComponentInjectable; export default secretsRouteComponentInjectable;

View File

@ -2,23 +2,14 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable"; import { getRouteSpecificComponentInjectable } from "../../routes/route-specific-component-injection-token";
import { import validatingWebhookConfigurationsRouteInjectable from "../../../common/front-end-routing/routes/cluster/config/validating-webhook-configurations/validating-webhook-configurations-route.injectable";
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 { ValidatingWebhookConfigurations } from "./validating-webhook-configurations"; import { ValidatingWebhookConfigurations } from "./validating-webhook-configurations";
const validatingWebhookConfigurationsRouteComponentInjectable = getInjectable({ const validatingWebhookConfigurationsRouteComponentInjectable = getRouteSpecificComponentInjectable({
id: "validating-webhook-configuration-route-component", id: "validating-webhook-configuration-route-component",
Component: ValidatingWebhookConfigurations,
instantiate: (di) => ({ routeInjectable: validatingWebhookConfigurationsRouteInjectable,
route: di.inject(validatingWebhookConfigurationsRouteInjectable),
Component: ValidatingWebhookConfigurations,
}),
injectionToken: routeSpecificComponentInjectionToken,
}); });
export default validatingWebhookConfigurationsRouteComponentInjectable; export default validatingWebhookConfigurationsRouteComponentInjectable;

View File

@ -2,20 +2,14 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable"; import { getRouteSpecificComponentInjectable } from "../../routes/route-specific-component-injection-token";
import { routeSpecificComponentInjectionToken } 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 verticalPodAutoscalersRouteInjectable from "../../../common/front-end-routing/routes/cluster/config/vertical-pod-autoscalers/vertical-pod-autoscalers-route.injectable";
import { VerticalPodAutoscalers } from "./vpa"; import { VerticalPodAutoscalers } from "./vpa";
const verticalPodAutoscalersRouteComponentInjectable = getInjectable({ const verticalPodAutoscalersRouteComponentInjectable = getRouteSpecificComponentInjectable({
id: "vertical-pod-autoscalers-route-component", id: "vertical-pod-autoscalers-route-component",
Component: VerticalPodAutoscalers,
instantiate: (di) => ({ routeInjectable: verticalPodAutoscalersRouteInjectable,
route: di.inject(verticalPodAutoscalersRouteInjectable),
Component: VerticalPodAutoscalers,
}),
injectionToken: routeSpecificComponentInjectionToken,
}); });
export default verticalPodAutoscalersRouteComponentInjectable; export default verticalPodAutoscalersRouteComponentInjectable;

View File

@ -2,20 +2,14 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable";
import { CustomResources } from "./view"; import { CustomResources } from "./view";
import customResourcesRouteInjectable from "../../../common/front-end-routing/routes/cluster/custom-resources/custom-resources-route.injectable"; 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", id: "custom-resources-route-component",
Component: CustomResources,
instantiate: (di) => ({ routeInjectable: customResourcesRouteInjectable,
route: di.inject(customResourcesRouteInjectable),
Component: CustomResources,
}),
injectionToken: routeSpecificComponentInjectionToken,
}); });
export default customResourcesRouteComponentInjectable; export default customResourcesRouteComponentInjectable;

View File

@ -2,20 +2,14 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable";
import { EntitySettingsRouteComponent } from "./entity-settings"; 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"; 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", id: "entity-settings-route-component",
Component: EntitySettingsRouteComponent,
instantiate: (di) => ({ routeInjectable: entitySettingsRouteInjectable,
route: di.inject(entitySettingsRouteInjectable),
Component: EntitySettingsRouteComponent,
}),
injectionToken: routeSpecificComponentInjectionToken,
}); });
export default entitySettingsRouteComponentInjectable; export default entitySettingsRouteComponentInjectable;

View File

@ -2,20 +2,14 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable";
import { Events } from "./events"; import { Events } from "./events";
import eventsRouteInjectable from "../../../common/front-end-routing/routes/cluster/events/events-route.injectable"; 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", id: "events-route-component",
Component: Events,
instantiate: (di) => ({ routeInjectable: eventsRouteInjectable,
route: di.inject(eventsRouteInjectable),
Component: Events,
}),
injectionToken: routeSpecificComponentInjectionToken,
}); });
export default eventsRouteComponentInjectable; export default eventsRouteComponentInjectable;

View File

@ -2,20 +2,14 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable";
import { Extensions } from "./extensions"; import { Extensions } from "./extensions";
import extensionsRouteInjectable from "../../../common/front-end-routing/routes/extensions/extensions-route.injectable"; 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", id: "extensions-route-component",
Component: Extensions,
instantiate: (di) => ({ routeInjectable: extensionsRouteInjectable,
route: di.inject(extensionsRouteInjectable),
Component: Extensions,
}),
injectionToken: routeSpecificComponentInjectionToken,
}); });
export default extensionsRouteComponentInjectable; export default extensionsRouteComponentInjectable;

View File

@ -2,20 +2,14 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable";
import { HelmCharts } from "./helm-charts"; import { HelmCharts } from "./helm-charts";
import helmChartsRouteInjectable from "../../../common/front-end-routing/routes/cluster/helm/charts/helm-charts-route.injectable"; 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", id: "helm-charts-route-component",
Component: HelmCharts,
instantiate: (di) => ({ routeInjectable: helmChartsRouteInjectable,
route: di.inject(helmChartsRouteInjectable),
Component: HelmCharts,
}),
injectionToken: routeSpecificComponentInjectionToken,
}); });
export default helmChartsRouteComponentInjectable; export default helmChartsRouteComponentInjectable;

View File

@ -2,20 +2,14 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable";
import { HelmReleases } from "./releases"; import { HelmReleases } from "./releases";
import helmReleasesRouteInjectable from "../../../common/front-end-routing/routes/cluster/helm/releases/helm-releases-route.injectable"; 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", id: "helm-releases-route-component",
Component: HelmReleases,
instantiate: (di) => ({ routeInjectable: helmReleasesRouteInjectable,
route: di.inject(helmReleasesRouteInjectable),
Component: HelmReleases,
}),
injectionToken: routeSpecificComponentInjectionToken,
}); });
export default helmReleasesRouteComponentInjectable; export default helmReleasesRouteComponentInjectable;

View File

@ -2,20 +2,14 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable";
import { NamespacesRoute } from "./route"; import { NamespacesRoute } from "./route";
import namespacesRouteInjectable from "../../../common/front-end-routing/routes/cluster/namespaces/namespaces-route.injectable"; 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", id: "namespaces-route-component",
Component: NamespacesRoute,
instantiate: (di) => ({ routeInjectable: namespacesRouteInjectable,
route: di.inject(namespacesRouteInjectable),
Component: NamespacesRoute,
}),
injectionToken: routeSpecificComponentInjectionToken,
}); });
export default namespacesRouteComponentInjectable; export default namespacesRouteComponentInjectable;

View File

@ -2,20 +2,14 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable";
import { Endpoints } from "./endpoints"; import { Endpoints } from "./endpoints";
import endpointsRouteInjectable from "../../../common/front-end-routing/routes/cluster/network/endpoints/endpoints-route.injectable"; 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", id: "endpoints-route-component",
Component: Endpoints,
instantiate: (di) => ({ routeInjectable: endpointsRouteInjectable,
route: di.inject(endpointsRouteInjectable),
Component: Endpoints,
}),
injectionToken: routeSpecificComponentInjectionToken,
}); });
export default endpointsRouteComponentInjectable; export default endpointsRouteComponentInjectable;

View File

@ -2,20 +2,14 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable"; import { getRouteSpecificComponentInjectable } from "../../routes/route-specific-component-injection-token";
import { routeSpecificComponentInjectionToken } from "../../routes/route-specific-component-injection-token";
import ingressClassesRouteInjectable from "../../../common/front-end-routing/routes/cluster/network/ingress-class/ingress-classes-route.injectable"; import ingressClassesRouteInjectable from "../../../common/front-end-routing/routes/cluster/network/ingress-class/ingress-classes-route.injectable";
import { IngressClasses } from "./ingress-classes"; import { IngressClasses } from "./ingress-classes";
const ingressClassesRouteComponentInjectable = getInjectable({ const ingressClassesRouteComponentInjectable = getRouteSpecificComponentInjectable({
id: "ingress-classes-route-component", id: "ingress-classes-route-component",
Component: IngressClasses,
instantiate: (di) => ({ routeInjectable: ingressClassesRouteInjectable,
route: di.inject(ingressClassesRouteInjectable),
Component: IngressClasses,
}),
injectionToken: routeSpecificComponentInjectionToken,
}); });
export default ingressClassesRouteComponentInjectable; export default ingressClassesRouteComponentInjectable;

View File

@ -2,20 +2,14 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable";
import { Ingresses } from "./ingresses"; import { Ingresses } from "./ingresses";
import ingressesRouteInjectable from "../../../common/front-end-routing/routes/cluster/network/ingresses/ingresses-route.injectable"; 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", id: "ingresses-route-component",
Component: Ingresses,
instantiate: (di) => ({ routeInjectable: ingressesRouteInjectable,
route: di.inject(ingressesRouteInjectable),
Component: Ingresses,
}),
injectionToken: routeSpecificComponentInjectionToken,
}); });
export default ingressesRouteComponentInjectable; export default ingressesRouteComponentInjectable;

View File

@ -2,20 +2,14 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable";
import { NetworkPolicies } from "./network-policies"; import { NetworkPolicies } from "./network-policies";
import networkPoliciesRouteInjectable from "../../../common/front-end-routing/routes/cluster/network/network-policies/network-policies-route.injectable"; 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", id: "network-policies-route-component",
Component: NetworkPolicies,
instantiate: (di) => ({ routeInjectable: networkPoliciesRouteInjectable,
route: di.inject(networkPoliciesRouteInjectable),
Component: NetworkPolicies,
}),
injectionToken: routeSpecificComponentInjectionToken,
}); });
export default networkPoliciesRouteComponentInjectable; export default networkPoliciesRouteComponentInjectable;

View File

@ -2,20 +2,14 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable";
import { PortForwards } from "./port-forwards"; import { PortForwards } from "./port-forwards";
import portForwardsRouteInjectable from "../../../common/front-end-routing/routes/cluster/network/port-forwards/port-forwards-route.injectable"; 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", id: "port-forwards-route-component",
Component: PortForwards,
instantiate: (di) => ({ routeInjectable: portForwardsRouteInjectable,
route: di.inject(portForwardsRouteInjectable),
Component: PortForwards,
}),
injectionToken: routeSpecificComponentInjectionToken,
}); });
export default portForwardsRouteComponentInjectable; export default portForwardsRouteComponentInjectable;

View File

@ -2,20 +2,14 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable";
import { Services } from "./services"; import { Services } from "./services";
import servicesRouteInjectable from "../../../common/front-end-routing/routes/cluster/network/services/services-route.injectable"; 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", id: "services-route-component",
Component: Services,
instantiate: (di) => ({ routeInjectable: servicesRouteInjectable,
route: di.inject(servicesRouteInjectable),
Component: Services,
}),
injectionToken: routeSpecificComponentInjectionToken,
}); });
export default servicesRouteComponentInjectable; export default servicesRouteComponentInjectable;

View File

@ -2,20 +2,14 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable";
import { NodesRoute } from "./route"; import { NodesRoute } from "./route";
import nodesRouteInjectable from "../../../common/front-end-routing/routes/cluster/nodes/nodes-route.injectable"; 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", id: "nodes-route-component",
Component: NodesRoute,
instantiate: (di) => ({ routeInjectable: nodesRouteInjectable,
route: di.inject(nodesRouteInjectable),
Component: NodesRoute,
}),
injectionToken: routeSpecificComponentInjectionToken,
}); });
export default nodesRouteComponentInjectable; export default nodesRouteComponentInjectable;

View File

@ -2,20 +2,14 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * 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 { 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 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", id: "pod-security-policies-route-component",
Component: PodSecurityPolicies,
instantiate: (di) => ({ routeInjectable: podSecurityPoliciesRouteInjectable,
route: di.inject(podSecurityPoliciesRouteInjectable),
Component: PodSecurityPolicies,
}),
injectionToken: routeSpecificComponentInjectionToken,
}); });
export default podSecurityPoliciesRouteComponentInjectable; export default podSecurityPoliciesRouteComponentInjectable;

View File

@ -2,20 +2,14 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable";
import { StorageClasses } from "./storage-classes"; import { StorageClasses } from "./storage-classes";
import storageClassesRouteInjectable from "../../../common/front-end-routing/routes/cluster/storage/storage-classes/storage-classes-route.injectable"; 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", id: "storage-classes-route-component",
Component: StorageClasses,
instantiate: (di) => ({ routeInjectable: storageClassesRouteInjectable,
route: di.inject(storageClassesRouteInjectable),
Component: StorageClasses,
}),
injectionToken: routeSpecificComponentInjectionToken,
}); });
export default storageClassesRouteComponentInjectable; export default storageClassesRouteComponentInjectable;

View File

@ -2,20 +2,14 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable";
import { PersistentVolumeClaims } from "./volume-claims"; import { PersistentVolumeClaims } from "./volume-claims";
import persistentVolumeClaimsRouteInjectable from "../../../common/front-end-routing/routes/cluster/storage/persistent-volume-claims/persistent-volume-claims-route.injectable"; 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", id: "persistent-volume-claims-route-component",
Component: PersistentVolumeClaims,
instantiate: (di) => ({ routeInjectable: persistentVolumeClaimsRouteInjectable,
route: di.inject(persistentVolumeClaimsRouteInjectable),
Component: PersistentVolumeClaims,
}),
injectionToken: routeSpecificComponentInjectionToken,
}); });
export default persistentVolumeClaimsRouteComponentInjectable; export default persistentVolumeClaimsRouteComponentInjectable;

View File

@ -2,21 +2,15 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable";
import { PersistentVolumes } from "./volumes"; import { PersistentVolumes } from "./volumes";
import persistentVolumesRouteInjectable from "../../../common/front-end-routing/routes/cluster/storage/persistent-volumes/persistent-volumes-route.injectable"; 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", id: "persistent-volumes-route-component",
Component: PersistentVolumes,
instantiate: (di) => ({ routeInjectable: persistentVolumesRouteInjectable,
route: di.inject(persistentVolumesRouteInjectable),
Component: PersistentVolumes,
}),
injectionToken: routeSpecificComponentInjectionToken,
}); });
export default persistentVolumesRouteComponentInjectable; export default persistentVolumesRouteComponentInjectable;

View File

@ -2,20 +2,14 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable";
import { ClusterRoleBindings } from "./view"; import { ClusterRoleBindings } from "./view";
import clusterRoleBindingsRouteInjectable from "../../../../common/front-end-routing/routes/cluster/user-management/cluster-role-bindings/cluster-role-bindings-route.injectable"; 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", id: "cluster-role-bindings-route-component",
Component: ClusterRoleBindings,
instantiate: (di) => ({ routeInjectable: clusterRoleBindingsRouteInjectable,
route: di.inject(clusterRoleBindingsRouteInjectable),
Component: ClusterRoleBindings,
}),
injectionToken: routeSpecificComponentInjectionToken,
}); });
export default clusterRoleBindingsRouteComponentInjectable; export default clusterRoleBindingsRouteComponentInjectable;

View File

@ -2,20 +2,14 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable";
import { ClusterRoles } from "./view"; import { ClusterRoles } from "./view";
import clusterRolesRouteInjectable from "../../../../common/front-end-routing/routes/cluster/user-management/cluster-roles/cluster-roles-route.injectable"; 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", id: "cluster-roles-route-component",
Component: ClusterRoles,
instantiate: (di) => ({ routeInjectable: clusterRolesRouteInjectable,
route: di.inject(clusterRolesRouteInjectable),
Component: ClusterRoles,
}),
injectionToken: routeSpecificComponentInjectionToken,
}); });
export default clusterRolesRouteComponentInjectable; export default clusterRolesRouteComponentInjectable;

View File

@ -2,20 +2,14 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable";
import { RoleBindings } from "./view"; import { RoleBindings } from "./view";
import roleBindingsRouteInjectable from "../../../../common/front-end-routing/routes/cluster/user-management/role-bindings/role-bindings-route.injectable"; 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", id: "role-bindings-route-component",
Component: RoleBindings,
instantiate: (di) => ({ routeInjectable: roleBindingsRouteInjectable,
route: di.inject(roleBindingsRouteInjectable),
Component: RoleBindings,
}),
injectionToken: routeSpecificComponentInjectionToken,
}); });
export default roleBindingsRouteComponentInjectable; export default roleBindingsRouteComponentInjectable;

View File

@ -2,20 +2,14 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable";
import { Roles } from "./view"; import { Roles } from "./view";
import rolesRouteInjectable from "../../../../common/front-end-routing/routes/cluster/user-management/roles/roles-route.injectable"; 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", id: "roles-route-component",
Component: Roles,
instantiate: (di) => ({ routeInjectable: rolesRouteInjectable,
route: di.inject(rolesRouteInjectable),
Component: Roles,
}),
injectionToken: routeSpecificComponentInjectionToken,
}); });
export default rolesRouteComponentInjectable; export default rolesRouteComponentInjectable;

View File

@ -2,20 +2,14 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable";
import { ServiceAccounts } from "./view"; import { ServiceAccounts } from "./view";
import serviceAccountsRouteInjectable from "../../../../common/front-end-routing/routes/cluster/user-management/service-accounts/service-accounts-route.injectable"; 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", id: "service-accounts-route-component",
Component: ServiceAccounts,
instantiate: (di) => ({ routeInjectable: serviceAccountsRouteInjectable,
route: di.inject(serviceAccountsRouteInjectable),
Component: ServiceAccounts,
}),
injectionToken: routeSpecificComponentInjectionToken,
}); });
export default serviceAccountsRouteComponentInjectable; export default serviceAccountsRouteComponentInjectable;

View File

@ -2,20 +2,14 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable";
import { Welcome } from "./welcome"; import { Welcome } from "./welcome";
import defaultWelcomeRouteInjectable from "../../../common/front-end-routing/routes/welcome/default-welcome-route.injectable"; 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", id: "default-welcome-route-component",
Component: Welcome,
instantiate: (di) => ({ routeInjectable: defaultWelcomeRouteInjectable,
route: di.inject(defaultWelcomeRouteInjectable),
Component: Welcome,
}),
injectionToken: routeSpecificComponentInjectionToken,
}); });
export default defaultWelcomeRouteComponentInjectable; export default defaultWelcomeRouteComponentInjectable;

View File

@ -2,20 +2,14 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable";
import { CronJobs } from "./cronjobs"; import { CronJobs } from "./cronjobs";
import cronJobsRouteInjectable from "../../../common/front-end-routing/routes/cluster/workloads/cron-jobs/cron-jobs-route.injectable"; 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", id: "cron-jobs-route-component",
Component: CronJobs,
instantiate: (di) => ({ routeInjectable: cronJobsRouteInjectable,
route: di.inject(cronJobsRouteInjectable),
Component: CronJobs,
}),
injectionToken: routeSpecificComponentInjectionToken,
}); });
export default cronJobsRouteComponentInjectable; export default cronJobsRouteComponentInjectable;

View File

@ -2,20 +2,14 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable";
import { DaemonSets } from "./daemonsets"; import { DaemonSets } from "./daemonsets";
import daemonsetsRouteInjectable from "../../../common/front-end-routing/routes/cluster/workloads/daemonsets/daemonsets-route.injectable"; 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", id: "daemonsets-route-component",
Component: DaemonSets,
instantiate: (di) => ({ routeInjectable: daemonsetsRouteInjectable,
route: di.inject(daemonsetsRouteInjectable),
Component: DaemonSets,
}),
injectionToken: routeSpecificComponentInjectionToken,
}); });
export default daemonsetsRouteComponentInjectable; export default daemonsetsRouteComponentInjectable;

View File

@ -2,20 +2,14 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable";
import { Deployments } from "./deployments"; import { Deployments } from "./deployments";
import deploymentsRouteInjectable from "../../../common/front-end-routing/routes/cluster/workloads/deployments/deployments-route.injectable"; 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", id: "deployments-route-component",
Component: Deployments,
instantiate: (di) => ({ routeInjectable: deploymentsRouteInjectable,
route: di.inject(deploymentsRouteInjectable),
Component: Deployments,
}),
injectionToken: routeSpecificComponentInjectionToken,
}); });
export default deploymentsRouteComponentInjectable; export default deploymentsRouteComponentInjectable;

View File

@ -2,20 +2,14 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable";
import { Jobs } from "./jobs"; import { Jobs } from "./jobs";
import jobsRouteInjectable from "../../../common/front-end-routing/routes/cluster/workloads/jobs/jobs-route.injectable"; 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", id: "jobs-route-component",
Component: Jobs,
instantiate: (di) => ({ routeInjectable: jobsRouteInjectable,
route: di.inject(jobsRouteInjectable),
Component: Jobs,
}),
injectionToken: routeSpecificComponentInjectionToken,
}); });
export default jobsRouteComponentInjectable; export default jobsRouteComponentInjectable;

View File

@ -2,20 +2,14 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable";
import { WorkloadsOverview } from "./overview"; import { WorkloadsOverview } from "./overview";
import workloadsOverviewRouteInjectable from "../../../common/front-end-routing/routes/cluster/workloads/overview/workloads-overview-route.injectable"; 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", id: "workloads-overview-route-component",
Component: WorkloadsOverview,
instantiate: (di) => ({ routeInjectable: workloadsOverviewRouteInjectable,
route: di.inject(workloadsOverviewRouteInjectable),
Component: WorkloadsOverview,
}),
injectionToken: routeSpecificComponentInjectionToken,
}); });
export default workloadsOverviewRouteComponentInjectable; export default workloadsOverviewRouteComponentInjectable;

View File

@ -2,20 +2,14 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable";
import { Pods } from "./pods"; import { Pods } from "./pods";
import podsRouteInjectable from "../../../common/front-end-routing/routes/cluster/workloads/pods/pods-route.injectable"; 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", id: "pods-route-component",
Component: Pods,
instantiate: (di) => ({ routeInjectable: podsRouteInjectable,
route: di.inject(podsRouteInjectable),
Component: Pods,
}),
injectionToken: routeSpecificComponentInjectionToken,
}); });
export default podsRouteComponentInjectable; export default podsRouteComponentInjectable;

View File

@ -2,20 +2,14 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable";
import { ReplicaSets } from "./replicasets"; import { ReplicaSets } from "./replicasets";
import replicasetsRouteInjectable from "../../../common/front-end-routing/routes/cluster/workloads/replicasets/replicasets-route.injectable"; 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", id: "replicasets-route-component",
Component: ReplicaSets,
instantiate: (di) => ({ routeInjectable: replicasetsRouteInjectable,
route: di.inject(replicasetsRouteInjectable),
Component: ReplicaSets,
}),
injectionToken: routeSpecificComponentInjectionToken,
}); });
export default replicasetsRouteComponentInjectable; export default replicasetsRouteComponentInjectable;

View File

@ -2,20 +2,14 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable";
import { ReplicationControllers } from "./replication-controllers"; 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"; 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", id: "replication-controller-route-component",
Component: ReplicationControllers,
instantiate: (di) => ({ routeInjectable: replicationControllersRouteInjectable,
route: di.inject(replicationControllersRouteInjectable),
Component: ReplicationControllers,
}),
injectionToken: routeSpecificComponentInjectionToken,
}); });
export default replicationControllersRouteComponentInjectable; export default replicationControllersRouteComponentInjectable;

View File

@ -2,20 +2,14 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable";
import { StatefulSets } from "./statefulsets"; import { StatefulSets } from "./statefulsets";
import statefulsetsRouteInjectable from "../../../common/front-end-routing/routes/cluster/workloads/statefulsets/statefulsets-route.injectable"; 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", id: "statefulsets-route-component",
Component: StatefulSets,
instantiate: (di) => ({ routeInjectable: statefulsetsRouteInjectable,
route: di.inject(statefulsetsRouteInjectable),
Component: StatefulSets,
}),
injectionToken: routeSpecificComponentInjectionToken,
}); });
export default statefulsetsRouteComponentInjectable; export default statefulsetsRouteComponentInjectable;

View File

@ -12,7 +12,7 @@ import { isEmpty, matches } from "lodash/fp";
import { extensionRegistratorInjectionToken } from "../../extensions/extension-loader/extension-registrator-injection-token"; import { extensionRegistratorInjectionToken } from "../../extensions/extension-loader/extension-registrator-injection-token";
import { SiblingsInTabLayout } from "../components/layout/siblings-in-tab-layout"; import { SiblingsInTabLayout } from "../components/layout/siblings-in-tab-layout";
import extensionPageParametersInjectable from "./extension-page-parameters.injectable"; 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 type { IComputedValue } from "mobx";
import { computed } from "mobx"; import { computed } from "mobx";
import { frontEndRouteInjectionToken } from "../../common/front-end-routing/front-end-route-injection-token"; import { frontEndRouteInjectionToken } from "../../common/front-end-routing/front-end-route-injection-token";
@ -62,65 +62,58 @@ const extensionRouteRegistratorInjectable = getInjectable({
export default extensionRouteRegistratorInjectable; export default extensionRouteRegistratorInjectable;
const toRouteInjectableFor = const toRouteInjectableFor = (di: DiContainerForInjection, extension: LensRendererExtension) => (
( (clusterFrame: boolean, getIsEnabled: (registration: PageRegistration) => IComputedValue<boolean>) => (
di: DiContainerForInjection, (registration: PageRegistration) => {
extension: LensRendererExtension, const routeInjectable = getInjectable({
) => id: `route-${registration.id ?? ""}-for-extension-${extension.sanitizedExtensionId}`,
(clusterFrame: boolean, getIsEnabled: (registration: PageRegistration) => IComputedValue<boolean>) =>
(registration: PageRegistration) => {
const routeInjectable = getInjectable({
id: `route-${registration.id ?? ""}-for-extension-${extension.sanitizedExtensionId}`,
instantiate: () => ({ instantiate: () => ({
path: getExtensionRoutePath(extension, registration.id), path: getExtensionRoutePath(extension, registration.id),
clusterFrame, clusterFrame,
isEnabled: getIsEnabled(registration), isEnabled: getIsEnabled(registration),
extension,
}),
injectionToken: frontEndRouteInjectionToken,
});
const normalizedParams = di.inject(extensionPageParametersInjectable, {
extension, extension,
registration, }),
});
const currentSidebarRegistration = extension.clusterPageMenus.find( injectionToken: frontEndRouteInjectionToken,
matches({ target: { pageId: registration.id }}), });
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 <ObserverPage params={normalizedParams} />;
}
return (
<SiblingsInTabLayout>
<ObserverPage params={normalizedParams} />
</SiblingsInTabLayout>
); );
const siblingRegistrations = currentSidebarRegistration?.parentId
? extension.clusterPageMenus.filter(
matches({ parentId: currentSidebarRegistration.parentId }),
)
: [];
const ObserverPage = observer(registration.components.Page);
const Component = () => {
if (isEmpty(siblingRegistrations)) {
return <ObserverPage params={normalizedParams} />;
}
return (
<SiblingsInTabLayout>
<ObserverPage params={normalizedParams} />
</SiblingsInTabLayout>
);
};
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];
}
)
);

View File

@ -2,12 +2,28 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * 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"; import type { Route } from "../../common/front-end-routing/front-end-route-injection-token";
export const routeSpecificComponentInjectionToken = getInjectionToken<{ export const routeSpecificComponentInjectionToken = getInjectionToken<{
route: Route<unknown>; route: Route<unknown>;
Component: React.ElementType<object>; Component: React.ComponentType<unknown>;
}>({ }>({
id: "route-specific-component-injection-token", id: "route-specific-component-injection-token",
}); });
export interface GetRouteSpecificComponentOptions<Params> {
id: string;
routeInjectable: Injectable<Route<Params>, Route<unknown>, void>;
Component: Params extends object ? React.ComponentType<Params> : React.ComponentType;
}
export const getRouteSpecificComponentInjectable = <Params>(options: GetRouteSpecificComponentOptions<Params>) => getInjectable({
id: options.id,
instantiate: (di) => ({
route: di.inject(options.routeInjectable),
Component: options.Component as React.ComponentType<unknown>,
}),
injectionToken: routeSpecificComponentInjectionToken,
});