mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Removed package "autobind-decorator" and @boundMethod in favour of "auto-bind" util for constructors-only. (#5218)
This commit is contained in:
1 parent
5f145e69e5
commit
06e7dfce5e
45 files changed
+150
-180
No files matched your search
@@ -5,7 +5,7 @@
|
||||
|
||||
import React from "react";
|
||||
import type { Cluster } from "../../../../common/cluster/cluster";
|
||||
import { boundMethod } from "../../../utils";
|
||||
import { autoBind } from "../../../utils";
|
||||
import { observable } from "mobx";
|
||||
import { observer } from "mobx-react";
|
||||
import type { KubernetesCluster } from "../../../../common/catalog-entities";
|
||||
@@ -28,9 +28,13 @@ export class ClusterIconSetting extends React.Component<ClusterIconSettingProps>
|
||||
@observable status = GeneralInputStatus.CLEAN;
|
||||
@observable errorText?: string;
|
||||
|
||||
constructor(props: ClusterIconSettingProps) {
|
||||
super(props);
|
||||
autoBind(this);
|
||||
}
|
||||
|
||||
private element = React.createRef<HTMLDivElement>();
|
||||
|
||||
@boundMethod
|
||||
async onIconPick([file]: File[]) {
|
||||
if (!file) {
|
||||
return;
|
||||
@@ -56,7 +60,6 @@ export class ClusterIconSetting extends React.Component<ClusterIconSettingProps>
|
||||
this.props.cluster.preferences.icon = null;
|
||||
}
|
||||
|
||||
@boundMethod
|
||||
onUploadClick() {
|
||||
this.element
|
||||
.current
|
||||
|
||||
@@ -7,7 +7,6 @@ import React from "react";
|
||||
import type { Cluster } from "../../../../common/cluster/cluster";
|
||||
import { observer } from "mobx-react";
|
||||
import { SubTitle } from "../../layout/sub-title";
|
||||
import { boundMethod } from "../../../../common/utils";
|
||||
import { shell } from "electron";
|
||||
import { Notice } from "../../+extensions/notice";
|
||||
|
||||
@@ -17,13 +16,11 @@ export interface ClusterKubeconfigProps {
|
||||
|
||||
@observer
|
||||
export class ClusterKubeconfig extends React.Component<ClusterKubeconfigProps> {
|
||||
|
||||
@boundMethod
|
||||
openKubeconfig() {
|
||||
openKubeconfig = () => {
|
||||
const { cluster } = this.props;
|
||||
|
||||
shell.showItemInFolder(cluster.kubeConfigPath);
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
return (
|
||||
|
||||
Reference in new issue
Block a user