mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
crd fix
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
parent
74ac272b0d
commit
56f1d19ca4
@ -7,7 +7,6 @@ import { Trans } from "@lingui/macro";
|
|||||||
import { RouteComponentProps } from "react-router";
|
import { RouteComponentProps } from "react-router";
|
||||||
import { KubeObjectListLayout } from "../kube-object";
|
import { KubeObjectListLayout } from "../kube-object";
|
||||||
import { KubeObject } from "../../api/kube-object";
|
import { KubeObject } from "../../api/kube-object";
|
||||||
import { KubeObjectMenu, KubeObjectMenuProps } from "../kube-object/kube-object-menu";
|
|
||||||
import { ICRDRouteParams } from "./crd.route";
|
import { ICRDRouteParams } from "./crd.route";
|
||||||
import { autorun, computed } from "mobx";
|
import { autorun, computed } from "mobx";
|
||||||
import { crdStore } from "./crd.store";
|
import { crdStore } from "./crd.store";
|
||||||
@ -91,16 +90,7 @@ export class CrdResources extends React.Component<Props> {
|
|||||||
}),
|
}),
|
||||||
crdInstance.getAge(),
|
crdInstance.getAge(),
|
||||||
]}
|
]}
|
||||||
renderItemMenu={(item: KubeObject) => {
|
|
||||||
return <CrdResourceMenu object={item}/>
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function CrdResourceMenu(props: KubeObjectMenuProps<KubeObject>) {
|
|
||||||
return (
|
|
||||||
<KubeObjectMenu {...props}/>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|||||||
@ -8,9 +8,9 @@ import { getDetails, hideDetails } from "../../navigation";
|
|||||||
import { Drawer } from "../drawer";
|
import { Drawer } from "../drawer";
|
||||||
import { KubeObject } from "../../api/kube-object";
|
import { KubeObject } from "../../api/kube-object";
|
||||||
import { Spinner } from "../spinner";
|
import { Spinner } from "../spinner";
|
||||||
import { apiManager, ApiComponents } from "../../api/api-manager";
|
import { apiManager } from "../../api/api-manager";
|
||||||
import { crdStore } from "../+custom-resources/crd.store";
|
import { crdStore } from "../+custom-resources/crd.store";
|
||||||
import { CrdResourceDetails, CrdResourceMenu } from "../+custom-resources";
|
import { CrdResourceDetails } from "../+custom-resources";
|
||||||
import { KubeObjectMenu } from "./kube-object-menu"
|
import { KubeObjectMenu } from "./kube-object-menu"
|
||||||
import { kubeObjectDetailRegistry } from "../../api/kube-object-details-registry";
|
import { kubeObjectDetailRegistry } from "../../api/kube-object-details-registry";
|
||||||
|
|
||||||
@ -66,7 +66,6 @@ export class KubeObjectDetails extends React.Component {
|
|||||||
const { object, isLoading, loadingError, isCrdInstance } = this;
|
const { object, isLoading, loadingError, isCrdInstance } = this;
|
||||||
const isOpen = !!(object || isLoading || loadingError);
|
const isOpen = !!(object || isLoading || loadingError);
|
||||||
let title = "";
|
let title = "";
|
||||||
let apiComponents: ApiComponents;
|
|
||||||
let details: JSX.Element[];
|
let details: JSX.Element[];
|
||||||
if (object) {
|
if (object) {
|
||||||
const { kind, getName } = object;
|
const { kind, getName } = object;
|
||||||
@ -75,8 +74,7 @@ export class KubeObjectDetails extends React.Component {
|
|||||||
return <item.components.Details object={object} key={`object-details-${index}`}/>
|
return <item.components.Details object={object} key={`object-details-${index}`}/>
|
||||||
})
|
})
|
||||||
if (isCrdInstance && details.length === 0) {
|
if (isCrdInstance && details.length === 0) {
|
||||||
apiComponents.Details = CrdResourceDetails
|
details.push(<CrdResourceDetails object={object} />)
|
||||||
apiComponents.Menu = CrdResourceMenu
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user