1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Fix input default value warning (#3497)

* Removing some props from passing to <input/>

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

* Fixing ns loadMetrics() this context

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev 2021-07-23 14:36:48 +03:00 committed by GitHub
parent 823d68014e
commit 44fad7f459
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -25,7 +25,7 @@ import React from "react";
import { computed, makeObservable, observable, reaction } from "mobx"; import { computed, makeObservable, observable, reaction } from "mobx";
import { disposeOnUnmount, observer } from "mobx-react"; import { disposeOnUnmount, observer } from "mobx-react";
import { DrawerItem } from "../drawer"; import { DrawerItem } from "../drawer";
import { cssNames } from "../../utils"; import { boundMethod, cssNames } from "../../utils";
import { getMetricsForNamespace, IPodMetrics, Namespace } from "../../api/endpoints"; import { getMetricsForNamespace, IPodMetrics, Namespace } from "../../api/endpoints";
import { getDetailsUrl, KubeObjectDetailsProps } from "../kube-object"; import { getDetailsUrl, KubeObjectDetailsProps } from "../kube-object";
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
@ -72,6 +72,7 @@ export class NamespaceDetails extends React.Component<Props> {
return limitRangeStore.getAllByNs(namespace); return limitRangeStore.getAllByNs(namespace);
} }
@boundMethod
async loadMetrics() { async loadMetrics() {
this.metrics = await getMetricsForNamespace(this.props.object.getName(), ""); this.metrics = await getMetricsForNamespace(this.props.object.getName(), "");
} }

View File

@ -328,6 +328,8 @@ export class Input extends React.Component<InputProps, State> {
multiLine, showValidationLine, validators, theme, maxRows, children, showErrorsAsTooltip, multiLine, showValidationLine, validators, theme, maxRows, children, showErrorsAsTooltip,
maxLength, rows, disabled, autoSelectOnFocus, iconLeft, iconRight, contentRight, id, maxLength, rows, disabled, autoSelectOnFocus, iconLeft, iconRight, contentRight, id,
dirty: _dirty, // excluded from passing to input-element dirty: _dirty, // excluded from passing to input-element
defaultValue,
trim,
...inputProps ...inputProps
} = this.props; } = this.props;
const { focused, dirty, valid, validating, errors } = this.state; const { focused, dirty, valid, validating, errors } = this.state;