mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
1 parent
d05d15e8ef
commit
97776b6460
3 files changed
+10
-5
No files matched your search
@@ -7,9 +7,11 @@ import React from "react";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { withInjectables } from "@ogre-tools/injectable-react";
|
||||
import { computed } from "mobx";
|
||||
import type {
|
||||
KubeObjectMenuItemComponent,
|
||||
KubeObjectMenuItem } from "../kube-object-menu/kube-object-menu-item-injection-token";
|
||||
import {
|
||||
kubeObjectMenuItemInjectionToken,
|
||||
KubeObjectMenuItemComponent,
|
||||
} from "../kube-object-menu/kube-object-menu-item-injection-token";
|
||||
import { ingressClassSetDefaultInjectable } from "./ingress-class-set-default.injectable";
|
||||
import { MenuItem } from "../menu";
|
||||
@@ -39,14 +41,14 @@ export const IngressClassMenu = withInjectables<{}, IngressClassMenuProps>(NonIn
|
||||
const ingressClassMenuInjectable = getInjectable({
|
||||
id: "ingress-class-kube-object-menu",
|
||||
|
||||
instantiate: () => {
|
||||
instantiate(): KubeObjectMenuItem {
|
||||
return {
|
||||
kind: "IngressClass",
|
||||
apiVersions: ["networking.k8s.io/v1"],
|
||||
Component: IngressClassMenu as KubeObjectMenuItemComponent,
|
||||
enabled: computed(() => true),
|
||||
orderNumber: 30,
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
injectionToken: kubeObjectMenuItemInjectionToken,
|
||||
|
||||
@@ -5,13 +5,12 @@
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import type { IngressClass } from "../../../common/k8s-api/endpoints/ingress-class.api";
|
||||
|
||||
// TODO: figure out if this needs to be injectable
|
||||
export const ingressClassSetDefaultInjectable = getInjectable({
|
||||
id: "ingressClassSetDefaultInjectable",
|
||||
|
||||
instantiate() {
|
||||
return (item: IngressClass) => {
|
||||
console.log("TODO: implement set-default ingress-class api call(s)", item);
|
||||
console.log(`TODO: implement set-default ingress-class api call(s)`, item);
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import assert from "assert";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import {
|
||||
kubeObjectStoreInjectionToken,
|
||||
@@ -11,11 +12,14 @@ import ingressClassApiInjectable
|
||||
import { IngressClassStore } from "./ingress-class-store";
|
||||
import clusterFrameContextForNamespacedResourcesInjectable
|
||||
from "../../cluster-frame-context/for-namespaced-resources.injectable";
|
||||
import storesAndApisCanBeCreatedInjectable from "../../stores-apis-can-be-created.injectable";
|
||||
|
||||
const ingressClassStoreInjectable = getInjectable({
|
||||
id: "ingress-class-store",
|
||||
|
||||
instantiate: (di) => {
|
||||
assert(di.inject(storesAndApisCanBeCreatedInjectable), "ingressClassStore is only available in certain environments");
|
||||
|
||||
const api = di.inject(ingressClassApiInjectable);
|
||||
|
||||
return new IngressClassStore({
|
||||
|
||||
Reference in new issue
Block a user