mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Lint: object-curly-spacing (error) (#4198)
This commit is contained in:
1 parent
0759b80435
commit
41863e87ce
89 files changed
+230
-216
No files matched your search
@@ -110,7 +110,7 @@ export async function bootstrap(comp: () => Promise<AppComponent>) {
|
||||
const { base, ...params } = cloudsMidnight;
|
||||
const baseTheme = base as monaco.editor.BuiltinTheme;
|
||||
|
||||
monaco.editor.defineTheme("clouds-midnight", {base: baseTheme, ...params});
|
||||
monaco.editor.defineTheme("clouds-midnight", { base: baseTheme, ...params });
|
||||
|
||||
// ThemeStore depends on: UserStore
|
||||
ThemeStore.createInstance();
|
||||
|
||||
@@ -124,7 +124,7 @@ export class AddCluster extends React.Component {
|
||||
</p>
|
||||
<div className="flex column">
|
||||
<MonacoEditor
|
||||
options={{...UserStore.getInstance().getEditorOptions()}}
|
||||
options={{ ...UserStore.getInstance().getEditorOptions() }}
|
||||
className={cssNames("MonacoEditor")}
|
||||
theme={ThemeStore.getInstance().activeTheme.monacoTheme}
|
||||
language="yaml"
|
||||
|
||||
@@ -91,7 +91,7 @@ export class HelmChartDetails extends Component<Props> {
|
||||
try {
|
||||
this.abortController?.abort();
|
||||
this.abortController = new AbortController();
|
||||
const { chart: { name, repo } } = this.props;
|
||||
const { chart: { name, repo }} = this.props;
|
||||
const { readme } = await getChartDetails(repo, name, { version: chart.version, reqInit: { signal: this.abortController.signal }});
|
||||
|
||||
this.readme = readme;
|
||||
|
||||
@@ -50,7 +50,7 @@ export class HelmCharts extends Component<Props> {
|
||||
}
|
||||
|
||||
get selectedChart() {
|
||||
const { match: { params: { chartName, repo } } } = this.props;
|
||||
const { match: { params: { chartName, repo }}} = this.props;
|
||||
|
||||
return helmChartStore.getByName(chartName, repo);
|
||||
}
|
||||
|
||||
@@ -169,8 +169,8 @@ export class ReleaseDetails extends Component<Props> {
|
||||
value={values}
|
||||
onChange={text => this.values = text}
|
||||
theme={ThemeStore.getInstance().activeTheme.monacoTheme}
|
||||
className={cssNames("MonacoEditor", {loading: valuesLoading})}
|
||||
options={{readOnly: valuesLoading, ...UserStore.getInstance().getEditorOptions()}}
|
||||
className={cssNames("MonacoEditor", { loading: valuesLoading })}
|
||||
options={{ readOnly: valuesLoading, ...UserStore.getInstance().getEditorOptions() }}
|
||||
>
|
||||
{valuesLoading && <Spinner center />}
|
||||
</MonacoEditor>
|
||||
|
||||
@@ -55,7 +55,7 @@ interface Props extends RouteComponentProps<ReleaseRouteParams> {
|
||||
@observer
|
||||
export class HelmReleases extends Component<Props> {
|
||||
componentDidMount() {
|
||||
const { match: { params: { namespace } } } = this.props;
|
||||
const { match: { params: { namespace }}} = this.props;
|
||||
|
||||
if (namespace) {
|
||||
namespaceStore.selectNamespaces(namespace);
|
||||
@@ -68,7 +68,7 @@ export class HelmReleases extends Component<Props> {
|
||||
}
|
||||
|
||||
get selectedRelease() {
|
||||
const { match: { params: { name, namespace } } } = this.props;
|
||||
const { match: { params: { name, namespace }}} = this.props;
|
||||
|
||||
return releaseStore.items.find(release => {
|
||||
return release.getName() == name && release.getNs() == namespace;
|
||||
|
||||
@@ -52,7 +52,7 @@ export class CatalogEntityStore extends ItemStore<CatalogEntityItem<CatalogEntit
|
||||
watch() {
|
||||
return disposer(
|
||||
reaction(() => this.entities, () => this.loadAll()),
|
||||
reaction(() => this.activeCategory, () => this.loadAll(), { delay: 100}),
|
||||
reaction(() => this.activeCategory, () => this.loadAll(), { delay: 100 }),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ export class Catalog extends React.Component<Props> {
|
||||
console.error(error);
|
||||
Notifications.error(<p>Unknown category: {routeTab}</p>);
|
||||
}
|
||||
}, {fireImmediately: true}),
|
||||
}, { fireImmediately: true }),
|
||||
]);
|
||||
|
||||
// If active category is filtered out, automatically switch to the first category
|
||||
@@ -169,7 +169,7 @@ export class Catalog extends React.Component<Props> {
|
||||
const activeCategory = this.categories.find(category => category.getId() === tabId);
|
||||
|
||||
if (activeCategory) {
|
||||
navigate(catalogURL({ params: {group: activeCategory.spec.group, kind: activeCategory.spec.names.kind }}));
|
||||
navigate(catalogURL({ params: { group: activeCategory.spec.group, kind: activeCategory.spec.names.kind }}));
|
||||
} else {
|
||||
navigate(catalogURL({ params: { group: browseCatalogTab }}));
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ function transformUnit(name: string, value: string): number {
|
||||
}
|
||||
|
||||
function renderQuotas(quota: ResourceQuota): JSX.Element[] {
|
||||
const { hard = {}, used = {} } = quota.status;
|
||||
const { hard = {}, used = {}} = quota.status;
|
||||
|
||||
return Object.entries(hard)
|
||||
.filter(([name]) => used[name])
|
||||
|
||||
@@ -157,7 +157,7 @@ export class CRDDetails extends React.Component<Props> {
|
||||
<>
|
||||
<DrawerTitle title="Validation"/>
|
||||
<MonacoEditor
|
||||
options={{readOnly: true, ...UserStore.getInstance().getEditorOptions()}}
|
||||
options={{ readOnly: true, ...UserStore.getInstance().getEditorOptions() }}
|
||||
className={cssNames("MonacoEditor", "validation")}
|
||||
theme={ThemeStore.getInstance().activeTheme.monacoTheme}
|
||||
language="yaml"
|
||||
|
||||
@@ -96,7 +96,7 @@ export class CrdResourceDetails extends React.Component<Props> {
|
||||
}
|
||||
|
||||
render() {
|
||||
const { props: { object, crd } } = this;
|
||||
const { props: { object, crd }} = this;
|
||||
|
||||
if (!object || !crd) {
|
||||
return null;
|
||||
|
||||
@@ -246,7 +246,7 @@ async function createTempFilesAndValidate({ fileName, dataP }: InstallRequest):
|
||||
}
|
||||
|
||||
async function unpackExtension(request: InstallRequestValidated, disposeDownloading?: Disposer) {
|
||||
const { id, fileName, tempFile, manifest: { name, version } } = request;
|
||||
const { id, fileName, tempFile, manifest: { name, version }} = request;
|
||||
|
||||
ExtensionInstallationStateStore.setInstalling(id);
|
||||
disposeDownloading?.();
|
||||
@@ -386,7 +386,7 @@ async function attemptInstall(request: InstallRequest, d?: ExtendableDisposer):
|
||||
// install extension if not yet exists
|
||||
await unpackExtension(validatedRequest, dispose);
|
||||
} else {
|
||||
const { manifest: { version: oldVersion } } = ExtensionLoader.getInstance().getExtension(validatedRequest.id);
|
||||
const { manifest: { version: oldVersion }} = ExtensionLoader.getInstance().getExtension(validatedRequest.id);
|
||||
|
||||
// otherwise confirmation required (re-install / update)
|
||||
const removeNotification = Notifications.info(
|
||||
@@ -451,7 +451,7 @@ async function installFromInput(input: string) {
|
||||
|
||||
await attemptInstall({ fileName, dataP: readFileNotify(input) });
|
||||
} else if (InputValidators.isExtensionNameInstall.validate(input)) {
|
||||
const [{ groups: { name, version } }] = [...input.matchAll(InputValidators.isExtensionNameInstallRegex)];
|
||||
const [{ groups: { name, version }}] = [...input.matchAll(InputValidators.isExtensionNameInstallRegex)];
|
||||
|
||||
await attemptInstallByInfo({ name, version });
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ export const InstalledExtensions = observer(({ extensions, uninstall, enable, di
|
||||
),
|
||||
version,
|
||||
status: (
|
||||
<div className={cssNames({[styles.enabled]: isEnabled, [styles.invalid]: !isCompatible})}>
|
||||
<div className={cssNames({ [styles.enabled]: isEnabled, [styles.invalid]: !isCompatible })}>
|
||||
{getStatus(extension)}
|
||||
</div>
|
||||
),
|
||||
|
||||
@@ -23,7 +23,7 @@ import "./endpoint-subset-list.scss";
|
||||
|
||||
import React from "react";
|
||||
import { observer } from "mobx-react";
|
||||
import { EndpointSubset, Endpoint, EndpointAddress} from "../../../common/k8s-api/endpoints";
|
||||
import { EndpointSubset, Endpoint, EndpointAddress } from "../../../common/k8s-api/endpoints";
|
||||
import { Table, TableCell, TableHead, TableRow } from "../table";
|
||||
import { boundMethod } from "../../utils";
|
||||
import { apiManager } from "../../../common/k8s-api/api-manager";
|
||||
@@ -47,7 +47,7 @@ export class EndpointSubsetList extends React.Component<Props> {
|
||||
|
||||
@boundMethod
|
||||
getNotReadyAddressTableRow(ip: string) {
|
||||
const { subset} = this.props;
|
||||
const { subset } = this.props;
|
||||
const address = subset.getNotReadyAddresses().find(address => address.getId() == ip);
|
||||
|
||||
return this.renderAddressTableRow(address);
|
||||
|
||||
@@ -62,7 +62,7 @@ export class IngressDetails extends React.Component<Props> {
|
||||
}
|
||||
|
||||
renderPaths(ingress: Ingress) {
|
||||
const { spec: { rules } } = ingress;
|
||||
const { spec: { rules }} = ingress;
|
||||
|
||||
if (!rules || !rules.length) return null;
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ export class NetworkPolicyDetails extends React.Component<Props> {
|
||||
<>
|
||||
<SubTitle title="To"/>
|
||||
{to.map(item => {
|
||||
const { ipBlock: { cidr, except } = {} } = item;
|
||||
const { ipBlock: { cidr, except } = {}} = item;
|
||||
|
||||
if (!cidr) return null;
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ export class PortForwards extends React.Component<Props> {
|
||||
}
|
||||
|
||||
get selectedPortForward() {
|
||||
const { match: { params: { forwardport } } } = this.props;
|
||||
const { match: { params: { forwardport }}} = this.props;
|
||||
|
||||
return portForwardStore.getById(forwardport);
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ const dialogState = observable.object({
|
||||
|
||||
@observer
|
||||
export class AddHelmRepoDialog extends React.Component<Props> {
|
||||
private emptyRepo = {name: "", url: "", username: "", password: "", insecureSkipTlsVerify: false, caFile:"", keyFile: "", certFile: ""};
|
||||
private emptyRepo = { name: "", url: "", username: "", password: "", insecureSkipTlsVerify: false, caFile:"", keyFile: "", certFile: "" };
|
||||
|
||||
private static keyExtensions = ["key", "keystore", "jks", "p12", "pfx", "pem"];
|
||||
private static certExtensions = ["crt", "cer", "ca-bundle", "p7b", "p7c" , "p7s", "p12", "pfx", "pem"];
|
||||
@@ -96,7 +96,7 @@ export class AddHelmRepoDialog extends React.Component<Props> {
|
||||
buttonLabel: `Use file`,
|
||||
filters: [
|
||||
fileFilter,
|
||||
{ name: "Any", extensions: ["*"]}
|
||||
{ name: "Any", extensions: ["*"] }
|
||||
]
|
||||
});
|
||||
|
||||
@@ -128,7 +128,7 @@ export class AddHelmRepoDialog extends React.Component<Props> {
|
||||
/>
|
||||
<Icon
|
||||
material="folder"
|
||||
onClick={() => this.selectFileDialog(fileType, {name: placeholder, extensions: fileExtensions})}
|
||||
onClick={() => this.selectFileDialog(fileType, { name: placeholder, extensions: fileExtensions })}
|
||||
tooltip="Browse"
|
||||
/>
|
||||
</div>);
|
||||
|
||||
@@ -55,7 +55,7 @@ export const Editor = observer(() => {
|
||||
<section>
|
||||
<SubTitle title="Line numbers"/>
|
||||
<Select
|
||||
options={Object.entries(EditorLineNumbersStyles).map(entry => ({label: entry[1], value: entry[0]}))}
|
||||
options={Object.entries(EditorLineNumbersStyles).map(entry => ({ label: entry[1], value: entry[0] }))}
|
||||
value={userStore.editorConfiguration?.lineNumbers}
|
||||
onChange={({ value }: SelectOption) => userStore.setEditorLineNumbers(value)}
|
||||
themeName="lens"
|
||||
|
||||
@@ -46,7 +46,7 @@ interface Value {
|
||||
info: SyncInfo;
|
||||
}
|
||||
|
||||
async function getMapEntry({ filePath, ...data}: KubeconfigSyncEntry): Promise<[string, Value]> {
|
||||
async function getMapEntry({ filePath, ...data }: KubeconfigSyncEntry): Promise<[string, Value]> {
|
||||
try {
|
||||
// stat follows the stat(2) linux syscall spec, namely it follows symlinks
|
||||
const stats = await fse.stat(filePath);
|
||||
|
||||
@@ -106,7 +106,7 @@ export class Preferences extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
export function ExtensionSettings({ title, id, components: { Hint, Input } }: RegisteredAppPreference) {
|
||||
export function ExtensionSettings({ title, id, components: { Hint, Input }}: RegisteredAppPreference) {
|
||||
return (
|
||||
<React.Fragment>
|
||||
<section id={id} className="small">
|
||||
|
||||
@@ -31,7 +31,7 @@ interface Props extends DOMAttributes<any>{
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export function RemovableItem({icon, onRemove, children, className, ...rest}: Props) {
|
||||
export function RemovableItem({ icon, onRemove, children, className, ...rest }: Props) {
|
||||
return (
|
||||
<div className={cssNames(styles.item, "flex gaps align-center justify-space-between", className)} {...rest}>
|
||||
{icon && (
|
||||
|
||||
@@ -39,7 +39,7 @@ const dummyDeployment: Deployment = {
|
||||
selfLink: "link",
|
||||
spec: {
|
||||
replicas: 1,
|
||||
selector: { matchLabels: { dummy: "label" } },
|
||||
selector: { matchLabels: { dummy: "label" }},
|
||||
template: {
|
||||
metadata: {
|
||||
labels: { dummy: "label" },
|
||||
|
||||
@@ -46,7 +46,7 @@ export class PodDetailsAffinities extends React.Component<Props> {
|
||||
<DrawerParamToggler label={affinitiesNum}>
|
||||
<div className="ace-container">
|
||||
<MonacoEditor
|
||||
options={{readOnly: true, ...UserStore.getInstance().getEditorOptions()}}
|
||||
options={{ readOnly: true, ...UserStore.getInstance().getEditorOptions() }}
|
||||
className={cssNames("MonacoEditor")}
|
||||
theme={ThemeStore.getInstance().activeTheme.monacoTheme}
|
||||
language="yaml"
|
||||
|
||||
@@ -60,7 +60,7 @@ const runningDeployment = new Deployment({
|
||||
|
||||
runningDeployment.spec = {
|
||||
replicas: 1,
|
||||
selector: { matchLabels: {} },
|
||||
selector: { matchLabels: {}},
|
||||
strategy: {
|
||||
type: "test",
|
||||
rollingUpdate: {
|
||||
@@ -91,7 +91,7 @@ const failedDeployment = new Deployment({
|
||||
|
||||
failedDeployment.spec = {
|
||||
replicas: 1,
|
||||
selector: { matchLabels: {} },
|
||||
selector: { matchLabels: {}},
|
||||
strategy: {
|
||||
type: "test",
|
||||
rollingUpdate: {
|
||||
@@ -122,7 +122,7 @@ const pendingDeployment = new Deployment({
|
||||
|
||||
pendingDeployment.spec = {
|
||||
replicas: 1,
|
||||
selector: { matchLabels: {} },
|
||||
selector: { matchLabels: {}},
|
||||
strategy: {
|
||||
type: "test",
|
||||
rollingUpdate: {
|
||||
|
||||
@@ -67,7 +67,7 @@ export class ClusterManager extends React.Component {
|
||||
<Route component={EntitySettings} {...routes.entitySettingsRoute} />
|
||||
{
|
||||
GlobalPageRegistry.getInstance().getItems()
|
||||
.map(({ url, components: { Page } }) => (
|
||||
.map(({ url, components: { Page }}) => (
|
||||
<Route key={url} path={url} component={Page} />
|
||||
))
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ export function MetricsSettings({ entity }: EntitySettingViewProps) {
|
||||
);
|
||||
}
|
||||
|
||||
export function NodeShellSettings({entity}: EntitySettingViewProps) {
|
||||
export function NodeShellSettings({ entity }: EntitySettingViewProps) {
|
||||
const cluster = getClusterForEntity(entity);
|
||||
|
||||
if(!cluster) {
|
||||
|
||||
@@ -63,7 +63,7 @@ export class CreateResourceStore extends DockTabStore<string> {
|
||||
const userTemplates = await this.getTemplates(this.userTemplatesFolder, "ungrouped");
|
||||
const lensTemplates = await this.getTemplates(this.lensTemplatesFolder, "lens");
|
||||
|
||||
return {...userTemplates,...lensTemplates};
|
||||
return { ...userTemplates,...lensTemplates };
|
||||
}
|
||||
|
||||
async watchUserTemplates(callback: ()=> void){
|
||||
|
||||
@@ -24,7 +24,7 @@ import "./create-resource.scss";
|
||||
import React from "react";
|
||||
import path from "path";
|
||||
import fs from "fs-extra";
|
||||
import {Select, GroupSelectOption, SelectOption} from "../select";
|
||||
import { Select, GroupSelectOption, SelectOption } from "../select";
|
||||
import yaml from "js-yaml";
|
||||
import { observable, makeObservable } from "mobx";
|
||||
import { observer } from "mobx-react";
|
||||
@@ -65,9 +65,9 @@ export class CreateResource extends React.Component<Props> {
|
||||
}
|
||||
|
||||
convertToGroup(group:string, items:string[]):GroupSelectOption {
|
||||
const options = items.map(v => ({label: path.parse(v).name, value: v}));
|
||||
const options = items.map(v => ({ label: path.parse(v).name, value: v }));
|
||||
|
||||
return {label: group, options};
|
||||
return { label: group, options };
|
||||
}
|
||||
|
||||
get tabId() {
|
||||
|
||||
@@ -23,7 +23,7 @@ import * as uuid from "uuid";
|
||||
import { action, computed, IReactionOptions, makeObservable, observable, reaction } from "mobx";
|
||||
import { autoBind, createStorage } from "../../utils";
|
||||
import throttle from "lodash/throttle";
|
||||
import {monacoModelsManager} from "./monaco-model-manager";
|
||||
import { monacoModelsManager } from "./monaco-model-manager";
|
||||
|
||||
export type TabId = string;
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ import { dockStore, DockTab, DockTabCreateSpecific, TabId, TabKind } from "./doc
|
||||
import type { KubeObject } from "../../../common/k8s-api/kube-object";
|
||||
import { apiManager } from "../../../common/k8s-api/api-manager";
|
||||
import type { KubeObjectStore } from "../../../common/k8s-api/kube-object.store";
|
||||
import {monacoModelsManager} from "./monaco-model-manager";
|
||||
import { monacoModelsManager } from "./monaco-model-manager";
|
||||
|
||||
export interface EditingResource {
|
||||
resource: string; // resource path, e.g. /api/v1/namespaces/default
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
import MonacoEditor, {monaco} from "react-monaco-editor";
|
||||
import MonacoEditor, { monaco } from "react-monaco-editor";
|
||||
import React from "react";
|
||||
import yaml from "js-yaml";
|
||||
import { observable, makeObservable } from "mobx";
|
||||
@@ -97,7 +97,7 @@ export class EditorPanel extends React.Component<Props> {
|
||||
render() {
|
||||
return (
|
||||
<MonacoEditor
|
||||
options={{model: null, ...UserStore.getInstance().getEditorOptions()}}
|
||||
options={{ model: null, ...UserStore.getInstance().getEditorOptions() }}
|
||||
theme={ThemeStore.getInstance().activeTheme.monacoTheme}
|
||||
language = "yaml"
|
||||
onChange = {this.onChange}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
import {monaco} from "react-monaco-editor";
|
||||
import { monaco } from "react-monaco-editor";
|
||||
|
||||
export type TabId = string;
|
||||
|
||||
@@ -39,7 +39,7 @@ export class MonacoModelsManager implements ModelsState {
|
||||
const uri = this.getUri(tabId);
|
||||
const model = monaco.editor.createModel(value, lang, uri);
|
||||
|
||||
if(!uri) this.models = this.models.concat({ id: tabId, modelUri: model.uri, lang});
|
||||
if(!uri) this.models = this.models.concat({ id: tabId, modelUri: model.uri, lang });
|
||||
}
|
||||
|
||||
getModel(tabId: string): monaco.editor.ITextModel {
|
||||
|
||||
@@ -109,7 +109,7 @@ export class Drawer extends React.Component<DrawerProps> {
|
||||
};
|
||||
|
||||
onClickOutside = (evt: MouseEvent) => {
|
||||
const { contentElem, mouseDownTarget, close, props: { open } } = this;
|
||||
const { contentElem, mouseDownTarget, close, props: { open }} = this;
|
||||
|
||||
if (!open || evt.defaultPrevented || contentElem.contains(mouseDownTarget)) {
|
||||
return;
|
||||
@@ -139,9 +139,9 @@ export class Drawer extends React.Component<DrawerProps> {
|
||||
const k8sObjName = title.split(":")[1] || title; // copy whole if no :
|
||||
|
||||
clipboard.writeText(k8sObjName.trim());
|
||||
this.setState({isCopied: true});
|
||||
this.setState({ isCopied: true });
|
||||
setTimeout(() => {
|
||||
this.setState({isCopied: false});
|
||||
this.setState({ isCopied: false });
|
||||
}, 3000);
|
||||
};
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ jest.mock("electron", () => ({
|
||||
|
||||
AppPaths.init();
|
||||
|
||||
const mockHotbars: {[id: string]: any} = {
|
||||
const mockHotbars: { [id: string]: any } = {
|
||||
"1": {
|
||||
id: "1",
|
||||
name: "Default",
|
||||
|
||||
@@ -74,7 +74,7 @@ export class HotbarEntityIcon extends React.Component<Props> {
|
||||
return null;
|
||||
}
|
||||
|
||||
const className = cssNames("led", { online: this.props.entity.status.phase === LensKubernetesClusterStatus.CONNECTED}); // TODO: make it more generic
|
||||
const className = cssNames("led", { online: this.props.entity.status.phase === LensKubernetesClusterStatus.CONNECTED }); // TODO: make it more generic
|
||||
|
||||
return <div className={className} />;
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ function onMenuItemClick(menuItem: CatalogEntityContextMenu) {
|
||||
}
|
||||
}
|
||||
|
||||
export const HotbarIcon = observer(({menuItems = [], size = 40, tooltip, ...props}: HotbarIconProps) => {
|
||||
export const HotbarIcon = observer(({ menuItems = [], size = 40, tooltip, ...props }: HotbarIconProps) => {
|
||||
const { uid, title, src, material, active, className, source, disabled, onMenuOpen, onClick, children, ...rest } = props;
|
||||
const id = `hotbarIcon-${uid}`;
|
||||
const [menuOpen, setMenuOpen] = useState(false);
|
||||
@@ -104,7 +104,7 @@ export const HotbarIcon = observer(({menuItems = [], size = 40, tooltip, ...prop
|
||||
className="HotbarIconMenu"
|
||||
isOpen={menuOpen}
|
||||
toggleEvent="contextmenu"
|
||||
position={{right: true, bottom: true }} // FIXME: position does not work
|
||||
position={{ right: true, bottom: true }} // FIXME: position does not work
|
||||
open={() => {
|
||||
onMenuOpen?.();
|
||||
toggleMenu();
|
||||
|
||||
@@ -89,7 +89,7 @@ export class KubeObjectMenu<T extends KubeObject> extends React.Component<KubeOb
|
||||
return KubeObjectMenuRegistry
|
||||
.getInstance()
|
||||
.getItemsForKind(object.kind, object.apiVersion)
|
||||
.map(({components: { MenuItem }}, index) => (
|
||||
.map(({ components: { MenuItem }}, index) => (
|
||||
<MenuItem
|
||||
object={object}
|
||||
key={`menu-item-${index}`}
|
||||
|
||||
@@ -134,7 +134,7 @@ export class KubeConfigDialog extends React.Component<Props> {
|
||||
value={yamlConfig}
|
||||
theme={ThemeStore.getInstance().activeTheme.monacoTheme}
|
||||
className={cssNames( "MonacoEditor")}
|
||||
options={{readOnly: true, ...UserStore.getInstance().getEditorOptions()}}
|
||||
options={{ readOnly: true, ...UserStore.getInstance().getEditorOptions() }}
|
||||
/>
|
||||
<textarea
|
||||
className="config-copy"
|
||||
|
||||
@@ -86,7 +86,7 @@ export class Sidebar extends React.Component<Props> {
|
||||
|
||||
return Object.entries(crdStore.groups).map(([group, crds]) => {
|
||||
const id = `crd-group:${group}`;
|
||||
const crdGroupsPageUrl = routes.crdURL({ query: { groups: group } });
|
||||
const crdGroupsPageUrl = routes.crdURL({ query: { groups: group }});
|
||||
|
||||
return (
|
||||
<SidebarItem key={id} id={id} text={group} url={crdGroupsPageUrl}>
|
||||
|
||||
@@ -102,7 +102,7 @@ export function ReactTable({ columns, data, headless }: Props) {
|
||||
</div>}
|
||||
|
||||
<div {...getTableBodyProps()}>
|
||||
{rows.map((row, index) => RenderRow({index}))}
|
||||
{rows.map((row, index) => RenderRow({ index }))}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -85,7 +85,7 @@ export function RecursiveTreeView({ data }: Props) {
|
||||
nodeId={node.id}
|
||||
label={node.name}
|
||||
onLabelClick={(event) => onLabelClick(event, node.id)}
|
||||
className={cssNames({selected: node.selected})}
|
||||
className={cssNames({ selected: node.selected })}
|
||||
title={node.name}
|
||||
>
|
||||
{Array.isArray(node.children) ? node.children.map((node) => renderTree([node])) : null}
|
||||
|
||||
@@ -29,7 +29,7 @@ export function initWelcomeMenuRegistry() {
|
||||
{
|
||||
title: "Browse Clusters in Catalog",
|
||||
icon: "view_list",
|
||||
click: () => navigate(catalogURL({ params: { group: "entity.k8slens.dev", kind: "KubernetesCluster" } } )),
|
||||
click: () => navigate(catalogURL({ params: { group: "entity.k8slens.dev", kind: "KubernetesCluster" }} )),
|
||||
}
|
||||
]);
|
||||
}
|
||||
@@ -50,7 +50,7 @@ export function bindProtocolAddRouteHandlers() {
|
||||
.addInternalHandler("/landing", () => {
|
||||
navigate(routes.catalogURL());
|
||||
})
|
||||
.addInternalHandler("/landing/view/:group/:kind", ({ pathname: { group, kind } }) => {
|
||||
.addInternalHandler("/landing/view/:group/:kind", ({ pathname: { group, kind }}) => {
|
||||
navigate(routes.catalogURL({
|
||||
params: {
|
||||
group, kind
|
||||
@@ -60,11 +60,11 @@ export function bindProtocolAddRouteHandlers() {
|
||||
.addInternalHandler("/cluster", () => {
|
||||
navigate(routes.addClusterURL());
|
||||
})
|
||||
.addInternalHandler("/entity/:entityId/settings", ({ pathname: { entityId } }) => {
|
||||
.addInternalHandler("/entity/:entityId/settings", ({ pathname: { entityId }}) => {
|
||||
const entity = catalogEntityRegistry.getById(entityId);
|
||||
|
||||
if (entity) {
|
||||
navigate(routes.entitySettingsURL({ params: { entityId } }));
|
||||
navigate(routes.entitySettingsURL({ params: { entityId }}));
|
||||
} else {
|
||||
Notifications.shortInfo(
|
||||
<p>
|
||||
@@ -74,11 +74,11 @@ export function bindProtocolAddRouteHandlers() {
|
||||
}
|
||||
})
|
||||
// Handlers below are deprecated and only kept for backward compact purposes
|
||||
.addInternalHandler("/cluster/:clusterId", ({ pathname: { clusterId } }) => {
|
||||
.addInternalHandler("/cluster/:clusterId", ({ pathname: { clusterId }}) => {
|
||||
const cluster = ClusterStore.getInstance().getById(clusterId);
|
||||
|
||||
if (cluster) {
|
||||
navigate(routes.clusterViewURL({ params: { clusterId } }));
|
||||
navigate(routes.clusterViewURL({ params: { clusterId }}));
|
||||
} else {
|
||||
Notifications.shortInfo(
|
||||
<p>
|
||||
@@ -87,11 +87,11 @@ export function bindProtocolAddRouteHandlers() {
|
||||
);
|
||||
}
|
||||
})
|
||||
.addInternalHandler("/cluster/:clusterId/settings", ({ pathname: { clusterId } }) => {
|
||||
.addInternalHandler("/cluster/:clusterId/settings", ({ pathname: { clusterId }}) => {
|
||||
const cluster = ClusterStore.getInstance().getById(clusterId);
|
||||
|
||||
if (cluster) {
|
||||
navigate(routes.entitySettingsURL({ params: { entityId: clusterId } }));
|
||||
navigate(routes.entitySettingsURL({ params: { entityId: clusterId }}));
|
||||
} else {
|
||||
Notifications.shortInfo(
|
||||
<p>
|
||||
@@ -103,7 +103,7 @@ export function bindProtocolAddRouteHandlers() {
|
||||
.addInternalHandler("/extensions", () => {
|
||||
navigate(routes.extensionsURL());
|
||||
})
|
||||
.addInternalHandler(`/extensions/install${LensProtocolRouter.ExtensionUrlSchema}`, ({ pathname, search: { version } }) => {
|
||||
.addInternalHandler(`/extensions/install${LensProtocolRouter.ExtensionUrlSchema}`, ({ pathname, search: { version }}) => {
|
||||
const name = [
|
||||
pathname[EXTENSION_PUBLISHER_MATCH],
|
||||
pathname[EXTENSION_NAME_MATCH],
|
||||
|
||||
Reference in new issue
Block a user