mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
chore, fix lint
Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
parent
d05d15e8ef
commit
97776b6460
@ -7,9 +7,11 @@ import React from "react";
|
|||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import { withInjectables } from "@ogre-tools/injectable-react";
|
import { withInjectables } from "@ogre-tools/injectable-react";
|
||||||
import { computed } from "mobx";
|
import { computed } from "mobx";
|
||||||
|
import type {
|
||||||
|
KubeObjectMenuItemComponent,
|
||||||
|
KubeObjectMenuItem } from "../kube-object-menu/kube-object-menu-item-injection-token";
|
||||||
import {
|
import {
|
||||||
kubeObjectMenuItemInjectionToken,
|
kubeObjectMenuItemInjectionToken,
|
||||||
KubeObjectMenuItemComponent,
|
|
||||||
} from "../kube-object-menu/kube-object-menu-item-injection-token";
|
} from "../kube-object-menu/kube-object-menu-item-injection-token";
|
||||||
import { ingressClassSetDefaultInjectable } from "./ingress-class-set-default.injectable";
|
import { ingressClassSetDefaultInjectable } from "./ingress-class-set-default.injectable";
|
||||||
import { MenuItem } from "../menu";
|
import { MenuItem } from "../menu";
|
||||||
@ -39,14 +41,14 @@ export const IngressClassMenu = withInjectables<{}, IngressClassMenuProps>(NonIn
|
|||||||
const ingressClassMenuInjectable = getInjectable({
|
const ingressClassMenuInjectable = getInjectable({
|
||||||
id: "ingress-class-kube-object-menu",
|
id: "ingress-class-kube-object-menu",
|
||||||
|
|
||||||
instantiate: () => {
|
instantiate(): KubeObjectMenuItem {
|
||||||
return {
|
return {
|
||||||
kind: "IngressClass",
|
kind: "IngressClass",
|
||||||
apiVersions: ["networking.k8s.io/v1"],
|
apiVersions: ["networking.k8s.io/v1"],
|
||||||
Component: IngressClassMenu as KubeObjectMenuItemComponent,
|
Component: IngressClassMenu as KubeObjectMenuItemComponent,
|
||||||
enabled: computed(() => true),
|
enabled: computed(() => true),
|
||||||
orderNumber: 30,
|
orderNumber: 30,
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
injectionToken: kubeObjectMenuItemInjectionToken,
|
injectionToken: kubeObjectMenuItemInjectionToken,
|
||||||
|
|||||||
@ -5,13 +5,12 @@
|
|||||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||||
import type { IngressClass } from "../../../common/k8s-api/endpoints/ingress-class.api";
|
import type { IngressClass } from "../../../common/k8s-api/endpoints/ingress-class.api";
|
||||||
|
|
||||||
// TODO: figure out if this needs to be injectable
|
|
||||||
export const ingressClassSetDefaultInjectable = getInjectable({
|
export const ingressClassSetDefaultInjectable = getInjectable({
|
||||||
id: "ingressClassSetDefaultInjectable",
|
id: "ingressClassSetDefaultInjectable",
|
||||||
|
|
||||||
instantiate() {
|
instantiate() {
|
||||||
return (item: IngressClass) => {
|
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.
|
* 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 assert from "assert";
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import {
|
import {
|
||||||
kubeObjectStoreInjectionToken,
|
kubeObjectStoreInjectionToken,
|
||||||
@ -11,11 +12,14 @@ import ingressClassApiInjectable
|
|||||||
import { IngressClassStore } from "./ingress-class-store";
|
import { IngressClassStore } from "./ingress-class-store";
|
||||||
import clusterFrameContextForNamespacedResourcesInjectable
|
import clusterFrameContextForNamespacedResourcesInjectable
|
||||||
from "../../cluster-frame-context/for-namespaced-resources.injectable";
|
from "../../cluster-frame-context/for-namespaced-resources.injectable";
|
||||||
|
import storesAndApisCanBeCreatedInjectable from "../../stores-apis-can-be-created.injectable";
|
||||||
|
|
||||||
const ingressClassStoreInjectable = getInjectable({
|
const ingressClassStoreInjectable = getInjectable({
|
||||||
id: "ingress-class-store",
|
id: "ingress-class-store",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => {
|
||||||
|
assert(di.inject(storesAndApisCanBeCreatedInjectable), "ingressClassStore is only available in certain environments");
|
||||||
|
|
||||||
const api = di.inject(ingressClassApiInjectable);
|
const api = di.inject(ingressClassApiInjectable);
|
||||||
|
|
||||||
return new IngressClassStore({
|
return new IngressClassStore({
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user