migration additions -- part 3 (adding makeObservable to constructor)

Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
Roman committed 2021-04-20 13:45:35 +03:00
1 parent 95794af5b2
commit 08787dce1f
139 files changed
+732 -147

No files matched your search

@@ -2,7 +2,7 @@ import "./statefulset-scale-dialog.scss";
import { StatefulSet, statefulSetApi } from "../../api/endpoints";
import React, { Component } from "react";
import { computed, observable } from "mobx";
import { computed, observable, makeObservable } from "mobx";
import { observer } from "mobx-react";
import { Dialog, DialogProps } from "../dialog";
import { Wizard, WizardStep } from "../wizard";
@@ -23,6 +23,11 @@ export class StatefulSetScaleDialog extends Component<Props> {
@observable currentReplicas = 0;
@observable desiredReplicas = 0;
constructor(props: Props) {
super(props);
makeObservable(this);
}
static open(statefulSet: StatefulSet) {
StatefulSetScaleDialog.isOpen = true;
StatefulSetScaleDialog.data = statefulSet;
@@ -1,4 +1,4 @@
import { observable } from "mobx";
import { observable, makeObservable } from "mobx";
import { autobind } from "../../utils";
import { KubeObjectStore } from "../../kube-object.store";
import { IPodMetrics, podsApi, PodStatus, StatefulSet, statefulSetApi } from "../../api/endpoints";
@@ -10,6 +10,12 @@ export class StatefulSetStore extends KubeObjectStore<StatefulSet> {
api = statefulSetApi;
@observable metrics: IPodMetrics = null;
constructor() {
super();
makeObservable(this);
}
async loadMetrics(statefulSet: StatefulSet) {
const pods = this.getChildPods(statefulSet);