mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
responding to review comments
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
159ff5c98e
commit
847c618a2a
@ -172,7 +172,6 @@
|
|||||||
"@hapi/call": "^8.0.0",
|
"@hapi/call": "^8.0.0",
|
||||||
"@hapi/subtext": "^7.0.3",
|
"@hapi/subtext": "^7.0.3",
|
||||||
"@kubernetes/client-node": "^0.12.0",
|
"@kubernetes/client-node": "^0.12.0",
|
||||||
"@material-ui/icons": "^4.11.2",
|
|
||||||
"abort-controller": "^3.0.0",
|
"abort-controller": "^3.0.0",
|
||||||
"array-move": "^3.0.0",
|
"array-move": "^3.0.0",
|
||||||
"await-lock": "^2.1.0",
|
"await-lock": "^2.1.0",
|
||||||
@ -234,6 +233,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@emeraldpay/hashicon-react": "^0.4.0",
|
"@emeraldpay/hashicon-react": "^0.4.0",
|
||||||
"@material-ui/core": "^4.10.1",
|
"@material-ui/core": "^4.10.1",
|
||||||
|
"@material-ui/icons": "^4.11.2",
|
||||||
"@material-ui/lab": "^4.0.0-alpha.57",
|
"@material-ui/lab": "^4.0.0-alpha.57",
|
||||||
"@pmmmwh/react-refresh-webpack-plugin": "^0.4.3",
|
"@pmmmwh/react-refresh-webpack-plugin": "^0.4.3",
|
||||||
"@testing-library/jest-dom": "^5.11.10",
|
"@testing-library/jest-dom": "^5.11.10",
|
||||||
@ -341,7 +341,7 @@
|
|||||||
"sharp": "^0.26.1",
|
"sharp": "^0.26.1",
|
||||||
"spectron": "11.0.0",
|
"spectron": "11.0.0",
|
||||||
"style-loader": "^1.2.1",
|
"style-loader": "^1.2.1",
|
||||||
"ts-jest": "^26.1.0",
|
"ts-jest": "26.3.0",
|
||||||
"ts-loader": "^7.0.5",
|
"ts-loader": "^7.0.5",
|
||||||
"ts-node": "^8.10.2",
|
"ts-node": "^8.10.2",
|
||||||
"type-fest": "^1.0.2",
|
"type-fest": "^1.0.2",
|
||||||
|
|||||||
@ -29,15 +29,15 @@ function readResolvedPathSync(filePath: string): string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function checkRawCluster(rawCluster: any): boolean {
|
function checkRawCluster(rawCluster: any): boolean {
|
||||||
return rawCluster?.name && rawCluster?.cluster?.server;
|
return Boolean(rawCluster?.name && rawCluster?.cluster?.server);
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkRawUser(rawUser: any): boolean {
|
function checkRawUser(rawUser: any): boolean {
|
||||||
return rawUser?.name;
|
return Boolean(rawUser?.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkRawContext(rawContext: any): boolean {
|
function checkRawContext(rawContext: any): boolean {
|
||||||
return rawContext.name && rawContext.context?.cluster && rawContext.context?.user;
|
return Boolean(rawContext.name && rawContext.context?.cluster && rawContext.context?.user);
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface KubeConfigOptions {
|
export interface KubeConfigOptions {
|
||||||
@ -206,6 +206,8 @@ export function getNodeWarningConditions(node: V1Node) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if `config` has valid `Context`, `User`, `Cluster`, and `exec` fields (if present when required)
|
* Checks if `config` has valid `Context`, `User`, `Cluster`, and `exec` fields (if present when required)
|
||||||
|
*
|
||||||
|
* Note: This function returns an error instead of throwing it, returning `undefined` if the validation passes
|
||||||
*/
|
*/
|
||||||
export function validateKubeConfig(config: KubeConfig, contextName: string, validationOpts: KubeConfigValidationOpts = {}): Error | undefined {
|
export function validateKubeConfig(config: KubeConfig, contextName: string, validationOpts: KubeConfigValidationOpts = {}): Error | undefined {
|
||||||
// we only receive a single context, cluster & user object here so lets validate them as this
|
// we only receive a single context, cluster & user object here so lets validate them as this
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { ObservableMap } from "mobx";
|
|||||||
import { CatalogEntity } from "../../../common/catalog";
|
import { CatalogEntity } from "../../../common/catalog";
|
||||||
import { loadFromOptions } from "../../../common/kube-helpers";
|
import { loadFromOptions } from "../../../common/kube-helpers";
|
||||||
import { Cluster } from "../../cluster";
|
import { Cluster } from "../../cluster";
|
||||||
import { computeDiff, configToModels } from "../kubeconfig-sync.source";
|
import { computeDiff, configToModels } from "../kubeconfig-sync";
|
||||||
import mockFs from "mock-fs";
|
import mockFs from "mock-fs";
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
|
|
||||||
@ -1 +1 @@
|
|||||||
export { KubeconfigSyncManager } from "./kubeconfig-sync.source";
|
export { KubeconfigSyncManager } from "./kubeconfig-sync";
|
||||||
|
|||||||
@ -21,7 +21,7 @@ import { LensApp } from "./lens-app";
|
|||||||
import { ThemeStore } from "./theme.store";
|
import { ThemeStore } from "./theme.store";
|
||||||
import { HelmRepoManager } from "../main/helm/helm-repo-manager";
|
import { HelmRepoManager } from "../main/helm/helm-repo-manager";
|
||||||
import { ExtensionInstallationStateStore } from "./components/+extensions/extension-install.store";
|
import { ExtensionInstallationStateStore } from "./components/+extensions/extension-install.store";
|
||||||
import { createMuiTheme, ThemeProvider } from "@material-ui/core";
|
import { DefaultProps } from "./mui-base-theme";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If this is a development buid, wait a second to attach
|
* If this is a development buid, wait a second to attach
|
||||||
@ -97,37 +97,5 @@ export async function bootstrap(App: AppComponent) {
|
|||||||
</>, rootElem);
|
</>, rootElem);
|
||||||
}
|
}
|
||||||
|
|
||||||
const defaultTheme = createMuiTheme({
|
|
||||||
props: {
|
|
||||||
MuiIconButton: {
|
|
||||||
color: "inherit",
|
|
||||||
},
|
|
||||||
MuiSvgIcon: {
|
|
||||||
fontSize: "inherit",
|
|
||||||
},
|
|
||||||
MuiTooltip: {
|
|
||||||
placement: "top",
|
|
||||||
}
|
|
||||||
},
|
|
||||||
overrides: {
|
|
||||||
MuiIconButton: {
|
|
||||||
root: {
|
|
||||||
"&:hover": {
|
|
||||||
color: "var(--iconActiveColor)",
|
|
||||||
backgroundColor: "var(--iconActiveBackground)",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
function DefaultProps(App: AppComponent) {
|
|
||||||
return (
|
|
||||||
<ThemeProvider theme={defaultTheme}>
|
|
||||||
<App />
|
|
||||||
</ThemeProvider>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// run
|
// run
|
||||||
bootstrap(process.isMainFrame ? LensApp : App);
|
bootstrap(process.isMainFrame ? LensApp : App);
|
||||||
|
|||||||
34
src/renderer/mui-base-theme.tsx
Normal file
34
src/renderer/mui-base-theme.tsx
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
import React from "react";
|
||||||
|
import { createMuiTheme, ThemeProvider } from "@material-ui/core";
|
||||||
|
|
||||||
|
const defaultTheme = createMuiTheme({
|
||||||
|
props: {
|
||||||
|
MuiIconButton: {
|
||||||
|
color: "inherit",
|
||||||
|
},
|
||||||
|
MuiSvgIcon: {
|
||||||
|
fontSize: "inherit",
|
||||||
|
},
|
||||||
|
MuiTooltip: {
|
||||||
|
placement: "top",
|
||||||
|
}
|
||||||
|
},
|
||||||
|
overrides: {
|
||||||
|
MuiIconButton: {
|
||||||
|
root: {
|
||||||
|
"&:hover": {
|
||||||
|
color: "var(--iconActiveColor)",
|
||||||
|
backgroundColor: "var(--iconActiveBackground)",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
export function DefaultProps(App: React.ComponentType) {
|
||||||
|
return (
|
||||||
|
<ThemeProvider theme= { defaultTheme } >
|
||||||
|
<App />
|
||||||
|
</ThemeProvider>
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -13657,7 +13657,7 @@ ts-essentials@^4.0.0:
|
|||||||
resolved "https://registry.yarnpkg.com/ts-essentials/-/ts-essentials-4.0.0.tgz#506c42b270bbd0465574b90416533175b09205ab"
|
resolved "https://registry.yarnpkg.com/ts-essentials/-/ts-essentials-4.0.0.tgz#506c42b270bbd0465574b90416533175b09205ab"
|
||||||
integrity sha512-uQJX+SRY9mtbKU+g9kl5Fi7AEMofPCvHfJkQlaygpPmHPZrtgaBqbWFOYyiA47RhnSwwnXdepUJrgqUYxoUyhQ==
|
integrity sha512-uQJX+SRY9mtbKU+g9kl5Fi7AEMofPCvHfJkQlaygpPmHPZrtgaBqbWFOYyiA47RhnSwwnXdepUJrgqUYxoUyhQ==
|
||||||
|
|
||||||
ts-jest@^26.1.0:
|
ts-jest@26.3.0:
|
||||||
version "26.3.0"
|
version "26.3.0"
|
||||||
resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-26.3.0.tgz#6b2845045347dce394f069bb59358253bc1338a9"
|
resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-26.3.0.tgz#6b2845045347dce394f069bb59358253bc1338a9"
|
||||||
integrity sha512-Jq2uKfx6bPd9+JDpZNMBJMdMQUC3sJ08acISj8NXlVgR2d5OqslEHOR2KHMgwymu8h50+lKIm0m0xj/ioYdW2Q==
|
integrity sha512-Jq2uKfx6bPd9+JDpZNMBJMdMQUC3sJ08acISj8NXlVgR2d5OqslEHOR2KHMgwymu8h50+lKIm0m0xj/ioYdW2Q==
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user