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:
parent
6642aef44a
commit
048ed7d143
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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<boolean>) =>
|
||||
(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<boolean>) => (
|
||||
(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 <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];
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
@ -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<unknown>;
|
||||
Component: React.ElementType<object>;
|
||||
Component: React.ComponentType<unknown>;
|
||||
}>({
|
||||
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,
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user