Fix issues with crd plugins (#243)

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen authored and GitHub committed 2020-04-13 18:21:51 +03:00
1 parent 298636b8f1
commit 4cd616bf65
8 files changed
+14 -39

No files matched your search

@@ -4,20 +4,13 @@ import * as React from "react";
import { observable, reaction } from "mobx";
import { disposeOnUnmount, observer } from "mobx-react";
import { matchPath, RouteProps } from "react-router-dom";
import { Trans } from "@lingui/macro";
import { createStorage, cssNames, isElectron } from "../../utils";
import { createStorage, cssNames } from "../../utils";
import { Tab, Tabs } from "../tabs";
import { Icon } from "../icon";
import { openUserKubeConfig } from "../kubeconfig-dialog";
import { Sidebar } from "./sidebar";
import { configStore } from "../../config.store";
import { ErrorBoundary } from "../error-boundary";
import { Dock } from "../dock";
import { MenuItem } from "../menu";
import { MenuActions } from "../menu/menu-actions";
import { navigate, navigation } from "../../navigation";
import { i18nStore } from "../../i18n";
import { Badge } from "../badge";
import { themeStore } from "../../theme.store";
export interface TabRoute extends RouteProps {
@@ -54,9 +47,8 @@ export class MainLayout extends React.Component<Props> {
render() {
const { className, contentClass, headerClass, tabs, footer, footerClass, children } = this.props;
const { clusterName, username, lensVersion, kubectlAccess } = configStore.config;
const { clusterName } = configStore.config;
const { pathname } = navigation.location;
const { languages, setLocale, activeLang } = i18nStore;
return (
<div className={cssNames("MainLayout", className, themeStore.activeTheme.type)}>
<header className={cssNames("flex gaps align-center", headerClass)}>
@@ -42,6 +42,10 @@ interface Props {
@observer
export class Sidebar extends React.Component<Props> {
async componentDidMount() {
if (!crdStore.isLoaded) crdStore.loadAll()
}
renderCustomResources() {
return Object.entries(crdStore.groups).map(([group, crds]) => {
const submenus = crds.map(crd => {