App reload in cluster settings (#858)

* Passing extra routes where to find clusterId

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Cluster settings refactorings

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Clean up

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev authored and GitHub committed 2020-09-12 16:35:04 +03:00
1 parent cc973bb9ef
commit c6b3738a75
3 files changed
+37 -30

No files matched your search

@@ -9,11 +9,16 @@ import { General } from "./general";
import { WizardLayout } from "../layout/wizard-layout";
import { ClusterIcon } from "../cluster-icon";
import { Icon } from "../icon";
import { getMatchedCluster } from "../cluster-manager/cluster-view.route";
import { navigate } from "../../navigation";
import { IClusterSettingsRouteParams } from "./cluster-settings.route";
import { clusterStore } from "../../../common/cluster-store";
import { RouteComponentProps } from "react-router";
interface Props extends RouteComponentProps<IClusterSettingsRouteParams> {
}
@observer
export class ClusterSettings extends React.Component {
export class ClusterSettings extends React.Component<Props> {
async componentDidMount() {
window.addEventListener('keydown', this.onEscapeKey);
}
@@ -34,7 +39,7 @@ export class ClusterSettings extends React.Component {
}
render() {
const cluster = getMatchedCluster();
const cluster = clusterStore.getById(this.props.match.params.clusterId);
if (!cluster) return null;
const header = (
<>