mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fix: add-cluster page D&D is broken (#1549)
* fix: add-cluster page D&D kube-config don't work: Error-info: <DropFileInput/> must contain only single child element Signed-off-by: Roman <ixrock@gmail.com> * renaming Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
parent
77c8617b79
commit
10eb082854
@ -1,6 +1,6 @@
|
|||||||
import "./add-cluster.scss";
|
import "./add-cluster.scss";
|
||||||
import os from "os";
|
import os from "os";
|
||||||
import React, { Fragment } from "react";
|
import React from "react";
|
||||||
import { observer } from "mobx-react";
|
import { observer } from "mobx-react";
|
||||||
import { action, observable, runInAction } from "mobx";
|
import { action, observable, runInAction } from "mobx";
|
||||||
import { remote } from "electron";
|
import { remote } from "electron";
|
||||||
@ -12,7 +12,6 @@ import { DropFileInput, Input } from "../input";
|
|||||||
import { AceEditor } from "../ace-editor";
|
import { AceEditor } from "../ace-editor";
|
||||||
import { Button } from "../button";
|
import { Button } from "../button";
|
||||||
import { Icon } from "../icon";
|
import { Icon } from "../icon";
|
||||||
import { WizardLayout } from "../layout/wizard-layout";
|
|
||||||
import { kubeConfigDefaultPath, loadConfig, splitConfig, validateConfig, validateKubeConfig } from "../../../common/kube-helpers";
|
import { kubeConfigDefaultPath, loadConfig, splitConfig, validateConfig, validateKubeConfig } from "../../../common/kube-helpers";
|
||||||
import { ClusterModel, ClusterStore, clusterStore } from "../../../common/cluster-store";
|
import { ClusterModel, ClusterStore, clusterStore } from "../../../common/cluster-store";
|
||||||
import { workspaceStore } from "../../../common/workspace-store";
|
import { workspaceStore } from "../../../common/workspace-store";
|
||||||
@ -332,14 +331,12 @@ export class AddCluster extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const addDisabled = this.selectedContexts.length === 0;
|
const submitDisabled = this.selectedContexts.length === 0;
|
||||||
return (
|
return (
|
||||||
<PageLayout className="AddClusters" header={<h2>Add Clusters</h2>}>
|
<DropFileInput onDropFiles={this.onDropKubeConfig}>
|
||||||
<h2>Add Clusters from Kubeconfig</h2>
|
<PageLayout className="AddClusters" header={<h2>Add Clusters</h2>}>
|
||||||
|
<h2>Add Clusters from Kubeconfig</h2>
|
||||||
{this.renderInfo()}
|
{this.renderInfo()}
|
||||||
|
|
||||||
<DropFileInput onDropFiles={this.onDropKubeConfig}>
|
|
||||||
{this.renderKubeConfigSource()}
|
{this.renderKubeConfigSource()}
|
||||||
{this.renderContextSelector()}
|
{this.renderContextSelector()}
|
||||||
<div className="cluster-settings">
|
<div className="cluster-settings">
|
||||||
@ -368,16 +365,16 @@ export class AddCluster extends React.Component {
|
|||||||
<div className="actions-panel">
|
<div className="actions-panel">
|
||||||
<Button
|
<Button
|
||||||
primary
|
primary
|
||||||
disabled={addDisabled}
|
disabled={submitDisabled}
|
||||||
label={this.selectedContexts.length < 2 ? <Trans>Add cluster</Trans> : <Trans>Add clusters</Trans>}
|
label={this.selectedContexts.length < 2 ? <Trans>Add cluster</Trans> : <Trans>Add clusters</Trans>}
|
||||||
onClick={this.addClusters}
|
onClick={this.addClusters}
|
||||||
waiting={this.isWaiting}
|
waiting={this.isWaiting}
|
||||||
tooltip={addDisabled ? _i18n._("Select at least one cluster to add.") : undefined}
|
tooltip={submitDisabled ? _i18n._("Select at least one cluster to add.") : undefined}
|
||||||
tooltipOverrideDisabled
|
tooltipOverrideDisabled
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</DropFileInput>
|
</PageLayout>
|
||||||
</PageLayout>
|
</DropFileInput>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user